OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
RFCavityRep.h
Go to the documentation of this file.
1 //
2 // Class RFCavityRep
3 // Representation for a RF cavity.
4 //
5 // Copyright (c) 200x - 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_RFCavityRep_HH
19 #define CLASSIC_RFCavityRep_HH
20 
21 #include "AbsBeamline/RFCavity.h"
24 
25 
26 class RFCavityRep: public RFCavity {
27 
28 public:
29 
31  explicit RFCavityRep(const std::string &name);
32 
33  RFCavityRep();
34  RFCavityRep(const RFCavityRep &);
35  virtual ~RFCavityRep();
36 
38  // Return an identical deep copy of the element.
39  virtual ElementBase *clone() const;
40 
42  // This method constructs a Channel permitting read/write access to
43  // the attribute [b]aKey[/b] and returns it.
44  // If the attribute does not exist, it returns NULL.
45  virtual Channel *getChannel(const std::string &aKey, bool = false);
46 
48  // Version for non-constant object.
49  virtual AcceleratingField &getField();
50 
52  // Version for constant object.
53  virtual const AcceleratingField &getField() const;
54 
56  // Return the element geometry.
57  // Version for non-constant object.
58  virtual StraightGeometry &getGeometry();
59 
61  // Return the element geometry
62  // Version for constant object.
63  virtual const StraightGeometry &getGeometry() const;
64 
66  // Return the RF amplitude in Volts.
67  virtual double getAmplitude() const;
68 
70  // Return the RF frequency in Hertz.
71  virtual double getFrequency() const;
72 
74  // Return the RF phase in radians.
75  virtual double getPhase() const;
76 
78  // Assign the RF amplitude in Volts.
79  virtual void setAmplitude(double V);
80 
82  // Assign the RF frequency in Hertz.
83  virtual void setFrequency(double f);
84 
86  // Assing the RF phase in radians.
87  virtual void setPhase(double phi);
88 
90  // If [b]ignore[/b] is true, cavities are ignored for static calculations.
91  static void setIgnore(bool ignore = false);
92 
93 private:
94 
95  // Not implemented.
96  void operator=(const RFCavityRep &);
97 
100 
103 
105  static bool ignoreCavities;
106 };
107 
108 #endif // CLASSIC_RFCavityRep_HH
const std::string name
Interface for RF cavity.
Definition: RFCavity.h:37
virtual void setPhase(double phi)
Set phase.
virtual void setFrequency(double f)
Set frequency.
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
Definition: RFCavityRep.cpp:82
virtual StraightGeometry & getGeometry()
Get geometry.
virtual double getPhase() const
Get phase.
virtual ElementBase * clone() const
Return clone.
Definition: RFCavityRep.cpp:77
virtual double getAmplitude() const
Get amplitude.
void operator=(const RFCavityRep &)
StraightGeometry geometry
The cavity's geometry.
Definition: RFCavityRep.h:99
virtual void setAmplitude(double V)
Set amplitude.
static bool ignoreCavities
Cavities are ignored (amplitude = 0) when this switch is set.
Definition: RFCavityRep.h:105
static void setIgnore(bool ignore=false)
Set ignore switch.
virtual AcceleratingField & getField()
Get field.
Definition: RFCavityRep.cpp:93
AcceleratingField field
The cavity's field.
Definition: RFCavityRep.h:102
virtual double getFrequency() const
Get frequency.
virtual ~RFCavityRep()
Definition: RFCavityRep.cpp:73
A geometry representing a straight line.
Abstract interface for read/write access to variable.
Definition: Channel.h:32