5 #define BOOK1D(name,title,nbinsx,lowx,highx) \
6 h##name = dbe_ ? dbe_->book1D(#name,title,nbinsx,lowx,highx)->getTH1F() \
7 : new TH1F(#name,title,nbinsx,lowx,highx)
10 #define BOOK2D(name,title,nbinsx,lowx,highx,nbinsy,lowy,highy) \
11 h##name = dbe_ ? dbe_->book2D(#name,title,nbinsx,lowx,highx,nbinsy,lowy,highy)->getTH2F() \
12 : new TH2F(#name,title,nbinsx,lowx,highx,nbinsy,lowy,highy)
15 #define DBOOK1D(name,title,nbinsx,lowx,highx) \
16 BOOK1D(B##name,"Barrel "#title,nbinsx,lowx,highx); BOOK1D(E##name,"Endcap "#title,nbinsx,lowx,highx); BOOK1D(F##name,"Forward "#title,nbinsx,lowx,highx);
17 #define DBOOK2D(name,title,nbinsx,lowx,highx,nbinsy,lowy,highy) \
18 BOOK2D(B##name,"Barrel "#title,nbinsx,lowx,highx,nbinsy,lowy,highy); BOOK2D(E##name,"Endcap "#title,nbinsx,lowx,highx,nbinsy,lowy,highy); BOOK2D(F##name,"Forward "#title,nbinsx,lowx,highx,nbinsy,lowy,highy);
22 #define SETAXES(name,xtitle,ytitle) \
23 h##name->GetXaxis()->SetTitle(xtitle); h##name->GetYaxis()->SetTitle(ytitle)
26 #define DSETAXES(name,xtitle,ytitle) \
27 SETAXES(B##name,xtitle,ytitle);SETAXES(E##name,xtitle,ytitle);SETAXES(F##name,xtitle,ytitle);
32 #define PT (plotAgainstReco_)?"reconstructed P_{T}" :"generated P_{T}"
33 #define P (plotAgainstReco_)?"generated P" :"generated P"
54 cout <<
"Benchmark output written to file " <<
outputFile_.c_str() << endl;
59 cout <<
"No output file specified ("<<
outputFile_<<
"). Results will not be saved!" << endl;
83 cout<<
"PFJetBenchmark Setup parameters =============================================="<<endl;
84 cout <<
"Filename to write histograms " << Filename<<endl;
85 cout <<
"PFJetBenchmark debug " <<
debug_<< endl;
88 cout <<
"deltaRMax " << deltaRMax << endl;
89 cout <<
"benchmarkLabel " << benchmarkLabel_ << endl;
96 string path =
"PFTask/Benchmarks/"+ benchmarkLabel_ +
"/";
97 if (plotAgainstReco) path +=
"Reco";
else path +=
"Gen";
105 cout <<
"Info: DQM is not available to provide data storage service. Using TFile to save histograms. "<<endl;
109 sprintf(cutString,
"Jet multiplicity P_{T}>%4.1f GeV",
recPt_cut);
110 BOOK1D(Njets,cutString,50, 0, 50);
112 BOOK1D(jetsPt,
"Jets P_{T} Distribution",100, 0, 500);
114 sprintf(cutString,
"Jets #eta Distribution |#eta|<%4.1f",
maxEta_cut);
115 BOOK1D(jetsEta,cutString,100, -5, 5);
117 BOOK2D(RPtvsEta,
"#DeltaP_{T}/P_{T} vs #eta",200, -5., 5., 200,-1,1);
118 BOOK2D(RNeutvsEta,
"R_{Neutral} vs #eta",200, -5., 5., 200,-1,1);
119 BOOK2D(RNEUTvsEta,
"R_{HCAL+ECAL} vs #eta",200, -5., 5., 200,-1,1);
120 BOOK2D(RNONLvsEta,
"R_{HCAL+ECAL - Hcal Only} vs #eta",200, -5., 5., 200,-1,1);
121 BOOK2D(RHCALvsEta,
"R_{HCAL} vs #eta",200, -5., 5., 200,-1,1);
122 BOOK2D(RHONLvsEta,
"R_{HCAL only} vs #eta",200, -5., 5., 200,-1,1);
123 BOOK2D(RCHEvsEta,
"R_{Charged} vs #eta",200, -5., 5., 200,-1,1);
124 BOOK2D(NCHvsEta,
"N_{Charged} vs #eta",200, -5., 5., 200,0.,200.);
125 BOOK2D(NCH0vsEta,
"N_{Charged} vs #eta, iter 0",200, -5., 5., 200,0.,200.);
126 BOOK2D(NCH1vsEta,
"N_{Charged} vs #eta, iter 1",200, -5., 5., 200,0.,200.);
127 BOOK2D(NCH2vsEta,
"N_{Charged} vs #eta, iter 2",200, -5., 5., 200,0.,200.);
128 BOOK2D(NCH3vsEta,
"N_{Charged} vs #eta, iter 3",200, -5., 5., 200,0.,200.);
129 BOOK2D(NCH4vsEta,
"N_{Charged} vs #eta, iter 4",200, -5., 5., 200,0.,200.);
130 BOOK2D(NCH5vsEta,
"N_{Charged} vs #eta, iter 5",200, -5., 5., 200,0.,200.);
131 BOOK2D(NCH6vsEta,
"N_{Charged} vs #eta, iter 6",200, -5., 5., 200,0.,200.);
134 DBOOK1D(RCHE,#DeltaE/E (charged had),80,-2,2);
135 DBOOK1D(RNHE,#DeltaE/E (neutral had),80,-2,2);
136 DBOOK1D(RNEE,#DeltaE/E (neutral em),80,-2,2);
137 DBOOK1D(Rneut,#DeltaE/E (neutral),80,-2,2);
138 DBOOK1D(NCH, #N_{charged},200,0.,200.);
139 DBOOK2D(RPtvsPt,#DeltaP_{
T}/P_{
T} vs P_{
T},250, 0, 500, 200,-1,1);
140 DBOOK2D(RCHEvsPt,#DeltaE/E (charged had) vs P_{
T},250, 0, 500, 120,-1,2);
141 DBOOK2D(RNHEvsPt,#DeltaE/E (neutral had) vs P_{
T},250, 0, 500, 120,-1,2);
142 DBOOK2D(RNEEvsPt,#DeltaE/E (neutral em) vs P_{
T},250, 0, 500, 120,-1,2);
143 DBOOK2D(RneutvsPt,#DeltaE/E (neutral) vs P_{
T},250, 0, 500, 120,-1,2);
144 DBOOK2D(NCHvsPt,N_{charged} vs P_{
T},250,0,500,200,0.,200.);
145 DBOOK2D(NCH0vsPt, N_{charged} vs P_{
T} iter 0,250,0,500,200,0.,200.);
146 DBOOK2D(NCH1vsPt, N_{charged} vs P_{
T} iter 1,250,0,500,200,0.,200.);
147 DBOOK2D(NCH2vsPt, N_{charged} vs P_{
T} iter 2,250,0,500,200,0.,200.);
148 DBOOK2D(NCH3vsPt, N_{charged} vs P_{
T} iter 3,250,0,500,200,0.,200.);
149 DBOOK2D(NCH4vsPt, N_{charged} vs P_{
T} iter 4,250,0,500,200,0.,200.);
150 DBOOK2D(NCH5vsPt, N_{charged} vs P_{
T} iter 5,250,0,500,200,0.,200.);
151 DBOOK2D(NCH6vsPt, N_{charged} vs P_{
T} iter 6,250,0,500,200,0.,200.);
156 DBOOK2D(RHCALvsP,#DeltaE/E (
HCAL) vs P,250, 0, 1000, 150,-1.5,1.5);
157 DBOOK2D(RHONLvsP,#DeltaE/E (
HCAL only) vs P,250, 0, 1000, 150,-1.5,1.5);
158 DBOOK1D(RPt20_40,#DeltaP_{
T}/P_{
T},80,-1,1);
159 DBOOK1D(RPt40_60,#DeltaP_{
T}/P_{
T},80,-1,1);
160 DBOOK1D(RPt60_80,#DeltaP_{
T}/P_{
T},80,-1,1);
161 DBOOK1D(RPt80_100,#DeltaP_{
T}/P_{
T},80,-1,1);
162 DBOOK1D(RPt100_150,#DeltaP_{
T}/P_{
T},80,-1,1);
163 DBOOK1D(RPt150_200,#DeltaP_{
T}/P_{
T},80,-1,1);
164 DBOOK1D(RPt200_250,#DeltaP_{
T}/P_{
T},80,-1,1);
165 DBOOK1D(RPt250_300,#DeltaP_{
T}/P_{
T},80,-1,1);
166 DBOOK1D(RPt300_400,#DeltaP_{
T}/P_{
T},160,-1,1);
167 DBOOK1D(RPt400_500,#DeltaP_{
T}/P_{
T},160,-1,1);
168 DBOOK1D(RPt500_750,#DeltaP_{
T}/P_{
T},160,-1,1);
169 DBOOK1D(RPt750_1250,#DeltaP_{
T}/P_{
T},160,-1,1);
170 DBOOK1D(RPt1250_2000,#DeltaP_{
T}/P_{
T},160,-1,1);
171 DBOOK1D(RPt2000_5000,#DeltaP_{
T}/P_{
T},160,-1,1);
173 DBOOK2D(DEtavsPt,#Delta#
eta vs P_{
T},1000,0,2000,500,-0.5,0.5);
174 DBOOK2D(DPhivsPt,#Delta#
phi vs P_{
T},1000,0,2000,500,-0.5,0.5);
175 BOOK2D(DEtavsEta,
"#Delta#eta vs P_{T}",1000,-5.,+5.,500,-0.5,0.5);
176 BOOK2D(DPhivsEta,
"#Delta#phi vs P_{T}",1000,-5.,+5.,500,-0.5,0.5);
181 SETAXES(Njets,
"",
"Multiplicity");
183 SETAXES(jetsEta,
"#eta",
"Number of Events");
184 SETAXES(RNeutvsEta,
"#eta",
"#DeltaE/E (Neutral)");
185 SETAXES(RNEUTvsEta,
"#eta",
"#DeltaE/E (ECAL+HCAL)");
186 SETAXES(RNONLvsEta,
"#eta",
"#DeltaE/E (ECAL+HCAL-only)");
187 SETAXES(RHCALvsEta,
"#eta",
"#DeltaE/E (HCAL)");
188 SETAXES(RHONLvsEta,
"#eta",
"#DeltaE/E (HCAL Only)");
189 SETAXES(RCHEvsEta,
"#eta",
"#DeltaE/E (Charged)");
190 SETAXES(RPtvsEta,
"#eta",
"#DeltaP_{T}/P_{T}");
191 SETAXES(DEtavsEta,
"#eta",
"#Delta#eta");
192 SETAXES(DPhivsEta,
"#eta",
"#Delta#phi");
194 DSETAXES(RPt,
"#DeltaP_{T}/P_{T}",
"Events");
195 DSETAXES(RPt20_40,
"#DeltaP_{T}/P_{T}",
"Events");
196 DSETAXES(RPt40_60,
"#DeltaP_{T}/P_{T}",
"Events");
197 DSETAXES(RPt60_80,
"#DeltaP_{T}/P_{T}",
"Events");
198 DSETAXES(RPt80_100,
"#DeltaP_{T}/P_{T}",
"Events");
199 DSETAXES(RPt100_150,
"#DeltaP_{T}/P_{T}",
"Events");
200 DSETAXES(RPt150_200,
"#DeltaP_{T}/P_{T}",
"Events");
201 DSETAXES(RPt200_250,
"#DeltaP_{T}/P_{T}",
"Events");
202 DSETAXES(RPt250_300,
"#DeltaP_{T}/P_{T}",
"Events");
203 DSETAXES(RPt300_400,
"#DeltaP_{T}/P_{T}",
"Events");
204 DSETAXES(RPt400_500,
"#DeltaP_{T}/P_{T}",
"Events");
205 DSETAXES(RPt500_750,
"#DeltaP_{T}/P_{T}",
"Events");
206 DSETAXES(RPt750_1250,
"#DeltaP_{T}/P_{T}",
"Events");
207 DSETAXES(RPt1250_2000,
"#DeltaP_{T}/P_{T}",
"Events");
208 DSETAXES(RPt2000_5000,
"#DeltaP_{T}/P_{T}",
"Events");
209 DSETAXES(RCHE,
"#DeltaE/E(charged had)",
"Events");
210 DSETAXES(RNHE,
"#DeltaE/E(neutral had)",
"Events");
211 DSETAXES(RNEE,
"#DeltaE/E(neutral em)",
"Events");
212 DSETAXES(Rneut,
"#DeltaE/E(neutral)",
"Events");
214 DSETAXES(RCHEvsPt,
PT,
"#DeltaE/E(charged had)");
215 DSETAXES(RNHEvsPt,
PT,
"#DeltaE/E(neutral had)");
216 DSETAXES(RNEEvsPt,
PT,
"#DeltaE/E(neutral em)");
217 DSETAXES(RneutvsPt,
PT,
"#DeltaE/E(neutral)");
218 DSETAXES(RHCALvsP, P,
"#DeltaE/E(HCAL)");
219 DSETAXES(RHONLvsP, P,
"#DeltaE/E(HCAL-only)");
220 DSETAXES(RNEUTvsP, P,
"#DeltaE/E(ECAL+HCAL)");
221 DSETAXES(RNONLvsP, P,
"#DeltaE/E(ECAL+HCAL-only)");
236 for(
unsigned i=0;
i<pfJets.size();
i++) {
239 unsigned highJets = 0;
240 for(
unsigned j=0;
j<pfJets.size();
j++) {
241 if (
j !=
i && pfJets[
j].pt() > pfJets[
i].pt() ) highJets++;
247 double rec_pt = pfj.
pt();
248 double rec_eta = pfj.
eta();
249 double rec_phi = pfj.
phi();
266 bool Forward =
false;
267 if (
std::abs(rec_eta) < 1.4 ) Barrel =
true;
285 double true_E = truth->
p();
286 double true_pt = truth->
pt();
287 double true_eta = truth->
eta();
288 double true_phi = truth->
phi();
291 else {pt_denom = true_pt;}
293 double true_ChargedHadEnergy;
294 double true_NeutralHadEnergy;
295 double true_NeutralEmEnergy;
296 gettrue (truth, true_ChargedHadEnergy, true_NeutralHadEnergy, true_NeutralEmEnergy);
297 double true_NeutralEnergy = true_NeutralHadEnergy + true_NeutralEmEnergy;
301 double rec_NeutralEnergy = rec_NeutralHadEnergy + rec_NeutralEmEnergy;
304 std::vector <unsigned int> chMult(7, static_cast<unsigned int>(0));
305 for (
unsigned ic = 0; ic < constituents.size (); ++ic) {
306 if ( constituents[ic]->particleId() > 3 )
continue;
308 if ( trackRef.
isNull() ) {
314 unsigned int iter = 0;
315 switch (trackRef->algo()) {
317 case TrackBase::iter0:
320 case TrackBase::iter1:
323 case TrackBase::iter2:
326 case TrackBase::iter3:
329 case TrackBase::iter4:
332 case TrackBase::iter5:
337 std::cout <<
"Warning in entry " <<
entry_ <<
" : iter = 6... " << std::endl;
350 double cut1 = 0.0001;
351 double cut2 = 0.0001;
352 double cut3 = 0.0001;
353 double cut4 = 0.0001;
354 double cut5 = 0.0001;
355 double cut6 = 0.0001;
356 double cut7 = 0.0001;
358 double resChargedHadEnergy= 0.;
359 double resNeutralHadEnergy= 0.;
360 double resNeutralEmEnergy= 0.;
361 double resNeutralEnergy= 0.;
363 double resHCALEnergy = 0.;
364 double resNEUTEnergy = 0.;
365 if ( rec_NeutralHadEnergy > cut6 && rec_ChargedHadEnergy < cut1 ) {
366 double true_NEUTEnergy = true_NeutralHadEnergy + true_NeutralEmEnergy;
367 double true_HCALEnergy = true_NEUTEnergy - rec_NeutralEmEnergy;
368 double rec_NEUTEnergy = rec_NeutralHadEnergy+rec_NeutralEmEnergy;
369 double rec_HCALEnergy = rec_NeutralHadEnergy;
370 resHCALEnergy = (rec_HCALEnergy-true_HCALEnergy)/rec_HCALEnergy;
371 resNEUTEnergy = (rec_NEUTEnergy-true_NEUTEnergy)/rec_NEUTEnergy;
372 if ( rec_NeutralEmEnergy > cut7 ) {
380 if (true_pt > 0.0001){
381 resPt = (rec_pt -true_pt)/true_pt ;
383 if (true_ChargedHadEnergy > cut1){
384 resChargedHadEnergy = (rec_ChargedHadEnergy- true_ChargedHadEnergy)/true_ChargedHadEnergy;
386 if (true_NeutralHadEnergy > cut2){
387 resNeutralHadEnergy = (rec_NeutralHadEnergy- true_NeutralHadEnergy)/true_NeutralHadEnergy;
390 if (rec_NeutralHadEnergy > cut3){
391 resNeutralHadEnergy = (rec_NeutralHadEnergy- true_NeutralHadEnergy)/rec_NeutralHadEnergy;
393 if (true_NeutralEmEnergy > cut4){
394 resNeutralEmEnergy = (rec_NeutralEmEnergy- true_NeutralEmEnergy)/true_NeutralEmEnergy;
396 if (true_NeutralEnergy > cut5){
397 resNeutralEnergy = (rec_NeutralEnergy- true_NeutralEnergy)/true_NeutralEnergy;
404 if ( ( resPt > 0.2 && true_pt > 100. ) ||
405 ( resPt < -0.5 && true_pt > 100. ) ) {
410 <<
" resPt = " << resPt
411 <<
" resCharged " << resChargedHadEnergy
412 <<
" resNeutralHad " << resNeutralHadEnergy
413 <<
" resNeutralEm " << resNeutralEmEnergy
414 <<
" pT (T/R) " << true_pt <<
"/" << rec_pt
415 <<
" Eta (T/R) " << truth->
eta() <<
"/" << rec_eta
416 <<
" Phi (T/R) " << truth->
phi() <<
"/" << rec_phi
422 for(
unsigned j=0;
j<pfJets.size();
j++) {
434 for(
unsigned j=0;
j<genJets.size();
j++) {
436 if ( gjo != truth &&
algo_->
deltaR(truth,gjo) < dRgo && gjo->
pt() > 0.25*truth->
pt() ) {
443 std::cout <<
"Excess probably due to overlapping jets (DR = " <<
algo_->
deltaR(genoj,pfoj) <<
"),"
444 <<
" at DeltaR(T/R) = " << dRgo <<
"/" << dRo
445 <<
" with pT(T/R) " << genoj->
pt() <<
"/" << pfoj->
pt()
446 <<
" and Eta (T/R) " << genoj->
eta() <<
"/" << pfoj->
eta()
447 <<
" and Phi (T/R) " << genoj->
phi() <<
"/" << pfoj->
phi()
456 cout <<
i <<
" =========PFJet Pt "<< rec_pt
457 <<
" eta " << rec_eta
458 <<
" phi " << rec_phi
459 <<
" Charged Had Energy " << rec_ChargedHadEnergy
460 <<
" Neutral Had Energy " << rec_NeutralHadEnergy
461 <<
" Neutral elm Energy " << rec_NeutralEmEnergy << endl;
462 cout <<
" matching Gen Jet Pt " << true_pt
463 <<
" eta " << truth->
eta()
464 <<
" phi " << truth->
phi()
465 <<
" Charged Had Energy " << true_ChargedHadEnergy
466 <<
" Neutral Had Energy " << true_NeutralHadEnergy
467 <<
" Neutral elm Energy " << true_NeutralEmEnergy << endl;
473 cout <<
"==============deltaR " << deltaR <<
" resPt " << resPt
474 <<
" resChargedHadEnergy " << resChargedHadEnergy
475 <<
" resNeutralHadEnergy " << resNeutralHadEnergy
476 <<
" resNeutralEmEnergy " << resNeutralEmEnergy
489 hNCHvsEta->Fill(true_eta, rec_ChargedMultiplicity);
498 if(plot2)
hRCHEvsEta->Fill(true_eta, resChargedHadEnergy);
499 if(plot5)
hRNeutvsEta->Fill(true_eta, resNeutralEnergy);
514 if ( pt_denom > 20. && pt_denom < 40. )
hBRPt20_40->Fill (resPt);
515 if ( pt_denom > 40. && pt_denom < 60. )
hBRPt40_60->Fill (resPt);
516 if ( pt_denom > 60. && pt_denom < 80. )
hBRPt60_80->Fill (resPt);
517 if ( pt_denom > 80. && pt_denom < 100. )
hBRPt80_100->Fill (resPt);
518 if ( pt_denom > 100. && pt_denom < 150. )
hBRPt100_150->Fill (resPt);
519 if ( pt_denom > 150. && pt_denom < 200. )
hBRPt150_200->Fill (resPt);
520 if ( pt_denom > 200. && pt_denom < 250. )
hBRPt200_250->Fill (resPt);
521 if ( pt_denom > 250. && pt_denom < 300. )
hBRPt250_300->Fill (resPt);
522 if ( pt_denom > 300. && pt_denom < 400. )
hBRPt300_400->Fill (resPt);
523 if ( pt_denom > 400. && pt_denom < 500. )
hBRPt400_500->Fill (resPt);
524 if ( pt_denom > 500. && pt_denom < 750. )
hBRPt500_750->Fill (resPt);
525 if ( pt_denom > 750. && pt_denom < 1250. )
hBRPt750_1250->Fill (resPt);
526 if ( pt_denom > 1250. && pt_denom < 2000. )
hBRPt1250_2000->Fill (resPt);
527 if ( pt_denom > 2000. && pt_denom < 5000. )
hBRPt2000_5000->Fill (resPt);
528 hBNCH->Fill(rec_ChargedMultiplicity);
536 hBNCHvsPt->Fill(pt_denom,rec_ChargedMultiplicity);
543 if(plot2)
hBRCHE->Fill(resChargedHadEnergy);
544 if(plot3)
hBRNHE->Fill(resNeutralHadEnergy);
545 if(plot4)
hBRNEE->Fill(resNeutralEmEnergy);
546 if(plot5)
hBRneut->Fill(resNeutralEnergy);
547 if(plot1)
hBRPtvsPt->Fill(pt_denom, resPt);
548 if(plot2)
hBRCHEvsPt->Fill(pt_denom, resChargedHadEnergy);
549 if(plot3)
hBRNHEvsPt->Fill(pt_denom, resNeutralHadEnergy);
550 if(plot4)
hBRNEEvsPt->Fill(pt_denom, resNeutralEmEnergy);
551 if(plot5)
hBRneutvsPt->Fill(pt_denom, resNeutralEnergy);
566 if ( pt_denom > 20. && pt_denom < 40. )
hERPt20_40->Fill (resPt);
567 if ( pt_denom > 40. && pt_denom < 60. )
hERPt40_60->Fill (resPt);
568 if ( pt_denom > 60. && pt_denom < 80. )
hERPt60_80->Fill (resPt);
569 if ( pt_denom > 80. && pt_denom < 100. )
hERPt80_100->Fill (resPt);
570 if ( pt_denom > 100. && pt_denom < 150. )
hERPt100_150->Fill (resPt);
571 if ( pt_denom > 150. && pt_denom < 200. )
hERPt150_200->Fill (resPt);
572 if ( pt_denom > 200. && pt_denom < 250. )
hERPt200_250->Fill (resPt);
573 if ( pt_denom > 250. && pt_denom < 300. )
hERPt250_300->Fill (resPt);
574 if ( pt_denom > 300. && pt_denom < 400. )
hERPt300_400->Fill (resPt);
575 if ( pt_denom > 400. && pt_denom < 500. )
hERPt400_500->Fill (resPt);
576 if ( pt_denom > 500. && pt_denom < 750. )
hERPt500_750->Fill (resPt);
577 if ( pt_denom > 750. && pt_denom < 1250. )
hERPt750_1250->Fill (resPt);
578 if ( pt_denom > 1250. && pt_denom < 2000. )
hERPt1250_2000->Fill (resPt);
579 if ( pt_denom > 2000. && pt_denom < 5000. )
hERPt2000_5000->Fill (resPt);
580 hENCH->Fill(rec_ChargedMultiplicity);
581 hENCHvsPt->Fill(pt_denom,rec_ChargedMultiplicity);
595 if(plot2)
hERCHE->Fill(resChargedHadEnergy);
596 if(plot3)
hERNHE->Fill(resNeutralHadEnergy);
597 if(plot4)
hERNEE->Fill(resNeutralEmEnergy);
598 if(plot5)
hERneut->Fill(resNeutralEnergy);
599 if(plot1)
hERPtvsPt->Fill(pt_denom, resPt);
600 if(plot2)
hERCHEvsPt->Fill(pt_denom, resChargedHadEnergy);
601 if(plot3)
hERNHEvsPt->Fill(pt_denom, resNeutralHadEnergy);
602 if(plot4)
hERNEEvsPt->Fill(pt_denom, resNeutralEmEnergy);
603 if(plot5)
hERneutvsPt->Fill(pt_denom, resNeutralEnergy);
617 if ( pt_denom > 20. && pt_denom < 40. )
hFRPt20_40->Fill (resPt);
618 if ( pt_denom > 40. && pt_denom < 60. )
hFRPt40_60->Fill (resPt);
619 if ( pt_denom > 60. && pt_denom < 80. )
hFRPt60_80->Fill (resPt);
620 if ( pt_denom > 80. && pt_denom < 100. )
hFRPt80_100->Fill (resPt);
621 if ( pt_denom > 100. && pt_denom < 150. )
hFRPt100_150->Fill (resPt);
622 if ( pt_denom > 150. && pt_denom < 200. )
hFRPt150_200->Fill (resPt);
623 if ( pt_denom > 200. && pt_denom < 250. )
hFRPt200_250->Fill (resPt);
624 if ( pt_denom > 250. && pt_denom < 300. )
hFRPt250_300->Fill (resPt);
625 if ( pt_denom > 300. && pt_denom < 400. )
hFRPt300_400->Fill (resPt);
626 if ( pt_denom > 400. && pt_denom < 500. )
hFRPt400_500->Fill (resPt);
627 if ( pt_denom > 500. && pt_denom < 750. )
hFRPt500_750->Fill (resPt);
628 if ( pt_denom > 750. && pt_denom < 1250. )
hFRPt750_1250->Fill (resPt);
629 if ( pt_denom > 1250. && pt_denom < 2000. )
hFRPt1250_2000->Fill (resPt);
630 if ( pt_denom > 2000. && pt_denom < 5000. )
hFRPt2000_5000->Fill (resPt);
637 if(plot2)
hFRCHE->Fill(resChargedHadEnergy);
638 if(plot3)
hFRNHE->Fill(resNeutralHadEnergy);
639 if(plot4)
hFRNEE->Fill(resNeutralEmEnergy);
640 if(plot5)
hFRneut->Fill(resNeutralEnergy);
641 if(plot1)
hFRPtvsPt->Fill(pt_denom, resPt);
642 if(plot2)
hFRCHEvsPt->Fill(pt_denom, resChargedHadEnergy);
643 if(plot3)
hFRNHEvsPt->Fill(pt_denom, resNeutralHadEnergy);
644 if(plot4)
hFRNEEvsPt->Fill(pt_denom, resNeutralEmEnergy);
645 if(plot5)
hFRneutvsPt->Fill(pt_denom, resNeutralEnergy);
664 double& true_NeutralHadEnergy,
double& true_NeutralEmEnergy){
666 true_NeutralEmEnergy = 0.;
667 true_ChargedHadEnergy = 0.;
668 true_NeutralHadEnergy = 0.;
670 for (
unsigned i = 0;
i < mcparts.size ();
i++) {
673 double e = mcpart->
energy();
676 true_NeutralEmEnergy += e;
682 true_ChargedHadEnergy += e;
688 true_NeutralHadEnergy += e;
696 cout<<setiosflags(ios::right);
697 cout<<setiosflags(ios::fixed);
698 cout<<setprecision(3);
700 cout <<
"PFJet p/px/py/pz/pt: " << pfj->
p() <<
"/" << pfj->
px ()
701 <<
"/" << pfj->
py() <<
"/" << pfj->
pz() <<
"/" << pfj->
pt() << endl
702 <<
" eta/phi: " << pfj->
eta () <<
"/" << pfj->
phi () << endl
703 <<
" PFJet specific:" << std::endl
712 cout<<resetiosflags(ios::right|ios::fixed);
718 cout <<
"GenJet p/px/py/pz/pt: " << truth->
p() <<
'/' << truth->
px ()
719 <<
'/' << truth->
py() <<
'/' << truth->
pz() <<
'/' << truth->
pt() << endl
720 <<
" eta/phi: " << truth->
eta () <<
'/' << truth->
phi () << endl
721 <<
" # of constituents: " << mcparts.size() << endl;
722 cout <<
" constituents:" << endl;
723 for (
unsigned i = 0;
i < mcparts.size ();
i++) {
725 cout <<
" #" <<
i <<
" PDG code:" << mcpart->
pdgId()
726 <<
", p/pt/eta/phi: " << mcpart->
p() <<
'/' << mcpart->
pt()
727 <<
'/' << mcpart->
eta() <<
'/' << mcpart->
phi() << endl;
virtual int pdgId() const
PDG identifier.
virtual double p() const
magnitude of momentum vector
#define BOOK1D(name, title, nbinsx, lowx, highx)
float chargedEmEnergy() const
chargedEmEnergy
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
std::vector< GenJet > GenJetCollection
collection of GenJet objects
#define SETAXES(name, xtitle, ytitle)
int chargedMultiplicity() const
chargedMultiplicity
Jets made from PFObjects.
virtual double eta() const
momentum pseudorapidity
float neutralEmEnergy() const
neutralEmEnergy
virtual ~PFJetBenchmark()
void gettrue(const reco::GenJet *truth, double &true_ChargedHadEnergy, double &true_NeutralHadEnergy, double &true_NeutralEmEnergy)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
virtual double energy() const
energy
void setup(std::string Filename, bool debug, bool plotAgainstReco=0, bool onlyTwoJets=1, double deltaRMax=0.1, std::string benchmarkLabel_="ParticleFlow", double recPt=-1, double maxEta=-1, DQMStore *dbe_store=NULL)
bool isNull() const
Checks for null.
#define BOOK2D(name, title, nbinsx, lowx, highx, nbinsy, lowy, highy)
virtual std::string print() const
Print object in details.
static double deltaR(const T *, const U *)
#define DBOOK2D(name, title, nbinsx, lowx, highx, nbinsy, lowy, highy)
Jets made from MC generator particles.
virtual std::vector< const GenParticle * > getGenConstituents() const
get all constituents
int neutralMultiplicity() const
neutralMultiplicity
void process(const reco::PFJetCollection &, const reco::GenJetCollection &)
double deltaR(double eta1, double eta2, double phi1, double phi2)
double resChargedHadEnergyMax_
static const Collection::value_type * matchByDeltaR(const T *, const Collection *)
virtual double px() const
x coordinate of momentum vector
virtual double pt() const
transverse momentum
virtual double pz() const
z coordinate of momentum vector
std::vector< PFJet > PFJetCollection
collection of PFJet objects
double resNeutralHadEnergyMax_
void printPFJet(const reco::PFJet *)
virtual std::vector< reco::PFCandidatePtr > getPFConstituents() const
get all constituents
float neutralHadronEnergy() const
neutralHadronEnergy
float chargedMuEnergy() const
chargedMuEnergy
double resNeutralEmEnergyMax_
#define DSETAXES(name, xtitle, ytitle)
virtual double phi() const
momentum azimuthal angle
void printGenJet(const reco::GenJet *)
#define DBOOK1D(name, title, nbinsx, lowx, highx)
float chargedHadronEnergy() const
chargedHadronEnergy
virtual double py() const
y coordinate of momentum vector
void setCurrentFolder(const std::string &fullpath)