MarlinTPC  1.2.0
TrackerRawViewer.h
1 #ifndef TrackerRawViewer_h
2 #define TrackerRawViewer_h 1
3 
4 #include "marlin/Processor.h"
5 #include "lcio.h"
6 #include <string>
7 #include <vector>
8 #include <map>
9 
10 // --- fix for lccd/ConditionsMap.hh tp print key made from pair
11 std::ostream& operator<<(std::ostream& os , const std::pair<int, int>& p)
12 {
13  os << "[" << p.first << "," << p.second << "]" ;
14  return os ;
15 }
16 
17 #include "ADCChannelMapping.h"
18 #include "lccd/ConditionsMap.hh"
19 
20 // -- Gear
21 #include "gear/GEAR.h"
22 #include "gear/TPCParameters.h"
23 
24 
25 //---- LCCD ----
26 typedef lccd::ConditionsMap< tpcconddata::ADCChannelMapping::key_type , tpcconddata::ADCChannelMapping > ChannelMap ;
27 
28 namespace marlintpc
29 {
30 
31  class ChannelPosMap ;
32 
58  class TrackerRawViewer : public marlin::Processor
59  {
60 
62  struct PadMeanADC
63  {
64 
65  PadMeanADC() : Total(0.), N(0) {}
66 
67  float Total ;
68  int N ;
69 
70  void operator+=(float adc)
71  {
72  Total += adc ;
73  // ++N ;
74  }
75  };
76 
77  typedef std::map< std::pair<int, int>, PadMeanADC > ADCMap ;
78 
79  public:
80 
81  virtual Processor* newProcessor()
82  {
83  return new TrackerRawViewer ;
84  }
85 
86 
88 
92  virtual void init() ;
93 
96  virtual void processRunHeader(lcio::LCRunHeader* run) ;
97 
100  virtual void processEvent(lcio::LCEvent * evt) ;
101 
102 
103  virtual void check(lcio::LCEvent * evt) ;
104 
105 
108  virtual void end() ;
109 
110 
111  protected:
112 
114  bool getPadCenter(double *padCenter, int cellID0, int cellID1) ;
115 
116  static const int ncol = 20 ;
117  static const int nscheme = 10 ;
118 
119  static const int Red = 0 ;
120  static const int Orange = 1 ;
121  static const int Plum = 2 ;
122  static const int Violet = 3 ;
123  static const int Blue = 4 ;
124  static const int LightBlue = 5 ;
125  static const int Aquamarine = 6 ;
126  static const int Green = 7 ;
127  static const int Olive = 8 ;
128  static const int Yellow = 9 ;
129 
130  static const int Dark = 10 ;
131  static const int Light = 11 ;
132  static const int Classic = 12 ;
135  std::string _colName ;
136  std::string _hitColName ;
137  std::string _trkColName ;
138  std::string _chMapCollection ;
139  std::string _chPosTextFile ;
140 
141  const gear::TPCParameters* _tpcParams ;
142  ChannelPosMap* _posMap ;
143  ChannelMap* _chMap ;
144 
145  float _driftVelocity ;
146  int _colorScaleMaxADC ;
147  int _colorScheme ;
148  bool _waitForKeyboard ;
149 
150  std::vector<int> _colors ;
151 
152  int _nRun ;
153  int _nEvt ;
154 
155  ADCMap _adcMap ;
156  ADCMap _adcMapInt ;
157  } ;
158 }
159 #endif
160 
161 
162 
virtual void processRunHeader(lcio::LCRunHeader *run)
Called for every run.
Simple event display that visualizes TrackerRawData for the LCTPC large prototype with CED...
Definition: TrackerRawViewer.h:58
bool getPadCenter(double *padCenter, int cellID0, int cellID1)
Computes the pad center for given hardware ID in padCenter - returns false if nothing found...
virtual void init()
Called at the begin of the job before anything is read.
std::string _colName
Input collection name.
Definition: TrackerRawViewer.h:135
virtual void processEvent(lcio::LCEvent *evt)
Called for every event - the working horse.
Helper class that creates (is) a simple map of hardware channel to position of the pad center (x...
Definition: ChannelPosMap.h:14
virtual void end()
Called after data processing for clean up.