MarlinTPC  1.2.0
dEdxProcessor.h
1 #ifndef DEDXPROCESSOR_H
2 #define DEDXPROCESSOR_H
3 
4 // C++
5 #include <string>
6 #include <fstream>
7 #include <set>
8 
9 
10 // LCIO
11 #include "lcio.h"
12 
13 // Marlin
14 #include "marlin/Processor.h"
15 #include "lccd/ConditionsMap.hh"
16 //ROOT
17 #include "TH1F.h"
18 #include "TFile.h"
19 #include "TNtuple.h"
20 
21 #include "gear/GEAR.h"
22 #include "HistogramWidthExtractionTools.h"
23 
24 namespace marlintpc
25 {
26 
44 class dEdxProcessor : public marlin::Processor
45 {
46 
47  public:
48 
49  /* This method will be called by the marlin package
50  * It returns a processor of the currend type
51  */
52  virtual Processor* newProcessor()
53  {
54  return new dEdxProcessor ;
55  }
56 
57  /* the default constructor
58  * here the processor parameters are registered to the marlin package
59  * other initialisation should be placed in the init method
60  */
61  dEdxProcessor() ;
62 
63  /* Called at the beginning of the job before anything is read.
64  * Use to initialize the processor, e.g. book histograms
65  */
66  virtual void init() ;
67 
68  /* Called for every run.
69  * in this processor it is not used
70  */
71  virtual void processRunHeader(lcio::LCRunHeader* run) ;
72 
73  /* Called for every event - the working horse.
74  * Here the real conversion take place
75  */
76  virtual void processEvent(lcio::LCEvent * evt) ;
77 
78  /* This method is only called if the check flag is set (default) in the main processor
79  * (where the input files are given)
80  * It should be used to create check plots which are not needed in a complete analysis
81  * (where normaly the check flag is deactivated)
82  */
83  virtual void check(lcio::LCEvent * evt) ;
84 
85 
86  /* Called after data processing for clean up.
87  * e.g. saving control histogramms, delete created objects
88  * (which are not stored in a collection/event), etc.
89  */
90  virtual void end() ;
91 
92 
93 
94 
95  protected:
96 
97  std::string _inputColName ;
98 
99  int _nRun ;
100  gear::IntVec _rows2skip;
101  std::set<std::pair<int,int> > _skipList;
102  static const std::pair<int, int> ALLROWS;
103 
104 
105  private:
106 
107  TNtuple *_tuple;
108  TH1F* _histodEdx;
110 } ;
111 
112 }
113 
114 #endif
115 
116 
117 
A collection of tools to evaluate the width of a distribution in a histogram.
Definition: HistogramWidthExtractionTools.h:22
std::set< std::pair< int, int > > _skipList
The list of the rows to skip.
Definition: dEdxProcessor.h:101
static const std::pair< int, int > ALLROWS
The pair that identifies the default value of the SkipRow parameter and the special combination meani...
Definition: dEdxProcessor.h:102
int _nRun
Definition: dEdxProcessor.h:99
std::string _inputColName
Definition: dEdxProcessor.h:97
A processor to calculate hitcharge per length unit taking into account the track length over the meas...
Definition: dEdxProcessor.h:44
gear::IntVec _rows2skip
Vector of rows to skip.
Definition: dEdxProcessor.h:100