OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
BeamBeamRep.h
Go to the documentation of this file.
1 #ifndef CLASSIC_BeamBeamRep_HH
2 #define CLASSIC_BeamBeamRep_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: BeamBeamRep.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: BeamBeamRep
13 //
14 // ------------------------------------------------------------------------
15 // Class category: BeamlineCore
16 // ------------------------------------------------------------------------
17 //
18 // $Date: 2000/03/27 09:32:33 $
19 // $Author: fci $
20 //
21 // ------------------------------------------------------------------------
22 
23 #include "AbsBeamline/BeamBeam.h"
25 #include "Fields/NullField.h"
26 
27 
28 // Class BeamBeamRep
29 // ------------------------------------------------------------------------
31 // A concrete representation for a beam-beam interaction.
32 // The opposite bunch has a Gaussian distribution of the form
33 // [P]
34 // N(x,y,s) = c * exp(- transpose(z - delta) sigma**(-1) (z - delta)),
35 // [P]
36 // with the definitions
37 // [DL]
38 // [DT]z[DD] position vector in space,
39 // [DT]delta[DD] centroid of opposite bunch in global reference system,
40 // [DT]sigma[DD] beam matrix in the TRANSPORT sense,
41 // [DT]c[DD] a normalising factor, such that the total charge is Q,
42 // [DT]sigma(i,i)[DD] standard deviation sigma(i) in direction i,
43 // [DT]r(i,j)[DD] = sigma(i,j)/sqrt(sigma(i,i)*sigma(i,j)),
44 // correlations between phase space coordinates i and j.
45 // [/DL]
46 
47 class BeamBeamRep: public BeamBeam {
48 
49 public:
50 
52  explicit BeamBeamRep(const std::string &name);
53 
54  BeamBeamRep();
55  BeamBeamRep(const BeamBeamRep &);
56  virtual ~BeamBeamRep();
57 
59  // Return an identical deep copy of the element.
60  virtual ElementBase *clone() const;
61 
63  // This method constructs a Channel permitting read/write access to
64  // the attribute[b]aKey[/b] and returns it.
65  // If the attribute does not exist, it returns NULL.
66  virtual Channel *getChannel(const std::string &aKey, bool = false);
67 
69  // Return the number of particles times the particle charge in the
70  // opposite bunch. Units are proton charges.
71  virtual double getBunchCharge() const;
72 
74  // Return the moment matrix for the opposite bunch (the matrix of
75  // second momenta). Units are square metres.
76  virtual const Matrix3D &getBunchMoment() const;
77 
79  // Return the displacement vector for position of opposite bunch.
80  // Units are metres.
81  virtual const Vector3D &getBunchDisplacement() const;
82 
84  // Version for non-constant object.
85  virtual NullField &getField();
86 
88  // Version for constant object.
89  virtual const NullField &getField() const;
90 
92  // Version for non-constant object.
93  virtual NullGeometry &getGeometry();
94 
96  // Version for constant object.
97  virtual const NullGeometry &getGeometry() const;
98 
100  // Return the image of the element, containing the name and type string
101  // of the element, and a copy of the user-defined attributes.
102  virtual ElementImage *getImage() const;
103 
105  // Units are proton charges.
106  void setBunchCharge(double);
107 
109  // Assign the moment matrix for the opposite bunch
110  // (the matrix of second momenta). Units are square metres.
111  void setBunchMoment(const Matrix3D &);
112 
114  // Assign the displacement vector for the opposite bunch.
115  // Units are metres.
116  void setBunchDisplacement(const Vector3D &);
117 
118 private:
119 
120  // Not implemented.
121  void operator=(const BeamBeamRep &);
122 
123  // Get a moment for the opposite bunch.
124  double getMoment(int index) const;
125 
126  // Get the displacement vector for the opposite bunch.
127  double getDisplacement(int index) const;
128 
129  // Set a moment for the opposite bunch.
130  void setMoment(int index, double);
131 
132  // Set a displacement for the opposite bunch.
133  void setDisplacement(int index, double);
134 
135  // The zero magnetic field.
137 
138  // The geometry (a straight geometry with zero length).
140 
141  // Total charge of the opposite bunch in proton charges.
142  double Q;
143 
144  // Displacement of the centre of gravity of the opposite bunch
145  // with respect to the local frame for the affected bunch.
147 
148  // Second moments of the opposite bunch.
150 };
151 
152 #endif // CLASSIC_BeamBeamRep_HH
Interface for basic beam line object.
Definition: ElementBase.h:128
virtual const Vector3D & getBunchDisplacement() const
Get displacement.
Matrix3D sigma
Definition: BeamBeamRep.h:149
virtual ElementBase * clone() const
Return clone.
Definition: BeamBeamRep.cpp:77
Representation of beam-beam interaction.
Definition: BeamBeamRep.h:47
void setBunchMoment(const Matrix3D &)
Set moments.
double getMoment(int index) const
virtual double getBunchCharge() const
Get bunch charge.
void setBunchDisplacement(const Vector3D &)
Set displacement.
void setMoment(int index, double)
Vector3D delta
Definition: BeamBeamRep.h:146
A zero electromagnetic field.
Definition: NullField.h:30
virtual ElementImage * getImage() const
Construct an image.
virtual ~BeamBeamRep()
Definition: BeamBeamRep.cpp:73
NullGeometry geometry
Definition: BeamBeamRep.h:139
virtual NullGeometry & getGeometry()
Get geometry.
An image of an element.
Definition: ElementImage.h:35
Geometry representing an identity transform.
Definition: NullGeometry.h:32
Abstract beam-beam interaction.
Definition: BeamBeam.h:37
3-dimensional matrix.
Definition: Matrix3D.h:33
NullField field
Definition: BeamBeamRep.h:136
virtual const Matrix3D & getBunchMoment() const
Get moments.
double getDisplacement(int index) const
A 3-dimension vector.
Definition: Vector3D.h:31
Abstract interface for read/write access to variable.
Definition: Channel.h:32
void setDisplacement(int index, double)
const std::string name
void setBunchCharge(double)
Set the bunch charge.
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
Definition: BeamBeamRep.cpp:82
virtual NullField & getField()
Get field.
void operator=(const BeamBeamRep &)