@@ -156,48 +156,48 @@ void LocalOpenDataTreeProducer::Loop()
156
156
TBranch * b_ak7_to_ak4 = tree -> Branch ("ak7_to_ak4" , ak7_to_ak4 , "ak7_to_ak4[njet_ak7]/I" );
157
157
158
158
TBranch * b_chf = tree -> Branch ("chf" , chf , "chf[njet]/F" );
159
- TBranch * b_nhf = tree -> Branch ("nhf" , nhf , "nhf[njet]/F" );
160
- TBranch * b_phf = tree -> Branch ("phf" , phf , "phf[njet]/F" );
161
- TBranch * b_elf = tree -> Branch ("elf" , elf , "elf[njet]/F" );
162
- TBranch * b_muf = tree -> Branch ("muf" , muf , "muf[njet]/F" );
163
-
164
- TBranch * b_hf_hf = tree -> Branch ("hf_hf" , hf_hf , "hf_hf[njet]/F" );
165
- TBranch * b_hf_phf = tree -> Branch ("hf_phf" , hf_phf , "hf_phf[njet]/F" );
166
- TBranch * b_hf_hm = tree -> Branch ("hf_hm" , hf_hm , "hf_hm[njet]/i" );
167
- TBranch * b_hf_phm = tree -> Branch ("hf_phm" , hf_phm , "hf_phm[njet]/i" );
168
-
159
+ TBranch * b_nhf = tree -> Branch ("nhf" , nhf , "nhf[njet]/F" );
160
+ TBranch * b_phf = tree -> Branch ("phf" , phf , "phf[njet]/F" );
161
+ TBranch * b_elf = tree -> Branch ("elf" , elf , "elf[njet]/F" );
162
+ TBranch * b_muf = tree -> Branch ("muf" , muf , "muf[njet]/F" );
163
+
164
+ TBranch * b_hf_hf = tree -> Branch ("hf_hf" , hf_hf , "hf_hf[njet]/F" );
165
+ TBranch * b_hf_phf = tree -> Branch ("hf_phf" , hf_phf , "hf_phf[njet]/F" );
166
+ TBranch * b_hf_hm = tree -> Branch ("hf_hm" , hf_hm , "hf_hm[njet]/i" );
167
+ TBranch * b_hf_phm = tree -> Branch ("hf_phm" , hf_phm , "hf_phm[njet]/i" );
168
+
169
169
TBranch * b_chm = tree -> Branch ("chm" , chm , "chm[njet]/i" );
170
- TBranch * b_nhm = tree -> Branch ("nhm" , nhm , "nhm[njet]/i" );
171
- TBranch * b_phm = tree -> Branch ("phm" , phm , "phm[njet]/i" );
172
- TBranch * b_elm = tree -> Branch ("elm" , elm , "elm[njet]/i" );
173
- TBranch * b_mum = tree -> Branch ("mum" , mum , "mum[njet]/i" );
170
+ TBranch * b_nhm = tree -> Branch ("nhm" , nhm , "nhm[njet]/i" );
171
+ TBranch * b_phm = tree -> Branch ("phm" , phm , "phm[njet]/i" );
172
+ TBranch * b_elm = tree -> Branch ("elm" , elm , "elm[njet]/i" );
173
+ TBranch * b_mum = tree -> Branch ("mum" , mum , "mum[njet]/i" );
174
174
175
- TBranch * b_hof = tree -> Branch ("hof" , hof , "hof[njet]/F" );
176
- TBranch * b_beta = tree -> Branch ("beta" , beta , "beta[njet]/F" );
177
- TBranch * b_bstar = tree -> Branch ("bstar" , bstar , "bstar[njet]/F" );
178
- TBranch * b_qgl = tree -> Branch ("qgl" , qgl , "qgl[njet]/F" );
179
-
175
+ TBranch * b_hof = tree -> Branch ("hof" , hof , "hof[njet]/F" );
176
+ TBranch * b_beta = tree -> Branch ("beta" , beta , "beta[njet]/F" );
177
+ TBranch * b_bstar = tree -> Branch ("bstar" , bstar , "bstar[njet]/F" );
178
+ TBranch * b_qgl = tree -> Branch ("qgl" , qgl , "qgl[njet]/F" );
179
+
180
180
if (isMC ) {
181
- TBranch * b_ngen = tree -> Branch ("ngen" , & ngen , "ngen/i" );
182
- TBranch * b_gen_pt = tree -> Branch ("gen_pt" , gen_pt , "gen_pt[ngen]/F" );
183
- TBranch * b_gen_eta = tree -> Branch ("gen_eta" , gen_eta , "gen_eta[ngen]/F" );
184
- TBranch * b_gen_phi = tree -> Branch ("gen_phi" , gen_eta , "gen_phi[ngen]/F" );
185
- TBranch * b_gen_E = tree -> Branch ("gen_E" , gen_E , "gen_E[ngen]/F" );
181
+ TBranch * b_ngen = tree -> Branch ("ngen" , & ngen , "ngen/i" );
182
+ TBranch * b_gen_pt = tree -> Branch ("gen_pt" , gen_pt , "gen_pt[ngen]/F" );
183
+ TBranch * b_gen_eta = tree -> Branch ("gen_eta" , gen_eta , "gen_eta[ngen]/F" );
184
+ TBranch * b_gen_phi = tree -> Branch ("gen_phi" , gen_eta , "gen_phi[ngen]/F" );
185
+ TBranch * b_gen_E = tree -> Branch ("gen_E" , gen_E , "gen_E[ngen]/F" );
186
186
}
187
187
188
- TBranch * b_run = tree -> Branch ("run" , & run , "run/i" );
189
- TBranch * b_lumi = tree -> Branch ("lumi" , & lumi , "lumi/i" );
190
- TBranch * b_event = tree -> Branch ("event" , & event , "event/l" );
188
+ TBranch * b_run = tree -> Branch ("run" , & run , "run/i" );
189
+ TBranch * b_lumi = tree -> Branch ("lumi" , & lumi , "lumi/i" );
190
+ TBranch * b_event = tree -> Branch ("event" , & event , "event/l" );
191
191
192
- TBranch * b_ntrg = tree -> Branch ("ntrg" , & ntrg , "ntrg/i" );
193
- TBranch * b_triggers = tree -> Branch ("triggers" , triggers , "triggers[ntrg]/O" );
192
+ TBranch * b_ntrg = tree -> Branch ("ntrg" , & ntrg , "ntrg/i" );
193
+ TBranch * b_triggers = tree -> Branch ("triggers" , triggers , "triggers[ntrg]/O" );
194
194
TBranch * b_triggernames = tree -> Branch ("triggernames" , & triggernames );
195
- TBranch * b_prescales = tree -> Branch ("prescales" , prescales , "prescales[ntrg]/i" );
195
+ TBranch * b_prescales = tree -> Branch ("prescales" , prescales , "prescales[ntrg]/i" );
196
196
197
- TBranch * b_met = tree -> Branch ("met" , & met , "met/F" );
198
- TBranch * b_sumet = tree -> Branch ("sumet" , & sumet , "sumet/F" );
199
- TBranch * b_rho = tree -> Branch ("rho" , & rho , "rho/F" );
200
- TBranch * b_pthat = tree -> Branch ("pthat" , & pthat , "pthat/F" );
197
+ TBranch * b_met = tree -> Branch ("met" , & met , "met/F" );
198
+ TBranch * b_sumet = tree -> Branch ("sumet" , & sumet , "sumet/F" );
199
+ TBranch * b_rho = tree -> Branch ("rho" , & rho , "rho/F" );
200
+ TBranch * b_pthat = tree -> Branch ("pthat" , & pthat , "pthat/F" );
201
201
TBranch * b_mcweight = tree -> Branch ("mcweight" , & mcweight , "mcweight/F" );
202
202
203
203
assert (fChain_ak4 && "AK4 tree invalid!" );
@@ -270,10 +270,10 @@ void LocalOpenDataTreeProducer::Loop()
270
270
fChain_ak4 -> SetBranchStatus ("EvtHdr_.mWeight" ,1 ); // mcweight
271
271
272
272
273
- fChain_ak7 -> SetBranchStatus ("PFJets_" , 1 );
274
- fChain_ak7 -> SetBranchStatus ("PFJets_.P4_.fCoordinates.f*" , 1 );
275
- fChain_ak7 -> SetBranchStatus ("PFJets_.cor_" , 1 );
276
- fChain_ak7 -> SetBranchStatus ("PFJets_.area_" , 1 );
273
+ fChain_ak7 -> SetBranchStatus ("PFJets_" , 1 );
274
+ fChain_ak7 -> SetBranchStatus ("PFJets_.P4_.fCoordinates.f*" , 1 );
275
+ fChain_ak7 -> SetBranchStatus ("PFJets_.cor_" , 1 );
276
+ fChain_ak7 -> SetBranchStatus ("PFJets_.area_" , 1 );
277
277
278
278
// Helper variables
279
279
TLorentzVector p4 , p4_ak4 , p4_ak7 , p4gen ;
@@ -284,7 +284,7 @@ void LocalOpenDataTreeProducer::Loop()
284
284
285
285
// DEBUG!!
286
286
// Change number of events here
287
- nentries = 100000 ;
287
+ nentries = 100000 ;
288
288
289
289
// Convert set into vector
290
290
std ::vector < std ::string > trg_vec ;
@@ -336,44 +336,44 @@ void LocalOpenDataTreeProducer::Loop()
336
336
p4 .SetPxPyPzE ( PFJets__P4__fCoordinates_fX [i ], PFJets__P4__fCoordinates_fY [i ],
337
337
PFJets__P4__fCoordinates_fZ [i ], PFJets__P4__fCoordinates_fT [i ]);
338
338
339
- // pT selection
339
+ // pT selection
340
340
Float_t minPt = 15 ;
341
- if (p4 .Pt () > minPt ) {
342
-
343
- jet_pt [i_out ] = p4 .Pt ();
344
- jet_eta [i_out ] = p4 .Eta ();
345
- jet_phi [i_out ] = p4 .Phi ();
346
- jet_E [i_out ] = p4 .E ();
347
-
348
-
349
- jet_tightID [i_out ] = PFJets__tightID_ [i ];
350
- jet_area [i_out ] = PFJets__area_ [i ];
351
- jet_jes [i_out ] = PFJets__cor_ [i ];
352
-
353
-
354
- // Jet composition
355
- chf [i_out ] = PFJets__chf_ [i ];
356
- nhf [i_out ] = PFJets__nhf_ [i ];
357
- phf [i_out ] = PFJets__nemf_ [i ];
358
- elf [i_out ] = PFJets__cemf_ [i ];
359
- muf [i_out ] = PFJets__muf_ [i ];
360
- hf_hf [i ] = PFJets__hf_hf_ [i ];
361
- hf_phf [i ] = PFJets__hf_phf_ [i ];
362
- hf_hm [i ] = PFJets__hf_hm_ [i ];
363
- hf_phm [i ] = PFJets__hf_phm_ [i ];
364
- chm [i_out ] = PFJets__chm_ [i ];
365
- nhm [i_out ] = PFJets__nhm_ [i ];
366
- phm [i_out ] = PFJets__phm_ [i ];
367
- elm [i_out ] = PFJets__elm_ [i ];
368
- mum [i_out ] = PFJets__mum_ [i ];
369
-
370
- qgl [i_out ] = PFJets__QGtagger_ [i ];
371
- beta [i_out ] = PFJets__beta_ [i ];
372
- bstar [i_out ] = PFJets__betaStar_ [i ];
373
- hof [i_out ] = PFJets__hof_ [i ];
341
+ if (p4 .Pt () > minPt ) {
342
+
343
+ jet_pt [i_out ] = p4 .Pt ();
344
+ jet_eta [i_out ] = p4 .Eta ();
345
+ jet_phi [i_out ] = p4 .Phi ();
346
+ jet_E [i_out ] = p4 .E ();
347
+
348
+
349
+ jet_tightID [i_out ] = PFJets__tightID_ [i ];
350
+ jet_area [i_out ] = PFJets__area_ [i ];
351
+ jet_jes [i_out ] = PFJets__cor_ [i ];
352
+
353
+
354
+ // Jet composition
355
+ chf [i_out ] = PFJets__chf_ [i ];
356
+ nhf [i_out ] = PFJets__nhf_ [i ];
357
+ phf [i_out ] = PFJets__nemf_ [i ];
358
+ elf [i_out ] = PFJets__cemf_ [i ];
359
+ muf [i_out ] = PFJets__muf_ [i ];
360
+ hf_hf [i ] = PFJets__hf_hf_ [i ];
361
+ hf_phf [i ] = PFJets__hf_phf_ [i ];
362
+ hf_hm [i ] = PFJets__hf_hm_ [i ];
363
+ hf_phm [i ] = PFJets__hf_phm_ [i ];
364
+ chm [i_out ] = PFJets__chm_ [i ];
365
+ nhm [i_out ] = PFJets__nhm_ [i ];
366
+ phm [i_out ] = PFJets__phm_ [i ];
367
+ elm [i_out ] = PFJets__elm_ [i ];
368
+ mum [i_out ] = PFJets__mum_ [i ];
369
+
370
+ qgl [i_out ] = PFJets__QGtagger_ [i ];
371
+ beta [i_out ] = PFJets__beta_ [i ];
372
+ bstar [i_out ] = PFJets__betaStar_ [i ];
373
+ hof [i_out ] = PFJets__hof_ [i ];
374
374
375
- ++ i_out ;
376
- }
375
+ ++ i_out ;
376
+ }
377
377
}
378
378
njet = i_out ;
379
379
@@ -382,28 +382,28 @@ void LocalOpenDataTreeProducer::Loop()
382
382
383
383
// Safety check
384
384
if (EvtHdr__mRun != EvtHdr__mRun_ak7 ||
385
- EvtHdr__mEvent != EvtHdr__mEvent_ak7 ||
386
- EvtHdr__mLumi != EvtHdr__mLumi_ak7 ) {
387
-
388
- assert (false && "Mismatch between AK4 and AK7 events!!" );
385
+ EvtHdr__mEvent != EvtHdr__mEvent_ak7 ||
386
+ EvtHdr__mLumi != EvtHdr__mLumi_ak7 ) {
387
+
388
+ assert (false && "Mismatch between AK4 and AK7 events!!" );
389
389
}
390
390
391
391
// Keep only four leading jets
392
- njet_ak7 = min (PFJets_ak7__ , 4 );
392
+ njet_ak7 = min (PFJets_ak7__ , 4 );
393
393
for (int i = 0 ; i != njet_ak7 ; ++ i ) {
394
394
395
395
p4_ak7 .SetPxPyPzE ( PFJets__P4__fCoordinates_fX_ak7 [i ], PFJets__P4__fCoordinates_fY_ak7 [i ],
396
396
PFJets__P4__fCoordinates_fZ_ak7 [i ], PFJets__P4__fCoordinates_fT_ak7 [i ]);
397
397
398
398
// 4-momentum (corrected!)
399
- jet_pt_ak7 [i ] = p4_ak7 .Pt ();
400
- jet_eta_ak7 [i ] = p4_ak7 .Eta ();
401
- jet_phi_ak7 [i ] = p4_ak7 .Phi ();
402
- jet_E_ak7 [i ] = p4_ak7 .E ();
399
+ jet_pt_ak7 [i ] = p4_ak7 .Pt ();
400
+ jet_eta_ak7 [i ] = p4_ak7 .Eta ();
401
+ jet_phi_ak7 [i ] = p4_ak7 .Phi ();
402
+ jet_E_ak7 [i ] = p4_ak7 .E ();
403
403
404
404
// Area and jet energy correction
405
405
jet_area_ak7 [i ] = PFJets__area_ak7_ [i ];
406
- jet_jes_ak7 [i ] = PFJets__cor_ak7_ [i ];
406
+ jet_jes_ak7 [i ] = PFJets__cor_ak7_ [i ];
407
407
408
408
// Matching AK7 jet to AK4
409
409
ak7_to_ak4 [i ] = -1 ;
@@ -425,7 +425,7 @@ void LocalOpenDataTreeProducer::Loop()
425
425
}
426
426
}
427
427
}
428
-
428
+
429
429
// MC jets
430
430
if (isMC ) {
431
431
ngen = GenJets__ ;
0 commit comments