MarlinTPC  1.2.0
HitAndTrackCounterProcessor.h
1 #ifndef HIT_TRACK_COUNTER_PROCESSOR_H
2 #define HIT_TRACK_COUNTER_PROCESSOR_H 1
3 
4 #define N_1D_HISTOS_HIT_TRACK_COUNTER_PROCESSOR 2
5 #define N_2D_HISTOS_HIT_TRACK_COUNTER_PROCESSOR 0
6 
7 //LCIO
8 #include "marlin/Processor.h"
9 #include <vector>
10 
11 #include <EVENT/TrackerHit.h>
12 #include <lcio.h>
13 
14 #include "ZBinTemplateProcessor.h"
15 
16 
17 namespace marlintpc
18 {
19 
46  class HitAndTrackCounterProcessor : public ZBinTemplateProcessor<N_1D_HISTOS_HIT_TRACK_COUNTER_PROCESSOR,
47  N_2D_HISTOS_HIT_TRACK_COUNTER_PROCESSOR>{
48 
49  public:
50 
51  virtual Processor* newProcessor() { return new HitAndTrackCounterProcessor ; }
52 
54 
55  virtual ~HitAndTrackCounterProcessor();
56 
57  virtual void init();
58 
59  virtual void processRunHeader(lcio::LCRunHeader* run ) ;
60 
61  virtual void processEvent(lcio::LCEvent * evt ) ;
62 
63  /* Sort function to sort the Hits along the track
64  */
65  static bool compareHit(const std::pair<TrackerHit*, double> & pair1,
66  const std::pair<TrackerHit*, double> & pair2)
67  {
68  return pair1.second < pair2.second;
69  }
70 
71  protected:
72 
73  std::string _tracksColName ;
74  std::string _hitsColName ;
75 
76  const std::string _hitsPerTrackHistosName;
77  const std::string _hitsPerEventHistosName;
78  const std::string _tracksPerEventHistosName;
79  const std::string _hitsPerTrackLengthHistosName;
80 
84  static const unsigned int _hitsPerTrackHistosIndex;
85  static const unsigned int _hitsPerTrackLengthHistosIndex;
86 // /// The index of the template parameter for the hitsPerEvent histos
87 // static const unsigned int _hitsPerEventHistosIndex;
88 // /// The index of the template parameter for the tracksPerEvent histos
89 // static const unsigned int _stracksPerEventHistosIndex;
90 
94  AIDA::IHistogram1D * _hitsPerEventHisto;
95  AIDA::IHistogram1D * _tracksPerEventHisto;
96 
101  };
102 }
103 
104 #endif // HIT_TRACK_COUNTER_PROCESSOR_H
Count hits in events and tracks, and tracks per event.
Definition: HitAndTrackCounterProcessor.h:46
std::string _hitsColName
the name of the input hits collection
Definition: HitAndTrackCounterProcessor.h:74
std::string _tracksColName
the name of the input tracks collection
Definition: HitAndTrackCounterProcessor.h:73
A template to create processors wich create 1D or 2D distribution histograms, one histogram per z bin...
Definition: ZBinTemplateProcessor.h:76
double _maxHitsPerTrackLength
Maximum value in TracksPerEvent histogram.
Definition: HitAndTrackCounterProcessor.h:100
double _maxHitsPerTrack
Maximum value in HitsPerTrack histogram.
Definition: HitAndTrackCounterProcessor.h:97
double _maxHitsPerEvent
Maximum value in HitsPerEvent histogram.
Definition: HitAndTrackCounterProcessor.h:98
AIDA::IHistogram1D * _tracksPerEventHisto
number of tracks per event
Definition: HitAndTrackCounterProcessor.h:95
virtual void init()
Register the AIDA histograms at the AIDAProcessor.
Definition: HitAndTrackCounterProcessor.cc:90
virtual Processor * newProcessor()
The newProcessor() function does not make sense for this template class, so it throws an lcio::Except...
Definition: HitAndTrackCounterProcessor.h:51
AIDA::IHistogram1D * _hitsPerEventHisto
For the following histograms a z binning does not make sense.
Definition: HitAndTrackCounterProcessor.h:94
static const unsigned int _hitsPerTrackHistosIndex
The index of the template parameter for the hitsPerTrack histos We want to have these values divided ...
Definition: HitAndTrackCounterProcessor.h:84
double _maxTracksPerEvent
Maximum value in TracksPerEvent histogram.
Definition: HitAndTrackCounterProcessor.h:99