Attachment 'ClusterWriteEngine.hh'
Download 1 #ifndef __KIT_CLUSTERWRITEENGINE_HH__
2 #define __KIT_CLUSTERWRITEENGINE_HH__
3
4 #include "RootWriteEngine.hh"
5 #include "marlin/Processor.h"
6 #include "RootTreeWriter.hh"
7 #include "TMath.h"
8
9 #include <string>
10 #include <EVENT/LCCollection.h>
11 #include <EVENT/Cluster.h>
12 #include <IMPL/LCCollectionVec.h>
13 #include <IMPL/ClusterImpl.h>
14 #include "math.h"
15 #include "ClusterShapes.h"
16
17 #include "TTree.h"
18
19 namespace marlin
20 {
21
22 ///\ingroup calice_engines
23 class KIT_ClusterWriteEngine: public RootWriteEngine
24 {
25 public:
26
27 KIT_ClusterWriteEngine( RootTreeWriter* host ):RootWriteEngine(host),
28 _engineName("KIT_ClusterWriteEngine")
29 {}
30
31
32 virtual const std::string& getEngineName()
33 { return _engineName; }
34
35
36 virtual void registerParameters();
37
38 virtual void registerBranches( TTree* hostTree );
39
40 virtual void fillVariables( EVENT::LCEvent* );
41
42 const static unsigned int MAXCLUSTER = 30; //should be big enough!
43 struct
44 {
45 int iEvt; // event number
46 int nCluster; // # cluster per event
47 int nGamma; // # photons per event
48 float etMiss; // missing transverse energy [GeV]
49 float esumCalos; // energy sum in calorimeters [GeV]
50 int nHitsCalos; // # hits in calorimeters
51 float esumECAL; // energy sum in ECAL [GeV]
52 int nHitsECAL; // # hits in ECAL
53 float esumHCAL; // energy sum in HCAL [GeV]
54 int nHitsHCAL; // # hits in HCAL
55 float energy[MAXCLUSTER]; // energy per cluster [GeV]
56 float clusterPos[MAXCLUSTER][3]; // cluster center of gravity
57 float thetaDir[MAXCLUSTER]; // cluster angle theta [degree]
58 float phiDir[MAXCLUSTER]; // cluster angle phi [degree]
59 float cosThetaPos[MAXCLUSTER]; // cosine of cluster position theta
60 float phiPos[MAXCLUSTER]; // cluster position phi [degree]
61 float dca[MAXCLUSTER]; // distance of closest approach to IP [mm]
62 float clusterAxis[MAXCLUSTER][3]; // cluster axis of inertia
63
64 int nHitsPerCluster[MAXCLUSTER]; // #hits per cluster
65
66 float trueDist[MAXCLUSTER]; // true distance of MCparticle to IP [mm]
67 float trueGammaEnergy[MAXCLUSTER]; // true energy of MCparticle gamma [GeV]
68 float trueGammaDirX[MAXCLUSTER]; // true x direction of MCparticle gamma [GeV]
69 float trueGammaDirY[MAXCLUSTER]; // true y direction of MCparticle gamma [GeV]
70 float trueGammaDirZ[MAXCLUSTER]; // true z direction of MCparticle gamma [GeV]
71 float trueGammaPosX[MAXCLUSTER]; // true x position of MCparticle gamma [GeV]
72 float trueGammaPosY[MAXCLUSTER]; // true y position of MCparticle gamma [GeV]
73 float trueGammaPosZ[MAXCLUSTER]; // true z position of MCparticle gamma [GeV]
74 float trueNeutralinoEnergy[MAXCLUSTER]; // true energy of MCparticle neutralino [GeV]
75 float trueNeutralinoDirX[MAXCLUSTER]; // true x direction of MCparticle neutralino [GeV]
76 float trueNeutralinoDirY[MAXCLUSTER]; // true y direction of MCparticle neutralino [GeV]
77 float trueNeutralinoDirZ[MAXCLUSTER]; // true z direction of MCparticle neutralino [GeV]
78 float trueThetaDir[MAXCLUSTER]; // true gamma angle theta [degree]
79 float truePhiDir[MAXCLUSTER]; // true gamma angle phi [degree]
80 float acolinearity; // ???
81 int trueNcluster; // true # cluster / event
82 } _clusterFill;
83
84
85
86 private:
87 std::string _engineName;
88 std::string _enginePrefix;
89 // processor parameters
90 std::string _prefix;
91 std::string _clusterColName;
92
93 int _ievt;
94 int _nCluster;
95 int _nGamma;
96 float _clusterPos[3];
97 int _nHitsPerCluster;
98 float _energy;
99 float _thetaDir;
100 float _phiDir;
101 float _thetaPos;
102 float _cosThetaPos;
103 float _phiPos;
104 float _dca;
105
106 float _etMiss;
107 float _esum_calos;
108 int _nhits_calos;
109 float _esum_ECAL;
110 int _nhits_ECAL;
111 float _esum_HCAL;
112 int _nhits_HCAL;
113
114 float _trueDist;
115 float _trueGammaEnergy;
116 float _trueGammaDirX;
117 float _trueGammaDirY;
118 float _trueGammaDirZ;
119 float _trueGammaPosX;
120 float _trueGammaPosY;
121 float _trueGammaPosZ;
122 float _trueNeutralinoEnergy;
123 float _trueNeutralinoDirX;
124 float _trueNeutralinoDirY;
125 float _trueNeutralinoDirZ;
126 float _trueThetaDir;
127 float _truePhiDir;
128 int _trueNcluster;
129 };
130
131 }//namespace marlin
132
133 #endif // __CLUSTERWRITEENGINE_HH__
134
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.