OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
OpalWake.h
Go to the documentation of this file.
1 #ifndef OPAL_Wake_HH
2 #define OPAL_Wake_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: OpalWake.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: OpalWake
13 //
14 // ------------------------------------------------------------------------
15 //
16 // $Date: 2000/03/27 09:33:44 $
17 // $Author: Andreas Adelmann $
18 //
19 // ------------------------------------------------------------------------
20 
22 #include "Algorithms/PartData.h"
23 
24 class ElementBase;
25 class WakeFunction;
26 
27 // Class OpalWake
28 // ------------------------------------------------------------------------
30 // A WAKE definition is used by most physics commands to define the
31 // particle charge and the reference momentum, together with some other
32 // data.
33 
34 class OpalWake: public Definition {
35 
36 public:
37 
39  OpalWake();
40 
41  virtual ~OpalWake();
42 
44  // Can replace only by another WAKE.
45  virtual bool canReplaceBy(Object *object);
46 
48  virtual OpalWake *clone(const std::string &name);
49 
51  virtual void execute();
52 
54  static OpalWake *find(const std::string &name);
55 
57  virtual void update();
58 
59  void print(std::ostream &os) const;
60 
61  int getNumberOfBins();
62 
63  void initWakefunction(ElementBase &element);
64 
66 
67 private:
68 
69  // Not implemented.
70  OpalWake(const OpalWake &);
71  void operator=(const OpalWake &);
72 
73  // Clone constructor.
74  OpalWake(const std::string &name, OpalWake *parent);
75 
76  // The particle reference data.
78 
79  // The conversion from GeV to eV.
80  static const double energy_scale;
81 
82  // the element the wake is attached to
84 
85 };
86 
87 inline std::ostream &operator<<(std::ostream &os, const OpalWake &b) {
88  b.print(os);
89  return os;
90 }
91 
92 #endif // OPAL_Wake_HH
std::ostream & operator<<(std::ostream &os, const Attribute &attr)
Definition: Attribute.cpp:167
virtual void update()
Update the WAKE data.
Definition: OpalWake.cpp:151
WakeFunction * wf_m
Definition: OpalWake.h:65
Interface for basic beam line object.
Definition: ElementBase.h:128
The base class for all OPAL definitions.
Definition: Definition.h:30
void print(std::ostream &os) const
Print the object.
Definition: OpalWake.cpp:241
void operator=(const OpalWake &)
Particle reference data.
Definition: PartData.h:38
virtual ~OpalWake()
Definition: OpalWake.cpp:114
The WAKE definition.
Definition: OpalWake.h:34
void initWakefunction(ElementBase &element)
Definition: OpalWake.cpp:157
virtual OpalWake * clone(const std::string &name)
Make clone.
Definition: OpalWake.cpp:126
virtual void execute()
Check the WAKE data.
Definition: OpalWake.cpp:131
static const double energy_scale
Definition: OpalWake.h:80
static OpalWake * find(const std::string &name)
Find named WAKE.
Definition: OpalWake.cpp:136
OpalWake()
Exemplar constructor.
Definition: OpalWake.cpp:56
The base class for all OPAL objects.
Definition: Object.h:48
const std::string name
ElementBase * itsElement_m
Definition: OpalWake.h:83
int getNumberOfBins()
Definition: OpalWake.cpp:146
PartData reference
Definition: OpalWake.h:77
virtual bool canReplaceBy(Object *object)
Test if replacement is allowed.
Definition: OpalWake.cpp:120