Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:56

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