MarlinTPC  1.2.0
TimePixClusterProjectionSeparatorProcessor.h
1 #ifndef TimePixClusterProjectionSeparatorProcessor_h
2 #define TimePixClusterProjectionSeparatorProcessor_h 1
3 
4 // C++
5 #include <iostream>
6 #include <queue>
7 #include <string>
8 #include <sstream>
9 #include <cmath>
10 #include <map>
11 #include <vector>
12 #include <iomanip>
13 
14 // LCIO
15 #include "lcio.h"
16 #include <EVENT/LCCollection.h>
17 #include <EVENT/TrackerData.h>
18 #include <IMPL/LCCollectionVec.h>
19 #include <IMPL/TrackerHitImpl.h>
20 #include <IMPL/TrackerDataImpl.h>
21 #include <IMPL/LCRelationImpl.h>
22 #include "UTIL/LCTOOLS.h"
23 #include <IMPL/LCFlagImpl.h>
24 
25 // Marlin
26 #include "marlin/Processor.h"
27 #include "TimePixPixelMode.h"
28 #include "TimePixMapListener.h"
29 #include "lccd/ConditionsMap.hh"
30 #include <marlin/ConditionsProcessor.h>
31 
32 // Aida
33 #ifdef MARLIN_USE_AIDA
34 #include <AIDA/AIDA.h>
35 #include <marlin/AIDAProcessor.h>
36 #include <AIDA/IPlotter.h>
37 #include <AIDA/IPlotterFactory.h>
38 #include <RAIDA/RAIDAUtil.h>
39 #include <RAIDA/IBrushStyleROOT.h>
40 #include <RAIDA/IPlotterFactoryROOT.h>
41 #include <AIDA/IMarkerStyle.h>
42 
43 //Root
44 #include "TROOT.h"
45 #include "TCanvas.h"
46 #include "TFile.h"
47 #include "TH2F.h"
48 #include "THStack.h"
49 #include "TLine.h"
50 #include "TH1F.h"
51 
52 #endif
53 
54 
55 namespace AIDA{
56 
57  class IHistogram1D;
58  class IHistogram2D;
59 
60 }
61 
62 namespace marlintpc{
63 
64  /* the following comment is tranfered to doxygen documentation
65  * which begins with a second asterix, or in case of on line comment an extra third slash
66  */
92  class TimePixClusterProjectionSeparatorProcessor : public marlin::Processor {
93 
94  public:
95 
96  /* This method will be called by the marlin package
97  * It returns a processor of the currend type (here TimePixClusterProjectionSeparatorProcessor)
98  */
99  virtual Processor* newProcessor() { return new TimePixClusterProjectionSeparatorProcessor ; }
100 
101  /* the default constructor
102  * here the processor parameters are registered to the marlin package
103  * other initialisation should be placed in the init method
104  */
106 
107  /* Called at the beginning of the job before anything is read.
108  * Use to initialize the processor, e.g. book histograms
109  */
110  virtual void init() ;
111 
112  /* Called for every run.
113  * in this processor it is not used
114  */
115  virtual void processRunHeader( lcio::LCRunHeader* run ) ;
116 
117  /* Called for every event - the working horse.
118  * Here the real conversion take place
119  */
120  virtual void processEvent( lcio::LCEvent * evt ) ;
121 
122  /* This method is only called if the check flag is set (default) in the main processor
123  * (where the input files are given)
124  * It should be used to create check plots which are not needed in a complete analysis
125  * (where normaly the check flag is deactivated)
126  */
127  virtual void check( lcio::LCEvent * evt ) ;
128 
129 
130  /* Called after data processing for clean up.
131  * e.g. saving control histogramms, delete created objects
132  * (which are not stored in a collection/event), etc.
133  */
134  virtual void end() ;
135 
136  /* Finds the next local maximum in an AIDA::IHistogram1D,
137  * starting at the binnumber given by int startbin
138  * and returns the bin number of the maximum
139  * if there is no maximum to be found it returns 0
140  */
141  virtual int locMaxFinder( int startbin, AIDA::IHistogram1D * h1) ;
142 
143  /* Finds the next local minimum in an AIDA::IHistogram1D,
144  * starting at the binnumber given by int startbin
145  * and returns the bin number of the minimum
146  * if there is no minimum to be found it returns 0
147  */
148  virtual int locMinFinder( int startbin,AIDA::IHistogram1D * h1) ;
149 
150  /* Finds the bin at which the cluster should be separated
151  * starting at the local minimum given by the binnumber locmin
152  * if the cluster should not be separated it returns 0
153  */
154  virtual int sepBinFinder( int locmin, AIDA::IHistogram1D * h1) ;
155 
156  protected:
157 
158  /* normally the doxygen documentation is palced before the method/variable
159  * but for one line comments in case of variables it may be more convenied for you
160  * to place it after the variable. In this case you use an arrow to tell doxygen
161  * to which variable the commet belongs to.
162  */
163 
164  std::string _inputColName ;
165  std::string _outputColName ;
167  std::string _relationsColName ;
168 
169  int _nColumn;
170  int _nRow;
174 
179 
185 
186  int _nRun ;
187 
188  double a;
189  double b;
190 
196  tpcconddata::TimePixMap * _timePixMap;
197 
198  private:
199  std::vector<AIDA::IHistogram1D *> hProjectXVec;
200  TH1F *_pixelCountHisto;
201 // AIDA::IHistogram1D * highTOT;
202  AIDA::IHistogram2D * aidahistocluster;
203  AIDA::IHistogram2D ** aidaonehit;
204 
205 
206  } ;
207 
208 }
209 
210 #endif
211 
212 
213 
std::string _outputTrackerDataColName
Definition: TimePixClusterProjectionSeparatorProcessor.h:166
int _outputIsTransient
give the status which is set to the transient flag of the output collection it is an int instead of a...
Definition: TimePixClusterProjectionSeparatorProcessor.h:178
tpcconddata::TimePixMap * _timePixMap
the actual mode map is a lccd::ConditionsMap the key is a PixelKey, specifically a struct which conta...
Definition: TimePixClusterProjectionSeparatorProcessor.h:196
std::string _relationsColName
Definition: TimePixClusterProjectionSeparatorProcessor.h:167
std::string _outputColName
Definition: TimePixClusterProjectionSeparatorProcessor.h:165
int _nRow
Definition: TimePixClusterProjectionSeparatorProcessor.h:170
bool isFirstCollection
is true till the first output collection is writen to an event used to store parameters only in the f...
Definition: TimePixClusterProjectionSeparatorProcessor.h:184
bool _keep_hs_sep
Definition: TimePixClusterProjectionSeparatorProcessor.h:173
double b
Definition: TimePixClusterProjectionSeparatorProcessor.h:189
int _nColumn
Definition: TimePixClusterProjectionSeparatorProcessor.h:169
int _clusterSizeToSep
Definition: TimePixClusterProjectionSeparatorProcessor.h:171
std::string _inputColName
Definition: TimePixClusterProjectionSeparatorProcessor.h:164
double a
Definition: TimePixClusterProjectionSeparatorProcessor.h:188
converts TrackerHits of a TimePix into further separated TrackerHits, by projecting them onto their o...
Definition: TimePixClusterProjectionSeparatorProcessor.h:92
int _minResultingClusterSize
Definition: TimePixClusterProjectionSeparatorProcessor.h:172
int _nRun
Definition: TimePixClusterProjectionSeparatorProcessor.h:186