OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Degrader.h
Go to the documentation of this file.
1 #ifndef CLASSIC_Degrader_HH
2 #define CLASSIC_Degrader_HH
3 
4 // Class category: AbsBeamline
5 // ------------------------------------------------------------------------
6 //
7 // $Date: 2000/03/27 09:32:31 $
8 // $Author: fci $
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: Degrader
13 // Defines the abstract interface for a beam Degrader.
14 // *** MISSING *** Degrader interface is still incomplete.
15 //
16 // ------------------------------------------------------------------------
17 // Class category: AbsBeamline
18 // ------------------------------------------------------------------------
19 //
20 // $Date: 2000/03/27 09:32:31 $
21 // $Author: fci $
22 //
23 // ------------------------------------------------------------------------
24 
25 #include "AbsBeamline/Component.h"
28 #include <vector>
29 
30 class LossDataSink;
31 
32 // Class Degrader
33 // ------------------------------------------------------------------------
35 // Class Degrader defines the abstract interface for a collimator.
36 
37 class Degrader: public Component {
38 
39 public:
40 
42  enum Plane {
44  OFF,
46  X,
48  Y,
51  };
52 
54  explicit Degrader(const std::string &name);
55 
56  Degrader();
57  Degrader(const Degrader &rhs);
58  virtual ~Degrader();
59 
61  virtual void accept(BeamlineVisitor &) const;
62 
63  virtual bool apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B);
64 
65  virtual bool applyToReferenceParticle(const Vector_t &R,
66  const Vector_t &P,
67  const double &t,
68  Vector_t &E,
69  Vector_t &B);
70 
71  virtual void initialise(PartBunchBase<double, 3> *bunch, double &startField, double &endField);
72 
73  virtual void initialise(PartBunchBase<double, 3> *bunch);
74 
75  virtual void finalise();
76 
77  virtual bool bends() const;
78 
79  virtual void goOnline(const double &kineticEnergy);
80 
81  virtual void goOffline();
82 
83  virtual ElementBase::ElementType getType() const;
84 
85  virtual void getDimensions(double &zBegin, double &zEnd) const;
86 
87  std::string getDegraderShape(); // AAA
88 
89  void setOutputFN(std::string fn);
90  std::string getOutputFN();
91 
92  virtual bool isInMaterial(double z);
93 
94 private:
95 
96  // Not implemented.
97  void operator=(const Degrader &);
98 
99  std::string filename_m;
101  std::vector<double> PosX_m;
102  std::vector<double> PosY_m;
103  std::vector<double> PosZ_m;
104  std::vector<double> MomentumX_m;
105  std::vector<double> MomentumY_m;
106  std::vector<double> MomentumZ_m;
107  std::vector<double> time_m;
108  std::vector<int> id_m;
109 
110  std::unique_ptr<LossDataSink> lossDs_m;
111 };
112 
113 #endif // CLASSIC_Degrader_HH
virtual bool isInMaterial(double z)
Definition: Degrader.cpp:82
std::vector< double > PosZ_m
Definition: Degrader.h:103
Plane
Plane selection.
Definition: Degrader.h:42
virtual ElementBase::ElementType getType() const
Get element type std::string.
Definition: Degrader.cpp:199
Definition: TSVMeta.h:24
std::vector< double > MomentumY_m
Definition: Degrader.h:105
void operator=(const Degrader &)
virtual bool bends() const
Definition: Degrader.cpp:178
std::vector< double > PosY_m
Definition: Degrader.h:102
std::vector< double > MomentumZ_m
Definition: Degrader.h:106
Monitor acts on both planes.
Definition: Degrader.h:50
Degrader()
Definition: Degrader.cpp:39
virtual void getDimensions(double &zBegin, double &zEnd) const
Definition: Degrader.cpp:193
Monitor acts on y-plane.
Definition: Degrader.h:48
Monitor is off (inactive).
Definition: Degrader.h:44
std::vector< double > MomentumX_m
Definition: Degrader.h:104
virtual bool apply(const size_t &i, const double &t, Vector_t &E, Vector_t &B)
Definition: Degrader.cpp:90
virtual void accept(BeamlineVisitor &) const
Apply visitor to Degrader.
Definition: Degrader.cpp:77
std::vector< int > id_m
Definition: Degrader.h:108
std::string filename_m
Definition: Degrader.h:99
std::vector< double > PosX_m
Definition: Degrader.h:101
virtual void initialise(PartBunchBase< double, 3 > *bunch, double &startField, double &endField)
Definition: Degrader.cpp:133
virtual bool applyToReferenceParticle(const Vector_t &R, const Vector_t &P, const double &t, Vector_t &E, Vector_t &B)
Definition: Degrader.cpp:118
virtual void goOnline(const double &kineticEnergy)
Definition: Degrader.cpp:157
std::unique_ptr< LossDataSink > lossDs_m
Definition: Degrader.h:110
virtual void finalise()
Definition: Degrader.cpp:152
std::vector< double > time_m
Definition: Degrader.h:107
virtual void goOffline()
Definition: Degrader.cpp:171
std::string getOutputFN()
Definition: Degrader.cpp:186
Abstract collimator.
Definition: Degrader.h:37
const std::string name
std::string getDegraderShape()
Definition: Degrader.cpp:203
Monitor acts on x-plane.
Definition: Degrader.h:46
Interface for a single beam element.
Definition: Component.h:51
Abstract algorithm.
void setOutputFN(std::string fn)
Definition: Degrader.cpp:182
virtual ~Degrader()
Definition: Degrader.cpp:70