7 |
|
#include <cmath> |
8 |
|
#include "assert.h" |
9 |
|
|
10 |
< |
class ZeeEventTree { |
11 |
< |
|
12 |
< |
public: |
13 |
< |
|
14 |
< |
/// variables |
15 |
< |
Float_t fWeight; |
16 |
< |
UInt_t fRunNumber; |
17 |
< |
UInt_t fLumiSectionNumber; |
18 |
< |
UInt_t fEventNumber; |
19 |
< |
Float_t fRho; |
20 |
< |
UInt_t fNVertices; |
21 |
< |
|
22 |
< |
Float_t fMass; |
23 |
< |
|
24 |
< |
Float_t fEle1Pt; |
25 |
< |
Float_t fEle1Eta; |
26 |
< |
Float_t fEle1Phi; |
27 |
< |
Float_t fEle1SCEt; |
28 |
< |
Float_t fEle1SCEta; |
29 |
< |
Float_t fEle1SCPhi; |
30 |
< |
Float_t fEle1HZZICHEP2012IDMVA; |
31 |
< |
Float_t fEle1PFIso04; |
32 |
< |
Float_t fEle1R9; |
33 |
< |
Bool_t fEle1PassLooseSimpleCuts; |
34 |
< |
Bool_t fEle1PassTightSimpleCuts; |
35 |
< |
Bool_t fEle1PassHZZICHEP2012; |
36 |
< |
|
37 |
< |
Float_t fEle2Pt; |
38 |
< |
Float_t fEle2Eta; |
39 |
< |
Float_t fEle2Phi; |
40 |
< |
Float_t fEle2SCEt; |
41 |
< |
Float_t fEle2SCEta; |
42 |
< |
Float_t fEle2SCPhi; |
43 |
< |
Float_t fEle2HZZICHEP2012IDMVA; |
44 |
< |
Float_t fEle2PFIso04; |
45 |
< |
Float_t fEle2R9; |
46 |
< |
Bool_t fEle2PassLooseSimpleCuts; |
47 |
< |
Bool_t fEle2PassTightSimpleCuts; |
48 |
< |
Bool_t fEle2PassHZZICHEP2012; |
49 |
< |
|
50 |
< |
public: |
51 |
< |
/// this is the main element |
52 |
< |
TTree *tree_; |
53 |
< |
TFile *f_; |
10 |
> |
namespace citana |
11 |
> |
{ |
12 |
> |
class ZeeEventTree { |
13 |
> |
|
14 |
> |
public: |
15 |
> |
|
16 |
> |
enum ZeeEventTreeType { kCITZeeEvent = 0, |
17 |
> |
kHggFutyanZeeDataEvent, |
18 |
> |
kHggFutyanZeeMCEvent, |
19 |
> |
}; |
20 |
> |
|
21 |
> |
enum DiElecTrigBits { kEle17SC8Trigger = 1UL<<0, |
22 |
> |
kEle20SC4Trigger = 1UL<<1, |
23 |
> |
kEle32SC17Trigger = 1UL<<2, |
24 |
> |
kEle17Ele8Loose = 1UL<<3, |
25 |
> |
kEle17Ele8Tight = 1UL<<4, |
26 |
> |
kSingleEleTight = 1UL<<5 |
27 |
> |
}; |
28 |
> |
|
29 |
> |
/// variables |
30 |
> |
UInt_t fTreeType; |
31 |
> |
Float_t fWeight; |
32 |
> |
UInt_t fRunNumber; |
33 |
> |
UInt_t fLumiSectionNumber; |
34 |
> |
UInt_t fEventNumber; |
35 |
> |
UInt_t fNPU; |
36 |
> |
Float_t fRho; |
37 |
> |
UInt_t fNVertices; |
38 |
> |
UInt_t fEventTriggerBits; |
39 |
> |
|
40 |
> |
Float_t fMass; |
41 |
> |
Float_t fMassRegression; |
42 |
> |
|
43 |
> |
|
44 |
> |
Float_t fEle1Pt; |
45 |
> |
Float_t fEle1Eta; |
46 |
> |
Float_t fEle1Phi; |
47 |
> |
Float_t fEle1SCEt; |
48 |
> |
Float_t fEle1SCEta; |
49 |
> |
Float_t fEle1SCPhi; |
50 |
> |
Float_t fEle1GenPt; |
51 |
> |
Float_t fEle1EnergyCorrAndSmeared; |
52 |
> |
Float_t fEle1Energy; |
53 |
> |
Float_t fEle1EnergyRegression; |
54 |
> |
Float_t fEle1EnergyRegressionWithTrkVarTwoPtBins; |
55 |
> |
Float_t fEle1EnergyRegressionWithTrkVar; |
56 |
> |
Float_t fEle1EnergyRegressionNoTrkVarTwoPtBins; |
57 |
> |
Float_t fEle1EnergyRegressionNoTrkVar; |
58 |
> |
Int_t fEle1Charge; |
59 |
> |
Float_t fEle1HZZICHEP2012IDMVA; |
60 |
> |
Float_t fEle1PFIso04; |
61 |
> |
Float_t fEle1R9; |
62 |
> |
Bool_t fEle1PassLooseSimpleCuts; |
63 |
> |
Bool_t fEle1PassMediumSimpleCuts; |
64 |
> |
Bool_t fEle1PassTightSimpleCuts; |
65 |
> |
Bool_t fEle1PassHZZICHEP2012; |
66 |
> |
|
67 |
> |
|
68 |
> |
Float_t fEle2Pt; |
69 |
> |
Float_t fEle2Eta; |
70 |
> |
Float_t fEle2Phi; |
71 |
> |
Float_t fEle2SCEt; |
72 |
> |
Float_t fEle2SCEta; |
73 |
> |
Float_t fEle2SCPhi; |
74 |
> |
Float_t fEle2GenPt; |
75 |
> |
Float_t fEle2EnergyCorrAndSmeared; |
76 |
> |
Float_t fEle2Energy; |
77 |
> |
Float_t fEle2EnergyRegression; |
78 |
> |
Float_t fEle2EnergyRegressionWithTrkVarTwoPtBins; |
79 |
> |
Float_t fEle2EnergyRegressionWithTrkVar; |
80 |
> |
Float_t fEle2EnergyRegressionNoTrkVarTwoPtBins; |
81 |
> |
Float_t fEle2EnergyRegressionNoTrkVar; |
82 |
> |
Int_t fEle2Charge; |
83 |
> |
Float_t fEle2HZZICHEP2012IDMVA; |
84 |
> |
Float_t fEle2PFIso04; |
85 |
> |
Float_t fEle2R9; |
86 |
> |
Bool_t fEle2PassLooseSimpleCuts; |
87 |
> |
Bool_t fEle2PassMediumSimpleCuts; |
88 |
> |
Bool_t fEle2PassTightSimpleCuts; |
89 |
> |
Bool_t fEle2PassHZZICHEP2012; |
90 |
> |
|
91 |
> |
|
92 |
> |
Int_t fRunNumber_int; |
93 |
> |
Int_t fLumiSectionNumber_int; |
94 |
> |
Int_t fEventNumber_int; |
95 |
> |
Int_t fNVertices_int; |
96 |
> |
Double_t dEle1Pt; |
97 |
> |
Double_t dEle1Eta; |
98 |
> |
Double_t dEle1Phi; |
99 |
> |
Double_t dEle1EnergyCorrAndSmeared; |
100 |
> |
Double_t dEle2Pt; |
101 |
> |
Double_t dEle2Eta; |
102 |
> |
Double_t dEle2Phi; |
103 |
> |
Double_t dEle2EnergyCorrAndSmeared; |
104 |
> |
|
105 |
> |
|
106 |
> |
|
107 |
> |
public: |
108 |
> |
/// this is the main element |
109 |
> |
TTree *tree_; |
110 |
> |
TFile *f_; |
111 |
|
|
112 |
< |
/// hold the names of variables to facilitate things (filled during Init) |
113 |
< |
std::vector<std::string> variables_; |
114 |
< |
|
115 |
< |
/// default constructor |
116 |
< |
ZeeEventTree() {}; |
117 |
< |
/// default destructor |
118 |
< |
~ZeeEventTree(){ |
119 |
< |
if (f_) f_->Close(); |
120 |
< |
}; |
112 |
> |
/// hold the names of variables to facilitate things (filled during Init) |
113 |
> |
std::vector<std::string> variables_; |
114 |
> |
|
115 |
> |
/// default constructor |
116 |
> |
ZeeEventTree() { |
117 |
> |
fTreeType = kCITZeeEvent; |
118 |
> |
}; |
119 |
> |
/// default destructor |
120 |
> |
~ZeeEventTree(){ |
121 |
> |
if (f_) f_->Close(); |
122 |
> |
}; |
123 |
|
|
124 |
< |
/// initialize varibles and fill list of available variables |
125 |
< |
void InitVariables() { |
126 |
< |
fWeight = 0.0; |
127 |
< |
fRunNumber = 0.0; |
128 |
< |
fLumiSectionNumber = 0.0; |
129 |
< |
fEventNumber = 0.0; |
130 |
< |
fRho = 0.0; |
131 |
< |
fNVertices = 0.0; |
132 |
< |
fMass = 0.0; |
133 |
< |
fEle1Pt = 0.0; |
134 |
< |
fEle1Eta = 0.0; |
135 |
< |
fEle1Phi = 0.0; |
136 |
< |
fEle1SCEt = 0.0; |
137 |
< |
fEle1SCEta = 0.0; |
138 |
< |
fEle1SCPhi = 0.0; |
139 |
< |
fEle1HZZICHEP2012IDMVA = 0.0; |
140 |
< |
fEle1PFIso04 = 0.0; |
141 |
< |
fEle1R9 = 0.0; |
142 |
< |
fEle1PassLooseSimpleCuts = kFALSE; |
143 |
< |
fEle1PassTightSimpleCuts = kFALSE; |
144 |
< |
fEle1PassHZZICHEP2012 = kFALSE; |
145 |
< |
fEle2Pt = 0.0; |
146 |
< |
fEle2Eta = 0.0; |
147 |
< |
fEle2Phi = 0.0; |
148 |
< |
fEle2SCEt = 0.0; |
149 |
< |
fEle2SCEta = 0.0; |
150 |
< |
fEle2SCPhi = 0.0; |
151 |
< |
fEle2HZZICHEP2012IDMVA = 0.0; |
152 |
< |
fEle2PFIso04 = 0.0; |
153 |
< |
fEle2R9 = 0.0; |
154 |
< |
fEle2PassLooseSimpleCuts = kFALSE; |
155 |
< |
fEle2PassTightSimpleCuts = kFALSE; |
156 |
< |
fEle2PassHZZICHEP2012 = kFALSE; |
157 |
< |
} |
124 |
> |
/// initialize varibles and fill list of available variables |
125 |
> |
void InitVariables() { |
126 |
> |
fWeight = 0.0; |
127 |
> |
fRunNumber = 0.0; |
128 |
> |
fLumiSectionNumber = 0.0; |
129 |
> |
fEventNumber = 0.0; |
130 |
> |
fNPU = 0.0; |
131 |
> |
fRho = 0.0; |
132 |
> |
fNVertices = 0.0; |
133 |
> |
fEventTriggerBits = 0; |
134 |
> |
fMass = 0.0; |
135 |
> |
fEle1Pt = 0.0; |
136 |
> |
fEle1Eta = 0.0; |
137 |
> |
fEle1Phi = 0.0; |
138 |
> |
fEle1SCEt = 0.0; |
139 |
> |
fEle1SCEta = 0.0; |
140 |
> |
fEle1SCPhi = 0.0; |
141 |
> |
fEle1GenPt = 0.0; |
142 |
> |
fEle1EnergyCorrAndSmeared = 0.0; |
143 |
> |
fEle1Energy = 0.0; |
144 |
> |
fEle1EnergyRegression = 0.0; |
145 |
> |
fEle1EnergyRegressionWithTrkVarTwoPtBins = 0.0; |
146 |
> |
fEle1EnergyRegressionWithTrkVar = 0.0; |
147 |
> |
fEle1EnergyRegressionNoTrkVarTwoPtBins = 0.0; |
148 |
> |
fEle1EnergyRegressionNoTrkVar = 0.0; |
149 |
> |
fEle1Charge = 0; |
150 |
> |
fEle1HZZICHEP2012IDMVA = 0.0; |
151 |
> |
fEle1PFIso04 = 0.0; |
152 |
> |
fEle1R9 = 0.0; |
153 |
> |
fEle1PassLooseSimpleCuts = kFALSE; |
154 |
> |
fEle1PassMediumSimpleCuts = kFALSE; |
155 |
> |
fEle1PassTightSimpleCuts = kFALSE; |
156 |
> |
fEle1PassHZZICHEP2012 = kFALSE; |
157 |
> |
fEle2Pt = 0.0; |
158 |
> |
fEle2Eta = 0.0; |
159 |
> |
fEle2Phi = 0.0; |
160 |
> |
fEle2SCEt = 0.0; |
161 |
> |
fEle2SCEta = 0.0; |
162 |
> |
fEle2SCPhi = 0.0; |
163 |
> |
fEle2GenPt = 0.0; |
164 |
> |
fEle2EnergyCorrAndSmeared = 0.0; |
165 |
> |
fEle2Energy = 0.0; |
166 |
> |
fEle2EnergyRegression = 0.0; |
167 |
> |
fEle2EnergyRegressionWithTrkVarTwoPtBins = 0.0; |
168 |
> |
fEle2EnergyRegressionWithTrkVar = 0.0; |
169 |
> |
fEle2EnergyRegressionNoTrkVarTwoPtBins = 0.0; |
170 |
> |
fEle2EnergyRegressionNoTrkVar = 0.0; |
171 |
> |
fEle2Charge = 0; |
172 |
> |
fEle2HZZICHEP2012IDMVA = 0.0; |
173 |
> |
fEle2PFIso04 = 0.0; |
174 |
> |
fEle2R9 = 0.0; |
175 |
> |
fEle2PassLooseSimpleCuts = kFALSE; |
176 |
> |
fEle2PassMediumSimpleCuts = kFALSE; |
177 |
> |
fEle2PassTightSimpleCuts = kFALSE; |
178 |
> |
fEle2PassHZZICHEP2012 = kFALSE; |
179 |
> |
|
180 |
> |
fRunNumber_int = 0; |
181 |
> |
fLumiSectionNumber_int = 0; |
182 |
> |
fEventNumber_int = 0; |
183 |
> |
fNVertices_int = 0; |
184 |
> |
dEle1Pt = 0; |
185 |
> |
dEle1Eta = 0; |
186 |
> |
dEle1Phi = 0; |
187 |
> |
dEle1EnergyCorrAndSmeared = 0; |
188 |
> |
dEle2Pt = 0; |
189 |
> |
dEle2Eta = 0; |
190 |
> |
dEle2Phi = 0; |
191 |
> |
dEle2EnergyCorrAndSmeared = 0; |
192 |
> |
|
193 |
> |
} |
194 |
|
|
195 |
< |
/// load a ZeeEventTree |
196 |
< |
void LoadTree(const char* file){ |
197 |
< |
f_ = TFile::Open(file); |
198 |
< |
assert(f_); |
199 |
< |
tree_ = dynamic_cast<TTree*>(f_->Get("Electrons")); |
200 |
< |
assert(tree_); |
201 |
< |
} |
195 |
> |
/// load a ZeeEventTree |
196 |
> |
void LoadTree(const char* file, UInt_t Type = kCITZeeEvent){ |
197 |
> |
fTreeType = Type; |
198 |
> |
f_ = TFile::Open(file); |
199 |
> |
assert(f_); |
200 |
> |
if (Type == kCITZeeEvent) { |
201 |
> |
tree_ = dynamic_cast<TTree*>(f_->Get("ZeeEvent")); |
202 |
> |
} else if (Type == kHggFutyanZeeDataEvent) { |
203 |
> |
tree_ = dynamic_cast<TTree*>(f_->Get("Data")); |
204 |
> |
} else if (Type == kHggFutyanZeeMCEvent) { |
205 |
> |
tree_ = dynamic_cast<TTree*>(f_->Get("DYJetsToLL")); |
206 |
> |
} else { |
207 |
> |
cout << "Warning: Type " << Type << " is not supported \n"; |
208 |
> |
} |
209 |
> |
InitTree(Type); |
210 |
> |
assert(tree_); |
211 |
> |
} |
212 |
|
|
213 |
< |
/// create a ZeeEventTree |
214 |
< |
void CreateTree(){ |
215 |
< |
tree_ = new TTree("Electrons","Electrons"); |
216 |
< |
f_ = 0; |
217 |
< |
|
218 |
< |
//book the branches |
219 |
< |
tree_->Branch("weight",&fWeight,"weight/F"); |
220 |
< |
tree_->Branch("run",&fRunNumber,"run/i"); |
221 |
< |
tree_->Branch("lumi",&fLumiSectionNumber,"lumi/i"); |
222 |
< |
tree_->Branch("event",&fEventNumber,"event/i"); |
223 |
< |
tree_->Branch("rho",&fRho,"rho/F"); |
224 |
< |
tree_->Branch("vertices",&fNVertices,"vertices/i"); |
225 |
< |
tree_->Branch("mass",&fMass,"mass/F"); |
226 |
< |
|
227 |
< |
tree_->Branch("Ele1Pt",&fEle1Pt,"Ele1Pt/F"); |
228 |
< |
tree_->Branch("Ele1Eta",&fEle1Eta,"Ele1Eta/F"); |
229 |
< |
tree_->Branch("Ele1Phi",&fEle1Phi,"Ele1Phi/F"); |
230 |
< |
tree_->Branch("Ele1SCEt",&fEle1SCEt,"Ele1SCEt/F"); |
231 |
< |
tree_->Branch("Ele1SCEta",&fEle1SCEta,"Ele1SCEta/F"); |
232 |
< |
tree_->Branch("Ele1SCPhi",&fEle1SCPhi,"Ele1SCPhi/F"); |
233 |
< |
tree_->Branch("Ele1HZZICHEP2012IDMVA",&fEle1HZZICHEP2012IDMVA,"Ele1HZZICHEP2012IDMVA/F"); |
234 |
< |
tree_->Branch("Ele1PFIso04",&fEle1PFIso04,"Ele1PFIso04/F"); |
235 |
< |
tree_->Branch("Ele1R9",&fEle1R9,"Ele1R9/F"); |
236 |
< |
tree_->Branch("Ele1PassLooseSimpleCuts",&fEle1PassLooseSimpleCuts,"Ele1PassLooseSimpleCuts/F"); |
237 |
< |
tree_->Branch("Ele1PassTightSimpleCuts",&fEle1PassTightSimpleCuts,"Ele1PassTightSimpleCuts/F"); |
238 |
< |
tree_->Branch("Ele1PassHZZICHEP2012",&fEle1PassHZZICHEP2012,"Ele1PassHZZICHEP2012/F"); |
239 |
< |
tree_->Branch("Ele2Pt",&fEle2Pt,"Ele2Pt/F"); |
240 |
< |
tree_->Branch("Ele2Eta",&fEle2Eta,"Ele2Eta/F"); |
241 |
< |
tree_->Branch("Ele2Phi",&fEle2Phi,"Ele2Phi/F"); |
242 |
< |
tree_->Branch("Ele2SCEt",&fEle2SCEt,"Ele2SCEt/F"); |
243 |
< |
tree_->Branch("Ele2SCEta",&fEle2SCEta,"Ele2SCEta/F"); |
244 |
< |
tree_->Branch("Ele2SCPhi",&fEle2SCPhi,"Ele2SCPhi/F"); |
245 |
< |
tree_->Branch("Ele2HZZICHEP2012IDMVA",&fEle2HZZICHEP2012IDMVA,"Ele2HZZICHEP2012IDMVA/F"); |
246 |
< |
tree_->Branch("Ele2PFIso04",&fEle2PFIso04,"Ele2PFIso04/F"); |
247 |
< |
tree_->Branch("Ele2R9",&fEle2R9,"Ele2R9/F"); |
248 |
< |
tree_->Branch("Ele2PassLooseSimpleCuts",&fEle2PassLooseSimpleCuts,"Ele2PassLooseSimpleCuts/F"); |
249 |
< |
tree_->Branch("Ele2PassTightSimpleCuts",&fEle2PassTightSimpleCuts,"Ele2PassTightSimpleCuts/F"); |
250 |
< |
tree_->Branch("Ele2PassHZZICHEP2012",&fEle2PassHZZICHEP2012,"Ele2PassHZZICHEP2012/F"); |
251 |
< |
|
252 |
< |
} |
253 |
< |
|
254 |
< |
// initialze a ZeeEventTree |
255 |
< |
void InitTree(){ |
256 |
< |
assert(tree_); |
257 |
< |
// don't forget to set pointers to zero before you set address |
258 |
< |
// or you will fully appreciate that "ROOT sucks" :) |
259 |
< |
InitVariables(); |
260 |
< |
//Set branch address |
261 |
< |
Int_t currentState = gErrorIgnoreLevel; |
262 |
< |
tree_->SetBranchAddress("weight",&fWeight); |
263 |
< |
tree_->SetBranchAddress("run",&fRunNumber); |
264 |
< |
tree_->SetBranchAddress("lumi",&fLumiSectionNumber); |
265 |
< |
tree_->SetBranchAddress("event",&fEventNumber); |
266 |
< |
tree_->SetBranchAddress("rho",&fRho); |
267 |
< |
tree_->SetBranchAddress("vertices",&fNVertices); |
268 |
< |
tree_->SetBranchAddress("mass",&fMass); |
269 |
< |
|
270 |
< |
tree_->SetBranchAddress("Ele1Pt",&fEle1Pt); |
271 |
< |
tree_->SetBranchAddress("Ele1Eta",&fEle1Eta); |
272 |
< |
tree_->SetBranchAddress("Ele1Phi",&fEle1Phi); |
273 |
< |
tree_->SetBranchAddress("Ele1SCEt",&fEle1SCEt); |
274 |
< |
tree_->SetBranchAddress("Ele1SCEta",&fEle1SCEta); |
275 |
< |
tree_->SetBranchAddress("Ele1SCPhi",&fEle1SCPhi); |
276 |
< |
tree_->SetBranchAddress("Ele1HZZICHEP2012IDMVA",&fEle1HZZICHEP2012IDMVA); |
277 |
< |
tree_->SetBranchAddress("Ele1PFIso04",&fEle1PFIso04); |
278 |
< |
tree_->SetBranchAddress("Ele1R9",&fEle1R9); |
279 |
< |
tree_->SetBranchAddress("Ele1PassLooseSimpleCuts",&fEle1PassLooseSimpleCuts); |
280 |
< |
tree_->SetBranchAddress("Ele1PassTightSimpleCuts",&fEle1PassTightSimpleCuts); |
281 |
< |
tree_->SetBranchAddress("Ele1PassHZZICHEP2012",&fEle1PassHZZICHEP2012); |
282 |
< |
tree_->SetBranchAddress("Ele2Pt",&fEle2Pt); |
283 |
< |
tree_->SetBranchAddress("Ele2Eta",&fEle2Eta); |
284 |
< |
tree_->SetBranchAddress("Ele2Phi",&fEle2Phi); |
285 |
< |
tree_->SetBranchAddress("Ele2SCEt",&fEle2SCEt); |
286 |
< |
tree_->SetBranchAddress("Ele2SCEta",&fEle2SCEta); |
287 |
< |
tree_->SetBranchAddress("Ele2SCPhi",&fEle2SCPhi); |
288 |
< |
tree_->SetBranchAddress("Ele2HZZICHEP2012IDMVA",&fEle2HZZICHEP2012IDMVA); |
289 |
< |
tree_->SetBranchAddress("Ele2PFIso04",&fEle2PFIso04); |
290 |
< |
tree_->SetBranchAddress("Ele2R9",&fEle2R9); |
291 |
< |
tree_->SetBranchAddress("Ele2PassLooseSimpleCuts",&fEle2PassLooseSimpleCuts); |
292 |
< |
tree_->SetBranchAddress("Ele2PassTightSimpleCuts",&fEle2PassTightSimpleCuts); |
293 |
< |
tree_->SetBranchAddress("Ele2PassHZZICHEP2012",&fEle2PassHZZICHEP2012); |
294 |
< |
|
295 |
< |
gErrorIgnoreLevel = currentState; |
296 |
< |
} |
213 |
> |
/// create a ZeeEventTree |
214 |
> |
void CreateTree(){ |
215 |
> |
tree_ = new TTree("ZeeEvent","ZeeEvent"); |
216 |
> |
f_ = 0; |
217 |
> |
|
218 |
> |
//book the branches |
219 |
> |
tree_->Branch("weight",&fWeight,"weight/F"); |
220 |
> |
tree_->Branch("run",&fRunNumber,"run/i"); |
221 |
> |
tree_->Branch("lumi",&fLumiSectionNumber,"lumi/i"); |
222 |
> |
tree_->Branch("event",&fEventNumber,"event/i"); |
223 |
> |
tree_->Branch("npu",&fNPU,"npu/i"); |
224 |
> |
tree_->Branch("rho",&fRho,"rho/F"); |
225 |
> |
tree_->Branch("vertices",&fNVertices,"vertices/i"); |
226 |
> |
tree_->Branch("triggerbits",&fEventTriggerBits,"triggerbits/i"); |
227 |
> |
tree_->Branch("mass",&fMass,"mass/F"); |
228 |
> |
|
229 |
> |
tree_->Branch("Ele1Pt",&fEle1Pt,"Ele1Pt/F"); |
230 |
> |
tree_->Branch("Ele1Eta",&fEle1Eta,"Ele1Eta/F"); |
231 |
> |
tree_->Branch("Ele1Phi",&fEle1Phi,"Ele1Phi/F"); |
232 |
> |
tree_->Branch("Ele1SCEt",&fEle1SCEt,"Ele1SCEt/F"); |
233 |
> |
tree_->Branch("Ele1SCEta",&fEle1SCEta,"Ele1SCEta/F"); |
234 |
> |
tree_->Branch("Ele1SCPhi",&fEle1SCPhi,"Ele1SCPhi/F"); |
235 |
> |
tree_->Branch("Ele1GenPt",&fEle1GenPt,"Ele1GenPt/F"); |
236 |
> |
tree_->Branch("Ele1EnergyCorrAndSmeared",&fEle1EnergyCorrAndSmeared,"Ele1EnergyCorrAndSmeared/F"); |
237 |
> |
tree_->Branch("Ele1Energy",&fEle1Energy,"Ele1Energy/F"); |
238 |
> |
tree_->Branch("Ele1EnergyRegression",&fEle1EnergyRegression,"Ele1EnergyRegression/F"); |
239 |
> |
tree_->Branch("Ele1EnergyRegressionWithTrkVarTwoPtBins",&fEle1EnergyRegressionWithTrkVarTwoPtBins,"Ele1EnergyRegressionWithTrkVarTwoPtBins/F"); |
240 |
> |
tree_->Branch("Ele1EnergyRegressionWithTrkVar",&fEle1EnergyRegressionWithTrkVar,"Ele1EnergyRegressionWithTrkVar/F"); |
241 |
> |
tree_->Branch("Ele1EnergyRegressionNoTrkVarTwoPtBins",&fEle1EnergyRegressionNoTrkVarTwoPtBins,"Ele1EnergyRegressionNoTrkVarTwoPtBins/F"); |
242 |
> |
tree_->Branch("Ele1EnergyRegressionNoTrkVar",&fEle1EnergyRegressionNoTrkVar,"Ele1EnergyRegressionNoTrkVar/F"); |
243 |
> |
tree_->Branch("Ele1Charge",&fEle1Charge,"Ele1Charge/I"); |
244 |
> |
tree_->Branch("Ele1HZZICHEP2012IDMVA",&fEle1HZZICHEP2012IDMVA,"Ele1HZZICHEP2012IDMVA/F"); |
245 |
> |
tree_->Branch("Ele1PFIso04",&fEle1PFIso04,"Ele1PFIso04/F"); |
246 |
> |
tree_->Branch("Ele1R9",&fEle1R9,"Ele1R9/F"); |
247 |
> |
tree_->Branch("Ele1PassLooseSimpleCuts",&fEle1PassLooseSimpleCuts,"Ele1PassLooseSimpleCuts/O"); |
248 |
> |
tree_->Branch("Ele1PassMediumSimpleCuts",&fEle1PassMediumSimpleCuts,"Ele1PassMediumSimpleCuts/O"); |
249 |
> |
tree_->Branch("Ele1PassTightSimpleCuts",&fEle1PassTightSimpleCuts,"Ele1PassTightSimpleCuts/O"); |
250 |
> |
tree_->Branch("Ele1PassHZZICHEP2012",&fEle1PassHZZICHEP2012,"Ele1PassHZZICHEP2012/O"); |
251 |
> |
tree_->Branch("Ele2Pt",&fEle2Pt,"Ele2Pt/F"); |
252 |
> |
tree_->Branch("Ele2Eta",&fEle2Eta,"Ele2Eta/F"); |
253 |
> |
tree_->Branch("Ele2Phi",&fEle2Phi,"Ele2Phi/F"); |
254 |
> |
tree_->Branch("Ele2SCEt",&fEle2SCEt,"Ele2SCEt/F"); |
255 |
> |
tree_->Branch("Ele2SCEta",&fEle2SCEta,"Ele2SCEta/F"); |
256 |
> |
tree_->Branch("Ele2SCPhi",&fEle2SCPhi,"Ele2SCPhi/F"); |
257 |
> |
tree_->Branch("Ele2GenPt",&fEle2GenPt,"Ele2GenPt/F"); |
258 |
> |
tree_->Branch("Ele2EnergyCorrAndSmeared",&fEle2EnergyCorrAndSmeared,"Ele2EnergyCorrAndSmeared/F"); |
259 |
> |
tree_->Branch("Ele2Energy",&fEle2Energy,"Ele2Energy/F"); |
260 |
> |
tree_->Branch("Ele2EnergyRegression",&fEle2EnergyRegression,"Ele2EnergyRegression/F"); |
261 |
> |
tree_->Branch("Ele2EnergyRegressionWithTrkVarTwoPtBins",&fEle2EnergyRegressionWithTrkVarTwoPtBins,"Ele2EnergyRegressionWithTrkVarTwoPtBins/F"); |
262 |
> |
tree_->Branch("Ele2EnergyRegressionWithTrkVar",&fEle2EnergyRegressionWithTrkVar,"Ele2EnergyRegressionWithTrkVar/F"); |
263 |
> |
tree_->Branch("Ele2EnergyRegressionNoTrkVarTwoPtBins",&fEle2EnergyRegressionNoTrkVarTwoPtBins,"Ele2EnergyRegressionNoTrkVarTwoPtBins/F"); |
264 |
> |
tree_->Branch("Ele2EnergyRegressionNoTrkVar",&fEle2EnergyRegressionNoTrkVar,"Ele2EnergyRegressionNoTrkVar/F"); |
265 |
> |
tree_->Branch("Ele2Charge",&fEle2Charge,"Ele2Charge/I"); |
266 |
> |
tree_->Branch("Ele2HZZICHEP2012IDMVA",&fEle2HZZICHEP2012IDMVA,"Ele2HZZICHEP2012IDMVA/F"); |
267 |
> |
tree_->Branch("Ele2PFIso04",&fEle2PFIso04,"Ele2PFIso04/F"); |
268 |
> |
tree_->Branch("Ele2R9",&fEle2R9,"Ele2R9/F"); |
269 |
> |
tree_->Branch("Ele2PassLooseSimpleCuts",&fEle2PassLooseSimpleCuts,"Ele2PassLooseSimpleCuts/O"); |
270 |
> |
tree_->Branch("Ele2PassMediumSimpleCuts",&fEle2PassMediumSimpleCuts,"Ele2PassMediumSimpleCuts/O"); |
271 |
> |
tree_->Branch("Ele2PassTightSimpleCuts",&fEle2PassTightSimpleCuts,"Ele2PassTightSimpleCuts/O"); |
272 |
> |
tree_->Branch("Ele2PassHZZICHEP2012",&fEle2PassHZZICHEP2012,"Ele2PassHZZICHEP2012/O"); |
273 |
> |
|
274 |
> |
} |
275 |
> |
|
276 |
> |
// initialze a ZeeEventTree |
277 |
> |
void InitTree(UInt_t Type = kCITZeeEvent){ |
278 |
> |
assert(tree_); |
279 |
> |
// don't forget to set pointers to zero before you set address |
280 |
> |
// or you will fully appreciate that "ROOT sucks" :) |
281 |
> |
InitVariables(); |
282 |
> |
//Set branch address |
283 |
> |
Int_t currentState = gErrorIgnoreLevel; |
284 |
> |
|
285 |
> |
if (Type == kCITZeeEvent) { |
286 |
> |
cout << "CITZeeEvent\n"; |
287 |
> |
tree_->SetBranchAddress("weight",&fWeight); |
288 |
> |
tree_->SetBranchAddress("run",&fRunNumber); |
289 |
> |
tree_->SetBranchAddress("lumi",&fLumiSectionNumber); |
290 |
> |
tree_->SetBranchAddress("event",&fEventNumber); |
291 |
> |
tree_->SetBranchAddress("npu",&fNPU); |
292 |
> |
tree_->SetBranchAddress("rho",&fRho); |
293 |
> |
tree_->SetBranchAddress("vertices",&fNVertices); |
294 |
> |
tree_->SetBranchAddress("triggerbits",&fEventTriggerBits); |
295 |
> |
tree_->SetBranchAddress("mass",&fMass); |
296 |
> |
tree_->SetBranchAddress("Ele1Pt",&fEle1Pt); |
297 |
> |
tree_->SetBranchAddress("Ele1Eta",&fEle1Eta); |
298 |
> |
tree_->SetBranchAddress("Ele1Phi",&fEle1Phi); |
299 |
> |
tree_->SetBranchAddress("Ele1SCEt",&fEle1SCEt); |
300 |
> |
tree_->SetBranchAddress("Ele1SCEta",&fEle1SCEta); |
301 |
> |
tree_->SetBranchAddress("Ele1SCPhi",&fEle1SCPhi); |
302 |
> |
tree_->SetBranchAddress("Ele1GenPt",&fEle1GenPt); |
303 |
> |
tree_->SetBranchAddress("Ele1EnergyCorrAndSmeared",&fEle1EnergyCorrAndSmeared); |
304 |
> |
tree_->SetBranchAddress("Ele1Energy",&fEle1Energy); |
305 |
> |
tree_->SetBranchAddress("Ele1EnergyRegression",&fEle1EnergyRegression); |
306 |
> |
tree_->SetBranchAddress("Ele1EnergyRegressionWithTrkVarTwoPtBins",&fEle1EnergyRegressionWithTrkVarTwoPtBins); |
307 |
> |
tree_->SetBranchAddress("Ele1EnergyRegressionWithTrkVar",&fEle1EnergyRegressionWithTrkVar); |
308 |
> |
tree_->SetBranchAddress("Ele1EnergyRegressionNoTrkVarTwoPtBins",&fEle1EnergyRegressionNoTrkVarTwoPtBins); |
309 |
> |
tree_->SetBranchAddress("Ele1EnergyRegressionNoTrkVar",&fEle1EnergyRegressionNoTrkVar); |
310 |
> |
tree_->SetBranchAddress("Ele1Charge",&fEle1Charge); |
311 |
> |
tree_->SetBranchAddress("Ele1HZZICHEP2012IDMVA",&fEle1HZZICHEP2012IDMVA); |
312 |
> |
tree_->SetBranchAddress("Ele1PFIso04",&fEle1PFIso04); |
313 |
> |
tree_->SetBranchAddress("Ele1R9",&fEle1R9); |
314 |
> |
tree_->SetBranchAddress("Ele1PassLooseSimpleCuts",&fEle1PassLooseSimpleCuts); |
315 |
> |
tree_->SetBranchAddress("Ele1PassMediumSimpleCuts",&fEle1PassMediumSimpleCuts); |
316 |
> |
tree_->SetBranchAddress("Ele1PassTightSimpleCuts",&fEle1PassTightSimpleCuts); |
317 |
> |
tree_->SetBranchAddress("Ele1PassHZZICHEP2012",&fEle1PassHZZICHEP2012); |
318 |
> |
tree_->SetBranchAddress("Ele2Pt",&fEle2Pt); |
319 |
> |
tree_->SetBranchAddress("Ele2Eta",&fEle2Eta); |
320 |
> |
tree_->SetBranchAddress("Ele2Phi",&fEle2Phi); |
321 |
> |
tree_->SetBranchAddress("Ele2SCEt",&fEle2SCEt); |
322 |
> |
tree_->SetBranchAddress("Ele2SCEta",&fEle2SCEta); |
323 |
> |
tree_->SetBranchAddress("Ele2SCPhi",&fEle2SCPhi); |
324 |
> |
tree_->SetBranchAddress("Ele2GenPt",&fEle2GenPt); |
325 |
> |
tree_->SetBranchAddress("Ele2EnergyCorrAndSmeared",&fEle2EnergyCorrAndSmeared); |
326 |
> |
tree_->SetBranchAddress("Ele2Energy",&fEle2Energy); |
327 |
> |
tree_->SetBranchAddress("Ele2EnergyRegression",&fEle2EnergyRegression); |
328 |
> |
tree_->SetBranchAddress("Ele2EnergyRegressionWithTrkVarTwoPtBins",&fEle2EnergyRegressionWithTrkVarTwoPtBins); |
329 |
> |
tree_->SetBranchAddress("Ele2EnergyRegressionWithTrkVar",&fEle2EnergyRegressionWithTrkVar); |
330 |
> |
tree_->SetBranchAddress("Ele2EnergyRegressionNoTrkVarTwoPtBins",&fEle2EnergyRegressionNoTrkVarTwoPtBins); |
331 |
> |
tree_->SetBranchAddress("Ele2EnergyRegressionNoTrkVar",&fEle2EnergyRegressionNoTrkVar); |
332 |
> |
tree_->SetBranchAddress("Ele2Charge",&fEle2Charge); |
333 |
> |
tree_->SetBranchAddress("Ele2HZZICHEP2012IDMVA",&fEle2HZZICHEP2012IDMVA); |
334 |
> |
tree_->SetBranchAddress("Ele2PFIso04",&fEle2PFIso04); |
335 |
> |
tree_->SetBranchAddress("Ele2R9",&fEle2R9); |
336 |
> |
tree_->SetBranchAddress("Ele2PassLooseSimpleCuts",&fEle2PassLooseSimpleCuts); |
337 |
> |
tree_->SetBranchAddress("Ele2PassMediumSimpleCuts",&fEle2PassMediumSimpleCuts); |
338 |
> |
tree_->SetBranchAddress("Ele2PassTightSimpleCuts",&fEle2PassTightSimpleCuts); |
339 |
> |
tree_->SetBranchAddress("Ele2PassHZZICHEP2012",&fEle2PassHZZICHEP2012); |
340 |
> |
} else if (Type == kHggFutyanZeeDataEvent || Type == kHggFutyanZeeMCEvent ) { |
341 |
> |
cout << "other type\n"; |
342 |
> |
//************************************************************ |
343 |
> |
//The commented out branches don't exist in this version |
344 |
> |
//************************************************************ |
345 |
> |
|
346 |
> |
tree_->SetBranchAddress("weight",&fWeight); |
347 |
> |
tree_->SetBranchAddress("run",&fRunNumber_int); |
348 |
> |
tree_->SetBranchAddress("lumi",&fLumiSectionNumber_int); |
349 |
> |
tree_->SetBranchAddress("event",&fEventNumber_int); |
350 |
> |
//tree_->SetBranchAddress("rho",&fRho); |
351 |
> |
tree_->SetBranchAddress("nvtx",&fNVertices_int); |
352 |
> |
//tree_->SetBranchAddress("triggerbits",&fEventTriggerBits); |
353 |
> |
tree_->SetBranchAddress("dipho_mass",&fMass); |
354 |
> |
tree_->SetBranchAddress("pho1_pt",&dEle1Pt); |
355 |
> |
tree_->SetBranchAddress("pho1_eta",&dEle1Eta); |
356 |
> |
tree_->SetBranchAddress("pho1_phi",&dEle1Phi); |
357 |
> |
//tree_->SetBranchAddress("Ele1SCEt",&fEle1SCEt); |
358 |
> |
tree_->SetBranchAddress("pho1_sceta",&fEle1SCEta); |
359 |
> |
tree_->SetBranchAddress("pho1_scphi",&fEle1SCPhi); |
360 |
> |
//tree_->SetBranchAddress("Ele1GenPt",&fEle1GenPt); |
361 |
> |
tree_->SetBranchAddress("pho1_energy",&dEle1EnergyCorrAndSmeared); |
362 |
> |
tree_->SetBranchAddress("pho1_energy_noregr",&fEle1Energy); |
363 |
> |
tree_->SetBranchAddress("pho1_energy_regr",&fEle1EnergyRegression); |
364 |
> |
//tree_->SetBranchAddress("Ele1Charge",&fEle1Charge); |
365 |
> |
//tree_->SetBranchAddress("Ele1HZZICHEP2012IDMVA",&fEle1HZZICHEP2012IDMVA); |
366 |
> |
//tree_->SetBranchAddress("Ele1PFIso04",&fEle1PFIso04); |
367 |
> |
tree_->SetBranchAddress("pho1_r9",&fEle1R9); |
368 |
> |
//tree_->SetBranchAddress("Ele1PassLooseSimpleCuts",&fEle1PassLooseSimpleCuts); |
369 |
> |
//tree_->SetBranchAddress("Ele1PassMediumSimpleCuts",&fEle1PassMediumSimpleCuts); |
370 |
> |
//tree_->SetBranchAddress("Ele1PassTightSimpleCuts",&fEle1PassTightSimpleCuts); |
371 |
> |
//tree_->SetBranchAddress("Ele1PassHZZICHEP2012",&fEle1PassHZZICHEP2012); |
372 |
> |
|
373 |
> |
tree_->SetBranchAddress("pho2_pt",&dEle2Pt); |
374 |
> |
tree_->SetBranchAddress("pho2_eta",&dEle2Eta); |
375 |
> |
tree_->SetBranchAddress("pho2_phi",&dEle2Phi); |
376 |
> |
//tree_->SetBranchAddress("Ele2SCEt",&fEle2SCEt); |
377 |
> |
tree_->SetBranchAddress("pho2_sceta",&fEle2SCEta); |
378 |
> |
tree_->SetBranchAddress("pho2_scphi",&fEle2SCPhi); |
379 |
> |
//tree_->SetBranchAddress("Ele2GenPt",&fEle2GenPt); |
380 |
> |
tree_->SetBranchAddress("pho2_energy",&dEle2EnergyCorrAndSmeared); |
381 |
> |
tree_->SetBranchAddress("pho2_energy_noregr",&fEle2Energy); |
382 |
> |
tree_->SetBranchAddress("pho2_energy_regr",&fEle2EnergyRegression); |
383 |
> |
//tree_->SetBranchAddress("Ele2Charge",&fEle2Charge); |
384 |
> |
//tree_->SetBranchAddress("Ele2HZZICHEP2012IDMVA",&fEle2HZZICHEP2012IDMVA); |
385 |
> |
//tree_->SetBranchAddress("Ele2PFIso04",&fEle2PFIso04); |
386 |
> |
tree_->SetBranchAddress("pho2_r9",&fEle2R9); |
387 |
> |
//tree_->SetBranchAddress("Ele2PassLooseSimpleCuts",&fEle2PassLooseSimpleCuts); |
388 |
> |
//tree_->SetBranchAddress("Ele2PassMediumSimpleCuts",&fEle2PassMediumSimpleCuts); |
389 |
> |
//tree_->SetBranchAddress("Ele2PassTightSimpleCuts",&fEle2PassTightSimpleCuts); |
390 |
> |
//tree_->SetBranchAddress("Ele2PassHZZICHEP2012",&fEle2PassHZZICHEP2012); |
391 |
> |
} else { |
392 |
> |
cout << "Warning: Type " << Type << " is not supported \n"; |
393 |
> |
} |
394 |
> |
|
395 |
> |
gErrorIgnoreLevel = currentState; |
396 |
> |
} |
397 |
> |
|
398 |
> |
Float_t Ele1Pt() { |
399 |
> |
if (fTreeType == kHggFutyanZeeDataEvent || fTreeType == kHggFutyanZeeMCEvent) return dEle1Pt; |
400 |
> |
else return fEle1Pt; |
401 |
> |
} |
402 |
> |
Float_t Ele1Eta() { |
403 |
> |
if (fTreeType == kHggFutyanZeeDataEvent || fTreeType == kHggFutyanZeeMCEvent) return dEle1Eta; |
404 |
> |
else return fEle1Eta; |
405 |
> |
} |
406 |
> |
Float_t Ele1Phi() { |
407 |
> |
if (fTreeType == kHggFutyanZeeDataEvent || fTreeType == kHggFutyanZeeMCEvent) return dEle1Phi; |
408 |
> |
else return fEle1Phi; |
409 |
> |
} |
410 |
> |
Float_t Ele1EnergyCorrAndSmeared() { |
411 |
> |
if (fTreeType == kHggFutyanZeeDataEvent || fTreeType == kHggFutyanZeeMCEvent) return dEle1EnergyCorrAndSmeared; |
412 |
> |
else return fEle1EnergyCorrAndSmeared; |
413 |
> |
} |
414 |
> |
Float_t Ele2Pt() { |
415 |
> |
if (fTreeType == kHggFutyanZeeDataEvent || fTreeType == kHggFutyanZeeMCEvent) return dEle2Pt; |
416 |
> |
else return fEle2Pt; |
417 |
> |
} |
418 |
> |
Float_t Ele2Eta() { |
419 |
> |
if (fTreeType == kHggFutyanZeeDataEvent || fTreeType == kHggFutyanZeeMCEvent) return dEle2Eta; |
420 |
> |
else return fEle2Eta; |
421 |
> |
} |
422 |
> |
Float_t Ele2Phi() { |
423 |
> |
if (fTreeType == kHggFutyanZeeDataEvent || fTreeType == kHggFutyanZeeMCEvent) return dEle2Phi; |
424 |
> |
else return fEle2Phi; |
425 |
> |
} |
426 |
> |
Float_t Ele2EnergyCorrAndSmeared() { |
427 |
> |
if (fTreeType == kHggFutyanZeeDataEvent || fTreeType == kHggFutyanZeeMCEvent) return dEle2EnergyCorrAndSmeared; |
428 |
> |
else return fEle2EnergyCorrAndSmeared; |
429 |
> |
} |
430 |
> |
UInt_t RunNumber() { |
431 |
> |
if (fTreeType == kHggFutyanZeeDataEvent || fTreeType == kHggFutyanZeeMCEvent) return fRunNumber_int; |
432 |
> |
else return fRunNumber; |
433 |
> |
} |
434 |
> |
UInt_t LumiSectionNumber() { |
435 |
> |
if (fTreeType == kHggFutyanZeeDataEvent || fTreeType == kHggFutyanZeeMCEvent) return fLumiSectionNumber_int; |
436 |
> |
else return fLumiSectionNumber; |
437 |
> |
} |
438 |
> |
UInt_t EventNumber() { |
439 |
> |
if (fTreeType == kHggFutyanZeeDataEvent || fTreeType == kHggFutyanZeeMCEvent) return fEventNumber_int; |
440 |
> |
else return fEventNumber; |
441 |
> |
} |
442 |
> |
UInt_t NVertices() { |
443 |
> |
if (fTreeType == kHggFutyanZeeDataEvent || fTreeType == kHggFutyanZeeMCEvent) return fNVertices_int; |
444 |
> |
else return fNVertices; |
445 |
> |
} |
446 |
|
|
193 |
– |
}; |
447 |
|
|
448 |
+ |
}; |
449 |
+ |
} |
450 |
|
|
451 |
|
|
452 |
|
#endif |