OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
TravelingWaveRep.h
Go to the documentation of this file.
1 #ifndef CLASSIC_TravelingWaveRep_HH
2 #define CLASSIC_TravelingWaveRep_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: TravelingWaveRep.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: TravelingWaveRep
13 //
14 // ------------------------------------------------------------------------
15 // Class category: BeamlineCore
16 // ------------------------------------------------------------------------
17 //
18 // $Date: 2000/03/27 09:32:34 $
19 // $Author: fci $
20 //
21 // ------------------------------------------------------------------------
22 
26 
27 
28 // Class TravelingWaveRep
29 // ------------------------------------------------------------------------
31 
33 
34 public:
35 
37  explicit TravelingWaveRep(const std::string &name);
38 
41  virtual ~TravelingWaveRep();
42 
44  // Return an identical deep copy of the element.
45  virtual ElementBase *clone() const;
46 
48  // This method constructs a Channel permitting read/write access to
49  // the attribute [b]aKey[/b] and returns it.
50  // If the attribute does not exist, it returns NULL.
51  virtual Channel *getChannel(const std::string &aKey, bool = false);
52 
54  // Version for non-constant object.
55  virtual AcceleratingField &getField();
56 
58  // Version for constant object.
59  virtual const AcceleratingField &getField() const;
60 
62  // Return the element geometry.
63  // Version for non-constant object.
64  virtual StraightGeometry &getGeometry();
65 
67  // Return the element geometry
68  // Version for constant object.
69  virtual const StraightGeometry &getGeometry() const;
70 
72  // Return the image of the element, containing the name and type string
73  // of the element, and a copy of the user-defined attributes.
74  virtual ElementImage *getImage() const;
75 
77  // Return the RF amplitude in Volts.
78  virtual double getAmplitude() const;
79 
81  // Return the RF frequency in Hertz.
82  virtual double getFrequency() const;
83 
85  // Return the RF phase in radians.
86  virtual double getPhase() const;
87 
89  // Assign the RF amplitude in Volts.
90  virtual void setAmplitude(double V);
91 
93  // Assign the RF frequency in Hertz.
94  virtual void setFrequency(double f);
95 
97  // Assing the RF phase in radians.
98  virtual void setPhase(double phi);
99 
101  // If [b]ignore[/b] is true, cavities are ignored for static calculations.
102  static void setIgnore(bool ignore = false);
103 
104 private:
105 
106  // Not implemented.
107  void operator=(const TravelingWaveRep &);
108 
111 
114 
116  static bool ignoreCavities;
117 };
118 
119 #endif // CLASSIC_TravelingWaveRep_HH
virtual StraightGeometry & getGeometry()
Get geometry.
Interface for basic beam line object.
Definition: ElementBase.h:128
Representation for a RF cavity.
virtual ~TravelingWaveRep()
AcceleratingField field
The cavity's field.
virtual AcceleratingField & getField()
Get field.
void operator=(const TravelingWaveRep &)
static bool ignoreCavities
Cavities are ignored (amplitude = 0) when this switch is set.
virtual void setPhase(double phi)
Set phase.
An image of an element.
Definition: ElementImage.h:35
virtual ElementImage * getImage() const
Construct an image.
Interface for RF cavity.
Definition: TravelingWave.h:37
static void setIgnore(bool ignore=false)
Set ignore switch.
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
A geometry representing a straight line.
virtual void setFrequency(double f)
Set frequency.
Abstract interface for read/write access to variable.
Definition: Channel.h:32
virtual ElementBase * clone() const
Return clone.
virtual double getPhase() const
Get phase.
const std::string name
virtual double getAmplitude() const
Get amplitude.
virtual double getFrequency() const
Get frequency.
virtual void setAmplitude(double V)
Set amplitude.
StraightGeometry geometry
The cavity's geometry.