1 |
pawan |
1.1 |
#include "/afs/cern.ch/user/p/pawan/scratch0/CMSSW_4_4_2/src/UserCode/HiForest/hiForest.h"
|
2 |
|
|
|
3 |
|
|
#include <TChain.h>
|
4 |
|
|
#include <TTree.h>
|
5 |
|
|
#include <TSystem.h>
|
6 |
|
|
#include <TH1.h>
|
7 |
|
|
#include <TH2.h>
|
8 |
|
|
#include <TProfile.h>
|
9 |
|
|
#include <TF1.h>
|
10 |
|
|
#include <TFile.h>
|
11 |
|
|
#include <TStyle.h>
|
12 |
|
|
#include <TStopwatch.h>
|
13 |
|
|
#include <cstdlib>
|
14 |
|
|
#include <cmath>
|
15 |
|
|
#include <iostream>
|
16 |
|
|
using namespace std;
|
17 |
|
|
|
18 |
|
|
|
19 |
|
|
#ifdef _MAKECINT_
|
20 |
|
|
//#pragma link off all globals;
|
21 |
|
|
//#pragma link off all classes;
|
22 |
|
|
//#pragma link off all functions;
|
23 |
|
|
#pragma link C++ class HiForest;
|
24 |
|
|
#pragma link C++ class Hlts;
|
25 |
|
|
#pragma link C++ class Skims;
|
26 |
|
|
#pragma link C++ class Evts;
|
27 |
|
|
#pragma link C++ class Jets;
|
28 |
|
|
#endif
|
29 |
|
|
|
30 |
|
|
const double pi=acos(-1.);
|
31 |
|
|
const double pi2=2*pi -1;
|
32 |
|
|
|
33 |
|
|
const int ncen=7;
|
34 |
|
|
const char *ccent[ncen]={"0-5%","5-10%","10-30%","30-50%","50-70%","70-90%","pp"};
|
35 |
|
|
|
36 |
|
|
//const int knj=7; //! algo 0: ic5, 1: ak3pu
|
37 |
|
|
//const char *calgo[knj]={"icPu5","akPu2PF","akPu3PF","akPu4PF","akPu2Calo","akPu3Calo","akPu4Calo"};
|
38 |
|
|
|
39 |
|
|
const int knj=3; //! algo 0: ic5, 1: ak3pu
|
40 |
|
|
const char *calgo[knj]={"akPu2PF","akPu3PF","akPu4PF"};
|
41 |
|
|
|
42 |
|
|
const int nvtx=4;
|
43 |
|
|
const int npix=5;
|
44 |
|
|
const int ketar=4;
|
45 |
|
|
const int maxruns=62;
|
46 |
|
|
|
47 |
|
|
int Run[maxruns];
|
48 |
|
|
double Lumi[maxruns];
|
49 |
|
|
|
50 |
|
|
void LoadRuns (const char */*sp*/);
|
51 |
|
|
int GetRunIdx (int /*irun*/);
|
52 |
|
|
int GetCentBin (int /*bin*/);
|
53 |
|
|
int GetVtxBin (float /*vz*/);
|
54 |
|
|
int GetPixelBin(int /*hiNpixeltracks*/);
|
55 |
|
|
int GetEtaBin (float /*eta*/);
|
56 |
|
|
|
57 |
|
|
|
58 |
|
|
class DuplicateEvents {
|
59 |
|
|
public:
|
60 |
|
|
DuplicateEvents(TString infname) {
|
61 |
|
|
inf = TFile::Open(infname);
|
62 |
|
|
t = (TTree*)inf->Get("hiEvtAnalyzer/HiTree");
|
63 |
|
|
};
|
64 |
|
|
~DuplicateEvents() {
|
65 |
|
|
delete inf;
|
66 |
|
|
}
|
67 |
|
|
void MakeList() {
|
68 |
|
|
cout << "Starting Making List to check for duplicate events" << endl;
|
69 |
|
|
evts.clear();
|
70 |
|
|
occurrence.clear();
|
71 |
|
|
int run,evt;
|
72 |
|
|
t->SetBranchAddress("run",&run);
|
73 |
|
|
t->SetBranchAddress("evt",&evt);
|
74 |
|
|
for (int i=0;i<t->GetEntries();i++) {
|
75 |
|
|
t->GetEntry(i);
|
76 |
|
|
if (i%100000==0) cout <<i<<" / "<<t->GetEntries() << " run: " << run << " evt: " << evt << endl;
|
77 |
|
|
int occur = (int)FindOccurrences(run,evt);
|
78 |
|
|
if (occur==0) occurrence.push_back(1);
|
79 |
|
|
else occurrence.push_back(2);
|
80 |
|
|
evts.push_back(std::make_pair(run,evt));
|
81 |
|
|
}
|
82 |
|
|
}
|
83 |
|
|
int FindOccurrences(int run, int evt) {
|
84 |
|
|
int noccur = count(evts.begin(), evts.end(), std::make_pair(run,evt));
|
85 |
|
|
return noccur;
|
86 |
|
|
}
|
87 |
|
|
TFile * inf;
|
88 |
|
|
TTree * t;
|
89 |
|
|
vector<pair<int, int> > evts;
|
90 |
|
|
vector<int> occurrence;
|
91 |
|
|
};
|
92 |
|
|
|
93 |
|
|
|
94 |
|
|
//! Smearing factor for only akPu's
|
95 |
|
|
/*
|
96 |
|
|
//! Reco pT Cut Centrality
|
97 |
|
|
//! pT>15 GeV 0-5% , 5-10% , 10-30% , 30-50% , 50-70% , 70-90% , pp
|
98 |
|
|
//! with new pp |vz|<15 cm with full pT hat bins and will be integrated from 80 to 400 GeV in ref pT (in withvtx dir)
|
99 |
|
|
double smearf[knj][ncen] ={{8.883 , 7.446 , 6.025 , 2.831 , 0.956 , 1.500 , 0.00}, //! akpu2pf
|
100 |
|
|
{9.905 , 8.865 , 7.354 , 4.664 , 3.163 , 0.000 , 0.00}, //! akpu3pf
|
101 |
|
|
{11.336 , 10.195 , 8.456 , 5.962 , 4.158 , 1.585 , 0.00}, //! akpu4pf
|
102 |
|
|
};
|
103 |
|
|
*/
|
104 |
|
|
|
105 |
|
|
double ptbins_smear[] = {80, 100, 120, 140, 160, 180, 200, 220, 240, 260, 280, 300, 320, 340, 360, 380, 400};
|
106 |
|
|
const int bins1 = sizeof(ptbins_smear)/sizeof(double) - 1;
|
107 |
|
|
const int smbins = bins1;
|
108 |
|
|
double smearf[knj][ncen][smbins] = {
|
109 |
|
|
{ {10.6069,9.53263,7.99496,6.47572,6.63517,6.43069,4.79561,5.52368,1.51585,4.73694,5.49985,4.34136,2.69882,3.18559,2.75011,0 }, //! 0-5% //! ak2PF
|
110 |
|
|
{9.5939,7.59408,6.41255,2.52901,0,3.03726,3.73099,5.65377,0,3.46223,0,0,2.48996,5.21187,3.39047,4.0801 }, //! 5-10%
|
111 |
|
|
{7.52046,7.09926,4.87256,5.56958,6.40448,5.15708,5.45629,3.48318,3.03069,0,5.56163,4.05211,2.18542,0.828933,4.28571,0.963933 }, //! 10-30%
|
112 |
|
|
{4.15823,4.29915,4.08619,0,4.64429,3.1441,0,2.75549,0,3.51214,1.52933,0,2.96407,2.92293,0,4.12055 }, //! 30-50%
|
113 |
|
|
{3.40076,1.91548,2.24094,4.40189,0,1.06348,3.58938,2.98547,2.11986,0,0,2.39968,0,0,1.17852,0 }, //! 50-70%
|
114 |
|
|
{3.46271,1.38165,1.47467,0,3.91275,2.09271,0,0,1.40595,0,2.66064,2.75378,1.6508,0,0,3.06773 }, //! 70-90%
|
115 |
|
|
{ 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00,0.00,0.00,0.00,0.00}}, //! pp
|
116 |
|
|
|
117 |
|
|
{ {10.0971,10.0556,11.53382,10.09026,11.04904,11.89586,11.82574,10.04593,6.36579,6.71464,6.78906,7.88803,0,7.553219,7.559386,0}, //! 0-5% //! ak3PF
|
118 |
|
|
{9.3828,8.2346,8.27719,7.70535,6.25354,7.98441,6.34697,8.95322,8.86133,0,0.097127,0.093448,0,8.376,8.87887,3.3609 }, //! 5-10%
|
119 |
|
|
{7.486,7.78749,7.84899,7.793231,7.62483,7.73366,6.93853,5.0297,3.58286,0.02722,5.53265,6.9743,0.040309,0,6.25054,0.046698 }, //! 10-30%
|
120 |
|
|
{5.15368,5.0759,5.3187,4.06908,5.98657,3.83484,3.07333,1.26228,0.50647,3.89258,3.03255,1.04565,1.07938,4.03525,0,4.13655 }, //! 30-50%
|
121 |
|
|
{3.99394,3.84754,4.03742,4.56218,4.32862,2.39101,3.83596,4.54976,0.041902,0,0,0.09433,0,2.0601,1.49476,0 }, //! 50-70%
|
122 |
|
|
{2.03394,2.01458,2.79081,0,0.026742,0.0218433,0.021867,0,0,0,0.0281399,0.00403,0.010721,0.048432,0.08341,0.04126 }, //! 70-90%
|
123 |
|
|
{ 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00,0.00,0.00,0.00,0.00}}, //! pp
|
124 |
|
|
|
125 |
|
|
{ {12.2563,11.5695,10.4316,8.80091,6.58487,7.90287,13.62099,13.63562,0.19621,3.12709,4.27031,6.8802,3.91001,3.8079,3.27438,4.06707 }, //! 0-5% //! ak4PF
|
126 |
|
|
{12.0168,9.35782,8.00736,7.29842,7.97529,6.42666,4.56315,4.51409,5.95295,1.24883,4.64867,3.70103,2.31134,6.32349,4.89873,3.1264 }, //! 5-10%
|
127 |
|
|
{9.6697,8.94999,13.88295,12.53489,12.92233,15.93666,5.38456,4.00389,4.43362,3.15875,5.23279,4.55506,4.00098,2.07628,4.37486,3.09102 }, //! 10-30%
|
128 |
|
|
{7.49541,6.63023,5.87943,4.95293,5.67788,4.70276,3.33361,3.45651,2.01514,3.88602,2.04301,2.5694,1.38983,4.30535,2.42315,3.50593 }, //! 30-50%
|
129 |
|
|
{6.22191,4.93202,5.07923,4.44174,4.10758,2.37307,3.582,4.4269,3.46693,0,3.01783,2.34337,0,1.90033,2.66977,0 }, //! 50-70%
|
130 |
|
|
{4.56134,3.35514,3.19569,0.1903,0.00174,0.06648,0.045127,0.01317,0.022475,0,0.066526,0.032671,0.082098,0,0.056494,0.098529 }, //! 70-90%
|
131 |
|
|
{ 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00,0.00,0.00,0.00,0.00}}, //! pp
|
132 |
|
|
};
|
133 |
|
|
int GetPtBinSmear(float /*pt*/);
|
134 |
|
|
|
135 |
|
|
|
136 |
|
|
|
137 |
|
|
|
138 |
|
|
TStopwatch timer;
|
139 |
|
|
void ForRaa(const char *ksp="pp")
|
140 |
|
|
{
|
141 |
|
|
|
142 |
|
|
timer.Start();
|
143 |
|
|
|
144 |
|
|
const float ketacut=2.;
|
145 |
|
|
const double kptrecocut=80.;
|
146 |
|
|
const bool iCountRuns=false;
|
147 |
|
|
|
148 |
|
|
//! Load Lib
|
149 |
|
|
gSystem->Load("/afs/cern.ch/user/p/pawan/scratch0/CMSSW_4_4_2/src/UserCode/HiForest/hiForest_h.so");
|
150 |
|
|
|
151 |
|
|
char mrun[6]={0};
|
152 |
|
|
//! Load Run numbers
|
153 |
|
|
for(int ir=0;ir<maxruns;ir++){
|
154 |
|
|
Run[ir]=-999;Lumi[ir]=-999;
|
155 |
|
|
}
|
156 |
|
|
if(!iCountRuns)LoadRuns(Form("%s",ksp));
|
157 |
|
|
|
158 |
|
|
//! pt binning
|
159 |
|
|
//! 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
160 |
|
|
//double ptbins[22] ={100.,110.,120.,130.,140.,150.,160.,170.,180.,190.,200.,220.,240.,260.,280.,300.,325.,350.,375.,400.,450.,558.,638.,828};
|
161 |
|
|
|
162 |
|
|
|
163 |
|
|
//! pt binning
|
164 |
|
|
double ptbins[] ={100, 110, 120, 130, 140, 150, 160, 170, 180, 200, 240, 300};
|
165 |
|
|
const int bins = sizeof(ptbins)/sizeof(double) - 1;
|
166 |
|
|
|
167 |
|
|
//! Define the input file and HiForest
|
168 |
|
|
//! CMSSW_4_4_2
|
169 |
|
|
|
170 |
|
|
TString inname="";
|
171 |
|
|
bool ispp=false;
|
172 |
|
|
if(strcmp(ksp,"pbpb")==0){
|
173 |
|
|
//! merged from prompt reco
|
174 |
|
|
//inname="rfio:/castor/cern.ch/user/f/frankma/forest2/HiForest-promptskim-hihighpt-hltjet80-pt90-v3_part.root";
|
175 |
|
|
inname="/d102/yjlee/hiForest2/HiForest-promptskim-hihighpt-hltjet80-pt90-v3_part.root";
|
176 |
|
|
|
177 |
|
|
}else if(strcmp(ksp,"pp")==0){
|
178 |
|
|
//! New production
|
179 |
|
|
//inname="rfio:/castor/cern.ch/user/f/frankma/forest2/HiForest-ppskim-hihighpt-pt90-v1_v3_part.root";
|
180 |
|
|
inname="/d102/yjlee/hiForest2PP/HiForest-ppskim-hihighpt-pt90-v1_v3_part.root";
|
181 |
|
|
|
182 |
|
|
ispp=true;
|
183 |
|
|
}
|
184 |
|
|
|
185 |
|
|
|
186 |
|
|
DuplicateEvents dupEvt(inname);
|
187 |
|
|
if(!ispp){
|
188 |
|
|
// Check for duplicate events only for PbPb
|
189 |
|
|
dupEvt.MakeList();
|
190 |
|
|
}
|
191 |
|
|
|
192 |
|
|
|
193 |
|
|
//! Define the input file and HiForest
|
194 |
|
|
//! CMSSW_4_4_2
|
195 |
|
|
HiForest *c = new HiForest(inname,Form("MyForest%s",ksp),ispp,0);
|
196 |
|
|
|
197 |
|
|
|
198 |
|
|
//! Output file
|
199 |
|
|
//! HIHighPt
|
200 |
|
|
TFile *fout = 0;
|
201 |
|
|
if(strcmp(ksp,"pp")==0){
|
202 |
|
|
fout = new TFile(Form("Output/HLT_Jet60_v1_ppSmearing_HiForest2_%s_pt%0.0f_2012.root",ksp,kptrecocut),"RECREATE");
|
203 |
|
|
//fout = new TFile(Form("Output/HLT_Jet60_v1_RandomCone_HiForest2_%s_pt%0.0f_2012.root",ksp,kptrecocut),"RECREATE");
|
204 |
|
|
}else{
|
205 |
|
|
fout = new TFile(Form("Output/HLT_HIJet80_v1_HiForest2_%s_pt%0.0f_2012.root",ksp,kptrecocut),"RECREATE");
|
206 |
|
|
}
|
207 |
|
|
|
208 |
|
|
std::cout<<"\t"<<std::endl;
|
209 |
|
|
std::cout<<"\t"<<std::endl;
|
210 |
|
|
std::cout<<"**************************************************** "<<std::endl;
|
211 |
|
|
std::cout<<Form("Running for %s ",ksp)<<std::endl;
|
212 |
|
|
std::cout<<Form("pT cut for %0.3f ",kptrecocut)<<std::endl;
|
213 |
|
|
std::cout<<Form("eta cut for %0.3f ",ketacut)<<std::endl;
|
214 |
|
|
std::cout<<"My hiForest Tree : " <<c->GetName()<<"\t Entries "<<c->GetEntries()<<std::endl;
|
215 |
|
|
std::cout<<"Output file "<<fout->GetName()<<std::endl;
|
216 |
|
|
std::cout<<"**************************************************** "<<std::endl;
|
217 |
|
|
std::cout<<"\t"<<std::endl;
|
218 |
|
|
std::cout<<"\t"<<std::endl;
|
219 |
|
|
|
220 |
|
|
|
221 |
|
|
//! Define event selection cut
|
222 |
|
|
|
223 |
|
|
//! Don't want to loop over trees which is not used in the analysis
|
224 |
|
|
//! event trees
|
225 |
|
|
//c->hasHltTree=0;
|
226 |
|
|
//c->hasSkimTree=0;
|
227 |
|
|
//c->hasEvtTree=0;
|
228 |
|
|
|
229 |
|
|
//! jet trees
|
230 |
|
|
c->hasIcPu5JetTree=0;
|
231 |
|
|
if(strcmp(ksp,"pp")==0){
|
232 |
|
|
c->hasAkPu2JetTree=0;
|
233 |
|
|
c->hasAkPu3JetTree=0;
|
234 |
|
|
c->hasAkPu4JetTree=0;
|
235 |
|
|
}else{
|
236 |
|
|
c->hasAk2JetTree=0;
|
237 |
|
|
c->hasAk3JetTree=0;
|
238 |
|
|
c->hasAk4JetTree=0;
|
239 |
|
|
}
|
240 |
|
|
c->hasAkPu2CaloJetTree=0;
|
241 |
|
|
c->hasAkPu3CaloJetTree=0;
|
242 |
|
|
c->hasAkPu4CaloJetTree=0;
|
243 |
|
|
|
244 |
|
|
|
245 |
|
|
//! photon tree
|
246 |
|
|
c->hasPhotonTree=0;
|
247 |
|
|
|
248 |
|
|
c->hasTrackTree=0;
|
249 |
|
|
c->hasPixTrackTree=0;
|
250 |
|
|
c->hasTowerTree=0;
|
251 |
|
|
c->hasHbheTree=0;
|
252 |
|
|
c->hasEbTree=0;
|
253 |
|
|
c->hasGenpTree=0;
|
254 |
|
|
c->hasGenParticleTree=0;
|
255 |
|
|
|
256 |
|
|
//! added by pawan
|
257 |
|
|
//! Select only the branches you want to use for the analysis
|
258 |
|
|
//! This increases the speed for running
|
259 |
|
|
|
260 |
|
|
//! For Hlt
|
261 |
|
|
c->hltTree->SetBranchStatus("*",0,0);
|
262 |
|
|
if(strcmp(ksp,"pp")==0) c->hltTree->SetBranchStatus("HLT_Jet60_v1",1,0);
|
263 |
|
|
else c->hltTree->SetBranchStatus("HLT_HIJet80_v1",1,0);
|
264 |
|
|
|
265 |
|
|
//! for Skim Tree
|
266 |
|
|
c->skimTree->SetBranchStatus("*",0,0);
|
267 |
|
|
c->skimTree->SetBranchStatus("pcollisionEventSelection",1,0);
|
268 |
|
|
c->skimTree->SetBranchStatus("pHBHENoiseFilter",1,0);
|
269 |
|
|
/*
|
270 |
|
|
if(ispp){
|
271 |
|
|
c->skimTree->SetBranchStatus("phiEcalRecHitSpikeFilter",1,0);
|
272 |
|
|
//c->skimTree->SetBranchStatus("phbheReflagNewTimeEnv",1,0);
|
273 |
|
|
//c->skimTree->SetBranchStatus("phcalTimingFilter",1,0);
|
274 |
|
|
//c->skimTree->SetBranchStatus("phfCoincFilter",1,0);
|
275 |
|
|
//c->skimTree->SetBranchStatus("ppurityFractionFilter",1,0);
|
276 |
|
|
}
|
277 |
|
|
*/
|
278 |
|
|
|
279 |
|
|
//! Evt tree
|
280 |
|
|
//c->evtTree->SetBranchStatus("*",0,0);
|
281 |
|
|
//c->evtTree->SetBranchStatus("run",1,0);
|
282 |
|
|
//c->evtTee->SetBranchStatus("lumi",1,0);
|
283 |
|
|
//c->evtTree->SetBranchStatus("hiBin",1,0);//! centrality bin
|
284 |
|
|
//c->evtTree->SetBranchStatus("hiHF",1,0);//! HF
|
285 |
|
|
//c->evtTree->SetBranchStatus("hiHFplus",1,0); //! HF plus
|
286 |
|
|
//c->evtTree->SetBranchStatus("hiHFminus",1,0);//! HF minus
|
287 |
|
|
//c->evtTree->SetBranchStatus("hiZDC",1,0);//!ZDC
|
288 |
|
|
|
289 |
|
|
if(c->hasIcPu5JetTree){
|
290 |
|
|
//! For jets icpu5
|
291 |
|
|
c->icPu5jetTree->SetBranchStatus("*",0,0);
|
292 |
|
|
c->icPu5jetTree->SetBranchStatus("nref",1,0);
|
293 |
|
|
c->icPu5jetTree->SetBranchStatus("rawpt",1,0);
|
294 |
|
|
c->icPu5jetTree->SetBranchStatus("jtpt",1,0);
|
295 |
|
|
c->icPu5jetTree->SetBranchStatus("jteta",1,0);
|
296 |
|
|
c->icPu5jetTree->SetBranchStatus("jtphi",1,0);
|
297 |
|
|
c->icPu5jetTree->SetBranchStatus("jtpu",1,0);
|
298 |
|
|
c->icPu5jetTree->SetBranchStatus("trackMax",1,0);
|
299 |
|
|
}
|
300 |
|
|
|
301 |
|
|
//
|
302 |
|
|
//
|
303 |
|
|
//
|
304 |
|
|
|
305 |
|
|
if(c->hasAk2JetTree){
|
306 |
|
|
//! For jets ak2pf
|
307 |
|
|
c->ak2jetTree->SetBranchStatus("*",0,0);
|
308 |
|
|
c->ak2jetTree->SetBranchStatus("nref",1,0);
|
309 |
|
|
c->ak2jetTree->SetBranchStatus("rawpt",1,0);
|
310 |
|
|
c->ak2jetTree->SetBranchStatus("jtpt",1,0);
|
311 |
|
|
c->ak2jetTree->SetBranchStatus("jteta",1,0);
|
312 |
|
|
c->ak2jetTree->SetBranchStatus("jtphi",1,0);
|
313 |
|
|
c->ak2jetTree->SetBranchStatus("jtpu",1,0);
|
314 |
|
|
c->ak2jetTree->SetBranchStatus("trackMax",1,0);
|
315 |
|
|
}
|
316 |
|
|
|
317 |
|
|
if(c->hasAk3JetTree){
|
318 |
|
|
//! For jets ak3pf
|
319 |
|
|
c->ak3jetTree->SetBranchStatus("*",0,0);
|
320 |
|
|
c->ak3jetTree->SetBranchStatus("nref",1,0);
|
321 |
|
|
c->ak3jetTree->SetBranchStatus("rawpt",1,0);
|
322 |
|
|
c->ak3jetTree->SetBranchStatus("jtpt",1,0);
|
323 |
|
|
c->ak3jetTree->SetBranchStatus("jteta",1,0);
|
324 |
|
|
c->ak3jetTree->SetBranchStatus("jtphi",1,0);
|
325 |
|
|
c->ak3jetTree->SetBranchStatus("jtpu",1,0);
|
326 |
|
|
c->ak3jetTree->SetBranchStatus("trackMax",1,0);
|
327 |
|
|
}
|
328 |
|
|
|
329 |
|
|
if(c->hasAk4JetTree){
|
330 |
|
|
//! For jets ak4pf
|
331 |
|
|
c->ak4jetTree->SetBranchStatus("*",0,0);
|
332 |
|
|
c->ak4jetTree->SetBranchStatus("nref",1,0);
|
333 |
|
|
c->ak4jetTree->SetBranchStatus("rawpt",1,0);
|
334 |
|
|
c->ak4jetTree->SetBranchStatus("jtpt",1,0);
|
335 |
|
|
c->ak4jetTree->SetBranchStatus("jteta",1,0);
|
336 |
|
|
c->ak4jetTree->SetBranchStatus("jtphi",1,0);
|
337 |
|
|
c->ak4jetTree->SetBranchStatus("jtpu",1,0);
|
338 |
|
|
c->ak4jetTree->SetBranchStatus("trackMax",1,0);
|
339 |
|
|
}
|
340 |
|
|
|
341 |
|
|
|
342 |
|
|
if(c->hasAkPu2JetTree){
|
343 |
|
|
//! For jets akpu2pf
|
344 |
|
|
c->akPu2jetTree->SetBranchStatus("*",0,0);
|
345 |
|
|
c->akPu2jetTree->SetBranchStatus("nref",1,0);
|
346 |
|
|
c->akPu2jetTree->SetBranchStatus("rawpt",1,0);
|
347 |
|
|
c->akPu2jetTree->SetBranchStatus("jtpt",1,0);
|
348 |
|
|
c->akPu2jetTree->SetBranchStatus("jteta",1,0);
|
349 |
|
|
c->akPu2jetTree->SetBranchStatus("jtphi",1,0);
|
350 |
|
|
c->akPu2jetTree->SetBranchStatus("jtpu",1,0);
|
351 |
|
|
c->akPu2jetTree->SetBranchStatus("trackMax",1,0);
|
352 |
|
|
}
|
353 |
|
|
|
354 |
|
|
if(c->hasAkPu3JetTree){
|
355 |
|
|
//! For jets akpu3pf
|
356 |
|
|
c->akPu3jetTree->SetBranchStatus("*",0,0);
|
357 |
|
|
c->akPu3jetTree->SetBranchStatus("nref",1,0);
|
358 |
|
|
c->akPu3jetTree->SetBranchStatus("rawpt",1,0);
|
359 |
|
|
c->akPu3jetTree->SetBranchStatus("jtpt",1,0);
|
360 |
|
|
c->akPu3jetTree->SetBranchStatus("jteta",1,0);
|
361 |
|
|
c->akPu3jetTree->SetBranchStatus("jtphi",1,0);
|
362 |
|
|
c->akPu3jetTree->SetBranchStatus("jtpu",1,0);
|
363 |
|
|
c->akPu3jetTree->SetBranchStatus("trackMax",1,0);
|
364 |
|
|
}
|
365 |
|
|
|
366 |
|
|
if(c->hasAkPu4JetTree){
|
367 |
|
|
//! For jets akpu4pf
|
368 |
|
|
c->akPu4jetTree->SetBranchStatus("*",0,0);
|
369 |
|
|
c->akPu4jetTree->SetBranchStatus("nref",1,0);
|
370 |
|
|
c->akPu4jetTree->SetBranchStatus("rawpt",1,0);
|
371 |
|
|
c->akPu4jetTree->SetBranchStatus("jtpt",1,0);
|
372 |
|
|
c->akPu4jetTree->SetBranchStatus("jteta",1,0);
|
373 |
|
|
c->akPu4jetTree->SetBranchStatus("jtphi",1,0);
|
374 |
|
|
c->akPu4jetTree->SetBranchStatus("jtpu",1,0);
|
375 |
|
|
c->akPu4jetTree->SetBranchStatus("trackMax",1,0);
|
376 |
|
|
}
|
377 |
|
|
|
378 |
|
|
|
379 |
|
|
|
380 |
|
|
if(c->hasAkPu2CaloJetTree){
|
381 |
|
|
//! For jets akpu2calo
|
382 |
|
|
c->akPu2CaloJetTree->SetBranchStatus("*",0,0);
|
383 |
|
|
c->akPu2CaloJetTree->SetBranchStatus("nref",1,0);
|
384 |
|
|
c->akPu2CaloJetTree->SetBranchStatus("rawpt",1,0);
|
385 |
|
|
c->akPu2CaloJetTree->SetBranchStatus("jtpt",1,0);
|
386 |
|
|
c->akPu2CaloJetTree->SetBranchStatus("jteta",1,0);
|
387 |
|
|
c->akPu2CaloJetTree->SetBranchStatus("jtphi",1,0);
|
388 |
|
|
c->akPu2CaloJetTree->SetBranchStatus("jtpu",1,0);
|
389 |
|
|
c->akPu2CaloJetTree->SetBranchStatus("trackMax",1,0);
|
390 |
|
|
}
|
391 |
|
|
|
392 |
|
|
if(c->hasAkPu3CaloJetTree){
|
393 |
|
|
//! For jets akpu3calo
|
394 |
|
|
c->akPu3CaloJetTree->SetBranchStatus("*",0,0);
|
395 |
|
|
c->akPu3CaloJetTree->SetBranchStatus("nref",1,0);
|
396 |
|
|
c->akPu3CaloJetTree->SetBranchStatus("rawpt",1,0);
|
397 |
|
|
c->akPu3CaloJetTree->SetBranchStatus("jtpt",1,0);
|
398 |
|
|
c->akPu3CaloJetTree->SetBranchStatus("jteta",1,0);
|
399 |
|
|
c->akPu3CaloJetTree->SetBranchStatus("jtphi",1,0);
|
400 |
|
|
c->akPu3CaloJetTree->SetBranchStatus("jtpu",1,0);
|
401 |
|
|
c->akPu3CaloJetTree->SetBranchStatus("trackMax",1,0);
|
402 |
|
|
}
|
403 |
|
|
|
404 |
|
|
if(c->hasAkPu4CaloJetTree){
|
405 |
|
|
//! For jets akpu4calo
|
406 |
|
|
c->akPu4CaloJetTree->SetBranchStatus("*",0,0);
|
407 |
|
|
c->akPu4CaloJetTree->SetBranchStatus("nref",1,0);
|
408 |
|
|
c->akPu4CaloJetTree->SetBranchStatus("rawpt",1,0);
|
409 |
|
|
c->akPu4CaloJetTree->SetBranchStatus("jtpt",1,0);
|
410 |
|
|
c->akPu4CaloJetTree->SetBranchStatus("jteta",1,0);
|
411 |
|
|
c->akPu4CaloJetTree->SetBranchStatus("jtphi",1,0);
|
412 |
|
|
c->akPu4CaloJetTree->SetBranchStatus("jtpu",1,0);
|
413 |
|
|
c->akPu4CaloJetTree->SetBranchStatus("trackMax",1,0);
|
414 |
|
|
}
|
415 |
|
|
|
416 |
|
|
std::cout<<"Loaded all tree variables "<<std::endl;
|
417 |
|
|
|
418 |
|
|
|
419 |
|
|
//! For jets
|
420 |
|
|
Jets *mJets;
|
421 |
|
|
|
422 |
|
|
int scaFac=1;
|
423 |
|
|
if(ispp)scaFac=5;
|
424 |
|
|
|
425 |
|
|
//! Define histograms here
|
426 |
|
|
TH1::SetDefaultSumw2();
|
427 |
|
|
TH2::SetDefaultSumw2();
|
428 |
|
|
TProfile::SetDefaultSumw2();
|
429 |
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////
|
430 |
|
|
TH1F *hEvt = new TH1F("hEvt","# of events ",4,0,4);
|
431 |
|
|
TH1F *hVz = new TH1F("hVz","vertex z distribution",80,-20,20);
|
432 |
|
|
TH2F *hEvtRun = new TH2F("hEvtRun","# of events in that run",maxruns,-0.5,maxruns-0.5,40,-40,40);
|
433 |
|
|
TH1F *hLumiBlock = new TH1F("hLumiBlock","Luminosity block from hlt",scaFac*1500,0,scaFac*1500);
|
434 |
|
|
TH2F *hLumiRun = new TH2F("hLumiRun","Luminosity Run-by-Run",maxruns,-0.5,maxruns-0.5,scaFac*100,0,scaFac*2000);
|
435 |
|
|
hLumiRun->GetXaxis()->SetLabelSize(0.03);
|
436 |
|
|
for(int ix=1;ix<=hLumiRun->GetNbinsX();ix++){
|
437 |
|
|
if(Run[ix-1]!=-999)sprintf(mrun,"%d",Run[ix-1]);
|
438 |
|
|
else sprintf(mrun,"%s","\0");
|
439 |
|
|
hLumiRun->GetXaxis()->SetBinLabel(ix,mrun);
|
440 |
|
|
}
|
441 |
|
|
TH2F *hHFPlusMinus = new TH2F("hHFPlusMinus","HF plus:minus",600,0,6000,600,0,6000);
|
442 |
|
|
TH1F *hHF = new TH1F("hHF","HF distribution",600,0,6000);
|
443 |
|
|
TH1F *hAvHF = new TH1F("hAvHF","HF E/hit distribution",100,0,0.1);
|
444 |
|
|
TH1F *hAvHFplus = new TH1F("hAvHFplus","HFplus E/hit distribution",100,0,0.1);
|
445 |
|
|
TH1F *hAvHFminus = new TH1F("hAvHFminus","HFminus E/hit distribution",100,0,0.2);
|
446 |
|
|
|
447 |
|
|
TH2F *hAvHFRun = new TH2F("hAvHFRun","HF E/hit distribution Run-by-Run",maxruns,-0.5,maxruns-0.5,100,0,0.1);
|
448 |
|
|
TH2F *hAvHFplusRun = new TH2F("hAvHFplusRun","HFplus E/hit distribution Run-by-Run",maxruns,-0.5,maxruns-0.5,100,0,0.1);
|
449 |
|
|
TH2F *hAvHFminusRun = new TH2F("hAvHFminusRun","HFminus E/hit distribution Run-by-Run",maxruns,-0.5,maxruns-0.5,100,0,0.2);
|
450 |
|
|
|
451 |
|
|
TH2F *hZDCPlusMinus = new TH2F("hZDCPlusMinus","ZDC plus:minus",1000,0,45000,1000,0,45000);
|
452 |
|
|
TH1F *hZDC = new TH1F("hZDC","ZDC distribution",5000,0,1e+05);
|
453 |
|
|
|
454 |
|
|
//! EE
|
455 |
|
|
TH1F *hET = new TH1F("hET","hiET",200,0,1600);
|
456 |
|
|
TH1F *hEB = new TH1F("hEB","hiEB",200,0,1200);
|
457 |
|
|
TH1F *hEE = new TH1F("hEE","hiEE",500,0,2500);
|
458 |
|
|
TH2F *hEBEE = new TH2F("hEBEE","hEBEE",200,0,1200,500,0,2500);
|
459 |
|
|
TH2F *hEEPlusMinus = new TH2F("hEEPlusMinus","hEEPlusEEMinus",200,0,1200,200,0,1200);
|
460 |
|
|
|
461 |
|
|
//! vertex
|
462 |
|
|
TH1F *hvz = new TH1F("hvz","hvz",40,-40,40);
|
463 |
|
|
hvz->Sumw2();
|
464 |
|
|
TH2F *hvxvy = new TH2F("hvxvy","vx vs vy",100,-0.2,0.2,100,-0.2,0.2);
|
465 |
|
|
TH2F *hvzrun = new TH2F("hvzrun","hvzrun",maxruns,-0.5,maxruns-0.5,40,-40,40);
|
466 |
|
|
hvzrun->Sumw2();
|
467 |
|
|
|
468 |
|
|
//! Pixel
|
469 |
|
|
TH1F *hNpix = new TH1F("hNpix","hiNpix",500,0,80000);
|
470 |
|
|
TH1F *hNpixelTracks = new TH1F("hNpixelTracks","hiNpixelTracks",200,0,3000);
|
471 |
|
|
TH1F *hNTracks = new TH1F("hNTracks","hiNTracks",100,0,1500);
|
472 |
|
|
TH2F *hNpixelTracksNTracks = new TH2F("hNpixelTracksNTracks","hNpixelTracksNTracks",500,0,15000,100,0,1500);
|
473 |
|
|
|
474 |
|
|
//! Cross correlations
|
475 |
|
|
TH2F *hHFZDC = new TH2F("hHFZDC","hHFZDC",600,0,6000,1000,0,1e+05);
|
476 |
|
|
TH2F *hNpixelTracksZDC = new TH2F("hNpixelTracksZDC","hNpixelTracksZDC",200,0,3000,1000,0,1e+05);
|
477 |
|
|
TH2F *hHFNpixelTracks = new TH2F("hHFNpixelTracks","hHFNpixelTracks",600,0,6000,200,0,3000);
|
478 |
|
|
|
479 |
|
|
TH1F *hBin = new TH1F("hBin","Centrality bin",40,-0.5,39.5);
|
480 |
|
|
|
481 |
|
|
TH1F *hHF_tr[knj];
|
482 |
|
|
TH1F *hTotJets[knj];
|
483 |
|
|
|
484 |
|
|
TH2F *hJetPtRun[knj];
|
485 |
|
|
TH2F *hJetPURun[knj];
|
486 |
|
|
TH2F *hMBJetsRun[knj];
|
487 |
|
|
TH2F *hTotJetsRun[knj];
|
488 |
|
|
|
489 |
|
|
//! mb
|
490 |
|
|
TH1F *hjetrptmb[knj], *hjetjptmb[knj], *hjetjpumb[knj];
|
491 |
|
|
TH1F *hjetetamb[knj], *hjetphimb[knj];
|
492 |
|
|
TH2F *hjetptetamb[knj], *hjetptphimb[knj], *hjetetaphimb[knj];
|
493 |
|
|
TH2F *hjetptpumb[knj];
|
494 |
|
|
|
495 |
|
|
//! vetex bin
|
496 |
|
|
TH1F *hjetrptvz[knj][nvtx], *hjetjptvz[knj][nvtx], *hjetjpuvz[knj][nvtx];
|
497 |
|
|
TH1F *hjetetavz[knj][nvtx], *hjetphivz[knj][nvtx];
|
498 |
|
|
TH2F *hjetptetavz[knj][nvtx], *hjetptphivz[knj][nvtx], *hjetetaphivz[knj][nvtx];
|
499 |
|
|
TH2F *hjetptpuvz[knj][nvtx];
|
500 |
|
|
|
501 |
|
|
//! pixel bin
|
502 |
|
|
TH1F *hjetrpt_pix[knj][npix], *hjetjpt_pix[knj][npix], *hjetjpu_pix[knj][npix];
|
503 |
|
|
TH1F *hjeteta_pix[knj][npix], *hjetphi_pix[knj][npix];
|
504 |
|
|
TH2F *hjetpteta_pix[knj][npix], *hjetptphi_pix[knj][npix], *hjetetaphi_pix[knj][npix];
|
505 |
|
|
TH2F *hjetptpu_pix[knj][npix];
|
506 |
|
|
|
507 |
|
|
//! ncen bin
|
508 |
|
|
TH1F *hfrpt[knj][ncen], *hfjpt[knj][ncen], *hfpupt[knj][ncen];
|
509 |
|
|
|
510 |
|
|
TH1F *hjetrpt [knj][ncen], *hjetjpt[knj][ncen], *hjetjpu[knj][ncen], *hjetspt[knj][ncen];
|
511 |
|
|
TH1F *hjeteta [knj][ncen], *hjetphi[knj][ncen];
|
512 |
|
|
TH2F *hjetpteta[knj][ncen], *hjetptphi[knj][ncen], *hjetetaphi[knj][ncen];
|
513 |
|
|
TH2F *hjetptpu[knj][ncen];
|
514 |
|
|
|
515 |
|
|
//! eta dependence
|
516 |
|
|
TH1F *hjetrptmb_etab[knj][ketar];
|
517 |
|
|
TH1F *hjetjptmb_etab[knj][ketar];
|
518 |
|
|
TH1F *hjetjpumb_etab[knj][ketar];
|
519 |
|
|
TH2F *hjetptpumb_etab[knj][ketar];
|
520 |
|
|
TH1F *hNevtmb_etab[knj];
|
521 |
|
|
|
522 |
|
|
TH1F *hjetrptpix_etab[knj][npix][ketar];
|
523 |
|
|
TH1F *hjetjptpix_etab[knj][npix][ketar];
|
524 |
|
|
TH1F *hjetjpupix_etab[knj][npix][ketar];
|
525 |
|
|
TH2F *hjetptpupix_etab[knj][npix][ketar];
|
526 |
|
|
TH1F *hNevtpix_etab[knj][npix];
|
527 |
|
|
|
528 |
|
|
TH1F *hjetrpt_etab[knj][ncen][ketar];
|
529 |
|
|
TH1F *hjetjpt_etab[knj][ncen][ketar];
|
530 |
|
|
TH1F *hjetjpu_etab[knj][ncen][ketar];
|
531 |
|
|
TH2F *hjetptpu_etab[knj][ncen][ketar];
|
532 |
|
|
TH1F *hNevt_etab[knj][ncen];
|
533 |
|
|
|
534 |
|
|
TH1F *hNref[knj];
|
535 |
|
|
TH1F *hNjets[knj][ncen], *hNjets_dist[knj][ncen];
|
536 |
|
|
TH1F *hMBJets[knj];
|
537 |
|
|
|
538 |
|
|
TH1F *hNevt [knj][ncen];
|
539 |
|
|
TH1F *hNevtvz [knj][nvtx];
|
540 |
|
|
TH1F *hNevtpix [knj][npix];
|
541 |
|
|
TH1F *hNevt_notr [knj][ncen];
|
542 |
|
|
|
543 |
|
|
|
544 |
|
|
for(int nj=0;nj<knj;nj++){
|
545 |
|
|
//std::cout<<Form("Histograms for algo %s",calgo[nj])<<std::endl;
|
546 |
|
|
|
547 |
|
|
//! Define the histograms for jets
|
548 |
|
|
hTotJets[nj] = new TH1F(Form("hTotJets%d",nj),Form("# of jets w/o cuts with %s",calgo[nj]),4,0,4);
|
549 |
|
|
hMBJets[nj] = new TH1F(Form("hMBJets%d",nj),Form("MB distribution of jets in %s",calgo[nj]),50,0,50);
|
550 |
|
|
|
551 |
|
|
hMBJetsRun[nj] = new TH2F(Form("hMBJetsRun%d",nj),Form("MB distribution of jets run-by-run in %s",calgo[nj]),maxruns,-0.5,maxruns-0.5,20,0,20);
|
552 |
|
|
hMBJetsRun[nj]->GetXaxis()->SetLabelSize(0.03);
|
553 |
|
|
|
554 |
|
|
//! for jet pt
|
555 |
|
|
hJetPtRun[nj] = new TH2F(Form("hJetPtRun%d",nj),Form("Jet pt run-by-run in %s",calgo[nj]),maxruns,-0.5,maxruns-0.5,100,0,300);
|
556 |
|
|
|
557 |
|
|
//! for jet pile up
|
558 |
|
|
hJetPURun[nj] = new TH2F(Form("hJetPURun%d",nj),Form("Jet pile up run-by-run in %s",calgo[nj]),maxruns,-0.5,maxruns-0.5,100,0,300);
|
559 |
|
|
|
560 |
|
|
hTotJetsRun[nj] = new TH2F(Form("hTotJetsRun%d",nj),Form("Total jets run-by-run in %s",calgo[nj]),maxruns,-0.5,maxruns-0.5,500,0,10000);
|
561 |
|
|
hTotJetsRun[nj]->GetXaxis()->SetLabelSize(0.03);
|
562 |
|
|
|
563 |
|
|
for(int ix=1;ix<=hMBJetsRun[nj]->GetNbinsX();ix++){
|
564 |
|
|
if(Run[ix-1]!=-999)sprintf(mrun,"%d",Run[ix-1]);
|
565 |
|
|
else sprintf(mrun,"%s","\0");
|
566 |
|
|
|
567 |
|
|
hMBJetsRun[nj]->GetXaxis()->SetBinLabel(ix,mrun);
|
568 |
|
|
hJetPtRun [nj]->GetXaxis()->SetBinLabel(ix,mrun);
|
569 |
|
|
hJetPURun [nj]->GetXaxis()->SetBinLabel(ix,mrun);
|
570 |
|
|
hTotJetsRun[nj]->GetXaxis()->SetBinLabel(ix,mrun);
|
571 |
|
|
}
|
572 |
|
|
|
573 |
|
|
hNref[nj] = new TH1F(Form("hNRef%d",nj),Form("# of jets in %s",calgo[nj]),40,0,100);
|
574 |
|
|
hHF_tr[nj] = new TH1F(Form("hHF_tr%d",nj),Form("HF triggered events (Jet p_{T} > 85 GeV/c distribution) %s",calgo[nj]),600,0,6000);
|
575 |
|
|
|
576 |
|
|
hjetetamb[nj] = new TH1F(Form("hjetetamb%d",nj),Form("jet eta distribution jet %s",calgo[nj]),18,-3.0,3.0);
|
577 |
|
|
hjetphimb[nj] = new TH1F(Form("hjetphimb%d",nj),Form("jet phi distribution jet %s",calgo[nj]),18,-pi,pi);
|
578 |
|
|
hjetrptmb[nj] = new TH1F(Form("hjetrptmb%d",nj),Form("jet(raw pt) p_{T} distribution jet %s",calgo[nj]),bins,ptbins);
|
579 |
|
|
hjetjptmb[nj] = new TH1F(Form("hjetjptmb%d",nj),Form("jet(jt pt) p_{T} distribution jet %s",calgo[nj]),bins,ptbins);
|
580 |
|
|
hjetjpumb[nj] = new TH1F(Form("hjetjpumb%d",nj),Form("jet(j pu) p_{T} distribution jet %s",calgo[nj]),100,0,300);
|
581 |
|
|
hjetptpumb[nj] = new TH2F(Form("hjetptpumb%d",nj),Form("jet(pt:pu) distribution jet %s",calgo[nj]),bins,ptbins,100,0,300);
|
582 |
|
|
|
583 |
|
|
hjetetaphimb[nj] = new TH2F(Form("hjetetaphimb%d",nj),Form("jet eta-phi distribution jet mb %s",calgo[nj]),36,-3.0,3.0,36,-pi,pi);
|
584 |
|
|
hjetptetamb[nj] = new TH2F(Form("hjetptetamb%d",nj),Form("jet pt-eta distribution jet mb %s",calgo[nj]),bins,ptbins,36,-3.0,3.0);
|
585 |
|
|
hjetptphimb[nj] = new TH2F(Form("hjetptphimb%d",nj),Form("jet pt-phi distribution jet mb %s",calgo[nj]),bins,ptbins,36,-pi,pi);
|
586 |
|
|
|
587 |
|
|
hNevtmb_etab[nj] = new TH1F(Form("hNevtmb_etab%d",nj),Form("# of events mb jet %s",calgo[nj]),40,-40,40);
|
588 |
|
|
for(int ie=0;ie<ketar;ie++){
|
589 |
|
|
hjetrptmb_etab[nj][ie] = new TH1F(Form("hjetrptmb_etab%d_%d",nj,ie),Form("jet(raw pt) p_{T} distribution jet %s etabin %d",calgo[nj],ie),bins,ptbins);
|
590 |
|
|
hjetjptmb_etab[nj][ie] = new TH1F(Form("hjetjptmb_etab%d_%d",nj,ie),Form("jet(jt pt) p_{T} distribution jet %s etabin %d",calgo[nj],ie),bins,ptbins);
|
591 |
|
|
hjetjpumb_etab[nj][ie] = new TH1F(Form("hjetjpumb_etab%d_%d",nj,ie),Form("jet(j pu) p_{T} distribution jet %s etabin %d",calgo[nj],ie),100,0,300);
|
592 |
|
|
hjetptpumb_etab[nj][ie] = new TH2F(Form("hjetptpumb_etab%d_%d",nj,ie),Form("jet(pt:pu) distribution jet %s etabin %d",calgo[nj],ie),bins,ptbins,100,0,300);
|
593 |
|
|
}
|
594 |
|
|
|
595 |
|
|
for(int ip=0;ip<npix;ip++){
|
596 |
|
|
hjeteta_pix[nj][ip] = new TH1F(Form("hjeteta_pix%d_%d",nj,ip),Form("jet eta distribution jet pix %d %s",ip,calgo[nj]),18,-3.0,3.0);
|
597 |
|
|
hjetphi_pix[nj][ip] = new TH1F(Form("hjetphi_pix%d_%d",nj,ip),Form("jet phi distribution jet pix %d %s",ip,calgo[nj]),18,-pi,pi);
|
598 |
|
|
hjetrpt_pix[nj][ip] = new TH1F(Form("hjetrpt_pix%d_%d",nj,ip),Form("jet(raw pt) p_{T} distribution jet pix %d %s",ip,calgo[nj]),bins,ptbins);
|
599 |
|
|
hjetjpt_pix[nj][ip] = new TH1F(Form("hjetjpt_pix%d_%d",nj,ip),Form("jet(jt pt) p_{T} distribution jet vz pix %d %s",ip,calgo[nj]),bins,ptbins);
|
600 |
|
|
hjetjpu_pix[nj][ip] = new TH1F(Form("hjetjpu_pix%d_%d",nj,ip),Form("jet(pu) p_{T} distribution jet vz pix %d %s",ip,calgo[nj]),100,0,300);
|
601 |
|
|
hjetptpu_pix[nj][ip] = new TH2F(Form("hjetptpu_pix%d_%d",nj,ip),Form("jet(pt:pu) distribution jet pix %d %s",ip,calgo[nj]),bins,ptbins,100,0,300);
|
602 |
|
|
|
603 |
|
|
hjetetaphi_pix[nj][ip] = new TH2F(Form("hjetetaphi_pix%d_%d",nj,ip),Form("jet eta-phi distribution jet pix %d %s",ip,calgo[nj]),36,-3.0,3.0,36,-pi,pi);
|
604 |
|
|
hjetpteta_pix [nj][ip] = new TH2F(Form("hjetpteta_pix%d_%d",nj,ip),Form("jet pt-eta distribution jet pix %d %s",ip,calgo[nj]),bins,ptbins,18,-3.0,3.0);
|
605 |
|
|
hjetptphi_pix [nj][ip] = new TH2F(Form("hjetptphi_pix%d_%d",nj,ip),Form("jet pt-phi distribution jet pix %d %s",ip,calgo[nj]),bins,ptbins,18,-pi,pi);
|
606 |
|
|
|
607 |
|
|
hNevtpix[nj][ip] = new TH1F(Form("hNevtpix%d_%d",nj,ip),Form("# of events cent pix %d %s",ip,calgo[nj]),40,-40,40);
|
608 |
|
|
|
609 |
|
|
hNevtpix_etab[nj][ip] = new TH1F(Form("hNevtpix_etab%d_%d",nj,ip),Form("# of events cent pix %d jet %s",ip,calgo[nj]),40,-40,40);
|
610 |
|
|
for(int ie=0;ie<ketar;ie++){
|
611 |
|
|
hjetrptpix_etab[nj][ip][ie] = new TH1F(Form("hjetrptpix_etab%d_%d_%d",nj,ip,ie),Form("jet(raw pt) p_{T} distribution pix %d jet %s etabin %d",ip,calgo[nj],ie),bins,ptbins);
|
612 |
|
|
hjetjptpix_etab[nj][ip][ie] = new TH1F(Form("hjetjptpix_etab%d_%d_%d",nj,ip,ie),Form("jet(jt pt) p_{T} distribution pix %d jet %s etabin %d",ip,calgo[nj],ie),bins,ptbins);
|
613 |
|
|
hjetjpupix_etab[nj][ip][ie] = new TH1F(Form("hjetjpupix_etab%d_%d_%d",nj,ip,ie),Form("jet(pu) p_{T} distribution pix %d jet %s etabin %d",ip,calgo[nj],ie),100,0,300);
|
614 |
|
|
hjetptpupix_etab[nj][ip][ie] = new TH2F(Form("hjetptpupix_etab%d_%d_%d",nj,ip,ie),Form("jet(pt:pu) distribution pix %d jet %s etabin %d",ip,calgo[nj],ie),bins,ptbins,100,0,300);
|
615 |
|
|
}
|
616 |
|
|
}
|
617 |
|
|
|
618 |
|
|
for(int iv=0;iv<nvtx;iv++){
|
619 |
|
|
hNevtvz[nj][iv] = new TH1F(Form("hNevtvz%d_%d",nj,iv),Form("# of events cent vz %d %s",iv,calgo[nj]),40,-40,40);
|
620 |
|
|
hjetetavz[nj][iv] = new TH1F(Form("hjetetavz%d_%d",nj,iv),Form("jet eta distribution jet vz %s",calgo[nj]),18,-3.0,3.0);
|
621 |
|
|
hjetphivz[nj][iv] = new TH1F(Form("hjetphivz%d_%d",nj,iv),Form("jet phi distribution jet vz %s",calgo[nj]),18,-pi,pi);
|
622 |
|
|
hjetrptvz[nj][iv] = new TH1F(Form("hjetrptvz%d_%d",nj,iv),Form("jet(raw pt) p_{T} distribution jet vz %s",calgo[nj]),bins,ptbins);
|
623 |
|
|
hjetjptvz[nj][iv] = new TH1F(Form("hjetjptvz%d_%d",nj,iv),Form("jet(jt pt) p_{T} distribution jet vz %s",calgo[nj]),bins,ptbins);
|
624 |
|
|
hjetjpuvz[nj][iv] = new TH1F(Form("hjetjpuvz%d_%d",nj,iv),Form("jet(pu) p_{T} distribution jet vz %s",calgo[nj]),100,0,300);
|
625 |
|
|
hjetptpuvz[nj][iv] = new TH2F(Form("hjetptpuvz%d_%d",nj,iv),Form("jet(pt:pu) distribution jet vz %s",calgo[nj]),bins,ptbins,100,0,300);
|
626 |
|
|
|
627 |
|
|
hjetetaphivz[nj][iv] = new TH2F(Form("hjetetaphivz%d_%d",nj,iv),Form("jet eta-phi distribution jet vz %s",calgo[nj]),36,-3.0,3.0,36,-pi,pi);
|
628 |
|
|
hjetptetavz[nj][iv] = new TH2F(Form("hjetptetavz%d_%d",nj,iv),Form("jet pt-eta distribution jet vz %s",calgo[nj]),bins,ptbins,18,-3.0,3.0);
|
629 |
|
|
hjetptphivz[nj][iv] = new TH2F(Form("hjetptphivz%d_%d",nj,iv),Form("jet pt-phi distribution jet vz %s",calgo[nj]),bins,ptbins,18,-pi,pi);
|
630 |
|
|
}
|
631 |
|
|
|
632 |
|
|
for(int icen=0;icen<ncen;icen++){
|
633 |
|
|
hjeteta[nj][icen] = new TH1F(Form("hjeteta%d_%d",nj,icen),Form("jet eta distribution jet centb %d %s",icen,calgo[nj]),18,-3.0,3.0);
|
634 |
|
|
hjetphi[nj][icen] = new TH1F(Form("hjetphi%d_%d",nj,icen),Form("jet phi distribution jet centb %d %s",icen,calgo[nj]),18,-pi,pi);
|
635 |
|
|
|
636 |
|
|
hfrpt[nj][icen] = new TH1F(Form("hfrpt%d_%d",nj,icen),Form("jet(raw pt) p_{T} distribution jet centb %d %s",icen,calgo[nj]),500,0.,1000);
|
637 |
|
|
hfjpt[nj][icen] = new TH1F(Form("hfjpt%d_%d",nj,icen),Form("jet(corrected pt) p_{T} distribution jet centb %d %s",icen,calgo[nj]),500,0.,1000);
|
638 |
|
|
hfpupt[nj][icen] = new TH1F(Form("hfpupt%d_%d",nj,icen),Form("jet(pilup pt) p_{T} distribution jet centb %d %s",icen,calgo[nj]),250,0.,100);
|
639 |
|
|
|
640 |
|
|
hjetrpt[nj][icen] = new TH1F(Form("hjetrpt%d_%d",nj,icen),Form("jet(raw pt) p_{T} distribution jet centb %d %s",icen,calgo[nj]),bins,ptbins);
|
641 |
|
|
hjetjpt[nj][icen] = new TH1F(Form("hjetjpt%d_%d",nj,icen),Form("jet(jt pt) p_{T} distribution jet centb %d %s",icen,calgo[nj]),bins,ptbins);
|
642 |
|
|
hjetspt[nj][icen] = new TH1F(Form("hjetspt%d_%d",nj,icen),Form("jet(smeared pt) p_{T} distribution jet centb %d %s",icen,calgo[nj]),bins,ptbins);
|
643 |
|
|
hjetjpu[nj][icen] = new TH1F(Form("hjetjpu%d_%d",nj,icen),Form("jet(pu) p_{T} distribution jet centb %d %s",icen,calgo[nj]),100,0,300);
|
644 |
|
|
hjetptpu[nj][icen] = new TH2F(Form("hjetptpu%d_%d",nj,icen),Form("jet(pt:pu) distribution jet centb %d %s",icen,calgo[nj]),bins,ptbins,100,0,300);
|
645 |
|
|
|
646 |
|
|
hjetetaphi[nj][icen] = new TH2F(Form("hjetetaphi%d_%d",nj,icen),Form("jet eta-phi distribution jet centb %d %s",icen,calgo[nj]),18,-3.0,3.0,18,-pi,pi);
|
647 |
|
|
hjetpteta[nj][icen] = new TH2F(Form("hjetpteta%d_%d",nj,icen),Form("jet pt-eta distribution jet centb %d %s",icen,calgo[nj]),bins,ptbins,18,-3.0,3.0);
|
648 |
|
|
hjetptphi[nj][icen] = new TH2F(Form("hjetptphi%d_%d",nj,icen),Form("jet pt-phi distribution jet centb %d %s",icen,calgo[nj]),bins,ptbins,18,-pi,pi);
|
649 |
|
|
|
650 |
|
|
hNevt_etab[nj][icen] = new TH1F(Form("hNevt_etab%d_%d",nj,icen),Form("# of events cent %d jet %s",icen,calgo[nj]),40,-40,40);
|
651 |
|
|
for(int ie=0;ie<ketar;ie++){
|
652 |
|
|
hjetrpt_etab[nj][icen][ie] = new TH1F(Form("hjetrpt_etab%d_%d_%d",nj,icen,ie),Form("jet(raw pt) p_{T} distribution centb %d jet %s etabin %d",icen,calgo[nj],ie),bins,ptbins);
|
653 |
|
|
hjetjpt_etab[nj][icen][ie] = new TH1F(Form("hjetjpt_etab%d_%d_%d",nj,icen,ie),Form("jet(jt pt) p_{T} distribution centb %d jet %s etabin %d",icen,calgo[nj],ie),bins,ptbins);
|
654 |
|
|
hjetjpu_etab[nj][icen][ie] = new TH1F(Form("hjetjpu_etab%d_%d_%d",nj,icen,ie),Form("jet(pu) p_{T} distribution centb %d jet %s etabin %d",icen,calgo[nj],ie),100,0,300);
|
655 |
|
|
hjetptpu_etab[nj][icen][ie] = new TH2F(Form("hjetptpu_etab%d_%d_%d",nj,icen,ie),Form("jet(pt:pu) distribution centb %d jet %s etabin %d",icen,calgo[nj],ie),bins,ptbins,100,0,300);
|
656 |
|
|
}
|
657 |
|
|
|
658 |
|
|
hNevt[nj][icen] = new TH1F(Form("hNevt%d_%d",nj,icen),Form("# of events cent %d %s",icen,calgo[nj]),40,-40,40);
|
659 |
|
|
|
660 |
|
|
hNevt_notr[nj][icen] = new TH1F(Form("hNevt_notr%d_%d",nj,icen),Form("# of events w/o trigger conditioncent %d %d",nj,icen),40,-40,40);
|
661 |
|
|
|
662 |
|
|
hNjets[nj][icen] = new TH1F(Form("hNjets%d_%d",nj,icen),Form("# of cent %d jets %s",icen,calgo[nj]),3,0.0,3.0);
|
663 |
|
|
|
664 |
|
|
hNjets_dist[nj][icen] = new TH1F(Form("hNjets_dist%d_%d",nj,icen),Form("distribution jets in cent %d %s",icen,calgo[nj]),100,0,100);
|
665 |
|
|
}
|
666 |
|
|
//std::cout<<Form("Initialized the histograms %s",calgo[nj]) <<std::endl;
|
667 |
|
|
std::cout<<"\t"<<std::endl;
|
668 |
|
|
}
|
669 |
|
|
/////////////////////////////////////////////////////////////////////////////////////////
|
670 |
|
|
|
671 |
|
|
/* for getting number of runs and runnumbers */
|
672 |
|
|
int runc=0;
|
673 |
|
|
int newrun=0;
|
674 |
|
|
int oldrun=-1;
|
675 |
|
|
int kstat[maxruns]={0};
|
676 |
|
|
|
677 |
|
|
|
678 |
|
|
float njets[knj][ncen];
|
679 |
|
|
float nmbj[knj];
|
680 |
|
|
float sumjpt[knj];
|
681 |
|
|
float sumjpu[knj];
|
682 |
|
|
int istat[knj];
|
683 |
|
|
int stat_etab[knj];
|
684 |
|
|
|
685 |
|
|
double totjetpt[knj][maxruns];
|
686 |
|
|
double totjets [knj][maxruns];
|
687 |
|
|
|
688 |
|
|
for(int nj=0;nj<knj;nj++){
|
689 |
|
|
for(int ir=0;ir<maxruns;ir++){
|
690 |
|
|
totjetpt[nj][ir]=0;
|
691 |
|
|
totjets[nj][ir]=0;
|
692 |
|
|
}
|
693 |
|
|
}
|
694 |
|
|
|
695 |
|
|
|
696 |
|
|
Long64_t nb = 0;
|
697 |
|
|
Long64_t nentries = c->GetEntries();
|
698 |
|
|
std::cout<<Form("# of entries in TTree for %s : ",ksp)<<nentries<<std::endl;
|
699 |
|
|
hEvt->Fill(2,nentries);
|
700 |
|
|
|
701 |
|
|
for (Long64_t ievt=0; ievt<nentries;ievt++) {//! event loop
|
702 |
|
|
//for (Long64_t ievt=0; ievt<200;ievt++) {//! event loop
|
703 |
|
|
//! load the hiForest event
|
704 |
|
|
nb += c->GetEntry(ievt);
|
705 |
|
|
|
706 |
|
|
//! Remove duplicate events
|
707 |
|
|
if(!ispp && dupEvt.occurrence[ievt]==2)continue;
|
708 |
|
|
|
709 |
|
|
|
710 |
|
|
|
711 |
|
|
//! select good events
|
712 |
|
|
bool goodEvent = false;
|
713 |
|
|
if(ispp){
|
714 |
|
|
goodEvent = c->skim.pcollisionEventSelection && c->skim.pHBHENoiseFilter && c->hlt.HLT_Jet60_v1 && fabs(c->evt.vz)<15.;
|
715 |
|
|
}else{
|
716 |
|
|
goodEvent = c->skim.pcollisionEventSelection && c->skim.pHBHENoiseFilter && c->hlt.HLT_HIJet80_v1 && fabs(c->evt.vz)<15.; ///! this one to use
|
717 |
|
|
}
|
718 |
|
|
if(!goodEvent)continue;
|
719 |
|
|
|
720 |
|
|
//! Event variables
|
721 |
|
|
int RunNo=-999, EvtNo=-999, hiBin=-999, LumiBlock=-999, hiNpix =-999, hiNpixelTracks=-999,hiNtracks=-999;
|
722 |
|
|
float vx=-999,vy=-999,vz=-999, hiHF=-999,hiHFplus=-999,hiHFminus=-999,hiHFhit=-999,hiHFhitplus=-999,
|
723 |
|
|
hiHFhitminus=-999,hiZDC=-999,hiZDCplus=-999,hiZDCminus=-999;
|
724 |
|
|
float hiET=-999,hiEE=-999,hiEB=-999,hiEEplus=-999,hiEEminus=-999;
|
725 |
|
|
|
726 |
|
|
|
727 |
|
|
RunNo = c->evt.run;
|
728 |
|
|
EvtNo = c->evt.evt;
|
729 |
|
|
hiBin = c->evt.hiBin;
|
730 |
|
|
LumiBlock = c->evt.lumi;
|
731 |
|
|
hiNpix = c->evt.hiNpix;
|
732 |
|
|
hiNpixelTracks = c->evt.hiNpixelTracks;
|
733 |
|
|
hiNtracks = c->evt.hiNtracks;
|
734 |
|
|
|
735 |
|
|
vx = c->evt.vx;
|
736 |
|
|
vy = c->evt.vy;
|
737 |
|
|
vz = c->evt.vz;
|
738 |
|
|
hiHF = c->evt.hiHF;
|
739 |
|
|
hiHFplus = c->evt.hiHFplus;
|
740 |
|
|
hiHFminus = c->evt.hiHFminus;
|
741 |
|
|
hiHFhit = c->evt.hiHFhit;
|
742 |
|
|
hiHFhitplus = c->evt.hiHFhitPlus;
|
743 |
|
|
hiHFhitminus = c->evt.hiHFhitMinus;
|
744 |
|
|
hiZDC = c->evt.hiZDC;
|
745 |
|
|
hiZDCplus = c->evt.hiZDCplus;
|
746 |
|
|
hiZDCminus = c->evt.hiZDCminus;
|
747 |
|
|
hiET = c->evt.hiET;
|
748 |
|
|
hiEE = c->evt.hiEE;
|
749 |
|
|
hiEB = c->evt.hiEB;
|
750 |
|
|
hiEEplus = c->evt.hiEEplus;
|
751 |
|
|
hiEEminus = c->evt.hiEEminus;
|
752 |
|
|
|
753 |
|
|
|
754 |
|
|
|
755 |
|
|
int RunId=0;
|
756 |
|
|
/* For getting the number of runs and runnumbers */
|
757 |
|
|
if(iCountRuns){
|
758 |
|
|
newrun=RunNo;
|
759 |
|
|
if(newrun!=oldrun){
|
760 |
|
|
bool mstat=true;
|
761 |
|
|
for(int ir=0;ir<runc;ir++){
|
762 |
|
|
if(kstat[ir]==newrun)mstat=false;
|
763 |
|
|
}
|
764 |
|
|
if(mstat){
|
765 |
|
|
oldrun=newrun;
|
766 |
|
|
kstat[runc]=newrun;
|
767 |
|
|
runc++;
|
768 |
|
|
std::cout<<"Run # : " <<newrun<<"\t # of runs : "<<runc<<std::endl;
|
769 |
|
|
}
|
770 |
|
|
}
|
771 |
|
|
}else{
|
772 |
|
|
RunId = GetRunIdx(RunNo);
|
773 |
|
|
if(RunId<0){
|
774 |
|
|
std::cout<<"Something is wrong with the LoadRuns, Current Run number not listed "<<std::endl;
|
775 |
|
|
exit(0);
|
776 |
|
|
}
|
777 |
|
|
}
|
778 |
|
|
|
779 |
|
|
//! Centrality bin
|
780 |
|
|
//! 5 or 7 bins
|
781 |
|
|
int centb=-1;
|
782 |
|
|
if(ispp) centb=ncen-1; //pp
|
783 |
|
|
else{ //! PbPb
|
784 |
|
|
centb=GetCentBin(hiBin);
|
785 |
|
|
}
|
786 |
|
|
|
787 |
|
|
if(centb<0 || centb>=ncen)continue;
|
788 |
|
|
|
789 |
|
|
//! Vertex z bin
|
790 |
|
|
//! Only two bins v<0 : 0 and vz>0 : 1
|
791 |
|
|
int vbin = GetVtxBin(vz);
|
792 |
|
|
//if(vbin<0)continue;
|
793 |
|
|
|
794 |
|
|
//! hiPixelTracks bins
|
795 |
|
|
//! 5 bins
|
796 |
|
|
int ipix = GetPixelBin(hiNpixelTracks);
|
797 |
|
|
//if(ipix<0)continue;
|
798 |
|
|
|
799 |
|
|
if(ievt%10000==0 && !iCountRuns)std::cout<<" ********** Event # " <<ievt<<"\t Run : "<<RunNo<<"\t HF : "<<hiHF<<std::endl;
|
800 |
|
|
//std::cout<<" ********** Event # " <<ievt<<"\t Run : "<<RunNo<<"\t HF : "<<hiHF<<std::endl;
|
801 |
|
|
|
802 |
|
|
//! Jet Algo loop starts here
|
803 |
|
|
//! nj : 0 (icpu5calo) and 1 (akpu3pf)
|
804 |
|
|
for(int nj=0;nj<knj;nj++){
|
805 |
|
|
|
806 |
|
|
//! Initialization
|
807 |
|
|
nmbj[nj]=0;
|
808 |
|
|
sumjpt[nj]=0;
|
809 |
|
|
sumjpu[nj]=0;
|
810 |
|
|
istat[nj]=0;
|
811 |
|
|
stat_etab[nj]=0;
|
812 |
|
|
for(int icen=0;icen<ncen;icen++){
|
813 |
|
|
njets[nj][icen]=0;
|
814 |
|
|
}
|
815 |
|
|
|
816 |
|
|
//! assign the jets for PbPb
|
817 |
|
|
if(strcmp(ksp,"pp")==0){
|
818 |
|
|
if(nj==0)mJets = &(c->ak2PF);
|
819 |
|
|
else if(nj==1)mJets = &(c->ak3PF);
|
820 |
|
|
else if(nj==2)mJets = &(c->ak4PF);
|
821 |
|
|
}else{
|
822 |
|
|
if(nj==0)mJets = &(c->akPu2PF);
|
823 |
|
|
else if(nj==1)mJets = &(c->akPu3PF);
|
824 |
|
|
else if(nj==2)mJets = &(c->akPu4PF);
|
825 |
|
|
}
|
826 |
|
|
|
827 |
|
|
/*if(nj==0)mJets = &(c->icPu5);
|
828 |
|
|
else if(nj==1)mJets = &(c->akPu2PF);
|
829 |
|
|
else if(nj==2)mJets = &(c->akPu3PF);
|
830 |
|
|
else if(nj==3)mJets = &(c->akPu4PF);
|
831 |
|
|
else if(nj==4)mJets = &(c->akPu2Calo);
|
832 |
|
|
else if(nj==5)mJets = &(c->akPu3Calo);
|
833 |
|
|
else if(nj==6)mJets = &(c->akPu4Calo);
|
834 |
|
|
*/
|
835 |
|
|
|
836 |
|
|
//if(nj==1)std::cout<<" \t \t "<<Form("\t %s : ",calgo[nj])<<mJets->nref<<"\t centb : "<<centb<<std::endl;
|
837 |
|
|
//! Loop over # of jets in a given algo
|
838 |
|
|
for(int ij=0; ij<mJets->nref; ij++){
|
839 |
|
|
|
840 |
|
|
//! Without any cut how many jets are there
|
841 |
|
|
hTotJets[nj]->Fill(1.);
|
842 |
|
|
|
843 |
|
|
//! jet selction cut
|
844 |
|
|
if(mJets->jtpt[ij]<kptrecocut || fabs(mJets->jtphi[ij])>pi)continue;
|
845 |
|
|
|
846 |
|
|
//! trackMax cuts
|
847 |
|
|
if(mJets->trackMax[ij]/mJets->jtpt[ij] < 0.01)continue;
|
848 |
|
|
|
849 |
|
|
//! jets within different etabins
|
850 |
|
|
//!
|
851 |
|
|
int ebin = GetEtaBin(fabs(mJets->jteta[ij]));
|
852 |
|
|
if(ebin<0)continue;
|
853 |
|
|
stat_etab[nj]=1;
|
854 |
|
|
hjetrptmb_etab [nj][ebin]->Fill(mJets->rawpt[ij]);
|
855 |
|
|
hjetjptmb_etab [nj][ebin]->Fill(mJets->jtpt[ij]);
|
856 |
|
|
hjetjpumb_etab [nj][ebin]->Fill(mJets->jtpu[ij]);
|
857 |
|
|
hjetptpumb_etab[nj][ebin]->Fill(mJets->jtpt[ij],mJets->jtpu[ij]);
|
858 |
|
|
|
859 |
|
|
if(ipix>=0){
|
860 |
|
|
hjetrptpix_etab [nj][ipix][ebin]->Fill(mJets->rawpt[ij]);
|
861 |
|
|
hjetjptpix_etab [nj][ipix][ebin]->Fill(mJets->jtpt[ij]);
|
862 |
|
|
hjetjpupix_etab [nj][ipix][ebin]->Fill(mJets->jtpu[ij]);
|
863 |
|
|
hjetptpupix_etab[nj][ipix][ebin]->Fill(mJets->jtpt[ij],mJets->jtpu[ij]);
|
864 |
|
|
}
|
865 |
|
|
hjetrpt_etab [nj][centb][ebin]->Fill(mJets->rawpt[ij]);
|
866 |
|
|
hjetjpt_etab [nj][centb][ebin]->Fill(mJets->jtpt[ij]);
|
867 |
|
|
hjetjpu_etab [nj][centb][ebin]->Fill(mJets->jtpu[ij]);
|
868 |
|
|
hjetptpu_etab[nj][centb][ebin]->Fill(mJets->jtpt[ij],mJets->jtpu[ij]);
|
869 |
|
|
|
870 |
|
|
|
871 |
|
|
if(fabs(mJets->jteta[ij]) < ketacut){
|
872 |
|
|
istat[nj]=1;
|
873 |
|
|
|
874 |
|
|
//! minbias
|
875 |
|
|
hjetrptmb [nj]->Fill(mJets->rawpt[ij]);
|
876 |
|
|
hjetjptmb [nj]->Fill(mJets->jtpt[ij]);
|
877 |
|
|
hjetjpumb [nj]->Fill(mJets->jtpu[ij]);
|
878 |
|
|
hjetptpumb[nj]->Fill(mJets->jtpt[ij],mJets->jtpu[ij]);
|
879 |
|
|
|
880 |
|
|
hjetetamb [nj]->Fill(mJets->jteta[ij]);
|
881 |
|
|
hjetphimb [nj]->Fill(mJets->jtphi[ij]);
|
882 |
|
|
hjetptetamb [nj]->Fill(mJets->jtpt[ij],mJets->jteta[ij]);
|
883 |
|
|
hjetptphimb [nj]->Fill(mJets->jtpt[ij],mJets->jtphi[ij]);
|
884 |
|
|
hjetetaphimb[nj]->Fill(mJets->jteta[ij],mJets->jtphi[ij]);
|
885 |
|
|
|
886 |
|
|
if(vbin>=0){
|
887 |
|
|
//! vertex z dependence
|
888 |
|
|
hjetrptvz [nj][vbin]->Fill(mJets->rawpt[ij]);
|
889 |
|
|
hjetjptvz [nj][vbin]->Fill(mJets->jtpt[ij]);
|
890 |
|
|
hjetjpuvz [nj][vbin]->Fill(mJets->jtpu[ij]);
|
891 |
|
|
hjetptpuvz[nj][vbin]->Fill(mJets->jtpt[ij],mJets->jtpu[ij]);
|
892 |
|
|
|
893 |
|
|
hjetetavz [nj][vbin]->Fill(mJets->jteta[ij]);
|
894 |
|
|
hjetphivz [nj][vbin]->Fill(mJets->jtphi[ij]);
|
895 |
|
|
hjetptetavz [nj][vbin]->Fill(mJets->jtpt[ij],mJets->jteta[ij]);
|
896 |
|
|
hjetptphivz [nj][vbin]->Fill(mJets->jtpt[ij],mJets->jtphi[ij]);
|
897 |
|
|
hjetetaphivz[nj][vbin]->Fill(mJets->jteta[ij],mJets->jtphi[ij]);
|
898 |
|
|
}
|
899 |
|
|
//! pixel tracks dependence
|
900 |
|
|
hjetrpt_pix [nj][ipix]->Fill(mJets->rawpt[ij]);
|
901 |
|
|
hjetjpt_pix [nj][ipix]->Fill(mJets->jtpt[ij]);
|
902 |
|
|
hjetjpu_pix [nj][ipix]->Fill(mJets->jtpu[ij]);
|
903 |
|
|
hjetptpu_pix[nj][ipix]->Fill(mJets->jtpt[ij],mJets->jtpu[ij]);
|
904 |
|
|
|
905 |
|
|
hjeteta_pix [nj][ipix]->Fill(mJets->jteta[ij]);
|
906 |
|
|
hjetphi_pix [nj][ipix]->Fill(mJets->jtphi[ij]);
|
907 |
|
|
hjetpteta_pix [nj][ipix]->Fill(mJets->jtpt[ij],mJets->jteta[ij]);
|
908 |
|
|
hjetptphi_pix [nj][ipix]->Fill(mJets->jtpt[ij],mJets->jtphi[ij]);
|
909 |
|
|
hjetetaphi_pix[nj][ipix]->Fill(mJets->jteta[ij],mJets->jtphi[ij]);
|
910 |
|
|
|
911 |
|
|
//! centrality
|
912 |
|
|
hNjets [nj][centb]->Fill(1.);
|
913 |
|
|
|
914 |
|
|
hfrpt [nj][centb]->Fill(mJets->rawpt[ij]);
|
915 |
|
|
hfjpt [nj][centb]->Fill(mJets->jtpt[ij]);
|
916 |
|
|
hfpupt [nj][centb]->Fill(mJets->jtpu[ij]);
|
917 |
|
|
|
918 |
|
|
|
919 |
|
|
hjetrpt [nj][centb]->Fill(mJets->rawpt[ij]);
|
920 |
|
|
hjetjpt [nj][centb]->Fill(mJets->jtpt[ij]);
|
921 |
|
|
hjetjpu [nj][centb]->Fill(mJets->jtpu[ij]);
|
922 |
|
|
hjetptpu[nj][centb]->Fill(mJets->jtpt[ij],mJets->jtpu[ij]);
|
923 |
|
|
|
924 |
|
|
//! pp pt smeared with PbPb resolution
|
925 |
|
|
if(strcmp(ksp,"pp")==0){
|
926 |
|
|
int smbin = GetPtBinSmear(mJets->jtpt[ij]);
|
927 |
|
|
if(smbin>=0){
|
928 |
|
|
for(int ic=0;ic<ncen-1;ic++){
|
929 |
|
|
float smpt = gRandom->Gaus(mJets->jtpt[ij],smearf[nj][ic][smbin]);
|
930 |
|
|
if(smpt<kptrecocut)continue;
|
931 |
|
|
hjetspt [nj][ic]->Fill(smpt);
|
932 |
|
|
}
|
933 |
|
|
}
|
934 |
|
|
}
|
935 |
|
|
|
936 |
|
|
hjeteta [nj][centb]->Fill(mJets->jteta[ij]);
|
937 |
|
|
hjetphi [nj][centb]->Fill(mJets->jtphi[ij]);
|
938 |
|
|
hjetpteta [nj][centb]->Fill(mJets->jtpt[ij],mJets->jteta[ij]);
|
939 |
|
|
hjetptphi [nj][centb]->Fill(mJets->jtpt[ij],mJets->jtphi[ij]);
|
940 |
|
|
hjetetaphi[nj][centb]->Fill(mJets->jteta[ij],mJets->jtphi[ij]);
|
941 |
|
|
|
942 |
|
|
//! For a given event
|
943 |
|
|
njets[nj][centb]++;
|
944 |
|
|
sumjpt[nj]+=mJets->jtpt[ij];
|
945 |
|
|
sumjpu[nj]+=mJets->jtpu[ij];
|
946 |
|
|
nmbj[nj]++;
|
947 |
|
|
|
948 |
|
|
//! For a given run
|
949 |
|
|
totjetpt[nj][RunId] += mJets->jtpt[ij];
|
950 |
|
|
totjets [nj][RunId]++;
|
951 |
|
|
|
952 |
|
|
} //! etacut
|
953 |
|
|
//if(centb==4)std::cout<<Form(" \t \t \t mbjets %s : ",calgo[nj]) <<nmbj[nj]<<"\t centb : "<<centb<<"\t jtpt "<<mJets->jtpt[ij]<<std::endl;
|
954 |
|
|
}//! # jet loop
|
955 |
|
|
|
956 |
|
|
hNref[nj]->Fill(mJets->nref);
|
957 |
|
|
hNevt_notr[nj][centb]->Fill(vz);
|
958 |
|
|
|
959 |
|
|
if(stat_etab[nj]){
|
960 |
|
|
hNevtmb_etab[nj]->Fill(vz);
|
961 |
|
|
hNevtpix_etab[nj][ipix]->Fill(vz);
|
962 |
|
|
hNevt_etab[nj][centb]->Fill(vz);
|
963 |
|
|
}
|
964 |
|
|
|
965 |
|
|
if(istat[nj]){
|
966 |
|
|
hNevt[nj][centb]->Fill(vz);
|
967 |
|
|
if(vbin>=0)hNevtvz[nj][vbin]->Fill(vz);
|
968 |
|
|
if(ipix>=0)hNevtpix[nj][ipix]->Fill(vz);
|
969 |
|
|
hMBJets[nj]->Fill(nmbj[nj]);
|
970 |
|
|
|
971 |
|
|
hHF_tr[nj]->Fill(hiHF);
|
972 |
|
|
|
973 |
|
|
//! # of jets distribution
|
974 |
|
|
hNjets_dist[nj][centb]->Fill(njets[nj][centb]);
|
975 |
|
|
hMBJetsRun [nj]->Fill(RunId,nmbj[nj]);
|
976 |
|
|
hJetPtRun [nj]->Fill(RunId,sumjpt[nj]/nmbj[nj]);
|
977 |
|
|
hJetPURun [nj]->Fill(RunId,sumjpu[nj]/nmbj[nj]);
|
978 |
|
|
|
979 |
|
|
}
|
980 |
|
|
}//! nj loop
|
981 |
|
|
|
982 |
|
|
//! Vz distribution
|
983 |
|
|
hVz->Fill(vz);
|
984 |
|
|
|
985 |
|
|
//! HF
|
986 |
|
|
if(hiHFhit>0){
|
987 |
|
|
hAvHF->Fill(hiHF/hiHFhit);
|
988 |
|
|
hAvHFRun->Fill(RunId,hiHF/hiHFhit);
|
989 |
|
|
}
|
990 |
|
|
if(hiHFhitplus>0){
|
991 |
|
|
hAvHFplus->Fill(hiHFplus/hiHFhitplus);
|
992 |
|
|
hAvHFplusRun->Fill(RunId,hiHFplus/hiHFhitplus);
|
993 |
|
|
}
|
994 |
|
|
if(hiHFhitminus>0){
|
995 |
|
|
hAvHFminus->Fill(hiHFplus/hiHFhitminus);
|
996 |
|
|
hAvHFminusRun->Fill(RunId,hiHFplus/hiHFhitminus);
|
997 |
|
|
}
|
998 |
|
|
hHF->Fill(hiHF);
|
999 |
|
|
hHFPlusMinus->Fill(hiHFplus,hiHFminus);
|
1000 |
|
|
|
1001 |
|
|
//! Luminosity run-by-run
|
1002 |
|
|
hLumiRun->Fill(RunId,LumiBlock);
|
1003 |
|
|
hLumiBlock->Fill(LumiBlock);
|
1004 |
|
|
hBin->Fill(hiBin);
|
1005 |
|
|
hEvtRun->Fill(RunId,vz);
|
1006 |
|
|
|
1007 |
|
|
//! ZDC
|
1008 |
|
|
hZDC->Fill(hiZDC);
|
1009 |
|
|
hZDCPlusMinus->Fill(hiZDCplus,hiZDCminus);
|
1010 |
|
|
|
1011 |
|
|
//! EE
|
1012 |
|
|
hET->Fill(hiET);
|
1013 |
|
|
hEB->Fill(hiEB);
|
1014 |
|
|
hEE->Fill(hiEE);
|
1015 |
|
|
hEBEE->Fill(hiEB,hiEE);
|
1016 |
|
|
hEEPlusMinus->Fill(hiEEplus,hiEEminus);
|
1017 |
|
|
|
1018 |
|
|
//! vertex
|
1019 |
|
|
hvz->Fill(vz);
|
1020 |
|
|
hvzrun->Fill(RunId,vz);
|
1021 |
|
|
hvxvy->Fill(vx,vy);
|
1022 |
|
|
|
1023 |
|
|
//! Pixel
|
1024 |
|
|
hNpix->Fill(hiNpix);
|
1025 |
|
|
hNpixelTracks->Fill(hiNpixelTracks);
|
1026 |
|
|
hNTracks->Fill(hiNtracks);
|
1027 |
|
|
hNpixelTracksNTracks->Fill(hiNpixelTracks,hiNtracks);
|
1028 |
|
|
|
1029 |
|
|
//! Cross correlations
|
1030 |
|
|
hHFZDC->Fill(hiHF,hiZDC);
|
1031 |
|
|
hNpixelTracksZDC->Fill(hiNpixelTracks,hiZDC);
|
1032 |
|
|
hHFNpixelTracks->Fill(hiHF,hiNpixelTracks);
|
1033 |
|
|
|
1034 |
|
|
}//! event loop ends
|
1035 |
|
|
|
1036 |
|
|
if(!iCountRuns){
|
1037 |
|
|
std::cout<<std::endl;
|
1038 |
|
|
std::cout<<std::endl;
|
1039 |
|
|
std::cout<<std::endl;
|
1040 |
|
|
|
1041 |
|
|
if(strcmp(ksp,"pp")==0){
|
1042 |
|
|
for(int nj=0;nj<knj;nj++){
|
1043 |
|
|
std::cout<<"# of Events : "<<calgo[nj]<<" \t : "<<hNevt[nj][ncen-1]->Integral()<<"\t # of Jets : "<<hNjets[nj][ncen-1]->Integral()<<std::endl;
|
1044 |
|
|
}
|
1045 |
|
|
}else{
|
1046 |
|
|
for(int nj=0;nj<knj;nj++){
|
1047 |
|
|
for(int ic=0;ic<ncen-1;ic++){
|
1048 |
|
|
std::cout<<"# of Events : "<<ccent[ic]<<"\t "<<calgo[nj]<<" \t : "<<hNevt[nj][ic]->Integral()<<"\t # of Jets : "<<hNjets[nj][ic]->Integral()<<std::endl;
|
1049 |
|
|
}
|
1050 |
|
|
std::cout<<"\t"<<std::endl;
|
1051 |
|
|
}
|
1052 |
|
|
}
|
1053 |
|
|
std::cout<<std::endl;
|
1054 |
|
|
std::cout<<std::endl;
|
1055 |
|
|
|
1056 |
|
|
for(int nj=0;nj<knj;nj++){
|
1057 |
|
|
std::cout<<Form("For %s algo : ",calgo[nj])<<std::endl;
|
1058 |
|
|
for(int ir=0;ir<maxruns;ir++){
|
1059 |
|
|
if(Run[ir]<0 || totjets[nj][ir]==0)continue;
|
1060 |
|
|
std::cout<<"\t RunNo : "<<Run[ir]<<"\t Sumjetpt : "<<totjetpt[nj][ir]<<"\t Totjets : "<<totjets[nj][ir]<<"\t <pT> : "<<totjetpt[nj][ir]/totjets[nj][ir]<<std::endl;
|
1061 |
|
|
hTotJetsRun[nj]->Fill(ir+1,totjets[nj][ir]);
|
1062 |
|
|
}
|
1063 |
|
|
}
|
1064 |
|
|
}
|
1065 |
|
|
|
1066 |
|
|
//! Write to output file
|
1067 |
|
|
fout->cd();
|
1068 |
|
|
fout->Write();
|
1069 |
|
|
fout->Close();
|
1070 |
|
|
|
1071 |
|
|
//! Check
|
1072 |
|
|
timer.Stop();
|
1073 |
|
|
float mbytes = 0.000001*nb;
|
1074 |
|
|
double rtime = timer.RealTime();
|
1075 |
|
|
double ctime = timer.CpuTime();
|
1076 |
|
|
|
1077 |
|
|
std::cout<<"\t"<<std::endl;
|
1078 |
|
|
std::cout<<Form("RealTime=%f seconds, CpuTime=%f seconds",rtime,ctime)<<std::endl;
|
1079 |
|
|
std::cout<<Form("You read %f Mbytes/RealTime seconds",mbytes/rtime)<<std::endl;
|
1080 |
|
|
std::cout<<Form("You read %f Mbytes/CpuTime seconds",mbytes/ctime)<<std::endl;
|
1081 |
|
|
std::cout<<"\t"<<std::endl;
|
1082 |
|
|
std::cout<<"Good bye : " <<"\t"<<std::endl;
|
1083 |
|
|
}
|
1084 |
|
|
int GetPtBinSmear(float pt)
|
1085 |
|
|
{
|
1086 |
|
|
int ibin=-1;
|
1087 |
|
|
for(int ix=0;ix<smbins;ix++){
|
1088 |
|
|
if(pt>=ptbins_smear[ix] && pt<ptbins_smear[ix+1]){
|
1089 |
|
|
return ix;
|
1090 |
|
|
}
|
1091 |
|
|
}
|
1092 |
|
|
return ibin;
|
1093 |
|
|
}
|
1094 |
|
|
int GetCentBin(int bin)
|
1095 |
|
|
{
|
1096 |
|
|
int ibin=-1;
|
1097 |
|
|
//! centrality is defined as 2.5% bins of cross section
|
1098 |
|
|
//! in 0-39 bins
|
1099 |
|
|
if(bin<2)ibin=0; //! 0-5%
|
1100 |
|
|
else if(bin>=2 && bin<4)ibin=1; //! 5-10%
|
1101 |
|
|
else if(bin>=4 && bin<12)ibin=2; //! 10-30%
|
1102 |
|
|
else if(bin>=12&& bin<20)ibin=3; //! 30-50%
|
1103 |
|
|
else if(bin>=20&& bin<28)ibin=4; //! 50-70%
|
1104 |
|
|
else if(bin>=28&& bin<36)ibin=5; //! 70-90%
|
1105 |
|
|
return ibin;
|
1106 |
|
|
}
|
1107 |
|
|
int GetRunIdx(int irun)
|
1108 |
|
|
{
|
1109 |
|
|
int runid=-1;
|
1110 |
|
|
int istat=1;
|
1111 |
|
|
int ir=0;
|
1112 |
|
|
while(istat>0){
|
1113 |
|
|
if(irun==Run[ir]){
|
1114 |
|
|
runid=ir;
|
1115 |
|
|
istat=-1;
|
1116 |
|
|
}
|
1117 |
|
|
ir++;
|
1118 |
|
|
}
|
1119 |
|
|
return runid;
|
1120 |
|
|
}
|
1121 |
|
|
int GetVtxBin(float vz)
|
1122 |
|
|
{
|
1123 |
|
|
int ibin=-1;
|
1124 |
|
|
ibin = (int)(nvtx*(vz+15.0)/30.0); //! vertex bin
|
1125 |
|
|
if(ibin<0 || ibin>=nvtx)return ibin=-1;
|
1126 |
|
|
else return ibin;
|
1127 |
|
|
|
1128 |
|
|
}
|
1129 |
|
|
int GetPixelBin(int npixtr)
|
1130 |
|
|
{
|
1131 |
|
|
int ibin=-1;
|
1132 |
|
|
if(npixtr>=700)ibin=0;
|
1133 |
|
|
else if(npixtr>=200 && npixtr<700)ibin=1;
|
1134 |
|
|
else if(npixtr>=100 && npixtr<200)ibin=2;
|
1135 |
|
|
else if(npixtr>=50 && npixtr<100)ibin=3;
|
1136 |
|
|
else if(npixtr<50)ibin=4;
|
1137 |
|
|
|
1138 |
|
|
return ibin;
|
1139 |
|
|
}
|
1140 |
|
|
int GetEtaBin(float eta)
|
1141 |
|
|
{
|
1142 |
|
|
int ibin=-1;
|
1143 |
|
|
|
1144 |
|
|
if(eta>=0 && eta<1.3)ibin=0; //! barrel
|
1145 |
|
|
else if(eta>=1.3 && eta<2.0)ibin=1;//! endcap+tracks
|
1146 |
|
|
else if(eta>=2.0 && eta<3.0)ibin=2;//! endcap-notracks
|
1147 |
|
|
else if(eta>=3.0 && eta<5.0)ibin=3;//! forward
|
1148 |
|
|
|
1149 |
|
|
return ibin;
|
1150 |
|
|
}
|
1151 |
|
|
void LoadRuns(const char *sp)
|
1152 |
|
|
{
|
1153 |
|
|
if(strcmp(sp,"pbpb")==0){
|
1154 |
|
|
/*HiforestDijet_v7.root*/
|
1155 |
|
|
Run[0] = 181611; Run[1] = 181683; Run[2] = 181684; Run[3] = 181685; Run[4] = 181686;
|
1156 |
|
|
Run[5] = 181687; Run[6] = 181688; Run[7] = 181689; Run[8] = 181690; Run[9] = 181691;
|
1157 |
|
|
|
1158 |
|
|
Run[10] = 181692; Run[11] = 181693; Run[12] = 181695; Run[13] = 181754; Run[14] = 181759;
|
1159 |
|
|
Run[15] = 181760; Run[16] = 181777; Run[17] = 181778; Run[18] = 181912; Run[19] = 181913;
|
1160 |
|
|
|
1161 |
|
|
Run[20] = 181914; Run[21] = 181938; Run[22] = 181946; Run[23] = 181950; Run[24] = 181969;
|
1162 |
|
|
Run[25] = 181985; Run[26] = 182052; Run[27] = 182065; Run[28] = 182066; Run[29] = 182098;
|
1163 |
|
|
|
1164 |
|
|
Run[30] = 182099; Run[31] = 182124; Run[32] = 182133; Run[33] = 182227; Run[34] = 182228;
|
1165 |
|
|
Run[35] = 182239; Run[36] = 182241; Run[37] = 182257; Run[38] = 182296; Run[39] = 182324;
|
1166 |
|
|
|
1167 |
|
|
Run[40] = 182365; Run[41] = 182382; Run[42] = 182398; Run[43] = 182422; Run[44] = 182536;
|
1168 |
|
|
Run[45] = 182561; Run[46] = 182572; Run[47] = 182591; Run[48] = 182609; Run[49] = 182664;
|
1169 |
|
|
|
1170 |
|
|
Run[50] = 182785; Run[51] = 182798; Run[52] = 182822; Run[53] = 182838; Run[54] = 182890;
|
1171 |
|
|
Run[55] = 182915; Run[56] = 182916; Run[57] = 182927; Run[58] = 182944; Run[59] = 182960;
|
1172 |
|
|
|
1173 |
|
|
Run[60] = 182972; Run[61] = 183013;
|
1174 |
|
|
|
1175 |
|
|
//! Recorded Luminosity for these runs
|
1176 |
|
|
//! Luminosity per run (everything is in /mub)
|
1177 |
|
|
Lumi[0] = 92.362e-03 ; Lumi[1] = 187.220e-03; Lumi[2] = 219.066e-03; Lumi[3] = 148.002e-03; Lumi[4] = 59.739e-03;
|
1178 |
|
|
Lumi[5] = 241.659e-03; Lumi[6] = 109.47e-03 ; Lumi[7] = 35.597e-03 ; Lumi[8] = 128.991e-03; Lumi[9] = 96.059e-03;
|
1179 |
|
|
|
1180 |
|
|
Lumi[10] = 171.437e-03; Lumi[11] = 206.834e-03; Lumi[12] = 83.324e-03 ; Lumi[13] = 38.624e-03 ; Lumi[14] = 100.677e-03;
|
1181 |
|
|
Lumi[15] = 224.282e-03; Lumi[16] = 103.743e-03; Lumi[17] = 169.573e-03; Lumi[18] = 697.353e-03; Lumi[19] = 2.333;
|
1182 |
|
|
|
1183 |
|
|
Lumi[20] = 47.166e-03; Lumi[21] = 3.184; Lumi[22] = 427.845e-03; Lumi[23] = 709.747e-03; Lumi[24] = 4.541;
|
1184 |
|
|
Lumi[25] = 4.152 ; Lumi[26] = 4.971; Lumi[27] = 189.544e-03; Lumi[28] = 4.286 ; Lumi[29] = 995.874e-03;
|
1185 |
|
|
|
1186 |
|
|
Lumi[30] = 4.351; Lumi[31] = 2.632; Lumi[32] = 1.101 ; Lumi[33] = 198.610e-03; Lumi[34] = 119.643e-03;
|
1187 |
|
|
Lumi[35] = 1.544; Lumi[36] = 3.124; Lumi[37] = 596.649e-03; Lumi[38] = 3.138 ; Lumi[39] = 4.144;
|
1188 |
|
|
|
1189 |
|
|
Lumi[40] = 5.207 ; Lumi[41] = 5.366; Lumi[42] = 105.077e-03; Lumi[43] = 5.123; Lumi[44] = 5.327;
|
1190 |
|
|
Lumi[45] = 816.714e-03; Lumi[46] = 6.188; Lumi[47] = 5.909 ; Lumi[48] = 6.629; Lumi[49] = 1.745;
|
1191 |
|
|
|
1192 |
|
|
Lumi[50] = 5.539; Lumi[51] = 4.551 ; Lumi[52] = 5.172; Lumi[53] = 3.397; Lumi[54] = 5.002;
|
1193 |
|
|
Lumi[55] = 5.193; Lumi[56] = 264.214e-03; Lumi[57] = 6.613; Lumi[58] = 3.569; Lumi[59] = 5.142;
|
1194 |
|
|
|
1195 |
|
|
Lumi[60] = 6.264; Lumi[61] = 6.410;
|
1196 |
|
|
}
|
1197 |
|
|
else if(strcmp(sp,"pp")==0){
|
1198 |
|
|
Run[0] = 161366;Run[1] = 161396;Run[2] = 161404;Run[3] = 161439;Run[4] = 161445;Run[5] = 161450;Run[6] = 161454;Run[7] = 161473;Run[8] = 161474;
|
1199 |
|
|
}
|
1200 |
|
|
std::cout<<"Run # loaded according to increasing order" <<std::endl;
|
1201 |
|
|
}
|