CFEL - ASG Software Suite  2.5.0
CASS
particle.h
Go to the documentation of this file.
1 //Copyright (C) 2009-2010 Lutz Foucar
2 
3 /**
4  * @file particle.h file contains the classes that describe a particle that hit
5  * a delayline detector.
6  *
7  * @author Lutz Foucar
8  */
9 
10 #ifndef __MyParticle_H__
11 #define __MyParticle_H__
12 
13 #include <vector>
14 #include <memory>
15 #include <tr1/memory>
16 #include <string>
17 
18 #include "spectrometer.h"
19 #include "momenta_calculator.h"
21 
22 namespace cass
23 {
24 class CASSSettings;
25 
26 namespace ACQIRIS
27 {
28 class IsParticleHit;
29 class MomentumCalculator;
30 class DelaylineDetector;
31 
32 /** A Particle
33  *
34  * class describing a particle. It contains the properties of a particle,
35  * classes that can calculate the momentum of the particle. Therefore it
36  * also contains the spectrometer through which the particle flys and a
37  * class that can correct the values from the detectorhit. To find out which
38  * of the provided detectorhits are a particle hit of this particle it owns
39  * a comparator class.
40  *
41  * @cassttng AcqirisDetectors/\%detectorname\%/Particles/\%particlename%/{Charge}\n
42  * The charge of the particle in atomic units. Default is 1.
43  * @cassttng AcqirisDetectors/\%detectorname\%/\%particlename%/{Mass}\n
44  * The Mass of the particle in atomic mass units. When one wants
45  * to define a electron the charge has to be -1 and the Mass 1.
46  * Default is 1.
47  * @cassttng AcqirisDetectors/\%detectorname\%/Particles/\%particlename%/{Spectrometer}\n
48  * The Spectrometer that the Particles fly through.
49  * See cass::ACQIRIS::Spectrometer
50  * @cassttng AcqirisDetectors/\%detectorname\%/Particles/\%particlename%/{Corrections}\n
51  * The corrections that one has to do to the raw values of a hit
52  * in order to convert the hit values to momentum.
53  * See cass::ACQIRIS::HitCorrector
54  * @cassttng AcqirisDetectors/\%detectorname\%/Particles/\%particlename%/{ConditionType}\n
55  * The type of condition that we use to identify a particle hit
56  * from a detectorhit. Default is 0. Possible choises are:
57  * - 0: condition on time of flight:
58  * See cass::ACQIRIS::TofCond
59  * - 1: condition on a radius with choseable center of the position:
60  * See cass::ACQIRIS::RadCond
61  * - 2: condition on a rectangle of the position:
62  * See cass::ACQIRIS::RectCond
63  * - 3: combination of condition 0 and 1:
64  * See cass::ACQIRIS::TofCond and cass::ACQIRIS::RadCond
65  * - 4: combination of condition 0 and 2:
66  * See cass::ACQIRIS::TofCond and cass::ACQIRIS::RadCond
67  *
68  * @author Lutz Foucar
69  */
70 class Particle
71 {
72 public:
73  /** constructor
74  *
75  * set the _listIsCreated flag to false
76  */
78  :_listIsCreated(false)
79  {}
80 
81  /** load the settings from .ini file
82  *
83  * First load the spectrometers settings, then the hitcorrector settings.
84  * Then load our properties. Then create the comaprison object that the
85  * user has chosen and load its settings. After that depending on the
86  * spectrometer type load the momentum calculation objects.
87  * The mass is always converted from atomic mass units to atomic units.
88  * Only if the mass is 1 and the charge is -1 (this is true for an electron)
89  * the conversion will be omited.
90  *
91  * @param s the CASSSettings object to read the info from
92  */
93  void loadSettings(CASSSettings &s);
94 
95  /** retrieve the particle hits
96  *
97  * goes through the detectorhits and checks whether the hit is a particle
98  * of our type. Then calculates the momenta in kartesian and
99  * polarcoordinates and puts the new hit into the list. Then returns the
100  * list.
101  * When the former is already done once, just return the list.
102  *
103  * @return the list of particle hits
104  */
105  particleHits_t& hits();
106 
107  /** tell which are the detector hits to search through
108  *
109  * after telling us which detectohit list to go through to search for
110  * particle hits, this resets the _listIsCreated flag and clears the
111  * _particlehits container.
112  *
113  * @param detector pointer to the detector containing this particle
114  */
116 
117  /** retrive the spectormeter */
118  const Spectrometer& spectrometer()const {return _spectrometer;}
119 
120  //@{
121  /** retrieve the particle properties */
122  double mass_au()const {return _mass_au;}
123  double charge_au()const {return _charge_au;}
124  //@}
125 
126 private:
127  /** the list of particle hits */
129 
130  /** pointer to the delayline detector that conatins this particle */
132 
133  /** flag to tell whether we already created the list of particle hits */
135 
136  /** identifer for checking detectorhit is a particle hit */
137  std::tr1::shared_ptr<IsParticleHit> _isParticleHit;
138 
139  /** calculate momenta along the detector plane of a particle hit */
140  std::tr1::shared_ptr<MomentumCalculator> _calc_detplane;
141 
142  /** calculate momenta along the ToF direction of a particle hit */
143  std::tr1::shared_ptr<MomentumCalculator> _calc_tof;
144 
145  /** copy and correction of the detectorhit */
147 
148  /** the spectrometer of this particle */
150 
151  /** the Mass of this Particle in atomic units */
152  double _mass_au;
153 
154  /** the charge of this Particle in atomic units */
155  double _charge_au;
156 };
157 }//end namespace acqiris
158 }//end namespace cass
159 #endif
DelaylineDetector * _detector
pointer to the delayline detector that conatins this particle
Definition: particle.h:131
particleHits_t & hits()
retrieve the particle hits
Definition: particle.cpp:296
copy and correct detectorhit properties
std::tr1::shared_ptr< IsParticleHit > _isParticleHit
identifer for checking detectorhit is a particle hit
Definition: particle.h:137
file contains the classes that calculate the momenta of particles from their detector hits...
double mass_au() const
retrieve the particle properties
Definition: particle.h:122
Settings for CASS.
Definition: cass_settings.h:30
particleHits_t _particlehits
the list of particle hits
Definition: particle.h:128
double _charge_au
the charge of this Particle in atomic units
Definition: particle.h:155
std::tr1::shared_ptr< MomentumCalculator > _calc_detplane
calculate momenta along the detector plane of a particle hit
Definition: particle.h:140
double _mass_au
the Mass of this Particle in atomic units
Definition: particle.h:152
bool _listIsCreated
flag to tell whether we already created the list of particle hits
Definition: particle.h:134
const Spectrometer & spectrometer() const
retrive the spectormeter
Definition: particle.h:118
HitCorrector _copyandcorrect
copy and correction of the detectorhit
Definition: particle.h:146
double charge_au() const
retrieve the particle properties
Definition: particle.h:123
contains the global definitions for acqiris analysis
void loadSettings(CASSSettings &s)
load the settings from .ini file
Definition: particle.cpp:274
void associate(DelaylineDetector *detector)
tell which are the detector hits to search through
Definition: particle.cpp:323
a REMI type spectrometer
Definition: spectrometer.h:85
std::tr1::shared_ptr< MomentumCalculator > _calc_tof
calculate momenta along the ToF direction of a particle hit
Definition: particle.h:143
Electron detector
Definition: hdf5-input.ini:62
A Particle.
Definition: particle.h:70
Particle()
constructor
Definition: particle.h:77
contains the classes that describe a REMI type spectrometer.
std::vector< particleHit_t > particleHits_t
define container for all particle hits
Spectrometer _spectrometer
the spectrometer of this particle
Definition: particle.h:149