OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Stripper.h
Go to the documentation of this file.
1 //
2 // Class Stripper
3 // The Stripper element defines the interface for a stripping foil
4 //
5 // Copyright (c) 2011, Jianjun Yang, Paul Scherrer Institut, Villigen PSI, Switzerland
6 // Copyright (c) 2017-2019, Paul Scherrer Institut, Villigen PSI, Switzerland
7 // All rights reserved
8 //
9 // Implemented as part of the PhD thesis
10 // "Beam dynamics in high intensity cyclotrons including neighboring bunch effects"
11 // and the paper
12 // "Beam dynamics in high intensity cyclotrons including neighboring bunch effects:
13 // Model, implementation, and application"
14 // (https://journals.aps.org/prab/pdf/10.1103/PhysRevSTAB.13.064201)
15 //
16 // This file is part of OPAL.
17 //
18 // OPAL is free software: you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation, either version 3 of the License, or
21 // (at your option) any later version.
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
25 //
26 #ifndef CLASSIC_Stripper_HH
27 #define CLASSIC_Stripper_HH
28 
30 
31 class Stripper: public PluginElement {
32 
33 public:
35  explicit Stripper(const std::string &name);
36 
37  Stripper();
38  Stripper(const Stripper &);
39  void operator=(const Stripper &) = delete;
40  virtual ~Stripper();
41 
43  virtual void accept(BeamlineVisitor &) const override;
45  virtual ElementBase::ElementType getType() const override;
47 
49  void setOPCharge(double charge);
50  double getOPCharge() const;
51  void setOPMass(double mass);
52  double getOPMass() const;
53  void setOPYield(double yield);
54  double getOPYield() const;
55  void setStop(bool stopflag);
56  bool getStop() const;
58 
59  virtual int getRequiredNumberOfTimeSteps() const override;
60 
61 private:
63  virtual bool doCheck(PartBunchBase<double, 3> *bunch, const int turnnumber, const double t, const double tstep) override;
65  virtual void doFinalise() override;
67  virtual bool doPreCheck(PartBunchBase<double, 3>*) override;
69  virtual bool doFinaliseCheck(PartBunchBase<double, 3> *bunch, bool flagNeedUpdate) override;
70 
71  double opcharge_m;
72  double opmass_m;
73  double opyield_m;
74  bool stop_m;
75 };
76 
77 inline
79 {
80  return 1;
81 }
82 
83 #endif // CLASSIC_Stripper_HH
const std::string name
double opcharge_m
Charge number of the out-coming particle.
Definition: Stripper.h:71
virtual ~Stripper()
Definition: Stripper.cpp:54
virtual bool doPreCheck(PartBunchBase< double, 3 > *) override
Virtual hook for preCheck.
Definition: Stripper.cpp:96
void setOPCharge(double charge)
Member variable access.
Definition: Stripper.cpp:64
double getOPMass() const
Definition: Stripper.cpp:84
virtual void accept(BeamlineVisitor &) const override
Apply visitor to Stripper.
Definition: Stripper.cpp:56
virtual ElementBase::ElementType getType() const override
Override implementation of PluginElement.
Definition: Stripper.cpp:190
Stripper()
Definition: Stripper.cpp:35
double getOPCharge() const
Definition: Stripper.cpp:80
void operator=(const Stripper &)=delete
virtual int getRequiredNumberOfTimeSteps() const override
Definition: Stripper.h:78
void setStop(bool stopflag)
Definition: Stripper.cpp:76
bool getStop() const
Definition: Stripper.cpp:92
void setOPYield(double yield)
Definition: Stripper.cpp:72
void setOPMass(double mass)
Definition: Stripper.cpp:68
double opmass_m
Mass of the out-coming particle.
Definition: Stripper.h:72
virtual bool doCheck(PartBunchBase< double, 3 > *bunch, const int turnnumber, const double t, const double tstep) override
Record hits when bunch particles pass.
Definition: Stripper.cpp:111
double getOPYield() const
Definition: Stripper.cpp:88
double opyield_m
Yield of the out-coming particle.
Definition: Stripper.h:73
virtual void doFinalise() override
Virtual hook for finalise.
Definition: Stripper.cpp:60
bool stop_m
Flag if particles should be stripped or stopped.
Definition: Stripper.h:74
virtual bool doFinaliseCheck(PartBunchBase< double, 3 > *bunch, bool flagNeedUpdate) override
Virtual hook for finaliseCheck.
Definition: Stripper.cpp:176