OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
CCollimator.h
Go to the documentation of this file.
1 //
2 // Class CCollimator
3 // Interface for cyclotron collimator
4 //
5 // Copyright (c) 2018-2020, Paul Scherrer Institut, Villigen PSI, Switzerland
6 // All rights reserved
7 //
8 // This file is part of OPAL.
9 //
10 // OPAL is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
17 //
18 #ifndef CLASSIC_CCollimator_HH
19 #define CLASSIC_CCollimator_HH
20 
22 
24 
25 class CCollimator: public PluginElement {
26 
27 public:
29  explicit CCollimator(const std::string &name);
30 
31  CCollimator();
32  CCollimator(const CCollimator &rhs);
33  void operator=(const CCollimator &) = delete;
34  virtual ~CCollimator();
35 
37  virtual void accept(BeamlineVisitor &) const override;
39  virtual void goOnline(const double &kineticEnergy) override;
40  virtual ElementBase::ElementType getType() const override;
41  virtual void getDimensions(double &zBegin, double &zEnd) const override;
43 
45  // bool checkCollimator(Vector_t r, Vector_t rmin, Vector_t rmax);
46 
48  void print();
49 
51  void setDimensions(double xstart, double xend,
52  double ystart, double yend,
53  double zstart, double zend,
54  double width);
57 
59  double getZStart() ;
60  double getZEnd() ;
61  double getWidth() ;
63 private:
65  virtual void doInitialise(PartBunchBase<double, 3> *bunch) override;
67  virtual bool doCheck(PartBunchBase<double, 3> *bunch, const int turnnumber, const double t, const double tstep) override;
69  virtual void doSetGeom() override;
71  virtual void doFinalise() override;
73  virtual bool doPreCheck(PartBunchBase<double, 3>*) override;
75  virtual bool doFinaliseCheck(PartBunchBase<double, 3> *bunch, bool flagNeedUpdate) override;
76 
77  bool informed_m = false;
78 
80  double zstart_m;
81  double zend_m;
82  double width_m;
84  double rmax_m;
85 
87 };
88 
89 inline
91  return zstart_m;
92 }
93 
94 inline
96  return zend_m;
97 }
98 
99 inline
101  return width_m;
102 }
103 #endif // CLASSIC_CCollimator_HH
const std::string name
double zend_m
Definition: CCollimator.h:81
virtual void doSetGeom() override
Calculate extend in r.
double getWidth()
Definition: CCollimator.h:100
virtual void accept(BeamlineVisitor &) const override
Apply visitor to CCollimator.
Definition: CCollimator.cpp:52
virtual void goOnline(const double &kineticEnergy) override
Override implementation of PluginElement.
void operator=(const CCollimator &)=delete
virtual void getDimensions(double &zBegin, double &zEnd) const override
double getZStart()
Member variable access.
Definition: CCollimator.h:90
virtual ElementBase::ElementType getType() const override
Get element type std::string.
double getZEnd()
Definition: CCollimator.h:95
virtual bool doPreCheck(PartBunchBase< double, 3 > *) override
Virtual hook for preCheck.
Definition: CCollimator.cpp:56
bool informed_m
Flag if error information already printed.
Definition: CCollimator.h:77
virtual void doInitialise(PartBunchBase< double, 3 > *bunch) override
Initialise particle matter interaction.
double zstart_m
input geometry positions
Definition: CCollimator.h:80
void print()
unused check method
virtual bool doFinaliseCheck(PartBunchBase< double, 3 > *bunch, bool flagNeedUpdate) override
Virtual hook for finaliseCheck.
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:78
double width_m
Definition: CCollimator.h:82
double rmax_m
maximum extend in r
Definition: CCollimator.h:84
ParticleMatterInteractionHandler * parmatint_m
Definition: CCollimator.h:86
void setDimensions(double xstart, double xend, double ystart, double yend)
unhide PluginElement::setDimensions(double xstart, double xend, double ystart, double yend)
virtual ~CCollimator()
Definition: CCollimator.cpp:50
virtual void doFinalise() override
Virtual hook for finalise.
void setDimensions(double xstart, double xend, double ystart, double yend)
Set dimensions and consistency checks.