CFEL - ASG Software Suite  2.5.0
CASS
spectrometer.h
Go to the documentation of this file.
1 //Copyright (C) 2009-2010 Lutz Foucar
2 
3 /**
4  * @file spectrometer.h contains the classes that describe a REMI type
5  * spectrometer.
6  *
7  * @author Lutz Foucar
8  */
9 
10 #ifndef __Spectrometer_H_
11 #define __Spectrometer_H_
12 
13 #include <vector>
14 
15 namespace cass
16 {
17 class CASSSettings;
18 
19 namespace ACQIRIS
20 {
21 class Particle;
22 
23 /** a region of a spectrometer
24  *
25  * this class defines a region of a REMI type spectrometer (Spectrometer)
26  * It has a length and a electric field strength.
27  *
28  * @cassttng AcqirisDetectors/\%detectorname\%/Particles/\%particlename%/Spectrometer/Regions/\%regionindex\%/{Length}\n
29  * The length of the spectrometer region in mm. Default is 10.
30  * @cassttng AcqirisDetectors/\%detectorname\%/Particles/\%particlename%/Spectrometer/Regions/\%regionindex\%/{EField}\n
31  * The strength of the electric field in the spectrometer region
32  * in \f$\frac{V}{cm}\f$. Default is 10.
33  *
34  * @author Lutz Foucar
35  */
37 {
38 public:
39  /** load the settings from .ini file
40  *
41  * @param s the CASSSettings object to read the information from
42  */
43  void loadSettings(CASSSettings&s);
44 
45  //@{
46  /** retrieve region properties */
47  double EField_Vpcm()const {return _efield;}
48  double length_mm()const {return _length;}
49  //@}
50 
51 private:
52  /** the length of the spectrometer region in mm */
53  double _length;
54  /** the electric field strength inside this region in \f$\frac{V}{cm}\f$ */
55  double _efield;
56 };
57 
58 /** a REMI type spectrometer
59  *
60  * class describes a remi type spectroemter that has one or more separeted
61  * regions. In the spectrometer a magenetic field can be present. In this
62  * case it is important to know in which direction the magnetic field is
63  * pointing and how strong it is. The latter can be measured by the cyclotron
64  * period of the electrons and the former by the rotation direction of the
65  * electrons.
66  *
67  * @cassttng AcqirisDetectors/\%detectorname\%/Particles/\%particlename%/Spectrometer/{BFieldIsOn}\n
68  * Flag to tell whether a magnetic field is present in the
69  * spectrometer. Default is false
70  * @cassttng AcqirisDetectors/\%detectorname\%/Particles/\%particlename%/Spectrometer/{RotationClockwise}\n
71  * Flag to tell in which direction the magentic field is pointing
72  * This can be told by telling in which way the electrons rotate.
73  * If they rotate clockwise this should be true. Default is true.
74  * @cassttng AcqirisDetectors/\%detectorname\%/Particles/\%particlename%/Spectrometer/{CyclotronPeriode}\n
75  * The time it takes for an electron to make a complete rotation
76  * in the magnetic field in ns. Default is 10
77  * @cassttng AcqirisDetectors/\%detectorname\%/Particles/\%particlename%/Spectrometer/{Regions}\n
78  * The groupname of the regions of a spectrometer.
79  * See cass::ACQIRIS::SpectrometerRegion
80  * @cassttng AcqirisDetectors/\%detectorname\%/Particles/\%particlename%/Spectrometer/Regions/{Size}\n
81  * The number of spectrometer regions available. Default is 0.
82  *
83  * @author Lutz Foucar
84  */
86 {
87 public:
88  /** typef for better readable code */
89  typedef std::vector<SpectrometerRegion> regions_t;
90 
91  /** load the settings from .ini file
92  *
93  * load all spectrometer regions from file before loading our own members.
94  * We need to convert the cyclotron period that is given by the user in
95  * electron periods to the period that this particle has. Therefore we
96  * need to multiply the period by the ratio of mass to charge of the
97  * particle.
98  *
99  * @param s the CASSSettings object to read the information from
100  * @param particle the particle that this spectrometer belongs to
101  */
102  void loadSettings(CASSSettings &s, const Particle& particle);
103 
104  //@{
105  /** retrieve magnetic field parameter */
106  double cyclotronPeriod_ns()const {return _cyclotronPeriod;}
107  bool BFieldIsOn()const {return _BFieldIsOn;}
108  bool rotationClockWise()const {return _rotationClockwise;}
109  //@}
110 
111  /** retrieve the regions of the spectrometer */
112  const regions_t& regions()const {return _regions;}
113 
114 private:
115  /** the regions of the spectrometer */
116  regions_t _regions;
117 
118  /** flag to tell whether the magnetic field is turned on */
120 
121  /** the cyclotron frequency of the particles in ns*/
123 
124  /** flag showing the direction of the magnetic field
125  *
126  * this is done by saying wether electrons turn clock or counterclockwise
127  */
129 };
130 } //end namespace ACQIRIS
131 } //end namespace cass
132 #endif
const regions_t & regions() const
retrieve the regions of the spectrometer
Definition: spectrometer.h:112
double _length
the length of the spectrometer region in mm
Definition: spectrometer.h:53
Settings for CASS.
Definition: cass_settings.h:30
bool _rotationClockwise
flag showing the direction of the magnetic field
Definition: spectrometer.h:128
regions_t _regions
the regions of the spectrometer
Definition: spectrometer.h:116
double _cyclotronPeriod
the cyclotron frequency of the particles in ns
Definition: spectrometer.h:122
a region of a spectrometer
Definition: spectrometer.h:36
double length_mm() const
retrieve region properties
Definition: spectrometer.h:48
void loadSettings(CASSSettings &s, const Particle &particle)
load the settings from .ini file
bool rotationClockWise() const
retrieve magnetic field parameter
Definition: spectrometer.h:108
std::vector< SpectrometerRegion > regions_t
typef for better readable code
Definition: spectrometer.h:89
double _efield
the electric field strength inside this region in
Definition: spectrometer.h:55
bool _BFieldIsOn
flag to tell whether the magnetic field is turned on
Definition: spectrometer.h:119
void loadSettings(CASSSettings &s)
load the settings from .ini file
bool BFieldIsOn() const
retrieve magnetic field parameter
Definition: spectrometer.h:107
double EField_Vpcm() const
retrieve region properties
Definition: spectrometer.h:47
double cyclotronPeriod_ns() const
retrieve magnetic field parameter
Definition: spectrometer.h:106
a REMI type spectrometer
Definition: spectrometer.h:85
A Particle.
Definition: particle.h:70