Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:48:17

0001 {
0002   gStyle -> SetOptStat(1);
0003   gStyle->SetPalette(1);
0004   gStyle->SetPadGridX(1);
0005   gStyle->SetPadGridY(1);
0006   //gStyle -> SetTitleFont(82);
0007   gStyle -> SetTextFont(102);
0008   //  Int_t fillstyle = 3008;
0009 Int_t sample=0;
0010 
0011 // TString imgpath("~/afs/public_html/validation/cone26piminus/");  
0012 // TFile* tf = new TFile("./ValidFile_minus.root","OPEN");
0013 // TString imgpath("~/afs/public_html/validation/cone26piplus/");  
0014 // TFile* tf = new TFile("./ValidFile_plus.root","OPEN");
0015 
0016  TString imgpath("~/afs/public_html/validation/");  
0017 // TFile* tf = new TFile("~/afs/arch/ValidFile_data2360.root","OPEN");
0018  TFile* tf = new TFile("~/afs/arch/ValidFile_data900v4.root","OPEN");
0019 // TFile* tf = new TFile("~/afs/arch/ValidFile_MC900v4.root","OPEN");
0020  //TFile* tf = new TFile("./ValidFile_XX_4.root","OPEN");
0021   
0022 
0023   //TCut tr_cut = "eTrack>47 && eTrack<53";  label = new TText(0.03,0.2, "50 GeV"); sample=50;
0024 
0025 //  TCut tr_cut = "eTrack>41 && eTrack<59";  label = new TText(0.03,0.2, "40-60 GeV"); sample=50;
0026 //  TCut tr_cut = "eTrack>5 && eTrack<60";  label = new TText(0.03,0.2, "MinBias 900"); sample=900;
0027   TCut tr_cut = "eTrack>5 && eTrack<60";  label = new TText(0.03,0.2, "Data @ 900 GeV"); sample=900;
0028 
0029   
0030 label -> SetNDC();
0031 label->SetTextAlign(11); 
0032 label->SetTextSize(0.05);
0033 label->SetTextAngle(90);
0034  label->SetTextColor(kRed);
0035 
0036   TCut test = "";
0037 //   TCut test = "eCentHitBefore/eClustBefore>1.";
0038 TCut tr_quality = "numValidTrkHits>11 && (abs(etaTrack) <= 1.47 || numValidTrkStrips>=11)"; 
0039  TCut mip_cut = "eECAL<1";
0040 // TCut hit_dist = "sqrt(dietatr*dietatr+diphitr*diphitr)<1.5";
0041  TCut hit_dist = "iDr<1.5";
0042  TCut ptNear = "PtNearBy<2";
0043 TCut selection = test && tr_cut && mip_cut && tr_quality && hit_dist && ptNear;
0044   
0045 
0046 //  TTree* ftree = (TTree*)tf->Get("fTree");  
0047 //  TTree* ttree = (TTree*)tf->Get("tTree");
0048   TTree* ftree = (TTree*)tf->Get("ValidationIsoTrk/fTree");  
0049   TTree* ttree = (TTree*)tf->Get("ValidationIsoTrk/tTree");
0050    Int_t  nentries = (Int_t)ftree->GetEntries();
0051   Double_t nent = 1.;
0052   TCanvas* c1 = new TCanvas("c1","all",0,0,350,350);
0053   c1-> cd();
0054     
0055   ftree -> Draw("eTrack>>eTrack", selection);
0056   eTrack -> SetTitle("eTrack");
0057 label -> Draw();
0058   c1 -> SetLogy();
0059    c1->SaveAs(imgpath+"p01.png");  
0060    
0061   ftree -> Draw("eECAL>>eECAL", tr_cut, "");
0062   //  ftree -> Draw("eECAL>>eECAL", tr_cut&& tr_quality && hit_dist, "");
0063   eECAL -> SetLineColor(kRed-2);
0064   eECAL -> SetTitle("EM energy");
0065 label -> Draw();
0066   c1->SaveAs(imgpath+"p02.png");  
0067 
0068   c1 -> SetLogy(0);
0069 
0070   ftree -> Draw("numHits>>nh2", selection&&"abs(iEta)>17");
0071 nh2 -> SetBins(20, 0,20);
0072   ftree -> Draw("numHits>>nh1", selection&&"abs(iEta)<14", "same");
0073   nh2 -> SetTitle("Number of Hits");
0074   nh1 -> SetLineColor(kOrange+2);
0075   nh2 -> SetLineColor(kBlue+2);
0076   leg = new TLegend(0.7,0.6,0.99,0.83);
0077   leg -> SetTextSize(0.04);
0078   leg->AddEntry(nh1,"#splitline{HBarrel}{|iEta|<14}","l");
0079   leg->AddEntry(nh2,"#splitline{HEndcap}{|iEta|>17}","l");
0080   leg -> Draw();
0081 label -> Draw();
0082   c1->SaveAs(imgpath+"p03.png");  
0083 
0084   ftree -> Draw("eTrack>>hh1", selection);
0085   ftree -> Draw("eClustAfter>>hh2", selection);
0086   ftree -> Draw("eClustBefore>>hh3", selection);
0087 hh2 -> SetLineColor(kGreen+2);
0088 hh3 -> SetLineColor(kRed+1);
0089   hh1 -> SetTitle("eTrack and eHcalClast");
0090   hh1 -> Draw("");
0091 hh1 -> SetAxisRange(0.,60.);
0092   //Double_t hmax = hh2->GetMaximum();
0093   //hh2->SetMaximum(hmax + hmax*0.1);
0094   hh3 -> Draw("same");
0095   hh2 -> Draw("same");
0096   leg = new TLegend(0.62,0.55,0.99,0.75);
0097   leg -> SetTextSize(0.04);
0098   leg->AddEntry(hh1,"orig. track","l");
0099   leg->AddEntry(hh3,"tr. bef calib","l");
0100   leg->AddEntry(hh2,"tr. aft calib","l");
0101   leg -> Draw();
0102 label -> Draw();
0103   c1->SaveAs(imgpath+"p04.png");  
0104   hh1 -> Delete();
0105   hh2 -> Delete();
0106   hh3 -> Delete();
0107 
0108 
0109   ftree -> Draw("iEta>>hh1", selection);
0110   hh1 -> SetTitle("iEta");
0111 label -> Draw();
0112   c1->SaveAs(imgpath+"p05.png");  
0113   hh1 -> Delete();
0114 
0115   ftree -> Draw("iPhi>>hh2", selection&&"abs(iEta)>20");
0116   ftree -> Draw("iPhi>>hh1", selection&&"abs(iEta)<20", "same");
0117   hh1 -> SetLineColor(kRed+1);
0118   hh2 -> SetLineColor(kBlue+1);
0119   hh2 -> SetTitle("iPhi");
0120   leg = new TLegend(0.68,0.55,0.99,0.7);
0121 if (sample==300){
0122   ftree -> Draw("iPhi>>hh3", selection&&"abs(iEta)<14", "same");
0123   ftree -> Draw("iPhi>>hh4", selection&&"abs(iEta)>14 && abs(iEta)<20", "same");
0124   hh3 -> SetLineColor(kGreen+1);
0125   hh4 -> SetLineColor(kOrange+1);
0126   leg = new TLegend(0.68,0.5,0.99,0.73);
0127   leg->AddEntry(hh3,"|iEta|<14","l");
0128   leg->AddEntry(hh4,"14<|iEta|<20","l");
0129 }
0130   leg -> SetTextSize(0.036);
0131   leg->AddEntry(hh1,"|iEta|<20","l");
0132   leg->AddEntry(hh2,"|iEta|>20","l");
0133   leg -> Draw();
0134 label -> Draw();
0135   c1->SaveAs(imgpath+"p06.png");  
0136   hh1 -> Delete();
0137   hh2 -> Delete();
0138    
0139   ftree -> Draw("eClustBefore/eTrack>>hh1", selection, "goff");
0140   hh1 -> SetTitle("Response = eHcalClast/eTrack");
0141   hh1 -> SetLineColor(kRed+1);
0142 hh1 -> SetAxisRange(0., 5);
0143   hh1 -> Draw();
0144   ftree -> Draw("eClustAfter/eTrack>>hh2", selection, "same");
0145   hh2 -> SetLineColor(kGreen+2);
0146   leg = new TLegend(0.68,0.77,0.99,0.91);
0147   leg -> SetTextSize(0.04);
0148   leg->AddEntry(hh1,"bef calib","l");
0149   leg->AddEntry(hh2,"aft calib","l");
0150   leg -> Draw();
0151 label -> Draw();
0152  Float_t mean1 = hh1 ->GetMean();
0153  Float_t mean2 = hh2 ->GetMean();
0154  Float_t rmsh1 = hh1 ->GetRMS();
0155  Float_t rmsh2 = hh2 ->GetRMS();
0156  //cout<<"mean1: "<<mean1<<"   mean2: "<<mean2<<endl;
0157  m1 = new TText(0.7,0.63, Form("mean1: %1.2f",mean1));  
0158  r1 = new TText(0.7,0.58, Form(" rms1: %1.2f",rmsh1));  
0159  m2 = new TText(0.7,0.45, Form("mean2: %1.2f", mean2));
0160  r2 = new TText(0.7,0.4, Form(" rms2: %1.2f", rmsh2));
0161  m1 -> SetNDC();
0162  m2 -> SetNDC();
0163  r1 -> SetNDC();
0164  r2 -> SetNDC();
0165  m1 -> Draw();  
0166  m2 -> Draw();  
0167  r1 -> Draw();  
0168  r2 -> Draw();  
0169  c1->SaveAs(imgpath+"p07a.png");  
0170   hh1 -> Delete();
0171   hh2 -> Delete();
0172 
0173 //  ftree -> Draw("eClustAfter/eTrack>>hh2", selection&&"abs(iEta)<17 && eClustAfter/eTrack>0.2", 
0174 //"goff");
0175 //  ftree -> Draw("eClustBefore/eTrack>>hh1", selection&&"abs(iEta)<17 && eClustBefore/eTrack>0.2", 
0176 //"goff");
0177   ftree -> Draw("eClustAfter/eTrack>>hh2", selection&&"abs(iEta)<17", "goff");
0178   ftree -> Draw("eClustBefore/eTrack>>hh1", selection&&"abs(iEta)<17", "goff");
0179   hh2 -> SetLineColor(kGreen+2);
0180   hh1 -> SetLineColor(kRed+1);
0181   hh2 -> SetTitle("Response in HBarrel |iEta|<17");
0182 hh2 -> SetAxisRange(0., 5);
0183   hh2 -> Draw("");
0184   hh1 -> Draw("same");
0185   leg = new TLegend(0.68,0.77,0.99,0.91);
0186   leg -> SetTextSize(0.04);
0187   leg->AddEntry(hh1,"bef calib","l");
0188   leg->AddEntry(hh2,"aft calib","l");
0189   leg -> Draw();
0190 label -> Draw();
0191  Float_t mean1 = hh1 ->GetMean();
0192  Float_t mean2 = hh2 ->GetMean();
0193  Float_t rmsh1 = hh1 ->GetRMS();
0194  Float_t rmsh2 = hh2 ->GetRMS();
0195  //cout<<"mean1: "<<mean1<<"   mean2: "<<mean2<<endl;
0196  m1 = new TText(0.7,0.63, Form("mean1: %1.2f",mean1));  
0197  r1 = new TText(0.7,0.58, Form(" rms1: %1.2f",rmsh1));  
0198  m2 = new TText(0.7,0.45, Form("mean2: %1.2f", mean2));
0199  r2 = new TText(0.7,0.4, Form(" rms2: %1.2f", rmsh2));
0200  m1 -> SetNDC();
0201  m2 -> SetNDC();
0202  r1 -> SetNDC();
0203  r2 -> SetNDC();
0204  m1 -> Draw();  
0205  m2 -> Draw();  
0206  r1 -> Draw();  
0207  r2 -> Draw();  
0208   c1->SaveAs(imgpath+"p07b.png");  
0209   hh1 -> Delete();
0210   hh2 -> Delete();
0211 
0212 //  ftree -> Draw("eClustAfter/eTrack>>hh2", selection&&"abs(iEta)>17  && eClustAfter/eTrack>0.2");
0213 //  ftree -> Draw("eClustBefore/eTrack>>hh1", selection&&"abs(iEta)>17  && eClustBefore/eTrack>0.2");
0214   ftree -> Draw("eClustAfter/eTrack>>hh2", selection&&"abs(iEta)>17");
0215   ftree -> Draw("eClustBefore/eTrack>>hh1", selection&&"abs(iEta)>17");
0216   hh2 -> SetLineColor(kGreen+2);
0217   hh1 -> SetLineColor(kRed+1);
0218   hh2 -> SetTitle("Response in HEndcap |iEta|>17");
0219  hh2 -> SetAxisRange(0., 5);
0220  hh2 -> Draw("");
0221   hh1 -> Draw("same");
0222   leg = new TLegend(0.68,0.77,0.99,0.91);
0223   leg -> SetTextSize(0.04);
0224   leg->AddEntry(hh1,"bef calib","l");
0225   leg->AddEntry(hh2,"aft calib","l");
0226   leg -> Draw();
0227 label -> Draw();
0228  Float_t mean1 = hh1 ->GetMean();
0229  Float_t mean2 = hh2 ->GetMean();
0230  Float_t rmsh1 = hh1 ->GetRMS();
0231  Float_t rmsh2 = hh2 ->GetRMS();
0232  //cout<<"mean1: "<<mean1<<"   mean2: "<<mean2<<endl;
0233  m1 = new TText(0.7,0.63, Form("mean1: %1.2f",mean1));  
0234  r1 = new TText(0.7,0.58, Form(" rms1: %1.2f",rmsh1));  
0235  m2 = new TText(0.7,0.45, Form("mean2: %1.2f", mean2));
0236  r2 = new TText(0.7,0.4, Form(" rms2: %1.2f", rmsh2));
0237  m1 -> SetNDC();
0238  m2 -> SetNDC();
0239  r1 -> SetNDC();
0240  r2 -> SetNDC();
0241  m1 -> Draw();  
0242  m2 -> Draw();  
0243  r1 -> Draw();  
0244  r2 -> Draw();  
0245   c1->SaveAs(imgpath+"p07c.png");  
0246   hh1 -> Delete();
0247   hh2 -> Delete();
0248 
0249 
0250   ftree -> Draw("eClustAfter/eTrack>>hh2", selection&&"abs(iEta)<17");
0251   ftree -> Draw("eClustAfter/eTrack>>hh3", selection&&"abs(iEta)>17");
0252   hh2 -> SetLineColor(kYellow+2);
0253   hh3 -> SetLineColor(kBlue+2);
0254   hh3 -> SetTitle("Response after calibration");
0255   hh3 -> SetAxisRange(0., 5);
0256 hh3 -> Draw("");
0257 //Double_t hmax = hh1->GetMaximum();
0258 //hh2->SetMaximum(hmax+ 100);
0259   hh2 -> Draw("same");
0260   leg = new TLegend(0.68,0.61,0.99,0.75);
0261   leg -> SetTextSize(0.04);
0262   leg->AddEntry(hh2,"HBarrel","l");
0263   leg->AddEntry(hh3,"HEndcap","l");
0264   leg -> Draw();
0265 label -> Draw();
0266   c1->SaveAs(imgpath+"p07d.png");  
0267   hh2 -> Delete();
0268   hh3 -> Delete();
0269 
0270   ftree -> Draw("(eClustAfter+eECAL)/eTrack>>hh1", tr_cut&& tr_quality && hit_dist && ptNear&&"abs(iEta)<17", "goff");
0271   ftree -> Draw("eClustAfter/eTrack>>hh2", tr_cut&& tr_quality && hit_dist && ptNear&&"abs(iEta)<17", "goff");
0272   ftree -> Draw("eClustAfter/eTrack>>hh3", selection&&"abs(iEta)<17", "goff");
0273 hh1 -> SetLineColor(kGreen+2);
0274 hh2 -> SetLineColor(kBlue+3);
0275 hh3 -> SetLineColor(kBlue);
0276   hh1 -> SetTitle("Response in HBarrel |iEta| < 17 after calibration");
0277   //  TH1F * hh1c =  hh1 -> DrawCopy("");
0278   // hh1c -> SetAxisRange(0.2,5.1);
0279   hh1 -> SetAxisRange(0., 5);
0280 hh1 -> Draw("");
0281   hh2 -> Draw("same");
0282   hh3 -> Draw("same");
0283   leg = new TLegend(0.65,0.65,0.99,0.92);
0284   leg -> SetTextSize(0.04);
0285   leg->AddEntry(hh1,"#splitline{not MIP}{E=E_{had}+ E_{em}}","l");
0286   leg->AddEntry(hh2,"#splitline{not MIP}{E = E_{had}}","l");
0287   leg->AddEntry(hh3,"MIP, E_{em}<1","l");
0288   leg -> Draw();
0289 label -> Draw();
0290   c1->SaveAs(imgpath+"p07e.png");  
0291   hh1 -> Delete();
0292   hh2 -> Delete();
0293   hh3 -> Delete();
0294 
0295 
0296   ftree -> Draw("(eClustAfter+eECAL)/eTrack>>hh1", tr_cut&& tr_quality && hit_dist && ptNear&&"abs(iEta)>17");
0297   ftree -> Draw("eClustAfter/eTrack>>hh2", tr_cut&& tr_quality && hit_dist && ptNear&&"abs(iEta)>17");
0298   ftree -> Draw("eClustAfter/eTrack>>hh3", selection&&"abs(iEta)>17");
0299   hh1 -> SetLineColor(kGreen+2);
0300 hh2 -> SetLineColor(kBlue+3);
0301 hh3 -> SetLineColor(kBlue);
0302   hh1 -> SetTitle("Response in HEndcap |iEta| > 17 after calibration");
0303 hh1 -> SetAxisRange(0., 5);
0304   hh1 -> Draw("");
0305   hh2 -> Draw("same");
0306   hh3 -> Draw("same");
0307   leg = new TLegend(0.65,0.65,0.99,0.92);
0308   leg -> SetTextSize(0.04);
0309   leg->AddEntry(hh1,"#splitline{not MIP}{E=E_{had}+ E_{em}}","l");
0310   leg->AddEntry(hh2,"#splitline{not MIP}{E = E_{had}}","l");
0311   leg->AddEntry(hh3,"MIP, E_{em}<1","l");
0312   leg -> Draw();
0313 label -> Draw();
0314   c1->SaveAs(imgpath+"p07f.png");  
0315   hh1 -> Delete();
0316   hh2 -> Delete();
0317   hh3 -> Delete();
0318 
0319 
0320 
0321   ftree -> Draw("eClustAfter/eTrack:eTrack>>hh1", selection && "abs(iEta) < 17", "prof");
0322   ftree -> Draw("eClustAfter/eTrack:eTrack>>hh2", selection && "abs(iEta) > 17", "prof");
0323   hh2 -> SetTitle("eHcalClast/eTrack vs eTrack (After Calib)");
0324   hh2 -> SetMaximum(2.3);
0325   hh2 -> SetMinimum(0.3);
0326  if (sample==10)   {hh2 -> SetMinimum(0.4);}
0327   hh2 -> SetLineColor(kBlue+2);
0328   hh1 -> SetLineColor(kGreen+2+2);
0329   hh1 -> Draw("same");
0330   leg = new TLegend(0.6,0.55,0.97,0.75);
0331   leg -> SetTextSize(0.04);
0332   leg->AddEntry(hh1,"|iEta| < 17","l");
0333   leg->AddEntry(hh2,"|iEta| > 17","l");
0334   leg -> Draw();
0335 label -> Draw();
0336   c1 -> SaveAs(imgpath+"p08.png");  
0337   hh1 -> Delete();
0338   hh2 -> Delete();
0339 
0340   ftree -> Draw("eClustBefore/eTrack:eTrack>>hh1", selection, "prof");
0341   ftree -> Draw("eClustAfter/eTrack:eTrack>>hh2", selection, "prof");
0342   hh2 -> SetTitle("eHcalClast/eTrack vs eTrack");
0343   hh2 -> SetLineColor(kGreen+2);
0344   hh1 -> SetLineColor(kRed+1);
0345   hh2 -> SetMaximum(2.3);
0346   hh2 -> SetMinimum(0.3);
0347  if (sample==10)   {hh2 -> SetMinimum(0.4);}
0348   hh1 -> Draw("same");
0349   leg = new TLegend(0.6,0.55,0.97,0.75);
0350   leg -> SetTextSize(0.04);
0351   leg->AddEntry(hh1,"Before Calib","l");
0352   leg->AddEntry(hh2,"After Calib","l");
0353   leg -> Draw();
0354 label -> Draw();
0355   c1 -> SaveAs(imgpath+"p09.png");  
0356   hh1 -> Delete();
0357   hh2 -> Delete();
0358 
0359   ftree -> Draw("eClustAfter/eTrack:eTrack>>hh1", selection, "prof");
0360   ftree -> Draw("eClustAfter/eTrack:eTrack>>hh2", tr_cut && tr_quality && hit_dist && ptNear, "prof same");
0361   ftree -> Draw("(eClustAfter+eECAL)/eTrack:eTrack>>hh3", tr_cut && tr_quality && hit_dist && ptNear, "prof same");
0362   hh1 -> SetTitle("eHcalClast/eTr vs eTr with and w/o ECAL");
0363   hh2 -> SetLineColor(kGreen+2);
0364   hh1 -> SetLineColor(kBlue);
0365   hh1 -> SetMaximum(2.3);
0366   hh1 -> SetMinimum(0.3);
0367   //hh1 -> Draw("same");
0368   leg = new TLegend(0.6,0.55,0.97,0.75);
0369   leg -> SetTextSize(0.04);
0370   leg->AddEntry(hh1, "MIP","l");
0371   leg->AddEntry(hh3, "E=E_{had}+E_{ecal}","l");
0372   leg->AddEntry(hh2,"E=E_{had}","l");
0373   leg -> Draw();
0374 label -> Draw();
0375   c1 -> SaveAs(imgpath+"p10.png");  
0376   hh1 -> Delete();
0377   hh2 -> Delete();
0378   hh3 -> Delete();
0379 
0380   
0381   ftree -> Draw("eBeforeDepth2>>hh3", selection && "eBeforeDepth2>0 && abs(iEta)>17");
0382   ftree -> Draw("eAfterDepth2>>hh4", selection && "eAfterDepth2>0 && abs(iEta)>17");
0383   ftree -> Draw("eBeforeDepth1>>hh1", selection && "eBeforeDepth1>0 && abs(iEta)>17");
0384   ftree -> Draw("eAfterDepth1>>hh2", selection && "eAfterDepth1>0 && abs(iEta)>17");
0385  
0386   hh1 -> SetLineColor(kRed+1);
0387   hh2 -> SetLineColor(kGreen+2);
0388   hh3 -> SetLineColor(kBlue+1);
0389   hh4 -> SetLineColor(kGreen+5);
0390 hh2 -> SetTitle("Energy in Depths 1 and 2");
0391 hh2 -> SetAxisRange(0., 50);
0392 hh2 ->Draw("");
0393 hh3 ->Draw("same");
0394 hh4 ->Draw("same");
0395 hh1 ->Draw("same");
0396   leg = new TLegend(0.53,0.45,0.97,0.75);
0397   leg -> SetTextSize(0.04);
0398   leg->AddEntry(hh1,"d=1 Before Calib","l");
0399   leg->AddEntry(hh2,"d=1 After Calib","l");
0400   leg->AddEntry(hh3,"d=2 Before Calib","l");
0401   leg->AddEntry(hh4,"d=2 After Calib","l");
0402   leg -> Draw();
0403 label -> Draw();
0404   c1->SaveAs(imgpath+"p11.png");  
0405   hh1 -> Delete();
0406   hh2 -> Delete();
0407   hh3 -> Delete();
0408   hh4 -> Delete();
0409 
0410   
0411   ftree -> Draw("log10(eAfterDepth1/eAfterDepth2)>>hh1", selection && "eAfterDepth2>1 && eAfterDepth1>1 && abs(iEta)>17", "");
0412   hh1 -> SetTitle("log10(eDepth1/eDepth2) at |iEta|>17");
0413   hh1 -> SetLineColor(kBlue);
0414 //  c1 -> SetLogy();
0415 label -> Draw();
0416   c1->SaveAs(imgpath+"p12.png");  
0417   hh1 -> Delete();
0418   c1 -> SetLogy(0);
0419   
0420   ftree -> Draw("eAfterDepth1/eAfterDepth2:iEta>>hh1", selection && "eAfterDepth2>0.1 && eAfterDepth1>0.1 && abs(iEta)>13", "prof");
0421   hh1 -> SetTitle("eDepth1/eDepth2 vs iEta");
0422   hh1 -> SetLineColor(kBlue);
0423 label -> Draw();
0424   c1->SaveAs(imgpath+"p13.png");  
0425   hh1 -> Delete();
0426   
0427   ftree -> Draw("eAfterDepth2/eTrack:eAfterDepth1/eTrack>>hh1", selection && "abs(iEta)>17", "colz");
0428   hh1 -> SetTitle("eD2/p vs eD1/p for |iEta|>17");
0429   hh1 -> SetXTitle("d1/trP");
0430   hh1 -> SetYTitle("d2/trP");
0431 label -> Draw();
0432   c1->SaveAs(imgpath+"p14a.png");  
0433   hh1 -> Delete();
0434 
0435   ftree -> Draw("iPhi:abs(iEta)>>hh1", selection && "abs(iEta)>17 && eAfterDepth1/eTrack<0.1 && eAfterDepth2/eTrack>0.6", "colz");
0436   hh1 -> SetTitle("iPhi vs iEta for eD1/p<0.1, eD2/p>0.6");
0437   hh1 -> SetXTitle("iEta");
0438   hh1 -> SetYTitle("iPhi");
0439 label -> Draw();
0440   c1->SaveAs(imgpath+"p14b.png");  
0441   hh1 -> Delete();
0442   
0443   ftree -> Draw("eClustBefore/eTrack>>hh1", selection &&"abs(iEta)>17 && eAfterDepth1/eTrack<0.1 && eAfterDepth2/eTrack>0.6", "hist");
0444   hh1 -> SetTitle("Response for eD1/p<0.1, eD2/p>0.6");
0445   hh1 -> SetLineColor(kRed+1);
0446   hh1 -> Draw();
0447   ftree -> Draw("eClustAfter/eTrack>>hh2", selection &&"abs(iEta)>17 && eAfterDepth1/eTrack<0.1 && eAfterDepth2/eTrack>0.6", "same");
0448   hh2 -> SetLineColor(kGreen+2);
0449   leg = new TLegend(0.68,0.65,0.99,0.8);
0450   leg -> SetTextSize(0.036);
0451   leg->AddEntry(hh1,"Before Calib","l");
0452   leg->AddEntry(hh2,"After Calib","l");
0453   leg -> Draw();
0454 label -> Draw();
0455   c1->SaveAs(imgpath+"p14c.png");  
0456   hh1 -> Delete();
0457   hh2 -> Delete();
0458 
0459   ftree -> Draw("eventNumber>>hh1", selection);
0460   hh1 -> SetTitle("Event Number");
0461   hh1 -> SetLineColor(kBlue);
0462 label -> Draw();
0463   c1->SaveAs(imgpath+"p15.png");  
0464   hh1 -> Delete();
0465 
0466   ftree -> Draw("runNumber>>hh1", selection);
0467   hh1 -> SetTitle("Run Number");
0468 hh1 -> SetLineColor(kBlue);
0469 hh1 -> SetNdivisions(404);
0470 
0471 label -> Draw();
0472   c1->SaveAs(imgpath+"p16.png");  
0473   hh1 -> Delete();
0474 
0475 
0476   ftree -> Draw("eClustAfter/eTrack:iPhi>>hh1", selection&&"abs(iEta)<17 && eClustAfter/eTrack>0.2", "prof");
0477   ftree -> Draw("eClustBefore/eTrack:iPhi>>hh2", selection&&"abs(iEta)<17 && eClustBefore/eTrack>0.2", "prof");
0478   hh2 -> SetLineColor(kRed+1);
0479   hh1 -> SetLineColor(kGreen+2);
0480   hh2 -> SetMaximum(1.2);
0481   hh2 -> SetMinimum(0.4);
0482  if (sample==10)   {hh2 -> SetMinimum(0.4);}
0483   hh2 -> SetTitle("eHcalClast/eTrack vs iPhi at HB");
0484 hh1 -> Draw("same");
0485   leg = new TLegend(0.4,0.8,0.75,0.92);
0486   leg -> SetTextSize(0.04);
0487   leg->AddEntry(hh2,"Before Calib","l");
0488   leg->AddEntry(hh1,"After Calib","l");
0489   leg -> Draw();
0490 label -> Draw();
0491   c1 -> SaveAs(imgpath+"p17.png");  
0492   hh1 -> Delete();
0493   hh2 -> Delete();
0494 
0495 
0496   ftree -> Draw("eClustAfter/eTrack:iEta>>hh1", selection&&"eClustAfter/eTrack>0.2", "prof");
0497   ftree -> Draw("eClustBefore/eTrack:iEta>>hh2", selection, "prof");
0498   hh2 -> SetMaximum(1.2);
0499   hh2 -> SetMinimum(0.4);
0500  if (sample==10)   {hh2 -> SetMinimum(0.4);}
0501   hh2 -> SetTitle("eHcalClast/eTrack vs iEta");
0502   hh2 -> SetLineColor(kRed+1);
0503   hh1 -> SetLineColor(kGreen+2);
0504   hh1 -> Draw("same");
0505   leg = new TLegend(0.4,0.8,0.75,0.92);
0506   leg -> SetTextSize(0.04);
0507   leg->AddEntry(hh2,"Before Calib","l");
0508   leg->AddEntry(hh1,"After Calib","l");
0509   leg -> Draw();
0510 label -> Draw();
0511   c1 -> SaveAs(imgpath+"p18.png");  
0512   hh1 -> Delete();
0513   hh2  -> Delete();
0514 
0515   ftree -> Draw("eClustAfter/eTrack:iPhi>>hh1", selection && "abs(iEta) < 20", "prof");
0516   ftree -> Draw("eClustAfter/eTrack:iPhi>>hh2", selection && "abs(iEta) > 20", "prof");
0517   hh2 -> SetTitle("eHcalClast/eTrack vs iPhi (After Calib)");
0518   hh2 -> SetMaximum(1.2);
0519   hh2 -> SetMinimum(0.4);
0520  if (sample==10)   {hh2 -> SetMinimum(0.4);}
0521   hh2 -> SetLineColor(kBlue);
0522   hh1 -> SetLineColor(kGreen+2);
0523   hh1 -> Draw("same");
0524   leg = new TLegend(0.4,0.8,0.75,0.92);
0525   leg -> SetTextSize(0.04);
0526   leg->AddEntry(hh1,"|iEta| < 20","l");
0527   leg->AddEntry(hh2,"|iEta| > 20","l");
0528   leg -> Draw();
0529 label -> Draw();
0530   c1 -> SaveAs(imgpath+"p19.png");  
0531   hh1 -> Delete();
0532   hh2 -> Delete();
0533 
0534 
0535   ftree -> Draw("eClustAfter/eTrack:iPhi>>hh2", selection && "iPhi%4==3 && abs(iEta)<20", "prof");
0536   ftree -> Draw("eClustAfter/eTrack:iPhi>>hh1", selection && "iPhi%4==0&& abs(iEta)<20", "prof");
0537   hh1 -> SetLineColor(kBlue);
0538   hh2 -> SetLineColor(kGreen+3);
0539   hh1 -> SetMaximum(1.2);
0540   hh1 -> SetMinimum(0.4);
0541  if (sample==10)   {hh1 -> SetMinimum(0.4);}
0542   hh1 -> SetTitle("eHcalClast/eTrack vs iPhi, |iEta|<20");
0543   hh2 -> Draw("same");
0544   leg = new TLegend(0.4,0.8,0.75,0.92);
0545   leg -> SetTextSize(0.04);
0546   leg->AddEntry(hh1,"iPhi%4=0","l");
0547   leg->AddEntry(hh2,"iPhi%4=3","l");
0548   leg -> Draw();
0549 label -> Draw();
0550   c1 -> SaveAs(imgpath+"p20.png");  
0551   hh1 -> Delete();
0552   hh2 -> Delete();
0553 
0554   ftree -> Draw("eClustAfter/eTrack:iPhi>>hh1", selection && "abs(iEta)>20", "prof");
0555   ftree -> Draw("eClustBefore/eTrack:iPhi>>hh2", selection && "abs(iEta)>20", "prof");
0556   hh1 -> SetLineColor(kBlue+1);
0557   hh2 -> SetLineColor(kRed+1);
0558   hh1 -> SetMaximum(1.2);
0559   hh1 -> SetMinimum(0.4);
0560  if (sample==10)   {hh1 -> SetMinimum(0.4);}
0561   hh1 -> SetTitle("eHcalClast/eTrack vs iPhi, |iEta|>20");
0562 hh1 -> Draw();
0563 hh2 -> Draw("same");
0564   leg = new TLegend(0.4,0.8,0.75,0.92);
0565   leg -> SetTextSize(0.04);
0566   leg->AddEntry(hh1,"after calib","l");
0567   leg->AddEntry(hh2,"before calib","l");
0568   leg -> Draw();
0569 label -> Draw();
0570   c1 -> SaveAs(imgpath+"p21.png");  
0571   hh1 -> Delete();
0572   hh2 -> Delete();
0573 
0574   c1 -> SetLogy();
0575   ftree -> Draw("e3x3After>>hh1", selection&&"e3x3After<100", "");
0576   hh1 -> SetLineColor(kBlue+1);
0577   hh1 -> SetTitle("e3x3");
0578 label -> Draw();
0579   c1 -> SaveAs(imgpath+"p22.png");  
0580   hh1 -> Delete();
0581 
0582 
0583   ftree -> Draw("e3x3Before/eClustBefore>>hh1", selection && "eClustBefore>15", "");
0584   ftree -> Draw("e3x3After/eClustAfter>>hh2", selection && "eClustAfter>15", "");
0585   hh1 -> SetLineColor(kRed+1);
0586   hh2 -> SetLineColor(kGreen+2);
0587   hh2 -> SetTitle("e3x3/eHcalClust");
0588   hh1 -> Draw("same");
0589 label -> Draw();
0590   c1 -> SaveAs(imgpath+"p23.png");  
0591   hh1 -> Delete();
0592   hh2 -> Delete();
0593   c1 -> SetLogy(0);
0594 
0595 
0596   ftree -> Draw("(e5x5After-e3x3After)/eTrack:eTrack>>hh2", selection && "abs(iEta)<17", "prof");
0597   ftree -> Draw("(e5x5After-e3x3After)/eTrack:eTrack>>hh1", selection && "abs(iEta)>17", "prof");
0598   hh1 -> SetLineColor(kBlue);
0599   hh2 -> SetLineColor(kGreen+2);
0600   hh1 -> SetTitle("(e5x5-e3x3)/eTrack vs eTrack");
0601   hh1 -> SetMaximum(0.3);
0602   if (sample=10) {  hh1 -> SetMaximum(0.4);}
0603 hh2 -> Draw("same");
0604   leg = new TLegend(0.65,0.55,0.97,0.75);
0605   leg -> SetTextSize(0.04);
0606   leg->AddEntry(hh1,"|iEta| > 17","l");
0607   leg->AddEntry(hh2,"|iEta| < 17","l");
0608   leg -> Draw();
0609 label -> Draw();
0610   c1 -> SaveAs(imgpath+"p24.png");  
0611   hh1 -> Delete();
0612   hh2 -> Delete();
0613 
0614   c1 -> SetLogy();
0615 //  ftree -> Draw("eCentHitAfter/eClustAfter>>hh1", selection && "eClustAfter>10", "");
0616   ftree -> Draw("eCentHitBefore/eClustBefore>>hh1", selection && "eClustBefore>3", "");
0617   hh1 -> SetLineColor(kBlue+1);
0618   hh1 -> SetTitle("eCentral/eClust");
0619 label -> Draw();
0620   c1 -> SaveAs(imgpath+"p25.png");  
0621   hh1 -> Delete();
0622   c1 -> SetLogy(0);
0623 
0624   ftree -> Draw("(eClustAfter-eCentHitAfter)/eTrack:eTrack>>hh2", selection && "abs(iEta) < 17", "prof");
0625   ftree -> Draw("(eClustAfter-eCentHitAfter)/eTrack:eTrack>>hh1", selection && "abs(iEta) > 17", "prof");
0626   hh1 -> SetLineColor(kBlue);
0627   hh2 -> SetLineColor(kGreen+2);
0628   hh1 -> SetTitle("(eClust-eCentHit)/eTrack vs eTrack");
0629   hh1 -> SetMaximum(0.9);
0630   hh2 -> Draw("same");
0631   leg = new TLegend(0.65,0.55,0.97,0.75);
0632   leg -> SetTextSize(0.04);
0633   leg->AddEntry(hh1,"|iEta| < 17","l");
0634   leg->AddEntry(hh2,"|iEta| > 17","l");
0635   leg -> Draw();
0636 label -> Draw();
0637   c1 -> SaveAs(imgpath+"p26.png");  
0638   hh1 -> Delete();
0639   hh2 -> Delete();
0640 
0641 
0642   ftree -> Draw("(e5x5After-e3x3After)/eTrack:iEta>>hh1", selection, "prof");
0643   hh1 -> SetLineColor(kGreen+2);
0644   hh1 -> SetTitle("(e5x5-e3x3)/eTrack vs iEta");
0645   hh1 -> SetMaximum(0.4);
0646 label -> Draw();
0647   c1 -> SaveAs(imgpath+"p27.png");  
0648   hh1 -> Delete();
0649 
0650   ftree -> Draw("(eClustAfter-eCentHitAfter)/eTrack:iEta>>hh1", selection, "prof");
0651   hh1 -> SetLineColor(kGreen+2);
0652   hh1 -> SetTitle("(eClust-eCentHit)/eTrack vs iEta");
0653   hh1 -> SetMaximum(0.6);
0654 label -> Draw();
0655   c1 -> SaveAs(imgpath+"p28.png");  
0656   hh1 -> Delete();
0657 
0658   
0659   //ftree -> Draw("iDr>>hh1", selection, "");
0660   ftree -> Draw("delR>>hh1", selection, "");
0661   hh1 -> SetLineColor(kGreen+2);
0662   hh1 -> SetTitle("dR(#eta,#phi) maxHit - assosiator point");
0663   //  hh1 -> SetMaximum(0.6);
0664 hh1 -> SetNdivisions(404);
0665 label -> Draw();
0666   c1 -> SaveAs(imgpath+"p29.png");  
0667   hh1 -> Delete();
0668   
0669   ftree -> Draw("(e5x5After-eClustAfter)/eTrack>>hh1", selection, "");
0670   hh1 -> SetLineColor(kBlue);
0671   hh1 -> SetTitle("(e5x5-eClust)/eTrack");
0672 label -> Draw();
0673   c1 -> SaveAs(imgpath+"p30.png");  
0674   hh1 -> Delete();
0675   
0676 
0677 /*  
0678 //Uncomment this if you want these plots. (takes long time to plot)
0679  TH1F * rms1 = new TH1F("rms1","rms", 51, -25, 25);
0680  TH1F * rms2 = new TH1F("rms2","rms", 51, -25, 25);
0681 
0682  Float_t imean;
0683  Float_t irms;
0684 
0685   for (Int_t i=-22; i<23; i++)
0686     {
0687       if (i==0) continue;
0688       TCut myiEta = Form("iEta==%i",i);
0689      
0690       ftree -> Draw("eClustAfter/eTrack>>hh1", selection && myiEta, "goff");
0691       ftree -> Draw("eClustBefore/eTrack>>hh2", selection && myiEta, "goff");
0692       irms = hh1->GetRMS();
0693       rms1->Fill(i,irms);           
0694       irms = hh2->GetRMS();
0695       rms2->Fill(i,irms);     
0696 
0697     }
0698 
0699  rms1 -> SetTitle("rms(Resp) vs iEta");
0700  rms1 -> SetMarkerColor(kBlue);
0701  rms2 -> SetMarkerColor(kRed+1);
0702  rms1 -> SetMarkerStyle(23);
0703  rms2 -> SetMarkerStyle(27);
0704 rms1 -> SetMaximum(0.3);//0.5 for 10 GeV
0705  rms1 -> Draw("p");
0706  rms2 -> Draw("p same");
0707 label -> Draw();
0708   c1 -> SaveAs(imgpath+"p31.png");  
0709 rms1 -> Delete();
0710 rms2 -> Delete();
0711 
0712 
0713  TH1F * rms1 = new TH1F("rms1","rms", 51, -25, 25);
0714  TH1F * rms2 = new TH1F("rms2","rms", 51, -25, 25);
0715 
0716 
0717   for (Int_t i=-22; i<23; i++)
0718     {
0719       if (i==0) continue;
0720       TCut myiEta = Form("iEta==%i",i);     
0721       ftree -> Draw("eClustAfter/eTrack>>hh1", selection && myiEta, "goff");
0722       ftree -> Draw("eClustBefore/eTrack>>hh2", selection && myiEta, "goff");
0723       imean = hh1->GetMean();
0724       irms = hh1->GetRMS();
0725       rms1 -> Fill(i,irms/imean);           
0726       imean = hh2->GetMean();
0727       irms = hh2->GetRMS();
0728       rms2-> Fill(i,irms/imean);     
0729 
0730     }
0731 
0732  rms1 -> SetTitle("rms(Resp)/mean vs iEta");
0733  rms1 -> SetMarkerColor(kBlue);
0734  rms2 -> SetMarkerColor(kRed+1);
0735  rms1 -> SetMarkerStyle(23);
0736  rms2 -> SetMarkerStyle(27);
0737 rms1 -> SetMaximum(0.3);//0.5 for 10 GeV
0738  rms1 -> Draw("p");
0739  rms2 -> Draw("p same");
0740 label -> Draw();
0741   c1 -> SaveAs(imgpath+"p32.png");  
0742 
0743     hh1 -> Delete();
0744    hh2 -> Delete();
0745 */
0746 
0747   ftree -> Draw("iTime>>hh2", selection&&"abs(iEta)>17", "");
0748  ftree -> Draw("iTime>>hh1", selection&&"abs(iEta)<15", "same");
0749 //hh1 -> SetAxisRange(-20, 20);
0750 //hh2 -> SetMaximum(hh1->GetMaximum()+10);
0751 
0752   //hh1 -> SetLineColor(kBlue+1);
0753   hh2 -> SetTitle("time in central rechit");
0754   hh1 -> SetLineColor(kOrange+3);
0755   hh2 -> SetLineColor(kBlue+2);
0756   leg = new TLegend(0.7,0.7,0.99,0.83);
0757   leg -> SetTextSize(0.04);
0758   leg->AddEntry(hh1,"HBarrel","l");
0759   leg->AddEntry(hh2,"HEndcap","l");
0760   leg -> Draw();
0761 label -> Draw();
0762   c1 -> SaveAs(imgpath+"p33.png");  
0763   hh1 -> Delete();
0764   hh2 -> Delete();
0765 
0766 
0767   ftree -> Draw("HTime>>hh1", selection&&"Iteration$<numHits && abs(iEta)<15 && abs(HTime)<100");
0768   ftree -> Draw("iTime>>hh2", selection&&"abs(iEta)<15", "same");
0769 //hh1 -> SetMaximum(hh2->GetMaximum()+10);
0770   hh1 -> SetTitle("time in HBarrel");
0771   hh2 -> SetLineColor(kBlue+1);
0772   leg = new TLegend(0.5,0.7,0.99,0.83);
0773   leg -> SetTextSize(0.04);
0774   leg->AddEntry(hh1,"rechits in cluster","l");
0775   leg->AddEntry(hh2,"central hit","l");
0776   leg -> Draw();
0777 label -> Draw();
0778   c1 -> SaveAs(imgpath+"p34.png");  
0779   hh1 -> Delete();
0780   hh2 -> Delete();
0781 
0782   ftree -> Draw("HTime>>hh1", selection&&"Iteration$<numHits && abs(iEta)>17 && abs(HTime)<100", "");
0783   ftree -> Draw("iTime>>hh2", selection&&"abs(iEta)>17 ", "same");
0784 //hh1 -> SetMaximum(hh2->GetMaximum()+10);
0785   hh2 -> SetLineColor(kBlue+1);
0786   hh1 -> SetTitle("time in HEndcap");
0787   leg = new TLegend(0.5,0.7,0.99,0.83);
0788   leg -> SetTextSize(0.04);
0789   leg->AddEntry(hh1,"rechits in cluster","l");
0790   leg->AddEntry(hh2,"central hit","l");
0791   leg -> Draw();
0792 label -> Draw();
0793   c1 -> SaveAs(imgpath+"p35.png");  
0794   hh1 -> Delete();
0795   hh2 -> Delete();
0796 
0797 
0798   c1 -> SetLogy();
0799   ftree -> Draw("PtNearBy>>hh1", "", "");
0800   hh1 -> SetTitle("pt near");
0801 label -> Draw();
0802   c1 -> SaveAs(imgpath+"p36.png");  
0803   hh1 -> Delete();
0804   c1 -> SetLogy(0);
0805 
0806   ftree -> Draw("numValidTrkHits>>hh1", tr_cut && mip_cut && hit_dist, "");
0807 //hh1 -> SetMaximum(hh2->GetMaximum()+10);
0808   hh1 -> SetTitle("track pattern: numberOfValidHits()");
0809 label -> Draw();
0810   c1 -> SaveAs(imgpath+"p37.png");  
0811   hh1 -> Delete();
0812 
0813   c1 -> SetLogy(1);
0814 
0815   ftree -> Draw("numValidTrkStrips>>hh1", tr_cut && mip_cut && hit_dist &&"iEta<17", "");
0816   hh1 -> SetTitle("track pattern: numberOfValidStripTECHits(). HB");
0817   hh1 -> SetLineColor(kRed+1);
0818 label -> Draw();
0819   c1 -> SaveAs(imgpath+"p38.png");  
0820   hh1 -> Delete();
0821 
0822 
0823   ftree -> Draw("numValidTrkStrips>>hh1", tr_cut && mip_cut && hit_dist && "iEta>18", "");
0824   hh1 -> SetTitle("track pattern: numberOfValidStripTECHits(). HE");
0825   hh1 -> SetLineColor(kBlue+1);
0826 label -> Draw();
0827   c1 -> SaveAs(imgpath+"p39.png");  
0828   hh1 -> Delete();
0829 
0830   ftree -> Draw("sqrt((abs(iEta-iEtaTr)+abs(iPhi-iPhiTr)))>>hh1", selection, "");
0831   //  ftree -> Draw("sqrt(abs(iEta-iEtaTr)+abs(iPhi-iPhiTr))>>hh2", selection, "");
0832   // ftree -> Draw("abs(iEta-iEtaTr)>>hh3", selection, "same");
0833   hh1 -> SetLineColor(kGreen+2);
0834   //  hh2 -> SetLineColor(kRed);
0835   //hh3 -> SetLineColor(kBlue+2);
0836   hh1 -> SetTitle("maxHit - trackHit");
0837   //  hh1 -> SetMaximum(0.6);
0838 label -> Draw();
0839   c1 -> SaveAs(imgpath+"p40.png");  
0840   hh1 -> Delete();
0841 
0842   ftree -> Draw("iDr>>hh1", tr_cut && mip_cut && tr_quality && ptNear, "");
0843 //  ftree -> Draw("sqrt(dietatr*dietatr+diphitr*diphitr)>>hh1", tr_cut && mip_cut && tr_quality && 
0844 //ptNear, "");
0845   hh1 -> SetLineColor(kGreen+2);
0846   hh1 -> SetTitle("maxHit - trackHit distance");
0847   hh1 -> SetXTitle("#sqrt{#Deltai#eta^2 + #Deltai#phi^2}");
0848 label -> Draw();
0849   c1 -> SaveAs(imgpath+"p41.png");  
0850   hh1 -> Delete();
0851 
0852 c1 -> SetLogy(0);
0853 
0854   ftree -> Draw("etaTrack>>hh1", selection, "");
0855   hh1 -> SetTitle("eta Track");
0856 label -> Draw();
0857    c1->SaveAs(imgpath+"p42.png");  
0858    hh1 -> Delete();
0859 
0860   ftree -> Draw("phiTrack>>hh1", selection, "");
0861   hh1 -> SetTitle("phi Track");
0862 label -> Draw();
0863    c1->SaveAs(imgpath+"p43.png");  
0864    hh1 -> Delete();
0865 
0866 
0867   ftree -> Draw("eECAL:iEta>>hh1", selection, "lego");
0868 //  ftree -> Draw("eECAL>>hh1", selection&&"iEta>17", "");
0869   hh1 -> SetTitle("ecal energy cs iEta");
0870   hh1 -> SetYTitle("energy");
0871   hh1 -> SetXTitle("iEta");
0872 label -> Draw();
0873    c1->SaveAs(imgpath+"p44.png");  
0874    hh1 -> Delete();
0875 
0876   c1 -> SetLogy();
0877   ftree -> Draw("eECAL>>hh1", selection&&"abs(iEta)>17", "");
0878  ftree -> Draw("eECAL>>hh2", selection&&"abs(iEta)<17", "same");
0879   hh1 -> SetTitle("ecal energy vs iEta");
0880   hh1 -> SetXTitle("energy");
0881   hh1 -> SetLineColor(kGreen+2);
0882   hh2 -> SetLineColor(kRed+2);
0883   leg = new TLegend(0.6,0.7,0.99,0.83);
0884   leg -> SetTextSize(0.04);
0885   leg->AddEntry(hh2,"|iEta|<17","l");
0886   leg->AddEntry(hh1,"|iEta|>17","l");
0887   leg -> Draw();
0888 label -> Draw();
0889    c1->SaveAs(imgpath+"p45.png");  
0890    hh1 -> Delete();
0891    hh2 -> Delete();
0892   c1 -> SetLogy(0);
0893 
0894 
0895   ftree -> Draw("iEta:iPhi>>hh1", selection&&"abs(iEta)<20", "colz");
0896   hh1 -> SetTitle("iEta-iPhi occupancy");
0897   hh1 -> SetYTitle("iEta");
0898   hh1 -> SetXTitle("iPhi");
0899 label -> Draw();
0900    c1->SaveAs(imgpath+"p46.png");  
0901    hh1 -> Delete();
0902 
0903   ftree -> Draw("iEta:iPhi>>hh1", selection&&"abs(iEta)>20", "colz");
0904   hh1 -> SetTitle("iEta-iPhi occupancy");
0905   hh1 -> SetYTitle("iEta");
0906   hh1 -> SetXTitle("iPhi");
0907 label -> Draw();
0908    c1->SaveAs(imgpath+"p47.png");  
0909    hh1 -> Delete();
0910 
0911   ftree -> Draw("eCentHitAfter:iPhi>>hh1", selection&&"abs(iEta)==22", "prof");
0912   hh1 -> SetTitle("eCentralHit vs iPhi for |iEta|=22");
0913   hh1 -> SetYTitle("energy");
0914   hh1 -> SetXTitle("iPhi");
0915   hh1 -> SetMinimum(0);
0916   hh1 -> SetMaximum(20);
0917 label -> Draw();
0918    c1->SaveAs(imgpath+"p48.png");  
0919    hh1 -> Delete();
0920 
0921 
0922   ftree -> Draw("eClustAfter/eTrack:iPhi>>hh1", selection&&"abs(iEta)==21", "prof");
0923   ftree -> Draw("eClustAfter/eTrack:iPhi>>hh2", selection&&"abs(iEta)==22", "prof same");
0924   ftree -> Draw("eClustAfter/eTrack:iPhi>>hh3", selection&&"abs(iEta)==23", "prof same");
0925   ftree -> Draw("eClustAfter/eTrack:iPhi>>hh4", selection&&"abs(iEta)==24", "prof same");
0926   hh1 -> SetTitle("Response vs iPhi");
0927   hh1 -> SetYTitle("Response");
0928   hh1 -> SetXTitle("iPhi");
0929   hh1 -> SetMaximum(1.5);
0930   hh1 -> SetMinimum(0.2);
0931   hh1 -> SetLineColor(kRed);
0932   hh2 -> SetLineColor(kGreen+2);
0933   hh3 -> SetLineColor(kBlue+2);
0934   hh4 -> SetLineColor(kYellow+2);
0935 
0936 leg = new TLegend(0.7,0.75,0.99,0.93);
0937   leg -> SetTextSize(0.04);
0938   leg->AddEntry(hh1,"|iEta|=21","l");
0939   leg->AddEntry(hh2,"|iEta|=22","l");
0940   leg->AddEntry(hh3,"|iEta|=23","l");
0941   leg->AddEntry(hh4,"|iEta|=24","l");
0942   leg -> Draw();
0943 
0944 label -> Draw();
0945  c1->SaveAs(imgpath+"p49.png");  
0946  hh1 -> Delete();
0947  hh2 -> Delete();
0948  hh3 -> Delete();
0949  hh4 -> Delete();
0950 
0951 
0952   ftree -> Draw("eClustAfter/eTrack:iPhi>>hh1(72,0,72)", selection&&"iEta==21", "prof");
0953   ftree -> Draw("eClustAfter/eTrack:iPhi>>hh2(72,0,72)", selection&&"iEta==22", "prof same");
0954   ftree -> Draw("eClustAfter/eTrack:iPhi>>hh3(72,0,72)", selection&&"iEta==-21", "prof same");
0955   ftree -> Draw("eClustAfter/eTrack:iPhi>>hh4(72,0,72)", selection&&"iEta==-22", "prof same");
0956   hh1 -> SetTitle("Response vs iPhi");
0957   hh1 -> SetYTitle("Response");
0958   hh1 -> SetXTitle("iPhi");
0959   hh1 -> SetMaximum(1.5);
0960   hh1 -> SetMinimum(0.2);
0961   hh1 -> SetLineColor(kRed);
0962   hh2 -> SetLineColor(kGreen+2);
0963   hh3 -> SetLineColor(kBlue+2);
0964   hh4 -> SetLineColor(kYellow+2);
0965 
0966 leg = new TLegend(0.7,0.75,0.99,0.93);
0967   leg -> SetTextSize(0.04);
0968   leg->AddEntry(hh1,"iEta=21","l");
0969   leg->AddEntry(hh2,"iEta=22","l");
0970   leg->AddEntry(hh3,"iEta=-21","l");
0971   leg->AddEntry(hh4,"iEta=-22","l");
0972   leg -> Draw();
0973 
0974 label -> Draw();
0975  c1->SaveAs(imgpath+"p50.png");  
0976  hh1 -> Delete();
0977  hh2 -> Delete();
0978  hh3 -> Delete();
0979  hh4 -> Delete();
0980 
0981 
0982   tf->Close();
0983 }
0984