-
Notifications
You must be signed in to change notification settings - Fork 1
/
RAA_read_data_pp.C
508 lines (410 loc) · 18.2 KB
/
RAA_read_data_pp.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
// Raghav Kunnawalam Elayavalli
// June 23rd 2014
// CERN
//
// Macro separated from RAA_read_data to just read in the pp datasets - due to condor submission details. look at the read_data_pbpb macro to get more information.
//
// old prescale info:
// get the prescl factor information.
// Float_t presclpbpb3 = (Float_t)jetpbpb1_v2->GetEntries("jet80")/jetpbpb1_v2->GetEntries("jet55&&jet80");
// cout<<"pbpb prescl3 = "<<presclpbpb3<<endl;//1.99871
// Float_t presclpp3 = (Float_t)jetpp1_v2->GetEntries("jet80")/jetpp1_v2->GetEntries("jet40&&jet80");
// cout<<"pp prescl3 = "<<presclpp3<<endl; //9.24968
// Aug 28th 2014 - read in data from the forest at CERN. will be changed to read in Aditya's ntuples once they are ready.
// Jan 23th 2015 - running it on the new files in MIT v29 JEC produced by pawan.
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <TH1F.h>
#include <TH1F.h>
#include <TH2F.h>
#include <TFile.h>
#include <TTree.h>
#include <TF1.h>
#include <TCanvas.h>
#include <TLegend.h>
#include <TGraphErrors.h>
#include <TGraphAsymmErrors.h>
#include <TH1.h>
#include <TH2.h>
#include <TH3.h>
#include <TFile.h>
#include <TStyle.h>
#include <TStopwatch.h>
#include <TRandom3.h>
#include <TChain.h>
#include <TNtuple.h>
#include <TProfile.h>
#include <TStopwatch.h>
#include <TCut.h>
#include <cstdlib>
#include <cmath>
#include "TLegend.h"
#include "TLatex.h"
#include "TMath.h"
#include "TLine.h"
// divide by bin width
void divideBinWidth(TH1 *h)
{
h->Sumw2();
for (int i=0;i<=h->GetNbinsX();i++)
{
Float_t val = h->GetBinContent(i);
Float_t valErr = h->GetBinError(i);
val/=h->GetBinWidth(i);
valErr/=h->GetBinWidth(i);
h->SetBinContent(i,val);
h->SetBinError(i,valErr);
}
h->GetXaxis()->CenterTitle();
h->GetYaxis()->CenterTitle();
}
static const int nbins_pt = 39;
static const double boundaries_pt[nbins_pt+1] = {
3, 4, 5, 7, 9, 12,
15, 18, 21, 24, 28,
32, 37, 43, 49, 56,
64, 74, 84, 97, 114,
133, 153, 174, 196,
220, 245, 272, 300,
330, 362, 395, 430,
468, 507, 548, 592,
638, 686, 1000
};
static const int nbins_eta = 1;
static const double boundaries_eta[nbins_eta][2] = {
{0.0,2.0}
};
static const double delta_eta[nbins_eta] = {
4.0
};
static const char etaWidth [nbins_eta][256] = {
"20_eta_20"
};
static const int no_radius = 3;//testing purposes
static const int list_radius[no_radius] = {2,3,4};
//these are the only radii we are interested for the RAA analysis: 2,3,4,5
//static const int no_radius = 7;
//static const int list_radius[no_radius] = {1,2,3,4,5,6,7};
using namespace std;
void RAA_read_data_pp(int startfile = 1,int endfile = 2,char *jet_type = "PF"){
TH1::SetDefaultSumw2();
gStyle->SetOptStat(0);
TStopwatch timer;
timer.Start();
bool printDebug = false;
if(printDebug) cout<<"Reading PP 2013 data"<<endl;
// data files - pp
std::string infile1;
infile1 = "jetRAA_pp_data_forest.txt";
std::ifstream instr1(infile1.c_str(),std::ifstream::in);
std::string filename1;
cout<<"reading from "<<startfile<<" to "<<endfile<<endl;
for(int ifile = 0;ifile<startfile;ifile++){
instr1>>filename1;
}
const int N = 5;
TChain * jetPP[N][no_radius];
string dir[N][no_radius];
for(int k = 0;k<no_radius;k++){
dir[0][k] = "hltanalysis";
dir[1][k] = "skimanalysis";
dir[2][k] = Form("ak%d%sJetAnalyzer",list_radius[k],jet_type);
dir[3][k] = "hiEvtAnalyzer";
dir[4][k] = "hltobject";
}
string trees[N] = {
"HltTree",
"HltTree",
"t",
"HiTree",
"jetObjTree",
};
//this loop is to assign the tree values before we go into the file loop.
for(int k = 0;k<no_radius;k++){
for(int t = 0;t<N;t++){
jetPP[t][k] = new TChain(string(dir[t][k]+"/"+trees[t]).data());
}//tree loop ends
}// radius loop ends
for(int ifile = startfile;ifile<endfile;ifile++){
instr1>>filename1;
if(printDebug)cout<<"File: "<<filename1<<endl;
for(int k = 0;k<no_radius;k++){
for(int t = 0;t<N;t++){
//jetpbpb1[t][k] = new TChain(string(dir[t][k]+"/"+trees[t]).data()) ;
jetPP[t][k]->Add(filename1.c_str());
if(printDebug)cout << "Tree loaded " << string(dir[t][k]+"/"+trees[t]).data() << endl;
if(printDebug)cout << "Entries : " << jetPP[t][k]->GetEntries() << endl;
}// tree loop ends
}// radius loop ends
}// file loop ends
for(int k = 0;k<no_radius;k++){
jetPP[2][k]->AddFriend(jetPP[0][k]);
jetPP[2][k]->AddFriend(jetPP[1][k]);
jetPP[2][k]->AddFriend(jetPP[3][k]);
jetPP[2][k]->AddFriend(jetPP[4][k]);
}// radius loop ends
if(printDebug) cout<<"no of entries in the forest = "<<jetPP[0][0]->GetEntries()<<endl;
//declare the histograms here. currently they are made uisng the jet trigger and 12003 combination method. Once we have the new forests with the trigger objects we will change it to use the 14007 method.
TH1F *hpp_Trg80[no_radius][nbins_eta];
TH1F *hpp_Trg60[no_radius][nbins_eta];
TH1F *hpp_Trg40[no_radius][nbins_eta];
TH1F *hpp_TrgComb[no_radius][nbins_eta];
TH1F *hpp_chMaxcut_Trg80[no_radius][nbins_eta];
TH1F *hpp_chMaxcut_Trg60[no_radius][nbins_eta];
TH1F *hpp_chMaxcut_Trg40[no_radius][nbins_eta];
TH1F *hpp_chMaxcut_TrgComb[no_radius][nbins_eta];
TH1F *hpp_eMaxcut_Trg80[no_radius][nbins_eta];
TH1F *hpp_eMaxcut_Trg60[no_radius][nbins_eta];
TH1F *hpp_eMaxcut_Trg40[no_radius][nbins_eta];
TH1F *hpp_eMaxcut_TrgComb[no_radius][nbins_eta];
TH1F *hpp_residual_Trg80[no_radius][nbins_eta];
TH1F *hpp_residual_Trg60[no_radius][nbins_eta];
TH1F *hpp_residual_Trg40[no_radius][nbins_eta];
TH1F *hpp_residual_TrgComb[no_radius][nbins_eta];
TH1F * hchMax[no_radius][nbins_eta];
TH1F * hphMax[no_radius][nbins_eta];
TH1F * hneMax[no_radius][nbins_eta];
TH1F * heMax[no_radius][nbins_eta];
TH1F * hmuMax[no_radius][nbins_eta];
TH1F * hchSum[no_radius][nbins_eta];
TH1F * hphSum[no_radius][nbins_eta];
TH1F * hneSum[no_radius][nbins_eta];
TH1F * heSum[no_radius][nbins_eta];
TH1F * hmuSum[no_radius][nbins_eta];
for(int k = 0;k<no_radius;k++){
for(int j = 0;j<nbins_eta;j++){
hpp_residual_Trg80[k][j] = new TH1F(Form("hpp_residual_Trg80_R%d_%s",list_radius[k],etaWidth[j]),Form("Spectra from Jet Trigger 80 for R%d and %s",list_radius[k],etaWidth[j]),400,0,400);
hpp_residual_Trg60[k][j] = new TH1F(Form("hpp_residual_Trg60_R%d_%s",list_radius[k],etaWidth[j]),Form("Spectra from Jet Trigger 60 for R%d and %s",list_radius[k],etaWidth[j]),400,0,400);
hpp_residual_Trg40[k][j] = new TH1F(Form("hpp_residual_Trg40_R%d_%s",list_radius[k],etaWidth[j]),Form("Spectra from Jet Trigger 40 for R%d and %s",list_radius[k],etaWidth[j]),400,0,400);
hpp_residual_TrgComb[k][j] = new TH1F(Form("hpp_residual_TrgComb_R%d_%s",list_radius[k],etaWidth[j]),Form("Combined Spectra from Jet Triggers for R%d and %s",list_radius[k],etaWidth[j]),400,0,400);
hpp_residual_effecprescl_Trg80[k][j] = new TH1F(Form("hpp_residual_effecprescl_Trg80_R%d_%s",list_radius[k],etaWidth[j]),Form("Spectra from Jet Trigger 80 for R%d and %s",list_radius[k],etaWidth[j]),400,0,400);
hpp_residual_effecprescl_Trg60[k][j] = new TH1F(Form("hpp_residual_effecprescl_Trg60_R%d_%s",list_radius[k],etaWidth[j]),Form("Spectra from Jet Trigger 60 for R%d and %s",list_radius[k],etaWidth[j]),400,0,400);
hpp_residual_effecprescl_Trg40[k][j] = new TH1F(Form("hpp_residual_effecprescl_Trg40_R%d_%s",list_radius[k],etaWidth[j]),Form("Spectra from Jet Trigger 40 for R%d and %s",list_radius[k],etaWidth[j]),400,0,400);
hpp_residual_effecprescl_TrgComb[k][j] = new TH1F(Form("hpp_residual_effecprescl_TrgComb_R%d_%s",list_radius[k],etaWidth[j]),Form("Combined Spectra from Jet Triggers for R%d and %s",list_radius[k],etaWidth[j]),400,0,400);
}// eta bin loop
}// radius loop
//setting branch addresses:
// jet tree
int nrefe_1;
float pt_1[1000];
// float old_pt3[1000];
float raw_1[1000];
float eta_1[1000];
// float eta_1_CM[1000];
float phi_1[1000];
float chMax_1[1000];
float trkMax_1[1000];
float chSum_1[1000];
float phSum_1[1000];
float neSum_1[1000];
float trkSum_1[1000];
float phMax_1[1000];
float neMax_1[1000];
float eMax_1[1000];
float muMax_1[1000];
float eSum_1[1000];
float muSum_1[1000];
// event tree
int evt_1;
int run_1;
int lumi_1;
float vx_1;
float vy_1;
float vz_1;
// int hiNtracks_1;
// float hiHFminus_1;
// float hiHFplus_1;
// float hiHFplusEta4_1;
// float hiHFminusEta4_1;
int pPAcollisionEventSelectionPA_1;
int pHBHENoiseFilter_1;
// int pprimaryvertexFilter_1;
// int pVertexFilterCutGplus_1;
// trigger tree
// int L1_MB_1;
// int L1_MB_p_1;
// int jetMB_1;
int jet40_1;
int jet60_1;
int jet80_1;
// int jetMB_p_1;
int jet40_p_1;
int jet60_p_1;
int jet80_p_1;
// trigger object tree - this contains the maximum value of the particular trigger object.
float trgObj_id_1;
float trgObj_pt_1;
float trgObj_eta_1;
float trgObj_phi_1;
float trgObj_mass_1;
for(int k = 0;k<no_radius;k++){
//set the branch addresses: - one of the most boring parts of the code:
jetPP[2][k]->SetBranchAddress("evt",&evt_1);
jetPP[2][k]->SetBranchAddress("run",&run_1);
jetPP[2][k]->SetBranchAddress("lumi",&lumi_1);
jetPP[2][k]->SetBranchAddress("vz",&vz_1);
jetPP[2][k]->SetBranchAddress("vx",&vx_1);
jetPP[2][k]->SetBranchAddress("vy",&vy_1);
// jetPP[2][k]->SetBranchAddress("hiNtracks",&hiNtracks_1);
// jetPP[2][k]->SetBranchAddress("hiHFminus",&hiHFminus_1);
// jetPP[2][k]->SetBranchAddress("hiHFplus",&hiHFplus_1);
// jetPP[2][k]->SetBranchAddress("hiHFplusEta4",&hiHFplusEta4_1);
// jetPP[2][k]->SetBranchAddress("hiHFminusEta4",&hiHFminusEta4_1);
jetPP[2][k]->SetBranchAddress("pPAcollisionEventSelectionPA",&pPAcollisionEventSelectionPA_1);
jetPP[2][k]->SetBranchAddress("pHBHENoiseFilter",&pHBHENoiseFilter_1);
// jetPP[2][k]->SetBranchAddress("pprimaryvertexFilter",&pprimaryvertexFilter_1);
// jetPP[2][k]->SetBranchAddress("pVertexFilterCutGplus",&pVertexFilterCutGplus_1);
jetPP[2][k]->SetBranchAddress("nref",&nrefe_1);
jetPP[2][k]->SetBranchAddress("jtpt",&pt_1);
jetPP[2][k]->SetBranchAddress("jteta",&eta_1);
jetPP[2][k]->SetBranchAddress("jtphi",&phi_1);
jetPP[2][k]->SetBranchAddress("rawpt",&raw_1);
jetPP[2][k]->SetBranchAddress("chargedMax",&chMax_1);
jetPP[2][k]->SetBranchAddress("chargedSum",&chSum_1);
jetPP[2][k]->SetBranchAddress("trackMax",&trkMax_1);
jetPP[2][k]->SetBranchAddress("trackSum",&trkSum_1);
jetPP[2][k]->SetBranchAddress("photonMax",&phMax_1);
jetPP[2][k]->SetBranchAddress("photonSum",&phSum_1);
jetPP[2][k]->SetBranchAddress("eMax",&eMax_1);
jetPP[2][k]->SetBranchAddress("eSum",&eSum_1);
jetPP[2][k]->SetBranchAddress("neutralMax",&neMax_1);
jetPP[2][k]->SetBranchAddress("neutralSum",&neSum_1);
jetPP[2][k]->SetBranchAddress("muMax",&muMax_1);
jetPP[2][k]->SetBranchAddress("muSum",&muSum_1);
//jetPP[2][k]->SetBranchAddress("HLT_PAZeroBiasPixel_SingleTrack_v1",&jetMB_1);
//jetPP[2][k]->SetBranchAddress("HLT_PAZeroBiasPixel_SingleTrack_v1_Prescl",&jetMB_p_1);
//jetPP[2][k]->SetBranchAddress("L1_ZeroBias",&L1_MB_1);
//jetPP[2][k]->SetBranchAddress("L1_ZeroBias_Prescl",&L1_MB_p_1);
jetPP[2][k]->SetBranchAddress("HLT_PAJet40_NoJetID_v1",&jet40_1);
jetPP[2][k]->SetBranchAddress("HLT_PAJet40_NoJetID_v1_Prescl",&jet40_p_1);
jetPP[2][k]->SetBranchAddress("HLT_PAJet60_NoJetID_v1",&jet60_1);
jetPP[2][k]->SetBranchAddress("HLT_PAJet60_NoJetID_v1_Prescl",&jet60_p_1);
jetPP[2][k]->SetBranchAddress("HLT_PAJet80_NoJetID_v1",&jet80_1);
jetPP[2][k]->SetBranchAddress("HLT_PAJet80_NoJetID_v1_Prescl",&jet80_p_1);
jetPP[2][k]->SetBranchAddress("id",&trgObj_id_1);
jetPP[2][k]->SetBranchAddress("pt",&trgObj_pt_1);
jetPP[2][k]->SetBranchAddress("eta",&trgObj_eta_1);
jetPP[2][k]->SetBranchAddress("phi",&trgObj_phi_1);
jetPP[2][k]->SetBranchAddress("mass",&trgObj_mass_1);
}//radius loop
TH1F *hEvents_HLT80 = new TH1F("hEvents_HLT80","",4,0,2);
TH1F *hEvents_HLT60 = new TH1F("hEvents_HLT60","",4,0,2);
TH1F *hEvents_HLT40 = new TH1F("hEvents_HLT40","",4,0,2);
//get all the pp spectra here:
//TCut pp3 = "jet40&&!jet60&&!jet80&&(chMax/pt)>0.01&&(TMath::Max(neMax,chMax)/TMath::Max(chSum,neSum))>=0.975";
//TNtuple *jets_ID[no_radius];
//for(int k = 0;k<no_radius;k++){
// jets_ID[k] = new TNtuple(Form("jets_R%d_ID",list_radius[k]),"","rawpt:jtpt:jet40:jet40_prescl:jet60:jet60_prescl:jet80:jet80_prescl:trgObjpt:chMax:chSum:phMax:phSum:neMax:neSum:muMax:muSum:eMax:eSum:trkMax:trkSum");
//}
//Float_t arrayValues[21];
TF1 * fResidual_0_eta_0p522 = new TF1("fResidual_0_eta_0p522","1 - [0]/pow(x,[1])");
fResidual_0_eta_0p522->SetParameter(0,0.0001950725);
fResidual_0_eta_0p522->SetParameter(1,-0.7253702207);
TF1 * fResidual_0p522_eta_1p044 = new TF1("fResidual_0p522_eta_1p044","1 - [0]/pow(x,[1])");
fResidual_0p522_eta_1p044->SetParameter(0, -0.0530616590);
fResidual_0p522_eta_1p044->SetParameter(1,0.6458308590);
TF1 * fResidual_1p044_eta_1p566 = new TF1("fResidual_1p044_eta_1p566","1 - [0]/pow(x,[1])");
fResidual_1p044_eta_1p566->SetParameter(0, -0.0361868092);
fResidual_1p044_eta_1p566->SetParameter(1, 0.3177377459);
TF1 * fResidual_1p566_eta_2p043 = new TF1("fResidual_1p566_eta_2p043","1 - [0]/pow(x,[1])");
fResidual_1p566_eta_2p043->SetParameter(0, -0.3569359074);
fResidual_1p566_eta_2p043->SetParameter(1, 0.4675646337);
Float_t effecPrescl = 9.275;
for(int k = 0;k<no_radius;k++){
if(printDebug) cout<<"Reading data for R = "<<list_radius[k]<<endl;
Long64_t nentries_jetPP = jetPP[2][k]->GetEntries();
if(printDebug) nentries_jetPP = 1000;
for(int jentry = 0;jentry<nentries_jetPP;jentry++){
jetPP[0][k]->GetEntry(jentry);
jetPP[1][k]->GetEntry(jentry);
jetPP[2][k]->GetEntry(jentry);
jetPP[3][k]->GetEntry(jentry);
jetPP[4][k]->GetEntry(jentry);
if(printDebug && jentry%100000==0)cout<<"pp data file"<<endl;
if(printDebug && jentry%100000==0)cout<<jentry<<": event = "<<evt_1<<"; run = "<<run_1<<endl;
if(pHBHENoiseFilter_1 == 0 || pPAcollisionEventSelectionPA_1==0) continue;
if(fabs(vz_1) > 15) continue;
if(jet40_1 == 0 && jet60_1 == 0 && jet80_1 == 0) continue;
if(jet80_1) hEvents_HLT80->Fill(1);
if(jet60_1 && !jet80_1) hEvents_HLT60->Fill(1,jet60_p_1);
if(jet60_1 && !jet80_1) hEvents_HLT60->Fill(0);
if(jet40_1 && !jet60_1 && !jet80_1) hEvents_HLT40->Fill(1,jet40_p_1);
if(jet40_1 && !jet60_1 && !jet80_1) hEvents_HLT40->Fill(0);
for(int j = 0;j<nbins_eta;j++){
for(int g = 0;g<nrefe_1;g++){
if(fabs(eta_1[g]) < boundaries_eta[j][0] || fabs(eta_1[g])>boundaries_eta[j][1]) continue;
if(fabs(eta_1[g]) < 0.522) pt_1[g] = pt_1[g] * fResidual_0_eta_0p522->Eval(pt_1[g]);
if(fabs(eta_1[g]) >= 0.522 && fabs(eta_1[g])< 1.044) pt_1[g] = pt_1[g] * fResidual_0p522_eta_1p044->Eval(pt_1[g]);
if(fabs(eta_1[g]) >= 1.044 && fabs(eta_1[g])< 1.566) pt_1[g] = pt_1[g] * fResidual_1p044_eta_1p566->Eval(pt_1[g]);
if(fabs(eta_1[g]) >= 1.566 && fabs(eta_1[g])< 2.043) pt_1[g] = pt_1[g] * fResidual_1p566_eta_2p043->Eval(pt_1[g]);
if(jet80_1 && trgObj_pt_1>=80){
hpp_residual_Trg80[k][j]->Fill(pt_1[g],jet80_p_1);
}
if(jet60_1==1 && trgObj_pt_1>=60 && trgObj_pt_1<80){
hpp_residual_Trg60[k][j]->Fill(pt_1[g],jet60_p_1);
}
if(jet40_1==1 && trgObj_pt_1>=40 && trgObj_pt_1<60){
hpp_residual_Trg40[k][j]->Fill(pt_1[g],jet40_p_1);
}
if(jet80_1==1){
hpp_residual_effecprescl_Trg80[k][j]->Fill(pt_1[g]);
}
if(jet60_1==1 && jet80_1==0){
hpp_residual_effecprescl_Trg60[k][j]->Fill(pt_1[g]);
}
if(jet40_1==1 && jet60_1==0 && jet80_1==0){
hpp_residual_effecprescl_Trg40[k][j]->Fill(pt_1[g],effecPrescl);
}
}// jet loop
}// eta bins
}// event loop for jet80or100
}// radius loop
// output file declaration
TDatime date;
TFile f(Form("/net/hisrv0001/home/rkunnawa/WORK/RAA/CMSSW_5_3_20/src/Output/pp_data_spectra_noJetIDCut_ak%s_%d_%d.root",jet_type,date.GetDate(),endfile),"RECREATE");
f.cd();
hEvents_HLT80->Write();
hEvents_HLT60->Write();
hEvents_HLT40->Write();
//for(int k = 0;k<no_radius;k++) jets_ID[k]->Write();
for(int k = 0;k<no_radius;k++){
for(int j = 0;j<nbins_eta;j++){
// normalize all the spectra to barns / delta pt delta eta
// hpp_Trg80[k][j]->Scale(1./(5.3*1e12*delta_eta[j]));//5.3 pico barns^-1 is the lumi of the dataset.
// hpp_Trg60[k][j]->Scale(1./(5.3*1e12*delta_eta[j]));
// hpp_Trg40[k][j]->Scale(1./(5.3*1e12*delta_eta[j]));
// divideBinWidth(hpp_Trg80[k][j]);// divide by delta pt.
// divideBinWidth(hpp_Trg60[k][j]);
// divideBinWidth(hpp_Trg40[k][j]);
hpp_residual_effecprescl_TrgComb[k][j]->Add(hpp_residual_effecprescl_Trg80[k][j]);
hpp_residual_effecprescl_TrgComb[k][j]->Add(hpp_residual_effecprescl_Trg60[k][j]);
hpp_residual_effecprescl_TrgComb[k][j]->Add(hpp_residual_effecprescl_Trg40[k][j]);
hpp_residual_effecprescl_Trg80[k][j]->Write();
if(printDebug)hpp_residual_effecprescl_Trg80[k][j]->Print();
hpp_residual_effecprescl_Trg60[k][j]->Write();
if(printDebug)hpp_residual_effecprescl_Trg60[k][j]->Print();
hpp_residual_effecprescl_Trg40[k][j]->Write();
if(printDebug)hpp_residual_effecprescl_Trg40[k][j]->Print();
hpp_residual_effecprescl_TrgComb[k][j]->Write();
if(printDebug)hpp_residual_effecprescl_TrgComb[k][j]->Print();
hpp_residual_TrgComb[k][j]->Add(hpp_residual_Trg80[k][j]);
hpp_residual_TrgComb[k][j]->Add(hpp_residual_Trg60[k][j]);
hpp_residual_TrgComb[k][j]->Add(hpp_residual_Trg40[k][j]);
hpp_residual_Trg80[k][j]->Write();
if(printDebug)hpp_residual_Trg80[k][j]->Print();
hpp_residual_Trg60[k][j]->Write();
if(printDebug)hpp_residual_Trg60[k][j]->Print();
hpp_residual_Trg40[k][j]->Write();
if(printDebug)hpp_residual_Trg40[k][j]->Print();
hpp_residual_TrgComb[k][j]->Write();
if(printDebug)hpp_residual_TrgComb[k][j]->Print();
}// eta bin loop
}// radius loop
f.Write();
f.Close();
timer.Stop();
cout<<"Macro finished: "<<endl;
cout<<"CPU time (min) = "<<(float)timer.CpuTime()/60<<endl;
cout<<"Real time (min) = "<<(float)timer.RealTime()/60<<endl;
}