MarlinTPC  1.2.0
ADC2PrimaryElectronFactorCalculator.h
1 #ifndef ADC2PRIMARYELECTRONFACTORCALCULATOR_H
2 #define ADC2PRIMARYELECTRONFACTORCALCULATOR_H
3 
4 // C++
5 #include <string>
6 #include <fstream>
7 
8 // LCIO
9 #include "lcio.h"
10 
11 // Marlin
12 #include "marlin/Processor.h"
13 #include "lccd/ConditionsMap.hh"
14 //ROOT
15 #include "TH1F.h"
16 #include "TFile.h"
17 #include "TNtuple.h"
18 
19 namespace marlintpc
20 {
21 
37 class ADC2PrimaryElectronFactorCalculatorProcessor : public marlin::Processor
38 {
39 
40  public:
41 
42  /* This method will be called by the marlin package
43  * It returns a processor of the currend type
44  */
45  virtual Processor* newProcessor()
46  {
48  }
49 
50  /* the default constructor
51  * here the processor parameters are registered to the marlin package
52  * other initialisation should be placed in the init method
53  */
55 
56  /* Called at the beginning of the job before anything is read.
57  * Use to initialize the processor, e.g. book histograms
58  */
59  virtual void init() ;
60 
61  /* Called for every run.
62  * in this processor it is not used
63  */
64  virtual void processRunHeader(lcio::LCRunHeader* run) ;
65 
66  /* Called for every event - the working horse.
67  * Here the real conversion take place
68  */
69  virtual void processEvent(lcio::LCEvent * evt) ;
70 
71  /* This method is only called if the check flag is set (default) in the main processor
72  * (where the input files are given)
73  * It should be used to create check plots which are not needed in a complete analysis
74  * (where normaly the check flag is deactivated)
75  */
76  virtual void check(lcio::LCEvent * evt) ;
77 
78 
79  /* Called after data processing for clean up.
80  * e.g. saving control histogramms, delete created objects
81  * (which are not stored in a collection/event), etc.
82  */
83  virtual void end() ;
84 
85 
86 
87 
88  protected:
89 
90  std::string _inputColName ;
91 
92  int _nRun ;
93 
94  private:
95  double _primEl;
96  TNtuple *_tuple;
97  TH1F* _histoL;
98  TH1F* _histoQ;
99  TH1F* _histodEdx;
100  TFile *_outfile_root;
101  std::ofstream _outfile;
102  std::string _outfileName;
103  std::string _rootoutfileName;
104 
105 } ;
106 
107 }
108 
109 #endif
110 
111 
112 
A processor to calculate hitcharge per length unit taking into account the track length over the meas...
Definition: ADC2PrimaryElectronFactorCalculator.h:37
int _nRun
Definition: ADC2PrimaryElectronFactorCalculator.h:92
std::string _inputColName
Definition: ADC2PrimaryElectronFactorCalculator.h:90