MarlinTPC  1.2.0
LinearGeometricMeanResolutionProcessor.h
1 #ifndef LinearGeometricMeanResolutionProcessor_h
2 #define LinearGeometricMeanResolutionProcessor_h 1
3 
4 #define N_1D_HISTOS_GEOMETRIC_MEAN_RESOLUTION_PROCESSOR 4
5 #define N_2D_HISTOS_GEOMETRIC_MEAN_RESOLUTION_PROCESSOR 0
6 
7 // C++
8 #include <string>
9 #include <iostream>
10 #include <sstream>
11 #include <cmath>
12 #include <vector>
13 
14 // LCIO
15 #include "lcio.h"
16 #include <EVENT/TrackerHit.h>
17 #include <EVENT/LCCollection.h>
18 #include <EVENT/Track.h>
19 #include <IMPL/LCCollectionVec.h>
20 #include <IMPL/TrackerHitImpl.h>
21 #include "UTIL/LCTOOLS.h"
22 #include "IntersectionCalculator.h"
23 
24 // Marlin
25 #include "marlin/Processor.h"
26 #include "ZBinTemplateProcessor.h"
27 #include "TimePixEventDisplayCreator.h"
28 #include "TrackFitterFactory.h"
29 #include "TrackFitterBase.h"
30 #include "LinearRegressionProcessor.h"
31 #include "LinearTrackRegression.h"
32 
33 // Aida
34 #ifdef MARLIN_USE_AIDA
35 //AIDA
36 #include <marlin/AIDAProcessor.h>
37 #include <AIDA/IHistogramFactory.h>
38 #include <AIDA/IHistogram1D.h>
39 #include <AIDA/IHistogram2D.h>
40 #endif
41 
42 //root
43 #include "TH2F.h"
44 #include "TF1.h"
45 #include "TList.h"
46 
47 namespace AIDA{
48  class IHistogram1D;
49  class IHistogram2D;
50 }
51 
52 namespace marlintpc{
53 
54  class TrackFitterFactory;
55 
56  /* the following comment is tranfered to doxygen documentation
57  * which begins with a second asterix, or in case of on line comment an extra third slash
58  */
59 
103  public ZBinTemplateProcessor<N_1D_HISTOS_GEOMETRIC_MEAN_RESOLUTION_PROCESSOR,
104  N_2D_HISTOS_GEOMETRIC_MEAN_RESOLUTION_PROCESSOR>{
105 
106 //public marlin::Processor {
107 
108  public:
109 
110  /* This method will be called by the marlin package
111  * It returns a processor of the currend type (here LinearGeometricMeanResolutionProcessor)
112  */
113  virtual Processor* newProcessor() { return new LinearGeometricMeanResolutionProcessor ; }
114 
115  /* the default constructor
116  * here the processor parameters are registered to the marlin package
117  * other initialisation should be placed in the init method
118  */
120 
122 
123  /* Called at the beginning of the job before anything is read.
124  * Use to initialize the processor, e.g. book histograms
125  */
126  virtual void init() ;
127 
128  /* Called for every run.
129  * in this processor it is not used
130  */
131  virtual void processRunHeader( lcio::LCRunHeader* run ) ;
132 
133  /* Called for every event - the working horse.
134  * Here the real conversion take place
135  */
136  virtual void processEvent( lcio::LCEvent * evt ) ;
137 
138  /* This method is only called if the check flag is set (default) in the main processor
139  * (where the input files are given)
140  * It should be used to create check plots which are not needed in a complete analysis
141  * (where normaly the check flag is deactivated)
142  */
143  virtual void check( lcio::LCEvent * evt ) ;
144 
145 
146  /* Called after data processing for clean up.
147  * e.g. saving control histogramms, delete created objects
148  * (which are not stored in a collection/event), etc.
149  */
150  virtual void end() ;
151 
152  static bool compareHit(const std::pair<TrackerHit*, double> & pair1,
153  const std::pair<TrackerHit*, double> & pair2)
154  {
155  return pair1.second < pair2.second;
156  }
157 
158 
159 
160  protected:
161 
162  /* normally the doxygen documentation is palced before the method/variable
163  * but for one line comments in case of variables it may be more convenied for you
164  * to place it after the variable. In this case you use an arrow to tell doxygen
165  * to which variable the commet belongs to.
166  */
167 
168  std::string _inputColName ;
169  int _histoBin;
170  float _histoRange;
171 
175  static const unsigned int _histoGeoNIndex;
176  static const unsigned int _histoGeoNminus1Index;
177  static const unsigned int _histoGeoZNIndex;
178  static const unsigned int _histoGeoZNminus1Index;
179 
180 
186 
187 private:
188 
189  AIDA::IHistogram1D* _histoGeoN;
190  AIDA::IHistogram1D* _histoGeoNminus1;
191  AIDA::IHistogram1D* _histoGeoZN;
192  AIDA::IHistogram1D* _histoGeoZNminus1;
193 
194  int _applyZCut;
195  float _zMin, _zMax;
196  bool _DisplayAllEvents;
197 
198  std::string _histoGeoNName;
199  std::string _histoGeoZNName;
200  std::string _histoGeoNminus1Name;
201  std::string _histoGeoZNminus1Name;
202 
203  TH2F * _xyResidualsScatterPlot;
204  TH2F * _zResidualsScatterPlot;
205 
206  double _transDiff;
207  double _longDiff;
208 
209  TimePixEventDisplayCreator *_eventDisplayCreator;
210  } ;
211 
212 }
213 
214 #endif
215 
216 
217 
bool isFirstCollection
is true till the first output collection is wirten to an event used to to store parameters only in th...
Definition: LinearGeometricMeanResolutionProcessor.h:185
virtual Processor * newProcessor()
The newProcessor() function does not make sense for this template class, so it throws an lcio::Except...
Definition: LinearGeometricMeanResolutionProcessor.h:113
The EVENT_DISPLAY_CREATOR is a class that allows to instantiate an EVENT_DISPLAY_CREATOR object ina a...
Definition: TimePixEventDisplayCreator.h:48
static const unsigned int _histoGeoNIndex
The index of the template parameter for the hitsPerTrack histos We want to have these values divided ...
Definition: LinearGeometricMeanResolutionProcessor.h:175
float _histoRange
Definition: LinearGeometricMeanResolutionProcessor.h:170
int _histoBin
Definition: LinearGeometricMeanResolutionProcessor.h:169
virtual void init()
Register the AIDA histograms at the AIDAProcessor.
Definition: LinearGeometricMeanResolutionProcessor.cc:137
A template to create processors wich create 1D or 2D distribution histograms, one histogram per z bin...
Definition: ZBinTemplateProcessor.h:76
std::string _inputColName
Definition: LinearGeometricMeanResolutionProcessor.h:168
Resoltuion calculator for straight lines using the gemetric mean method.
Definition: LinearGeometricMeanResolutionProcessor.h:102