MarlinTPC  1.2.0
WriteXrayObjectsToROOTTreeProcessor.h
1 #ifndef WriteXrayObjectsToROOTTreeProcessor_h
2 #define WriteXrayObjectsToROOTTreeProcessor_h 1
3 
4 #include "GridPixXrayObject.h"
5 #include "XrayGeometryService.h"
6 
7 //c++
8 #include <string>
9 #include <sstream>
10 #include <map>
11 #include <vector>
12 
13 //marlin
14 #include <marlin/Global.h>
15 #include <marlin/Processor.h>
16 
17 //lcio
18 #include <lcio.h>
19 #include <EVENT/LCCollection.h>
20 #include <IMPL/LCCollectionVec.h>
21 #include <EVENT/LCRelation.h>
22 #include <EVENT/TrackerHit.h>
23 #include <EVENT/TrackerData.h>
24 
25 //gear
26 #include <gear/GEAR.h>
27 #include <gear/TPCModule.h>
28 #include <gear/TPCParameters.h>
29 #include <gear/PadRowLayout2D.h>
30 
31 //root
32 #include "TFile.h"
33 #include "TTree.h"
34 
35 namespace marlintpc {
36 
37 class WriteXrayObjectsToROOTTreeProcessor;
38 
39 class WriteXrayObjectsToROOTTreeProcessor: public marlin::Processor {
40 
41 public:
42 
43  virtual Processor* newProcessor() {return new WriteXrayObjectsToROOTTreeProcessor;}
44 
46 
48 
49  virtual void init();
50 
51  virtual void processRunHeader(lcio::LCRunHeader *run);
52 
53  virtual void processEvent(lcio::LCEvent *evt);
54 
55  virtual void end();
56 
57 protected:
58 
59  void writeHitToMap(std::map<int,double> *map, lcio::TrackerHit *hit);
60 
61  void writeHitToVectors(std::vector<int> *xVec, std::vector<int> *yVec, std::vector<double> *valVec, lcio::TrackerHit *hit);
62 
63  std::string _inputXrayObjectCollectionName;
64 
65  std::string _rootFileName;
66  std::string _rootFileDescription;
67 
68  TFile* _rootFile;
69 
70  std::string _rootTreeDescription;
71 
72  TTree* _rootTree;
73 
74  XrayGeometryService* _geometryService;
75 
76  int _eventCounter;
77  int _runCounter;
78 
79  //branches for the tree
80  int* _runNumber;
81  int* _runType;
82  int* _eventNumber;
83  ULong64_t* _timestamp;
84 
85  int* _numberOfPixels;
86  int* _totalCharge;
87 
88  double* _energyFromCharge;
89  double* _energyFromPixels;
90 
91  double* _positionX;
92  double* _positionY;
93 
94  double* _rotationAngle;
95 
96  double* _rmsTransverse;
97  double* _rmsLongitudinal;
98 
99  double* _excentricity;
100 
101  double* _radius;
102 
103  double* _width;
104  double* _length;
105 
106  double* _skewnessTransverse;
107  double* _skewnessLongitudinal;
108 
109  double* _kurtosisTransverse;
110  double* _kurtosisLongitudinal;
111 
112  double* _likelihoodMarlin;
113 
114  double* _fractionWithinRmsTransverse;
115 
116  std::map<int,double>* _pixelMap;
117  std::vector<int>* _xVector;
118  std::vector<int>* _yVector;
119  std::vector<double>* _valueVector;
120 
121  //to be continued
122 
123 
124 };//class WriteXrayObjectsToROOTTreeProcessor
125 
126 }//namespace marlintpc
127 
128 #endif
Definition: XrayGeometryService.h:22
Definition: WriteXrayObjectsToROOTTreeProcessor.h:39