OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
CCollimator.h
Go to the documentation of this file.
1 #ifndef CLASSIC_CCollimator_HH
2 #define CLASSIC_CCollimator_HH
3 
5 
7 
8 // Class CCollimator
9 // ------------------------------------------------------------------------
11 // Class CCollimator defines the abstract interface for a collimator.
12 
13 class CCollimator: public PluginElement {
14 
15 public:
17  explicit CCollimator(const std::string &name);
18 
19  CCollimator();
20  CCollimator(const CCollimator &rhs);
21  void operator=(const CCollimator &) = delete;
22  virtual ~CCollimator();
23 
25  virtual void accept(BeamlineVisitor &) const override;
27  virtual void goOnline(const double &kineticEnergy) override;
28  virtual ElementBase::ElementType getType() const override;
29  virtual void getDimensions(double &zBegin, double &zEnd) const override;
31 
33  // bool checkCollimator(Vector_t r, Vector_t rmin, Vector_t rmax);
34 
36  void print();
37 
39  void setDimensions(double xstart, double xend,
40  double ystart, double yend,
41  double zstart, double zend,
42  double width);
45 
47  double getZStart() ;
48  double getZEnd() ;
49  double getWidth() ;
51 private:
53  virtual void doInitialise(PartBunchBase<double, 3> *bunch) override;
55  virtual bool doCheck(PartBunchBase<double, 3> *bunch, const int turnnumber, const double t, const double tstep) override;
57  virtual void doSetGeom() override;
59  virtual void doFinalise() override;
61  virtual bool doPreCheck(PartBunchBase<double, 3>*) override;
63  virtual bool doFinaliseCheck(PartBunchBase<double, 3> *bunch, bool flagNeedUpdate) override;
64 
65  bool informed_m = false;
66 
68  double zstart_m;
69  double zend_m;
70  double width_m;
72  double rmax_m;
73 
75 };
76 
77 inline
79  return zstart_m;
80 }
81 
82 inline
84  return zend_m;
85 }
86 
87 inline
89  return width_m;
90 }
91 #endif // CLASSIC_CCollimator_HH
virtual void accept(BeamlineVisitor &) const override
Apply visitor to CCollimator.
Definition: CCollimator.cpp:35
double getZStart()
Member variable access.
Definition: CCollimator.h:78
double getZEnd()
Definition: CCollimator.h:83
double width_m
Definition: CCollimator.h:70
virtual void goOnline(const double &kineticEnergy) override
Override implementation of PluginElement.
virtual bool doCheck(PartBunchBase< double, 3 > *bunch, const int turnnumber, const double t, const double tstep) override
Record hits when bunch particles pass.
Definition: CCollimator.cpp:61
virtual bool doPreCheck(PartBunchBase< double, 3 > *) override
Virtual hook for preCheck.
Definition: CCollimator.cpp:39
bool informed_m
Flag if error information already printed.
Definition: CCollimator.h:65
void operator=(const CCollimator &)=delete
double rmax_m
maximum extend in r
Definition: CCollimator.h:72
virtual void doFinalise() override
Virtual hook for finalise.
ParticleMatterInteractionHandler * parmatint_m
Definition: CCollimator.h:74
virtual void doSetGeom() override
Calculate extend in r.
Interface for cyclotron collimator.
Definition: CCollimator.h:13
virtual ~CCollimator()
Definition: CCollimator.cpp:33
virtual void getDimensions(double &zBegin, double &zEnd) const override
void print()
unused check method
const std::string name
void setDimensions(double xstart, double xend, double ystart, double yend, double zstart, double zend, double width)
Set dimensions and consistency checks.
virtual ElementBase::ElementType getType() const override
Get element type std::string.
virtual bool doFinaliseCheck(PartBunchBase< double, 3 > *bunch, bool flagNeedUpdate) override
Virtual hook for finaliseCheck.
Definition: CCollimator.cpp:83
double zstart_m
input geometry positions
Definition: CCollimator.h:68
double getWidth()
Definition: CCollimator.h:88
Abstract algorithm.
virtual void doInitialise(PartBunchBase< double, 3 > *bunch) override
Initialise particle matter interaction.
Definition: CCollimator.cpp:96
double zend_m
Definition: CCollimator.h:69
void setDimensions(double xstart, double xend, double ystart, double yend)
Set dimensions and consistency checks.