File indexing completed on 2024-04-06 11:58:57
0001 {
0002 gStyle -> SetOptStat(1);
0003 gStyle->SetPalette(1);
0004 gStyle->SetPadGridX(1);
0005 gStyle->SetPadGridY(1);
0006
0007
0008 Int_t sample=0;
0009
0010
0011 TString imgpath("~/afs/public_html/pfcorrs/v02/");
0012
0013
0014 TFile* fMC = new TFile("~/nobackup/arch/hcalCorrPFv13_35cm.root","OPEN");
0015
0016
0017 TCut tr_cut = "eParticle>45 && eParticle<55"; label = new TText(0.03,0.2, "Pions 50 GeV "); sample=50;
0018
0019 label -> SetNDC(); label->SetTextAlign(11); label->SetTextSize(0.05); label->SetTextAngle(90); label->SetTextColor(kRed);
0020
0021 TCut trkQual = "";
0022
0023 TCut mip_cut = "eECAL09cm<1.";
0024 TCut hit_dist = "delR<16";
0025 TCut mc_dist = "";
0026
0027
0028 TCut low_resp_cut = "eHcalCone/eParticle>0.2";
0029 TCut maxPNearBy = "";
0030
0031 TCut neutral_iso_cut = "(abs(iEta)<=13&&(eECAL40cm-eECAL09cm)<6.8)||(abs(iEta)==14&&(eECAL40cm-eECAL09cm)<6.6)||(abs(iEta)==15&&(eECAL40cm-eECAL09cm)<6.6)||(abs(iEta)==16&&(eECAL40cm-eECAL09cm)<9.8)||(abs(iEta)==17&&(eECAL40cm-eECAL09cm)<10.4)||(abs(iEta)==18&&(eECAL40cm-eECAL09cm)<9.8)||(abs(iEta)==19&&(eECAL40cm-eECAL09cm)<11.0)||(abs(iEta)==20&&(eECAL40cm-eECAL09cm)<12.3)||(abs(iEta)==21&&(eECAL40cm-eECAL09cm)<13.6)||(abs(iEta)==22&&(eECAL40cm-eECAL09cm)<15.2)||(abs(iEta)==23&&(eECAL40cm-eECAL09cm)<15.4)||(abs(iEta)==24&&(eECAL40cm-eECAL09cm)<16.3)||(abs(iEta)==25&&(eECAL40cm-eECAL09cm)<16.1)||(abs(iEta)==26&&(eECAL40cm-eECAL09cm)<15.4)||(abs(iEta)==27&&(eECAL40cm-eECAL09cm)<15.4)||abs(iEta)>27";
0032
0033 TCut selection = trkQual && neutral_iso_cut && tr_cut && mip_cut && hit_dist && mc_dist && maxPNearBy && low_resp_cut;
0034
0035 TTree* ftreeMC = (TTree*)fMC->Get("hcalPFcorrs/pfTree");
0036
0037
0038 TCanvas* c1 = new TCanvas("c1","all",0,0,350,350);
0039 c1-> cd();
0040
0041 c1 -> SetLogy();
0042
0043
0044 ftreeMC -> Draw("eParticle>>hMC", selection&&"abs(iEta)>29");
0045
0046 hMC -> SetTitle("eParticle");
0047 hMC -> SetFillColor(kRed-10);
0048 label -> Draw();
0049 c1->SaveAs(imgpath+"p01.png");
0050 hMC->Delete();
0051
0052
0053 ftreeMC -> Draw("iEta>>hMC", selection);
0054 hMC -> SetTitle("iEta");
0055 hMC -> SetFillColor(kRed-10);
0056 label -> Draw();
0057 c1->SaveAs(imgpath+"p02.png");
0058 hMC->Delete();
0059
0060 ftreeMC -> Draw("eECAL>>hMC", tr_cut && trkQual, "hist");
0061 hMC -> SetTitle("EM energy");
0062 hMC -> SetFillColor(kRed-10);
0063 label -> Draw();
0064 c1->SaveAs(imgpath+"p03.png");
0065 hMC->Delete();
0066
0067 c1 -> SetLogy(0);
0068
0069 ftreeMC -> Draw("iPhi>>hMC", selection&&"abs(iEta)<17");
0070 hMC -> SetTitle("iPhi at |iEta|<17)");
0071 hMC -> SetFillColor(kRed-10);
0072 label -> Draw();
0073 c1->SaveAs(imgpath+"p04.png");
0074 hMC->Delete();
0075
0076
0077 ftreeMC -> Draw("iPhi>>hMC", selection&&"abs(iEta)>=17 && abs(iEta)<21");
0078 hMC -> SetTitle("iPhi at 17<=|iEta|<21)");
0079 hMC -> SetFillColor(kRed-10);
0080 label -> Draw();
0081 c1->SaveAs(imgpath+"p05.png");
0082 hMC->Delete();
0083
0084
0085 ftreeMC -> Draw("iPhi>>hMC", selection&&"abs(iEta)>=21&&abs(iEta)<29");
0086 hMC -> SetTitle("iPhi at 21<=|iEta|<29");
0087 hMC -> SetFillColor(kRed-10);
0088 label -> Draw();
0089 c1->SaveAs(imgpath+"p06.png");
0090 hMC->Delete();
0091
0092 ftreeMC -> Draw("iPhi>>hMC", selection&&"abs(iEta)>=29");
0093 hMC -> SetTitle("iPhi at |iEta|>=29");
0094 hMC -> SetFillColor(kRed-10);
0095 label -> Draw();
0096 c1->SaveAs(imgpath+"p07.png");
0097 hMC->Delete();
0098
0099
0100
0101 ftreeMC -> Draw("UsedCells>>hMC", selection&&"abs(iEta)<17");
0102 hMC -> SetBins(20, 0,20);
0103 hMC -> SetTitle("Number of Hits, HB (|iEta|<17)");
0104 hMC -> SetFillColor(kRed-10);
0105 label -> Draw();
0106 hMC -> SetNdivisions(110);
0107 c1->SaveAs(imgpath+"p08.png");
0108 hMC->Delete();
0109
0110
0111 ftreeMC -> Draw("UsedCells>>hMC", selection&&"abs(iEta)>=17 && abs(iEta)<21");
0112 hMC -> SetBins(20, 0,20);
0113 hMC -> SetTitle("Number of Hits, HE (17<=|iEta|<21)");
0114 hMC -> SetFillColor(kRed-10);
0115 label -> Draw();
0116 hMC -> SetNdivisions(110);
0117 c1->SaveAs(imgpath+"p09.png");
0118 hMC->Delete();
0119
0120
0121 ftreeMC -> Draw("UsedCells>>hMC", selection&&"abs(iEta)>=21&&abs(iEta)<29");
0122 hMC -> SetBins(20, 0,20);
0123 hMC -> SetTitle("Number of Hits, HB (21<=|iEta|<29)");
0124 hMC -> SetFillColor(kRed-10);
0125 label -> Draw();
0126 hMC -> SetNdivisions(110);
0127 c1->SaveAs(imgpath+"p10.png");
0128 hMC->Delete();
0129
0130 ftreeMC -> Draw("UsedCells>>hMC", selection&&"abs(iEta)>=29");
0131 hMC -> SetBins(20, 0,20);
0132 hMC -> SetTitle("Number of Hits, HF (|iEta|>=29)");
0133 hMC -> SetFillColor(kRed-10);
0134 label -> Draw();
0135 hMC -> SetNdivisions(110);
0136 c1->SaveAs(imgpath+"p11.png");
0137 hMC->Delete();
0138
0139 ftreeMC -> Draw("eHcalCone>>hMC", selection);
0140 hMC -> SetTitle("eHcal in cone");
0141 hMC -> SetFillColor(kRed-10);
0142
0143 label -> Draw();
0144 c1->SaveAs(imgpath+"p12.png");
0145 hMC -> Delete();
0146
0147
0148 ftreeMC -> Draw("eHcalCone/eParticle>>hMC", selection&&"abs(iEta)<17");
0149 hMC -> SetTitle("eHcal/eParticle at |iEta|<17");
0150 hMC -> SetFillColor(kRed-10);
0151 label -> Draw();
0152 c1->SaveAs(imgpath+"p13.png");
0153 hMC -> Delete();
0154
0155
0156 ftreeMC -> Draw("eHcalCone/eParticle>>hMC", selection&&"abs(iEta)>=17 && abs(iEta)<21");
0157 hMC -> SetTitle("eHcal/eParticle at 17<=|iEta|<21");
0158 hMC -> SetFillColor(kRed-10);
0159 label -> Draw();
0160 c1->SaveAs(imgpath+"p14.png");
0161 hMC -> Delete();
0162
0163
0164 ftreeMC -> Draw("eHcalCone/eParticle>>hMC", selection&&"abs(iEta)>=21 && abs(iEta)<29");
0165 hMC -> SetTitle("eHcal/eParticle at 21<=|iEta|<29");
0166 hMC -> SetFillColor(kRed-10);
0167 label -> Draw();
0168 c1->SaveAs(imgpath+"p15.png");
0169 hMC -> Delete();
0170
0171
0172 ftreeMC -> Draw("eHcalCone/eParticle>>hMC", selection&&"abs(iEta)>=29");
0173 hMC -> SetTitle("eHcal/eParticle at |iEta|>=29");
0174 hMC -> SetFillColor(kRed-10);
0175 label -> Draw();
0176 c1->SaveAs(imgpath+"p16.png");
0177 hMC -> Delete();
0178
0179 ftreeMC -> Draw("eHcalCone/eParticle:iEta>>hMC(83,-42.5,42.5)", selection, "prof");
0180 hMC -> SetTitle("eHcal/eParticle vs iEta");
0181 hMC -> SetFillColor(kRed-10);
0182 hMC -> SetMaximum(1.2);
0183 hMC -> SetMinimum(0.1);
0184 label -> Draw();
0185 c1->SaveAs(imgpath+"p17.png");
0186 hMC -> Delete();
0187
0188 ftreeMC -> Draw("eHcalCone/eParticle:iPhi>>hMC", selection, "prof");
0189 hMC -> SetTitle("eHcal/eParticle vs iPhi");
0190 hMC -> SetMaximum(1.2);
0191 hMC -> SetMinimum(0.1);
0192
0193 hMC -> SetFillColor(kRed-10);
0194 label -> Draw();
0195 c1->SaveAs(imgpath+"p18.png");
0196 hMC -> Delete();
0197
0198 c1 -> SetLogy(0);
0199
0200 ftreeMC -> Draw("eParticle/e5x5:iEta>>hMC(83,-42.5,42.5)", selection,"prof");
0201 hMC -> SetTitle("Corrections");
0202 hMC -> SetFillColor(kRed-10);
0203 label -> Draw();
0204 c1->SaveAs(imgpath+"p19.png");
0205 hMC -> Delete();
0206
0207
0208
0209
0210
0211
0212
0213
0214
0215
0216 ftreeMC -> Draw("etaParticle>>hMC", selection);
0217 hMC -> SetTitle("eta of MC particle");
0218 hMC -> SetFillColor(kRed-10);
0219 label -> Draw();
0220 c1->SaveAs(imgpath+"p20.png");
0221 hMC -> Delete();
0222
0223 ftreeMC -> Draw("phiParticle>>hMC", selection, "");
0224 hMC -> SetTitle("phi of MC particle");
0225 hMC -> SetFillColor(kRed-10);
0226 label -> Draw();
0227 c1->SaveAs(imgpath+"p21.png");
0228 hMC -> Delete();
0229
0230
0231 ftreeMC -> Draw("etaParticle:etaGPoint>>hMC", selection, "prof");
0232 hMC -> SetTitle("etaMC vs etaGPoint");
0233 hMC -> SetXTitle("eta");
0234 label -> Draw();
0235 c1->SaveAs(imgpath+"p22.png");
0236 hMC -> Delete();
0237
0238 ftreeMC -> Draw("phiParticle:phiGPoint>>hMC", selection, "prof");
0239 hMC -> SetTitle("phiMC vs phiGPoint");
0240 hMC -> SetXTitle("phi");
0241 label -> Draw();
0242 c1->SaveAs(imgpath+"p23.png");
0243 hMC -> Delete();
0244
0245
0246 ftreeMC -> Draw("(eECAL40cm-eECAL09cm)>>hMC", selection, "");
0247 hMC -> SetTitle("neutral energy");
0248 hMC -> SetFillColor(kRed-10);
0249 label -> Draw();
0250 c1->SaveAs(imgpath+"p24.png");
0251 hMC -> Delete();
0252
0253 c1 -> SetLogy();
0254
0255 ftreeMC -> Draw("delRmc>>hMC", "delRmc<1.", "");
0256 hMC -> SetTitle("#DeltaR(genTrack, recoTrack)");
0257 hMC -> SetFillColor(kRed-10);
0258 label -> Draw();
0259 c1->SaveAs(imgpath+"p25.png");
0260 hMC -> Delete();
0261
0262
0263 ftreeMC -> Draw("delR>>hMC", selection, "");
0264 hMC -> SetTitle("#DeltaR(hotHit, trackHit)");
0265 hMC -> SetFillColor(kRed-10);
0266 label -> Draw();
0267 c1->SaveAs(imgpath+"p26.png");
0268 hMC -> Delete();
0269
0270
0271 ftreeMC -> Draw("iPhi>>hMC", selection&&"abs(iEta)>=29");
0272 hMC -> SetTitle("iPhi at |iEta|>=29");
0273 hMC -> SetFillColor(kRed-10);
0274 label -> Draw();
0275 c1->SaveAs(imgpath+"p07.png");
0276 hMC->Delete();
0277
0278
0279
0280 ftreeMC -> Draw("iPhi>>hMC", selection&&"abs(iEta)>=29");
0281 hMC -> SetTitle("iPhi at |iEta|>=29");
0282 hMC -> SetFillColor(kRed-10);
0283 label -> Draw();
0284 c1->SaveAs(imgpath+"p07.png");
0285 hMC->Delete();
0286
0287
0288
0289 c1 -> SetLogy();
0290
0291
0292 gStyle -> SetOptStat(0);
0293 ftreeMC -> Draw("nTracks>>hMC", "abs(etaParticle)<2.","");
0294 hMC -> SetTitle("nTracks");
0295 hMC -> SetLineColor(kRed+2);
0296 c1->SaveAs(imgpath+"p30.png");
0297
0298 hMC->Delete();
0299
0300
0301 ftreeMC -> Draw("trkQual[0]>>hMC1", "");
0302 hMC1 -> SetMinimum(0.1);
0303 ftreeMC -> Draw("trkQual[1]>>hMC2", "", "same");
0304 ftreeMC -> Draw("trkQual[2]>>hMC3", "", "same");
0305 ftreeMC -> Draw("trkQual[3]>>hMC4", "", "same");
0306 hMC1 -> SetTitle("trkQual");
0307 hMC1 -> SetLineColor(kRed+2);
0308 hMC2 -> SetLineColor(kBlue+2);
0309 hMC3 -> SetLineColor(kGreen+2);
0310 hMC4 -> SetLineColor(kYellow+2);
0311 c1->SaveAs(imgpath+"p31.png");
0312
0313 hMC1->Delete();
0314 hMC2->Delete();
0315 hMC3->Delete();
0316 hMC4->Delete();
0317
0318 c1 -> SetLogy();
0319
0320 ftreeMC -> Draw("numValidTrkHits[0]>>hMC1", "");
0321
0322 ftreeMC -> Draw("numValidTrkHits[1]>>hMC2", "", "same");
0323 ftreeMC -> Draw("numValidTrkHits[2]>>hMC3", "", "same");
0324 ftreeMC -> Draw("numValidTrkHits[3]>>hMC4", "", "same");
0325 hMC1 -> SetTitle("numValidTrkHits");
0326 hMC1 -> SetLineColor(kRed+2);
0327 hMC2 -> SetLineColor(kBlue+2);
0328 hMC3 -> SetLineColor(kGreen+2);
0329 hMC4 -> SetLineColor(kYellow+2);
0330 c1->SaveAs(imgpath+"p32.png");
0331
0332 hMC1->Delete();
0333 hMC2->Delete();
0334 hMC3->Delete();
0335 hMC4->Delete();
0336
0337 ftreeMC -> Draw("numValidTrkStrips[0]>>hMC1", "abs(trackEta)>1.7");
0338
0339 ftreeMC -> Draw("numValidTrkStrips[1]>>hMC2", "abs(trackEta)>1.7", "same");
0340 ftreeMC -> Draw("numValidTrkStrips[2]>>hMC3", "abs(trackEta)>1.7", "same");
0341 ftreeMC -> Draw("numValidTrkStrips[3]>>hMC4", "abs(trackEta)>1.7", "same");
0342 hMC1 -> SetTitle("numValidTrkStrips");
0343 hMC1 -> SetLineColor(kRed+2);
0344 hMC2 -> SetLineColor(kBlue+2);
0345 hMC3 -> SetLineColor(kGreen+2);
0346 hMC4 -> SetLineColor(kYellow+2);
0347 c1->SaveAs(imgpath+"p33.png");
0348
0349 hMC1->Delete();
0350 hMC2->Delete();
0351 hMC3->Delete();
0352 hMC4->Delete();
0353
0354 ftreeMC -> Draw("numLayers[0]>>hMC1", "");
0355 ftreeMC -> Draw("numLayers[1]>>hMC2", "", "same");
0356 ftreeMC -> Draw("numLayers[2]>>hMC3", "", "same");
0357 ftreeMC -> Draw("numLayers[3]>>hMC4", "", "same");
0358 hMC1 -> SetTitle("numLayers");
0359 hMC1 -> SetLineColor(kRed+2);
0360 hMC2 -> SetLineColor(kBlue+2);
0361 hMC3 -> SetLineColor(kGreen+2);
0362 hMC4 -> SetLineColor(kYellow+2);
0363 c1->SaveAs(imgpath+"p34.png");
0364
0365 hMC1->Delete();
0366 hMC2->Delete();
0367 hMC3->Delete();
0368 hMC4->Delete();
0369
0370 ftreeMC -> Draw("trackP[0]>>hMC1", "trackP[0]<150");
0371 ftreeMC -> Draw("trackP[1]>>hMC2", "trackP[1]<150", "same");
0372 ftreeMC -> Draw("trackP[2]>>hMC3", "trackP[2]<150", "same");
0373 ftreeMC -> Draw("trackP[3]>>hMC4", "trackP[3]<150", "same");
0374 hMC1 -> SetTitle("trackP");
0375 hMC1 -> SetLineColor(kRed+2);
0376 hMC2 -> SetLineColor(kBlue+2);
0377 hMC3 -> SetLineColor(kGreen+2);
0378 hMC4 -> SetLineColor(kYellow+2);
0379 c1->SaveAs(imgpath+"p35.png");
0380
0381 hMC1->Delete();
0382 hMC2->Delete();
0383 hMC3->Delete();
0384 hMC4->Delete();
0385
0386
0387
0388 ftreeMC -> Draw("trackEta[0]>>hMC1", "");
0389 ftreeMC -> Draw("trackEta[1]>>hMC2", "", "same");
0390 ftreeMC -> Draw("trackEta[2]>>hMC3", "", "same");
0391 ftreeMC -> Draw("trackEta[3]>>hMC4", "", "same");
0392 hMC1 -> SetTitle("trackEta");
0393 hMC1 -> SetLineColor(kRed+2);
0394 hMC2 -> SetLineColor(kBlue+2);
0395 hMC3 -> SetLineColor(kGreen+2);
0396 hMC4 -> SetLineColor(kYellow+2);
0397 c1->SaveAs(imgpath+"p36.png");
0398 hMC1->Delete();
0399 hMC2->Delete();
0400 hMC3->Delete();
0401 hMC4->Delete();
0402
0403 c1 -> SetLogy(0);
0404 ftreeMC -> Draw("trackPhi[0]>>hMC1", "");
0405 ftreeMC -> Draw("trackPhi[1]>>hMC2", "", "same");
0406 ftreeMC -> Draw("trackPhi[2]>>hMC3", "", "same");
0407 ftreeMC -> Draw("trackPhi[3]>>hMC4", "", "same");
0408 hMC1 -> SetTitle("trackPhi");
0409 hMC1 -> SetLineColor(kRed+2);
0410 hMC2 -> SetLineColor(kBlue+2);
0411 hMC3 -> SetLineColor(kGreen+2);
0412 hMC4 -> SetLineColor(kYellow+2);
0413 c1->SaveAs(imgpath+"p37.png");
0414
0415 hMC1->Delete();
0416 hMC2->Delete();
0417 hMC3->Delete();
0418 hMC4->Delete();
0419
0420 c1-> SetLogy();
0421
0422 ftreeMC -> Draw("delRmc[0]>>hMC1", "delRmc[0]<1.");
0423 ftreeMC -> Draw("delRmc[1]>>hMC2", "delRmc[1]<1.", "same");
0424 ftreeMC -> Draw("delRmc[2]>>hMC3", "delRmc[2]<1.", "same");
0425 ftreeMC -> Draw("delRmc[3]>>hMC4", "delRmc[3]<1.", "same");
0426 hMC1 -> SetTitle("delRmc");
0427 hMC1 -> SetLineColor(kRed+2);
0428 hMC2 -> SetLineColor(kBlue+2);
0429 hMC3 -> SetLineColor(kGreen+2);
0430 hMC4 -> SetLineColor(kYellow+2);
0431 c1->SaveAs(imgpath+"p38.png");
0432
0433 hMC1->Delete();
0434 hMC2->Delete();
0435 hMC3->Delete();
0436 hMC4->Delete();
0437
0438 c1-> SetLogy(0);
0439
0440 ftreeMC -> Draw("sqrt(xAtHcal*xAtHcal+yAtHcal*yAtHcal):zAtHcal>>hMC", "","box");
0441 hMC -> SetTitle("r vs z");
0442 hMC -> SetFillColor(kRed+2);
0443 label -> Draw();
0444 c1->SaveAs(imgpath+"p39.png");
0445 hMC->Delete();
0446
0447 ftreeMC -> Draw("zAtHcal:iEta>>hMC", "","box");
0448 hMC -> SetTitle("z vs iEta");
0449 hMC -> SetLineColor(kRed+2);
0450 c1->SaveAs(imgpath+"p40.png");
0451
0452 hMC->Delete();
0453
0454
0455 fMC->Close();
0456
0457
0458 }