MarlinTPC  1.2.0
GEMProcessor.h
1 #ifndef GEMProcessor_h
2 #define GEMProcessor_h 1
3 
4 //C++
5 #include <string>
6 #include <vector>
7 #include "TF1.h"
8 
9 //LCIO
10 #include <IMPL/LCCollectionVec.h>
11 #include <marlin/Processor.h>
12 #include <lcio.h>
13 
14 namespace marlintpc{
15 
16 /* The following comment is tranfered to doxygen documentation
17  * which begins with a second asterix, or in case of on line comment an extra third slash
18  */
19 
73 class GEMProcessor : public marlin::Processor {
74 
75  public:
76 
77  virtual Processor *newProcessor(){ return new GEMProcessor ; }
78 
81  GEMProcessor() ;
82 
85  virtual ~GEMProcessor(){}
86 
90  virtual void init() ;
91 
94  virtual void processRunHeader(lcio::LCRunHeader* run ) ;
95 
98  virtual void processEvent(lcio::LCEvent * evt ) ;
99 
104  void LoadGEMSettings();
105 
109  int GEM_Collection(int GEMNr, int enumber);
110 
114  double GEM_Gain(int GEMNr, int enumber);
115 
119  int GEM_Extraction(int GEMNr, int enumber);
120 
123  double CalculateAttachment(double E);
124 
125  double AttachmentParam(double E, double a0, double a1, double a2,
126  double a3, double a4, double a5);
127 
133  int CalculateNrElectrons(double attachment1, double attachment2,
134  double attachment3, int charge);
135 
136 
139  virtual void end() ;
140 
141 
142 protected:
143 
144  std::string _inputCollectionName;
148 
149  std::string paramfile;
150  std::string gas;
151 
152  float UGEM1;
153  float UGEM2;
154  float UGEM3;
155 
156  float ETrans1;
157  float ETrans2;
158  float EInd;
159 
160  float _gainFactor;
161 
163 
164  float _driftField;
165 
166  double Extr[3];
167  double Coll[3];
168  double Gain[3];
169  double gainmean[3];
170 
171  /* Attachment
172  */
173  double A1, A2, A3;
174 
175  //For internal bookkeeping
176  int _nRun;
177  int _nEvt;
178 
179  double _meanAmp;
180 
183  bool _GEMGainPolya;//< Flag to swicth between polya and exponential gain in GEMs
184  // TF1 *_gainPolya;///<Polya function for gain in GEMs, if option selected
185  // store one for each GEM, to avoid all the recalculations in TF1::GetRandom after changing parameters
186  std::map<int, TF1*> _gainPolya;
188 
189 }; //end of class definition
190 
191 } //end of namespace marlintpc
192 
193 #endif
std::string _outputCollectionName
Name of output collection.
Definition: GEMProcessor.h:145
virtual void end()
Called after data processing for clean up.
Definition: GEMProcessor.cc:605
This Processor takes drifted electrons and uses a triple GEM structure for amplification.
Definition: GEMProcessor.h:73
bool _fullCurlerBackwardCompatibility
Flag whether to multiply hits in curlers with 10.
Definition: GEMProcessor.h:182
double _meanAmp
Mean amplification in GEMs.
Definition: GEMProcessor.h:179
float _gainFactor
Correction factor for GAIN.
Definition: GEMProcessor.h:160
double CalculateAttachment(double E)
Claculates the attachment between GEMs.
std::string _tpcConditionsColName
Name of collection containing the TPCConditions.
Definition: GEMProcessor.h:146
int GEM_Extraction(int GEMNr, int enumber)
Gives the Extraction out of GEM i=GEMNr for enumber of electrons indside GEM hole.
Definition: GEMProcessor.cc:555
virtual ~GEMProcessor()
D'tor.
Definition: GEMProcessor.h:85
float ETrans1
Strength of first transversal field in [V/cm].
Definition: GEMProcessor.h:156
double GEM_Gain(int GEMNr, int enumber)
Gives the gain in GEM i=GEMNr using an exponential distribution for the gain in one GEM...
Definition: GEMProcessor.cc:527
float UGEM1
Voltage of GEM 1 in [V].
Definition: GEMProcessor.h:152
std::map< int, TF1 * > _gainPolya
Polya function for gain in GEMs, if option selected.
Definition: GEMProcessor.h:186
void LoadGEMSettings()
Reads parameter file with GEM parametrisations and sets collection and extraction efficiencies as wel...
Definition: GEMProcessor.cc:480
float ETrans2
Strength of second transversal field in [V/cm].
Definition: GEMProcessor.h:157
float UGEM3
Voltage of GEM 3 in [V].
Definition: GEMProcessor.h:154
float UGEM2
Voltage of GEM 2 in [V].
Definition: GEMProcessor.h:153
virtual void processRunHeader(lcio::LCRunHeader *run)
Called for every run.
Definition: GEMProcessor.cc:225
double _ionisationEnergy
Ionisation energy of the gas.
Definition: GEMProcessor.h:181
std::string paramfile
Name of file containig GEM parametrization.
Definition: GEMProcessor.h:149
float _driftField
Strength of the drift field in [V/cm].
Definition: GEMProcessor.h:164
std::string _altTPCConditionsName
Name of the newly created TPCConditonsCollection if the original one is not writeable.
Definition: GEMProcessor.h:147
std::string gas
Name of gas in TPC (P5, P10 or TDR)
Definition: GEMProcessor.h:150
int _transient
Sets output collection to transient when set to another value than 0.
Definition: GEMProcessor.h:162
int CalculateNrElectrons(double attachment1, double attachment2, double attachment3, int charge)
Function to claculate number of electrons after passing through the GEM structure.
Definition: GEMProcessor.cc:579
double _polyaThetaP1
value for the parameter theta+1 of the polya gain distribution
Definition: GEMProcessor.h:187
int GEM_Collection(int GEMNr, int enumber)
Gives the Collection into GEM i=GEMNr for enumber of electrons in front of GEM hole.
Definition: GEMProcessor.cc:504
GEMProcessor()
C'tor.
Definition: GEMProcessor.cc:67
float EInd
Strength of induction field in [V/cm].
Definition: GEMProcessor.h:158
virtual void init()
Called at the begin of the job before anything is read.
Definition: GEMProcessor.cc:175
std::string _inputCollectionName
Name of input collection.
Definition: GEMProcessor.h:144
virtual void processEvent(lcio::LCEvent *evt)
Called for every event - the working horse.
Definition: GEMProcessor.cc:244