MarlinTPC  1.2.0
DriftProcessor.h
1 #ifndef DriftProcessor_h
2 #define DriftProcessor_h 1
3 
4 
5 //LCIO
6 #include <EVENT/SimTrackerHit.h>
7 #include <lcio.h>
8 
9 //MARLIN
10 #include "marlin/Processor.h"
11 
12 //C++
13 #include <string>
14 
15 //GSL
16 #include <gsl/gsl_rng.h>
17 #include <gsl/gsl_randist.h>
18 
19 #include "TPCGas.h"
20 
21 namespace marlintpc{
22 
23 
24 /* The following comment is tranfered to doxygen documentation
25  * which begins with a second asterix, or in case of on line comment an extra third slash
26  */
27 
55 class DriftProcessor : public marlin::Processor {
56 
57  public:
58 
59  virtual Processor* newProcessor() { return new DriftProcessor ; }
60 
63  DriftProcessor() ;
64 
67  virtual ~DriftProcessor(){}
68 
72  virtual void init() ;
73 
76  virtual void processRunHeader( lcio::LCRunHeader* run ) ;
77 
80  virtual void processEvent( lcio::LCEvent * evt ) ;
81 
82 
85  virtual void end();
86 
87 
88 protected:
89 
94 
97  void GetElectronCoordinates(SimTrackerHit *);
98 
99 
100  //Input/output collection names
101  std::string _inputCollectionName;
104  std::string _gas;
105 
106  float _EField;
107  float _BField;
108 
110 
111  gsl_rng *r;
112  // coordinates and variables for track
114  double x_e,y_e,z_e,t_e; // e- coordinates
115  // particle variables
116  //int numberofelectrons;
117 
118  //TPC parameter
119  double _TPCLength;
122  double _distance;
123 
124  //Coordinates of the drifted electron.
125  float xdrift,ydrift,zdrift,tdrift;
126  float _vdrift;
127  float _difflong;
128  float _difftrans;
129  double _meanAmp;
130 
132 
135 
137 
138  double _attachment;
139 };
140 
141 }//end of namespace marlintpc
142 
143 #endif
std::string _inputCollectionName
Name of the input collection.
Definition: DriftProcessor.h:101
std::string _outputCollectionName
Name of the output collection.
Definition: DriftProcessor.h:102
float _vdrift
Drift velocity in mm/us.
Definition: DriftProcessor.h:126
double _TPCOuterRadius
Outer Radius of the TPC.
Definition: DriftProcessor.h:120
virtual void init()
Called at the begin of the job before anything is read.
Definition: DriftProcessor.cc:118
The TPCGas is a helper class containing a parametrisation of some gas mixtures It can be used by proc...
Definition: TPCGas.h:18
bool _isFirstEvent
Flag to store if this is the first event processed after init.
Definition: DriftProcessor.h:136
double _TPCLength
Maximum drift length of the TPC.
Definition: DriftProcessor.h:119
double x_e
Definition: DriftProcessor.h:114
double _TPCInnerRadius
Inner Radius of the TPC.
Definition: DriftProcessor.h:121
float _difftrans
Transversal diffusion in um/sqrt(cm)
Definition: DriftProcessor.h:128
int _transient
If not set to 0 output collection is set transient.
Definition: DriftProcessor.h:109
double _attachment
Additional attachment in drift reagion due to water and/or oxygen in gas.
Definition: DriftProcessor.h:138
void MakeElectronDriftCoordinates()
Calculates coordinates of the drifted electrons.
Definition: DriftProcessor.cc:325
std::string _tpcConditionsColName
Name of collection with TPCConditions.
Definition: DriftProcessor.h:103
TPCGas * _gasClass
gas object to calulated properties like drift and diffusion
Definition: DriftProcessor.h:131
gsl_rng * r
Random generator for landau and gaussian.
Definition: DriftProcessor.h:111
std::string _gas
Name of the gas used in the TPC.
Definition: DriftProcessor.h:104
virtual ~DriftProcessor()
D'tor.
Definition: DriftProcessor.h:67
double _ionisationEnergy
Ionisation energy of the gas.
Definition: DriftProcessor.h:133
virtual void end()
Called after all events were processed for clean up.
Definition: DriftProcessor.cc:349
DriftProcessor()
C'tor.
Definition: DriftProcessor.cc:59
float tdrift
Coordinates of drifted e-.
Definition: DriftProcessor.h:125
double _distance
Drift distance of an electron.
Definition: DriftProcessor.h:122
Processor to drift primary electrons according to the characteristics of the choosen gas to pad plane...
Definition: DriftProcessor.h:55
virtual void processEvent(lcio::LCEvent *evt)
Called for every event - the working horse.
Definition: DriftProcessor.cc:184
float _difflong
Longitudinal diffusion in um/sqrt(cm)
Definition: DriftProcessor.h:127
virtual void processRunHeader(lcio::LCRunHeader *run)
Called for every run.
Definition: DriftProcessor.cc:166
double _meanAmp
Mean amplification of an single electron.
Definition: DriftProcessor.h:129
bool _fullCurlerBackwardCompatibility
Flag whether to multiply hits in curlers with 10.
Definition: DriftProcessor.h:134
void GetElectronCoordinates(SimTrackerHit *)
Gets electron coordinates before drifting.
Definition: DriftProcessor.cc:315