OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
RFCavityRep.h
Go to the documentation of this file.
1 #ifndef CLASSIC_RFCavityRep_HH
2 #define CLASSIC_RFCavityRep_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: RFCavityRep.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: RFCavityRep
13 //
14 // ------------------------------------------------------------------------
15 // Class category: BeamlineCore
16 // ------------------------------------------------------------------------
17 //
18 // $Date: 2000/03/27 09:32:34 $
19 // $Author: fci $
20 //
21 // ------------------------------------------------------------------------
22 
23 #include "AbsBeamline/RFCavity.h"
26 
27 
28 // Class RFCavityRep
29 // ------------------------------------------------------------------------
31 
32 class RFCavityRep: public RFCavity {
33 
34 public:
35 
37  explicit RFCavityRep(const std::string &name);
38 
39  RFCavityRep();
40  RFCavityRep(const RFCavityRep &);
41  virtual ~RFCavityRep();
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 RFCavityRep &);
108 
111 
114 
116  static bool ignoreCavities;
117 };
118 
119 #endif // CLASSIC_RFCavityRep_HH
virtual void setPhase(double phi)
Set phase.
Interface for basic beam line object.
Definition: ElementBase.h:128
virtual void setAmplitude(double V)
Set amplitude.
void operator=(const RFCavityRep &)
virtual void setFrequency(double f)
Set frequency.
static void setIgnore(bool ignore=false)
Set ignore switch.
virtual double getPhase() const
Get phase.
Representation for a RF cavity.
Definition: RFCavityRep.h:32
virtual ElementBase * clone() const
Return clone.
Definition: RFCavityRep.cpp:87
AcceleratingField field
The cavity's field.
Definition: RFCavityRep.h:113
virtual ~RFCavityRep()
Definition: RFCavityRep.cpp:83
virtual ElementImage * getImage() const
Construct an image.
static bool ignoreCavities
Cavities are ignored (amplitude = 0) when this switch is set.
Definition: RFCavityRep.h:116
An image of an element.
Definition: ElementImage.h:35
virtual double getAmplitude() const
Get amplitude.
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
Definition: RFCavityRep.cpp:92
A geometry representing a straight line.
Abstract interface for read/write access to variable.
Definition: Channel.h:32
virtual StraightGeometry & getGeometry()
Get geometry.
Interface for RF cavity.
Definition: RFCavity.h:37
const std::string name
virtual AcceleratingField & getField()
Get field.
StraightGeometry geometry
The cavity's geometry.
Definition: RFCavityRep.h:110
virtual double getFrequency() const
Get frequency.