Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:33:36

0001 void V0ValHistoPublisher(char* newFile="NEW_FILE", char* refFile="REF_FILE") {
0002 
0003   gROOT->Reset();
0004   gROOT->SetBatch();
0005 
0006   // Many of these style statements will likely require tweaking
0007   //  to work with the V0 histograms
0008   gROOT->SetStyle("Plain");
0009   gStyle->SetPadGridX(kTRUE);
0010   gStyle->SetPadGridY(kTRUE);
0011   gStyle->SetPadRightMargin(0.07);
0012   gStyle->SetPadLeftMargin(0.13);
0013   gStyle->SetOptTitle(1);
0014   //gStyle->SetTitleXSize(0.07); 
0015   //gStyle->SetTitleXOffset(0.6); 
0016   //tyle->SetTitleYSize(0.3);
0017   //gStyle->SetLabelSize(0.6) 
0018   //gStyle->SetTextSize(0.5);
0019   char* refLabel("REF_LABEL, REF_RELEASE REFSELECTION");
0020   char* newLabel("NEW_LABEL, NEW_RELEASE NEWSELECTION");
0021   //char* refLabel2("");
0022 
0023   TFile* infile1 = new TFile(refFile);
0024   infile1->cd("DQMData/Vertexing/V0V/EffFakes");
0025   TDirectory* refdir = gDirectory;
0026   TList* hList1 = refdir->GetListOfKeys();
0027   infile1->cd("DQMData/Vertexing/V0V/Other");
0028   TDirectory* refdir_1 = gDirectory;
0029   TList* hList1_1 = refdir_1->GetListOfKeys();
0030 
0031   TFile* infile2 = new TFile(newFile);
0032   infile2->cd("DQMData/Vertexing/V0V/EffFakes");
0033   TDirectory* newdir = gDirectory;
0034   TList* hList2 = newdir->GetListOfKeys();
0035   infile2->cd("DQMData/Vertexing/V0V/Other");
0036   TDirectory* newdir_1 = gDirectory;
0037   TList* hList2_1 = newdir_1->GetListOfKeys();
0038 
0039   TCanvas* canvas;
0040 
0041   // Kshort plots
0042   TH1F *ksEffEta, *ksTkEffEta;
0043   TH1F *ksEffPt, *ksTkEffPt;
0044   TH1F *ksEffR, *ksTkEffR;
0045 
0046   TH1F *ksNewEffEta, *ksNewTkEffEta;
0047   TH1F *ksNewEffPt, *ksNewTkEffPt;
0048   TH1F *ksNewEffR, *ksNewTkEffR;
0049 
0050   TH1F *ksFakeEta, *ksTkFakeEta;
0051   TH1F *ksFakePt, *ksTkFakePt;
0052   TH1F *ksFakeR, *ksTkFakeR;
0053 
0054   TH1F *ksNewFakeEta, *ksNewTkFakeEta;
0055   TH1F *ksNewFakePt, *ksNewTkFakePt;
0056   TH1F *ksNewFakeR, *ksNewTkFakeR;
0057 
0058   TH1F *ksNewFakeMass, *ksNewGoodMass;
0059   TH1F *ksNewMassAll;
0060   TH1F *ksFakeMass, *ksGoodMass;
0061   TH1F* ksMassAll;
0062 
0063   // K0s Efficiency plots from reference release
0064   //refdir->GetObject(hList1->At(0)->GetName(), ksEffEta);
0065   refdir->GetObject(hList1->FindObject("K0sEffVsEta")->GetName(), ksEffEta);
0066   ksEffEta->GetYaxis()->SetRangeUser(0, 1.1);
0067   
0068   //refdir->GetObject(hList1->At(6)->GetName(), ksTkEffEta);
0069   refdir->GetObject(hList1->FindObject("K0sTkEffVsEta")->GetName(), ksTkEffEta);
0070   ksTkEffEta->GetYaxis()->SetRangeUser(0, 1.1);
0071 
0072   //refdir->GetObject(hList1->At(1)->GetName(), ksEffPt);
0073   refdir->GetObject(hList1->FindObject("K0sEffVsPt")->GetName(), ksEffPt);
0074   ksEffPt->GetYaxis()->SetRangeUser(0, 1.1);
0075   ksEffPt->GetYaxis()->SetTitle("K^{0}_{S} Efficiency vs p_{T}");
0076   ksEffPt->GetYaxis()->SetTitleSize(0.05);
0077   ksEffPt->GetYaxis()->SetTitleOffset(1.2);
0078   ksEffPt->SetTitle("");
0079 
0080   //refdir->GetObject(hList1->At(7)->GetName(), ksTkEffPt);
0081   refdir->GetObject(hList1->FindObject("K0sTkEffVsPt")->GetName(), ksTkEffPt);
0082   ksTkEffPt->GetYaxis()->SetRangeUser(0, 1.1);
0083   ksTkEffPt->GetYaxis()->SetTitle("K^{0}_{S} Tracking Efficiency vs p_{T}");
0084   ksTkEffPt->GetYaxis()->SetTitleSize(0.05);
0085   ksTkEffPt->GetYaxis()->SetTitleOffset(1.2);
0086   ksTkEffPt->SetTitle("");
0087 
0088   //refdir->GetObject(hList1->At(2)->GetName(), ksEffR);
0089   refdir->GetObject(hList1->FindObject("K0sEffVsR")->GetName(), ksEffR);
0090   ksEffR->GetYaxis()->SetRangeUser(0, 1.1);
0091 
0092   //refdir->GetObject(hList1->At(8)->GetName(), ksTkEffR);
0093   refdir->GetObject(hList1->FindObject("K0sTkEffVsR")->GetName(), ksTkEffR);
0094   ksTkEffR->GetYaxis()->SetRangeUser(0, 1.1);
0095 
0096   // K0S mass plots from ref release
0097   refdir_1->GetObject(hList1_1->FindObject("ksMassFake")->GetName(), ksFakeMass);
0098   ksFakeMass->SetXTitle(//"Mass of fake Ks, ref release");
0099             refLabel);
0100   refdir_1->GetObject(hList1_1->FindObject("ksMassGood")->GetName(), ksGoodMass);
0101   ksGoodMass->SetXTitle(//"Mass of good Ks, ref release");
0102             refLabel);
0103   refdir_1->GetObject(hList1_1->FindObject("ksMassAll")->GetName(), ksMassAll);
0104   ksMassAll->SetXTitle(//"Mass of all found Ks, ref release");
0105                refLabel);
0106 
0107 
0108   // K0s efficiency plots from new release
0109   //newdir->GetObject(hList1->At(0)->GetName(), ksNewEffEta);
0110   newdir->GetObject(hList2->FindObject("K0sEffVsEta")->GetName(), ksNewEffEta);
0111   ksNewEffEta->GetYaxis()->SetRangeUser(0, 1.1);
0112 
0113   //newdir->GetObject(hList1->At(6)->GetName(), ksNewTkEffEta);
0114   newdir->GetObject(hList2->FindObject("K0sTkEffVsEta")->GetName(), ksNewTkEffEta);
0115   ksNewTkEffEta->GetYaxis()->SetRangeUser(0, 1.1);
0116 
0117   //newdir->GetObject(hList1->At(1)->GetName(), ksNewEffPt);
0118   newdir->GetObject(hList2->FindObject("K0sEffVsPt")->GetName(), ksNewEffPt);
0119   ksNewEffPt->GetYaxis()->SetRangeUser(0, 1.1);
0120   ksNewEffPt->GetYaxis()->SetRangeUser(0, 1.1);
0121   ksNewEffPt->GetYaxis()->SetTitle("K^{0}_{S} Efficiency vs p_{T}");
0122   ksNewEffPt->GetYaxis()->SetTitleSize(0.05);
0123   ksNewEffPt->GetYaxis()->SetTitleOffset(1.2);
0124   ksNewEffPt->SetTitle("");
0125 
0126   //newdir->GetObject(hList1->At(7)->GetName(), ksNewTkEffPt);
0127   newdir->GetObject(hList2->FindObject("K0sTkEffVsPt")->GetName(), ksNewTkEffPt);
0128   ksNewTkEffPt->GetYaxis()->SetRangeUser(0, 1.1);
0129   ksNewTkEffPt->GetYaxis()->SetTitle("K^{0}_{S} Tracking Efficiency vs p_{T}");
0130   ksNewTkEffPt->GetYaxis()->SetTitleSize(0.05);
0131   ksNewTkEffPt->GetYaxis()->SetTitleOffset(1.2);
0132   ksNewTkEffPt->SetTitle("");
0133 
0134   //newdir->GetObject(hList1->At(2)->GetName(), ksNewEffR);
0135   newdir->GetObject(hList2->FindObject("K0sEffVsR")->GetName(), ksNewEffR);
0136   ksNewEffR->GetYaxis()->SetRangeUser(0, 1.1);
0137 
0138   //newdir->GetObject(hList1->At(8)->GetName(), ksNewTkEffR);
0139   newdir->GetObject(hList2->FindObject("K0sTkEffVsR")->GetName(), ksNewTkEffR);
0140   ksNewTkEffR->GetYaxis()->SetRangeUser(0, 1.1);
0141 
0142   // K0S mass plots from new release
0143   newdir_1->GetObject(hList2_1->FindObject("ksMassFake")->GetName(), ksNewFakeMass);
0144   ksNewFakeMass->SetXTitle(//"Mass of fake Ks, new release");
0145                newLabel);
0146   newdir_1->GetObject(hList2_1->FindObject("ksMassGood")->GetName(), ksNewGoodMass);
0147   ksNewGoodMass->SetXTitle(//"Mass of good Ks, new release");
0148                newLabel);
0149   newdir_1->GetObject(hList2_1->FindObject("ksMassAll")->GetName(), ksNewMassAll);
0150   ksNewMassAll->SetXTitle(//"Mass of all found Ks, new release");
0151               newLabel);
0152 
0153 
0154   // K0s fake rate plots from reference release
0155   //refdir->GetObject(hList1->At(3)->GetName(), ksFakeEta);
0156   refdir->GetObject(hList1->FindObject("K0sFakeVsEta")->GetName(), ksFakeEta);
0157   ksFakeEta->GetYaxis()->SetRangeUser(0, 1.1);
0158 
0159   //refdir->GetObject(hList1->At(9)->GetName(), ksTkFakeEta);
0160   refdir->GetObject(hList1->FindObject("K0sTkFakeVsEta")->GetName(), ksTkFakeEta);
0161   ksTkFakeEta->GetYaxis()->SetRangeUser(0, 1.1);
0162 
0163   //refdir->GetObject(hList1->At(4)->GetName(), ksFakePt);
0164   refdir->GetObject(hList1->FindObject("K0sFakeVsPt")->GetName(), ksFakePt);
0165   ksFakePt->GetYaxis()->SetRangeUser(0, 1.1);
0166   ksFakePt->GetYaxis()->SetRangeUser(0, 1.1);
0167   ksFakePt->GetYaxis()->SetTitle("K^{0}_{S} Fake Rate vs p_{T}");
0168   ksFakePt->GetYaxis()->SetTitleSize(0.05);
0169   ksFakePt->GetYaxis()->SetTitleOffset(1.2);
0170   ksFakePt->SetTitle("");
0171 
0172   //refdir->GetObject(hList1->At(10)->GetName(), ksTkFakePt);
0173   refdir->GetObject(hList1->FindObject("K0sTkFakeVsPt")->GetName(), ksTkFakePt);
0174   ksTkFakePt->GetYaxis()->SetRangeUser(0, 1.1);
0175   ksTkFakePt->GetYaxis()->SetTitle("K^{0}_{S} Tracking Fake Rate vs p_{T}");
0176   ksTkFakePt->GetYaxis()->SetTitleSize(0.05);
0177   ksTkFakePt->GetYaxis()->SetTitleOffset(1.2);
0178   ksTkFakePt->SetTitle("");
0179 
0180   //refdir->GetObject(hList1->At(5)->GetName(), ksFakeR);
0181   refdir->GetObject(hList1->FindObject("K0sFakeVsR")->GetName(), ksFakeR);
0182   ksFakeR->GetYaxis()->SetRangeUser(0, 1.1);
0183 
0184   //refdir->GetObject(hList1->At(11)->GetName(), ksTkFakeR);
0185   refdir->GetObject(hList1->FindObject("K0sTkFakeVsR")->GetName(), ksTkFakeR);
0186   ksTkFakeR->GetYaxis()->SetRangeUser(0, 1.1);
0187 
0188 
0189 
0190   // Kshort plots from new release we're testing
0191   //newdir->GetObject(hList1->At(3)->GetName(), ksNewFakeEta);
0192   newdir->GetObject(hList2->FindObject("K0sFakeVsEta")->GetName(), ksNewFakeEta);
0193   ksNewFakeEta->GetYaxis()->SetRangeUser(0, 1.1);
0194 
0195   //newdir->GetObject(hList1->At(9)->GetName(), ksNewTkFakeEta);
0196   newdir->GetObject(hList2->FindObject("K0sTkFakeVsEta")->GetName(), ksNewTkFakeEta);
0197   ksNewTkFakeEta->GetYaxis()->SetRangeUser(0, 1.1);
0198 
0199   //newdir->GetObject(hList1->At(4)->GetName(), ksNewFakePt);
0200   newdir->GetObject(hList2->FindObject("K0sFakeVsPt")->GetName(), ksNewFakePt);
0201   ksNewFakePt->GetYaxis()->SetRangeUser(0, 1.1);
0202   ksNewFakePt->SetTitle("");
0203 
0204   //newdir->GetObject(hList1->At(10)->GetName(), ksNewTkFakePt);
0205   newdir->GetObject(hList2->FindObject("K0sTkFakeVsPt")->GetName(), ksNewTkFakePt);
0206   ksNewTkFakePt->GetYaxis()->SetRangeUser(0, 1.1);
0207   ksNewTkFakePt->SetTitle("");
0208 
0209   //newdir->GetObject(hList1->At(5)->GetName(), ksNewFakeR);
0210   newdir->GetObject(hList2->FindObject("K0sFakeVsR")->GetName(), ksNewFakeR);
0211   ksNewFakeR->GetYaxis()->SetRangeUser(0, 1.1);
0212 
0213   //newdir->GetObject(hList1->At(11)->GetName(), ksNewTkFakeR);
0214   newdir->GetObject(hList2->FindObject("K0sTkFakeVsR")->GetName(), ksNewTkFakeR);
0215   ksNewTkFakeR->GetYaxis()->SetRangeUser(0, 1.1);
0216 
0217 
0218   canvas = new TCanvas("Kshorts", "K^{0}_{S} Efficiency", 
0219                1000, 1400);
0220 
0221   ksEffEta->SetMarkerStyle(20);
0222   ksEffEta->SetMarkerColor(2);
0223   ksEffEta->SetMarkerSize(0.7);
0224   ksEffEta->SetLineColor(2);
0225   ksNewEffEta->SetMarkerStyle(20);
0226   ksNewEffEta->SetMarkerColor(4);
0227   ksNewEffEta->SetMarkerSize(0.7);
0228   ksNewEffEta->SetLineColor(4);
0229 
0230   ksTkEffEta->SetMarkerStyle(20);
0231   ksTkEffEta->SetMarkerColor(2);
0232   ksTkEffEta->SetMarkerSize(0.7);
0233   ksTkEffEta->SetLineColor(2);
0234   ksNewTkEffEta->SetMarkerStyle(20);
0235   ksNewTkEffEta->SetMarkerColor(4);
0236   ksNewTkEffEta->SetMarkerSize(0.7);
0237   ksNewTkEffEta->SetLineColor(4);
0238 
0239   ksEffPt->SetMarkerStyle(20);
0240   ksEffPt->SetMarkerColor(2);
0241   ksEffPt->SetMarkerSize(0.7);
0242   ksEffPt->SetLineColor(2);
0243   ksNewEffPt->SetMarkerStyle(20);
0244   ksNewEffPt->SetMarkerColor(4);
0245   ksNewEffPt->SetMarkerSize(0.7);
0246   ksNewEffPt->SetLineColor(4);
0247 
0248   ksTkEffPt->SetMarkerStyle(20);
0249   ksTkEffPt->SetMarkerColor(2);
0250   ksTkEffPt->SetMarkerSize(0.7);
0251   ksTkEffPt->SetLineColor(2);
0252   ksNewTkEffPt->SetMarkerStyle(20);
0253   ksNewTkEffPt->SetMarkerColor(4);
0254   ksNewTkEffPt->SetMarkerSize(0.7);
0255   ksNewTkEffPt->SetLineColor(4);
0256 
0257   ksEffR->SetMarkerStyle(20);
0258   ksEffR->SetMarkerColor(2);
0259   ksEffR->SetMarkerSize(0.7);
0260   ksEffR->SetLineColor(2);
0261   ksNewEffR->SetMarkerStyle(20);
0262   ksNewEffR->SetMarkerColor(4);
0263   ksNewEffR->SetMarkerSize(0.7);
0264   ksNewEffR->SetLineColor(4);
0265 
0266   ksTkEffR->SetMarkerStyle(20);
0267   ksTkEffR->SetMarkerColor(2);
0268   ksTkEffR->SetMarkerSize(0.7);
0269   ksTkEffR->SetLineColor(2);
0270   ksNewTkEffR->SetMarkerStyle(20);
0271   ksNewTkEffR->SetMarkerColor(4);
0272   ksNewTkEffR->SetMarkerSize(0.7);
0273   ksNewTkEffR->SetLineColor(4);
0274 
0275   canvas->Divide(2,3);
0276 
0277   canvas->cd(1);
0278   setStats(ksEffEta, ksNewEffEta, -1, 0, false);
0279   ksEffEta->Draw();
0280   ksNewEffEta->Draw("sames");
0281 
0282   canvas->cd(2);
0283   setStats(ksTkEffEta, ksNewTkEffEta, -1, 0, false);
0284   ksTkEffEta->Draw();
0285   ksNewTkEffEta->Draw("sames");
0286 
0287   canvas->cd(3);
0288   setStats(ksEffPt, ksNewEffPt, -1, 0, false);
0289   ksEffPt->Draw();
0290   ksNewEffPt->Draw("sames");
0291 
0292   canvas->cd(4);
0293   setStats(ksTkEffPt, ksNewTkEffPt, 0.6, 0.65, false);
0294   ksTkEffPt->Draw();
0295   ksNewTkEffPt->Draw("sames");
0296 
0297   canvas->cd(5);
0298   setStats(ksEffR, ksNewEffR, -1, 0, false);
0299   ksEffR->Draw();
0300   ksNewEffR->Draw("sames");
0301 
0302   canvas->cd(6);
0303   setStats(ksTkEffR, ksNewTkEffR, 0.6, 0.65, false);
0304   ksTkEffR->Draw();
0305   ksNewTkEffR->Draw("sames");
0306 
0307   canvas->cd();
0308   leg1 = new TLegend(0.20, 0.64, 0.80, 0.69);
0309   leg1->SetTextSize(0.012);
0310   leg1->SetLineColor(1);
0311   leg1->SetLineWidth(1);
0312   leg1->SetLineStyle(1);
0313   leg1->SetFillColor(0);
0314   leg1->SetBorderSize(3);
0315   leg1->AddEntry(ksEffEta, refLabel, "LPF");
0316   leg1->AddEntry(ksNewEffEta, newLabel, "LPF");
0317   leg1->Draw();
0318 
0319   canvas->Print("K0sEff.png");
0320   canvas->Print("K0sEff.pdf");
0321 
0322   delete leg1;
0323   //delete canvas;
0324 
0325   ksmcanvas = new TCanvas("KsMass", "K^{0}_{S} mass plots",
0326               1000, 1400);
0327 
0328   ksFakeMass->SetLineColor(2);
0329   ksFakeMass->SetMarkerStyle(20);
0330   ksFakeMass->SetMarkerColor(2);
0331   ksNewFakeMass->SetLineColor(4);
0332   ksNewFakeMass->SetMarkerStyle(20);
0333   ksNewFakeMass->SetMarkerColor(4);
0334 
0335   ksGoodMass->SetLineColor(2);
0336   ksGoodMass->SetMarkerStyle(20);
0337   ksGoodMass->SetMarkerColor(2);
0338   ksNewGoodMass->SetLineColor(4);
0339   ksNewGoodMass->SetMarkerStyle(20);
0340   ksNewGoodMass->SetMarkerColor(4);
0341 
0342   ksMassAll->SetLineColor(2);
0343   ksMassAll->SetMarkerStyle(20);
0344   ksMassAll->SetMarkerColor(2);
0345   ksNewMassAll->SetLineColor(4);
0346   ksNewMassAll->SetMarkerStyle(20);
0347   ksNewMassAll->SetMarkerColor(4);
0348 
0349   ksmcanvas->Divide(2,3);
0350   ksmcanvas->cd(1);
0351   ksMassAll->Draw();
0352 
0353   ksmcanvas->cd(2);
0354   ksNewMassAll->Draw();
0355 
0356   ksmcanvas->cd(3);
0357   ksGoodMass->Draw();
0358 
0359   ksmcanvas->cd(4);
0360   ksNewGoodMass->Draw();
0361 
0362   ksmcanvas->cd(5);
0363   ksFakeMass->Draw();
0364 
0365   ksmcanvas->cd(6);
0366   ksNewFakeMass->Draw();
0367 
0368   ksmcanvas->Print("KsMass.png");
0369   ksmcanvas->Print("KsMass.pdf");
0370 
0371 
0372   canvas = new TCanvas("Kshorts", "K^{0}_{S} Fake Rate", 
0373                1000, 1400);
0374 
0375   ksFakeEta->SetMarkerStyle(20);
0376   ksFakeEta->SetMarkerColor(2);
0377   ksFakeEta->SetMarkerSize(0.5);
0378   ksFakeEta->SetLineColor(2);
0379   ksNewFakeEta->SetMarkerStyle(20);
0380   ksNewFakeEta->SetMarkerColor(4);
0381   ksNewFakeEta->SetMarkerSize(0.5);
0382   ksNewFakeEta->SetLineColor(4);
0383 
0384   ksTkFakeEta->SetMarkerStyle(20);
0385   ksTkFakeEta->SetMarkerColor(2);
0386   ksTkFakeEta->SetMarkerSize(0.5);
0387   ksTkFakeEta->SetLineColor(2);
0388   ksNewTkFakeEta->SetMarkerStyle(20);
0389   ksNewTkFakeEta->SetMarkerColor(4);
0390   ksNewTkFakeEta->SetMarkerSize(0.5);
0391   ksNewTkFakeEta->SetLineColor(4);
0392 
0393   ksFakePt->SetMarkerStyle(20);
0394   ksFakePt->SetMarkerColor(2);
0395   ksFakePt->SetMarkerSize(0.5);
0396   ksFakePt->SetLineColor(2);
0397   ksNewFakePt->SetMarkerStyle(20);
0398   ksNewFakePt->SetMarkerColor(4);
0399   ksNewFakePt->SetMarkerSize(0.5);
0400   ksNewFakePt->SetLineColor(4);
0401 
0402   ksTkFakePt->SetMarkerStyle(20);
0403   ksTkFakePt->SetMarkerColor(2);
0404   ksTkFakePt->SetMarkerSize(0.5);
0405   ksTkFakePt->SetLineColor(2);
0406   ksNewTkFakePt->SetMarkerStyle(20);
0407   ksNewTkFakePt->SetMarkerColor(4);
0408   ksNewTkFakePt->SetMarkerSize(0.5);
0409   ksNewTkFakePt->SetLineColor(4);
0410 
0411   ksFakeR->SetMarkerStyle(20);
0412   ksFakeR->SetMarkerColor(2);
0413   ksFakeR->SetMarkerSize(0.5);
0414   ksFakeR->SetLineColor(2);
0415   ksNewFakeR->SetMarkerStyle(20);
0416   ksNewFakeR->SetMarkerColor(4);
0417   ksNewFakeR->SetMarkerSize(0.5);
0418   ksNewFakeR->SetLineColor(4);
0419 
0420   ksTkFakeR->SetMarkerStyle(20);
0421   ksTkFakeR->SetMarkerColor(2);
0422   ksTkFakeR->SetMarkerSize(0.5);
0423   ksTkFakeR->SetLineColor(2);
0424   ksNewTkFakeR->SetMarkerStyle(20);
0425   ksNewTkFakeR->SetMarkerColor(4);
0426   ksNewTkFakeR->SetMarkerSize(0.5);
0427   ksNewTkFakeR->SetLineColor(4);
0428 
0429   canvas->Divide(2,3);
0430 
0431   canvas->cd(1);
0432   setStats(ksFakeEta, ksNewFakeEta, -1, 0, false);
0433   ksFakeEta->Draw();
0434   ksNewFakeEta->Draw("sames");
0435 
0436   canvas->cd(2);
0437   setStats(ksTkFakeEta, ksNewTkFakeEta, -1, 0, false);
0438   ksTkFakeEta->Draw();
0439   ksNewTkFakeEta->Draw("sames");
0440 
0441   canvas->cd(3);
0442   setStats(ksFakePt, ksNewFakePt, -1, 0, false);
0443   ksFakePt->Draw();
0444   ksNewFakePt->Draw("sames");
0445 
0446   canvas->cd(4);
0447   setStats(ksTkFakePt, ksNewTkFakePt, 0.6, 0.65, false);
0448   ksTkFakePt->Draw();
0449   ksNewTkFakePt->Draw("sames");
0450 
0451   canvas->cd(5);
0452   setStats(ksFakeR, ksNewFakeR, -1, 0, false);
0453   ksFakeR->Draw();
0454   ksNewFakeR->Draw("sames");
0455 
0456   canvas->cd(6);
0457   setStats(ksTkFakeR, ksNewTkFakeR, 0.6, 0.65, false);
0458   ksTkFakeR->Draw();
0459   ksNewTkFakeR->Draw("sames");
0460 
0461   canvas->cd();
0462   leg2 = new TLegend(0.20, 0.64, 0.80, 0.69);
0463   leg2->SetTextSize(0.012);
0464   leg2->SetLineColor(1);
0465   leg2->SetLineWidth(1);
0466   leg2->SetLineStyle(1);
0467   leg2->SetFillColor(0);
0468   leg2->SetBorderSize(3);
0469   leg2->AddEntry(ksFakeEta, refLabel, "LPF");
0470   leg2->AddEntry(ksNewFakeEta, newLabel, "LPF");
0471   leg2->Draw();
0472 
0473   canvas->Print("K0sFake.png");
0474   canvas->Print("K0sFake.pdf");
0475 
0476   delete leg2;
0477 
0478   cout << "Plotting Lambdas" << endl;
0479   // Lambda plots
0480   TH1F *lamEffEta, *lamTkEffEta;
0481   TH1F *lamEffPt, *lamTkEffPt;
0482   TH1F *lamEffR, *lamTkEffR;
0483 
0484   TH1F *lamNewEffEta, *lamNewTkEffEta;
0485   TH1F *lamNewEffPt, *lamNewTkEffPt;
0486   TH1F *lamNewEffR, *lamNewTkEffR;
0487 
0488   TH1F *lamFakeEta, *lamTkFakeEta;
0489   TH1F *lamFakePt, *lamTkFakePt;
0490   TH1F *lamFakeR, *lamTkFakeR;
0491 
0492   TH1F *lamNewFakeEta, *lamNewTkFakeEta;
0493   TH1F *lamNewFakePt, *lamNewTkFakePt;
0494   TH1F *lamNewFakeR, *lamNewTkFakeR;
0495 
0496   TH1F *lamNewFakeMass, *lamNewGoodMass;
0497   TH1F *lamNewMassAll;
0498   TH1F *lamFakeMass, *lamGoodMass;
0499   TH1F *lamMassAll;
0500 
0501   // Lambda Efficiency plots from reference release
0502   //refdir->GetObject(hList1->At(12)->GetName(), lamEffEta);
0503   refdir->GetObject(hList1->FindObject("LamEffVsEta")->GetName(), lamEffEta);
0504   lamEffEta->GetYaxis()->SetRangeUser(0, 1.1);
0505 
0506   //refdir->GetObject(hList1->At(18)->GetName(), lamTkEffEta);
0507   refdir->GetObject(hList1->FindObject("LamTkEffVsEta")->GetName(), lamTkEffEta);
0508   lamTkEffEta->GetYaxis()->SetRangeUser(0, 1.1);
0509 
0510   //refdir->GetObject(hList1->At(13)->GetName(), lamEffPt);
0511   refdir->GetObject(hList1->FindObject("LamEffVsPt")->GetName(), lamEffPt);
0512   lamEffPt->GetYaxis()->SetRangeUser(0, 1.1);
0513   lamEffPt->GetYaxis()->SetTitle("#Lambda^{0} Efficiency vs p_{T}");
0514   lamEffPt->GetYaxis()->SetTitleSize(0.05);
0515   lamEffPt->GetYaxis()->SetTitleOffset(1.2);
0516   lamEffPt->SetTitle("");
0517 
0518   //refdir->GetObject(hList1->At(19)->GetName(), lamTkEffPt);
0519   refdir->GetObject(hList1->FindObject("LamTkEffVsPt")->GetName(), lamTkEffPt);
0520   lamTkEffPt->GetYaxis()->SetRangeUser(0, 1.1);
0521   lamTkEffPt->GetYaxis()->SetTitle("#Lambda^{0} Tracking Efficiency vs p_{T}");
0522   lamTkEffPt->GetYaxis()->SetTitleSize(0.05);
0523   lamTkEffPt->GetYaxis()->SetTitleOffset(1.2);
0524   lamTkEffPt->SetTitle("");
0525 
0526   //refdir->GetObject(hList1->At(14)->GetName(), lamEffR);
0527   refdir->GetObject(hList1->FindObject("LamEffVsR")->GetName(), lamEffR);
0528   lamEffR->GetYaxis()->SetRangeUser(0, 1.1);
0529 
0530   //refdir->GetObject(hList1->At(20)->GetName(), lamTkEffR);
0531   refdir->GetObject(hList1->FindObject("LamTkEffVsR")->GetName(), lamTkEffR);
0532   lamTkEffR->GetYaxis()->SetRangeUser(0, 1.1);
0533 
0534   // Lambda mass plots from ref release
0535   refdir_1->GetObject(hList1_1->FindObject("lamMassFake")->GetName(), lamFakeMass);
0536   lamFakeMass->SetXTitle(//"Mass of fake #Lambda, ref release");
0537              refLabel);
0538   refdir_1->GetObject(hList1_1->FindObject("lamMassGood")->GetName(), lamGoodMass);
0539   lamGoodMass->SetXTitle(//"Mass of good #Lambda, ref release");
0540              refLabel);
0541   refdir_1->GetObject(hList1_1->FindObject("lamMassAll")->GetName(), lamMassAll);
0542   lamMassAll->SetXTitle(//"Mass of all found #Lambda, ref release");
0543             refLabel);
0544 
0545 
0546   // Lambda efficiency plots from new release
0547   //newdir->GetObject(hList1->At(12)->GetName(), lamNewEffEta);
0548   newdir->GetObject(hList2->FindObject("LamEffVsEta")->GetName(), lamNewEffEta);
0549   lamNewEffEta->GetYaxis()->SetRangeUser(0, 1.1);
0550 
0551   //newdir->GetObject(hList1->At(18)->GetName(), lamNewTkEffEta);
0552   newdir->GetObject(hList2->FindObject("LamTkEffVsEta")->GetName(), lamNewTkEffEta);
0553   lamNewTkEffEta->GetYaxis()->SetRangeUser(0, 1.1);
0554 
0555   //newdir->GetObject(hList1->At(13)->GetName(), lamNewEffPt);
0556   newdir->GetObject(hList2->FindObject("LamEffVsPt")->GetName(), lamNewEffPt);
0557   lamNewEffPt->GetYaxis()->SetRangeUser(0, 1.1);
0558   lamNewEffPt->GetYaxis()->SetRangeUser(0, 1.1);
0559   lamNewEffPt->GetYaxis()->SetTitle("#Lambda^{0} Efficiency vs p_{T}");
0560   lamNewEffPt->GetYaxis()->SetTitleSize(0.05);
0561   lamNewEffPt->GetYaxis()->SetTitleOffset(1.2);
0562   lamNewEffPt->SetTitle("");
0563 
0564   //newdir->GetObject(hList1->At(19)->GetName(), lamNewTkEffPt);
0565   newdir->GetObject(hList1->FindObject("LamTkEffVsPt")->GetName(), lamNewTkEffPt);
0566   lamNewTkEffPt->GetYaxis()->SetRangeUser(0, 1.1);
0567   lamNewTkEffPt->GetYaxis()->SetTitle("#Lambda^{0} Tracking Efficiency vs p_{T}");
0568   lamNewTkEffPt->GetYaxis()->SetTitleSize(0.05);
0569   lamNewTkEffPt->GetYaxis()->SetTitleOffset(1.2);
0570   lamNewTkEffPt->SetTitle("");
0571 
0572   //newdir->GetObject(hList1->At(14)->GetName(), lamNewEffR);
0573   newdir->GetObject(hList2->FindObject("LamEffVsR")->GetName(), lamNewEffR);
0574   lamNewEffR->GetYaxis()->SetRangeUser(0, 1.1);
0575 
0576   //newdir->GetObject(hList1->At(20)->GetName(), lamNewTkEffR);
0577   newdir->GetObject(hList2->FindObject("LamTkEffVsR")->GetName(), lamNewTkEffR);
0578   lamNewTkEffR->GetYaxis()->SetRangeUser(0, 1.1);
0579 
0580   // Lambda mass plots from new release
0581   newdir_1->GetObject(hList2_1->FindObject("lamMassFake")->GetName(), lamNewFakeMass);
0582   lamNewFakeMass->SetXTitle(//"Mass of fake #Lambda, new release");
0583                 newLabel);
0584   newdir_1->GetObject(hList2_1->FindObject("lamMassGood")->GetName(), lamNewGoodMass);
0585   lamNewGoodMass->SetXTitle(//"Mass of good #Lambda, new release");
0586                 newLabel);
0587   newdir_1->GetObject(hList2_1->FindObject("lamMassAll")->GetName(), lamNewMassAll);
0588   lamNewMassAll->SetXTitle(//"Mass of all found #Lambda, new release");
0589                newLabel);
0590 
0591 
0592   // Lambda fake rate plots from reference release
0593   //refdir->GetObject(hList1->At(15)->GetName(), lamFakeEta);
0594   refdir->GetObject(hList1->FindObject("LamFakeVsEta")->GetName(), lamFakeEta);
0595   lamFakeEta->GetYaxis()->SetRangeUser(0, 1.1);
0596 
0597   //refdir->GetObject(hList1->At(21)->GetName(), lamTkFakeEta);
0598   refdir->GetObject(hList1->FindObject("LamTkFakeVsEta")->GetName(), lamTkFakeEta);
0599   lamTkFakeEta->GetYaxis()->SetRangeUser(0, 1.1);
0600 
0601   //refdir->GetObject(hList1->At(16)->GetName(), lamFakePt);
0602   refdir->GetObject(hList2->FindObject("LamFakeVsPt")->GetName(), lamFakePt);
0603   lamFakePt->GetYaxis()->SetRangeUser(0, 1.1);
0604   lamFakePt->GetYaxis()->SetRangeUser(0, 1.1);
0605   lamFakePt->GetYaxis()->SetTitle("#Lambda^{0} Fake Rate vs p_{T}");
0606   lamFakePt->GetYaxis()->SetTitleSize(0.05);
0607   lamFakePt->GetYaxis()->SetTitleOffset(1.2);
0608   lamFakePt->SetTitle("");
0609 
0610   //refdir->GetObject(hList1->At(22)->GetName(), lamTkFakePt);
0611   refdir->GetObject(hList1->FindObject("LamTkFakeVsPt")->GetName(), lamTkFakePt);
0612   lamTkFakePt->GetYaxis()->SetRangeUser(0, 1.1);
0613   lamTkFakePt->GetYaxis()->SetTitle("#Lambda^{0} Tracking Fake Rate vs p_{T}");
0614   lamTkFakePt->GetYaxis()->SetTitleSize(0.05);
0615   lamTkFakePt->GetYaxis()->SetTitleOffset(1.2);
0616   lamTkFakePt->SetTitle("");
0617 
0618   //refdir->GetObject(hList1->At(17)->GetName(), lamFakeR);
0619   refdir->GetObject(hList1->FindObject("LamFakeVsR")->GetName(), lamFakeR);
0620   lamFakeR->GetYaxis()->SetRangeUser(0, 1.1);
0621 
0622   //refdir->GetObject(hList1->At(23)->GetName(), lamTkFakeR);
0623   refdir->GetObject(hList1->FindObject("LamTkFakeVsR")->GetName(), lamTkFakeR);
0624   lamTkFakeR->GetYaxis()->SetRangeUser(0, 1.1);
0625 
0626 
0627 
0628   // Lambda plots from new release we're testing
0629   //newdir->GetObject(hList1->At(15)->GetName(), lamNewFakeEta);
0630   newdir->GetObject(hList2->FindObject("LamFakeVsEta")->GetName(), lamNewFakeEta);
0631   lamNewFakeEta->GetYaxis()->SetRangeUser(0, 1.1);
0632 
0633   //newdir->GetObject(hList1->At(21)->GetName(), lamNewTkFakeEta);
0634   newdir->GetObject(hList2->FindObject("LamTkFakeVsEta")->GetName(), lamNewTkFakeEta);
0635   lamNewTkFakeEta->GetYaxis()->SetRangeUser(0, 1.1);
0636 
0637   //newdir->GetObject(hList1->At(16)->GetName(), lamNewFakePt);
0638   newdir->GetObject(hList2->FindObject("LamFakeVsPt")->GetName(), lamNewFakePt);
0639   lamNewFakePt->GetYaxis()->SetRangeUser(0, 1.1);
0640   lamNewFakePt->SetTitle("");
0641 
0642   //newdir->GetObject(hList1->At(22)->GetName(), lamNewTkFakePt);
0643   newdir->GetObject(hList2->FindObject("LamTkFakeVsPt")->GetName(), lamNewTkFakePt);
0644   lamNewTkFakePt->GetYaxis()->SetRangeUser(0, 1.1);
0645   lamNewTkFakePt->SetTitle("");
0646 
0647   //newdir->GetObject(hList1->At(17)->GetName(), lamNewFakeR);
0648   newdir->GetObject(hList2->FindObject("LamFakeVsR")->GetName(), lamNewFakeR);
0649   lamNewFakeR->GetYaxis()->SetRangeUser(0, 1.1);
0650 
0651   //newdir->GetObject(hList1->At(23)->GetName(), lamNewTkFakeR);
0652   newdir->GetObject(hList2->FindObject("LamTkFakeVsR")->GetName(), lamNewTkFakeR);
0653   lamNewTkFakeR->GetYaxis()->SetRangeUser(0, 1.1);
0654 
0655 
0656   canvas = new TCanvas("Lambdas", "#Lambda^{0} Efficiency", 
0657                1000, 1400);
0658 
0659   lamEffEta->SetMarkerStyle(20);
0660   lamEffEta->SetMarkerColor(2);
0661   lamEffEta->SetMarkerSize(0.5);
0662   lamEffEta->SetLineColor(2);
0663   lamNewEffEta->SetMarkerStyle(20);
0664   lamNewEffEta->SetMarkerColor(4);
0665   lamNewEffEta->SetMarkerSize(0.5);
0666   lamNewEffEta->SetLineColor(4);
0667 
0668   lamTkEffEta->SetMarkerStyle(20);
0669   lamTkEffEta->SetMarkerColor(2);
0670   lamTkEffEta->SetMarkerSize(0.5);
0671   lamTkEffEta->SetLineColor(2);
0672   lamNewTkEffEta->SetMarkerStyle(20);
0673   lamNewTkEffEta->SetMarkerColor(4);
0674   lamNewTkEffEta->SetMarkerSize(0.5);
0675   lamNewTkEffEta->SetLineColor(4);
0676 
0677   lamEffPt->SetMarkerStyle(20);
0678   lamEffPt->SetMarkerColor(2);
0679   lamEffPt->SetMarkerSize(0.5);
0680   lamEffPt->SetLineColor(2);
0681   lamNewEffPt->SetMarkerStyle(20);
0682   lamNewEffPt->SetMarkerColor(4);
0683   lamNewEffPt->SetMarkerSize(0.5);
0684   lamNewEffPt->SetLineColor(4);
0685 
0686   lamTkEffPt->SetMarkerStyle(20);
0687   lamTkEffPt->SetMarkerColor(2);
0688   lamTkEffPt->SetMarkerSize(0.5);
0689   lamTkEffPt->SetLineColor(2);
0690   lamNewTkEffPt->SetMarkerStyle(20);
0691   lamNewTkEffPt->SetMarkerColor(4);
0692   lamNewTkEffPt->SetMarkerSize(0.5);
0693   lamNewTkEffPt->SetLineColor(4);
0694 
0695   lamEffR->SetMarkerStyle(20);
0696   lamEffR->SetMarkerColor(2);
0697   lamEffR->SetMarkerSize(0.5);
0698   lamEffR->SetLineColor(2);
0699   lamNewEffR->SetMarkerStyle(20);
0700   lamNewEffR->SetMarkerColor(4);
0701   lamNewEffR->SetMarkerSize(0.5);
0702   lamNewEffR->SetLineColor(4);
0703 
0704   lamTkEffR->SetMarkerStyle(20);
0705   lamTkEffR->SetMarkerColor(2);
0706   lamTkEffR->SetMarkerSize(0.5);
0707   lamTkEffR->SetLineColor(2);
0708   lamNewTkEffR->SetMarkerStyle(20);
0709   lamNewTkEffR->SetMarkerColor(4);
0710   lamNewTkEffR->SetMarkerSize(0.5);
0711   lamNewTkEffR->SetLineColor(4);
0712 
0713   canvas->Divide(2,3);
0714 
0715   canvas->cd(1);
0716   setStats(lamEffEta, lamNewEffEta, -1, 0, false);
0717   lamEffEta->Draw();
0718   lamNewEffEta->Draw("sames");
0719 
0720   canvas->cd(2);
0721   setStats(lamTkEffEta, lamNewTkEffEta, -1, 0, false);
0722   lamTkEffEta->Draw();
0723   lamNewTkEffEta->Draw("sames");
0724 
0725   canvas->cd(3);
0726   setStats(lamEffPt, lamNewEffPt, -1, 0, false);
0727   lamEffPt->Draw();
0728   lamNewEffPt->Draw("sames");
0729 
0730   canvas->cd(4);
0731   setStats(lamTkEffPt, lamNewTkEffPt, 0.6, 0.65, false);
0732   lamTkEffPt->Draw();
0733   lamNewTkEffPt->Draw("sames");
0734 
0735   canvas->cd(5);
0736   setStats(lamEffR, lamNewEffR, -1, 0, false);
0737   lamEffR->Draw();
0738   lamNewEffR->Draw("sames");
0739 
0740   canvas->cd(6);
0741   setStats(lamTkEffR, lamNewTkEffR, 0.6, 0.65, false);
0742   lamTkEffR->Draw();
0743   lamNewTkEffR->Draw("sames");
0744 
0745   canvas->cd();
0746   leg3 = new TLegend(0.20, 0.64, 0.80, 0.69);
0747   leg3->SetTextSize(0.012);
0748   leg3->SetLineColor(1);
0749   leg3->SetLineWidth(1);
0750   leg3->SetLineStyle(1);
0751   leg3->SetFillColor(0);
0752   leg3->SetBorderSize(3);
0753   leg3->AddEntry(lamEffEta, refLabel, "LPF");
0754   leg3->AddEntry(lamNewEffEta, newLabel, "LPF");
0755   leg3->Draw();
0756 
0757   canvas->Print("LamEff.png");
0758   canvas->Print("LamEff.pdf");
0759 
0760   delete leg3;
0761   //delete canvas;
0762 
0763   lammcanvas = new TCanvas("LamMass", "#Lambda^{0} mass plots",
0764                1000, 1400);
0765 
0766   lamFakeMass->SetLineColor(2);
0767   lamFakeMass->SetMarkerStyle(20);
0768   lamFakeMass->SetMarkerColor(2);
0769   lamNewFakeMass->SetLineColor(4);
0770   lamNewFakeMass->SetMarkerStyle(20);
0771   lamNewFakeMass->SetMarkerColor(4);
0772 
0773   lamGoodMass->SetLineColor(2);
0774   lamGoodMass->SetMarkerStyle(20);
0775   lamGoodMass->SetMarkerColor(2);
0776   lamNewGoodMass->SetLineColor(4);
0777   lamNewGoodMass->SetMarkerStyle(20);
0778   lamNewGoodMass->SetMarkerColor(4);
0779 
0780   lamMassAll->SetLineColor(2);
0781   lamMassAll->SetMarkerStyle(20);
0782   lamMassAll->SetMarkerColor(2);
0783   lamNewMassAll->SetLineColor(4);
0784   lamNewMassAll->SetMarkerStyle(20);
0785   lamNewMassAll->SetMarkerColor(4);
0786 
0787   lammcanvas->Divide(2,3);
0788   lammcanvas->cd(1);
0789   lamMassAll->Draw();
0790 
0791   lammcanvas->cd(2);
0792   lamNewMassAll->Draw();
0793 
0794   lammcanvas->cd(3);
0795   lamGoodMass->Draw();
0796 
0797   lammcanvas->cd(4);
0798   lamNewGoodMass->Draw();
0799 
0800   lammcanvas->cd(5);
0801   lamFakeMass->Draw();
0802 
0803   lammcanvas->cd(6);
0804   lamNewFakeMass->Draw();
0805 
0806   lammcanvas->Print("LamMass.png");
0807   lammcanvas->Print("LamMass.pdf");
0808 
0809   canvas = new TCanvas("Lambdas", "#Lambda^{0} Fake Rate", 
0810                1000, 1400);
0811 
0812   lamFakeEta->SetMarkerStyle(20);
0813   lamFakeEta->SetMarkerColor(2);
0814   lamFakeEta->SetMarkerSize(0.5);
0815   lamFakeEta->SetLineColor(2);
0816   lamNewFakeEta->SetMarkerStyle(20);
0817   lamNewFakeEta->SetMarkerColor(4);
0818   lamNewFakeEta->SetMarkerSize(0.5);
0819   lamNewFakeEta->SetLineColor(4);
0820 
0821   lamTkFakeEta->SetMarkerStyle(20);
0822   lamTkFakeEta->SetMarkerColor(2);
0823   lamTkFakeEta->SetMarkerSize(0.5);
0824   lamTkFakeEta->SetLineColor(2);
0825   lamNewTkFakeEta->SetMarkerStyle(20);
0826   lamNewTkFakeEta->SetMarkerColor(4);
0827   lamNewTkFakeEta->SetMarkerSize(0.5);
0828   lamNewTkFakeEta->SetLineColor(4);
0829 
0830   lamFakePt->SetMarkerStyle(20);
0831   lamFakePt->SetMarkerColor(2);
0832   lamFakePt->SetMarkerSize(0.5);
0833   lamFakePt->SetLineColor(2);
0834   lamNewFakePt->SetMarkerStyle(20);
0835   lamNewFakePt->SetMarkerColor(4);
0836   lamNewFakePt->SetMarkerSize(0.5);
0837   lamNewFakePt->SetLineColor(4);
0838 
0839   lamTkFakePt->SetMarkerStyle(20);
0840   lamTkFakePt->SetMarkerColor(2);
0841   lamTkFakePt->SetMarkerSize(0.5);
0842   lamTkFakePt->SetLineColor(2);
0843   lamNewTkFakePt->SetMarkerStyle(20);
0844   lamNewTkFakePt->SetMarkerColor(4);
0845   lamNewTkFakePt->SetMarkerSize(0.5);
0846   lamNewTkFakePt->SetLineColor(4);
0847 
0848   lamFakeR->SetMarkerStyle(20);
0849   lamFakeR->SetMarkerColor(2);
0850   lamFakeR->SetMarkerSize(0.5);
0851   lamFakeR->SetLineColor(2);
0852   lamNewFakeR->SetMarkerStyle(20);
0853   lamNewFakeR->SetMarkerColor(4);
0854   lamNewFakeR->SetMarkerSize(0.5);
0855   lamNewFakeR->SetLineColor(4);
0856 
0857   lamTkFakeR->SetMarkerStyle(20);
0858   lamTkFakeR->SetMarkerColor(2);
0859   lamTkFakeR->SetMarkerSize(0.5);
0860   lamTkFakeR->SetLineColor(2);
0861   lamNewTkFakeR->SetMarkerStyle(20);
0862   lamNewTkFakeR->SetMarkerColor(4);
0863   lamNewTkFakeR->SetMarkerSize(0.5);
0864   lamNewTkFakeR->SetLineColor(4);
0865 
0866   canvas->Divide(2,3);
0867 
0868   canvas->cd(1);
0869   setStats(lamFakeEta, lamNewFakeEta, -1, 0, false);
0870   lamFakeEta->Draw();
0871   lamNewFakeEta->Draw("sames");
0872 
0873   canvas->cd(2);
0874   setStats(lamTkFakeEta, lamNewTkFakeEta, -1, 0, false);
0875   lamTkFakeEta->Draw();
0876   lamNewTkFakeEta->Draw("sames");
0877 
0878   canvas->cd(3);
0879   setStats(lamFakePt, lamNewFakePt, -1, 0, false);
0880   lamFakePt->Draw();
0881   lamNewFakePt->Draw("sames");
0882 
0883   canvas->cd(4);
0884   setStats(lamTkFakePt, lamNewTkFakePt, 0.6, 0.65, false);
0885   lamTkFakePt->Draw();
0886   lamNewTkFakePt->Draw("sames");
0887 
0888   canvas->cd(5);
0889   setStats(lamFakeR, lamNewFakeR, -1, 0, false);
0890   lamFakeR->Draw();
0891   lamNewFakeR->Draw("sames");
0892 
0893   canvas->cd(6);
0894   setStats(lamTkFakeR, lamNewTkFakeR, 0.6, 0.65, false);
0895   lamTkFakeR->Draw();
0896   lamNewTkFakeR->Draw("sames");
0897 
0898   canvas->cd();
0899   leg4 = new TLegend(0.20, 0.64, 0.80, 0.69);
0900   leg4->SetTextSize(0.012);
0901   leg4->SetLineColor(1);
0902   leg4->SetLineWidth(1);
0903   leg4->SetLineStyle(1);
0904   leg4->SetFillColor(0);
0905   leg4->SetBorderSize(3);
0906   leg4->AddEntry(lamFakeEta, refLabel, "LPF");
0907   leg4->AddEntry(lamNewFakeEta, newLabel, "LPF");
0908   leg4->Draw();
0909 
0910   canvas->Print("LamFake.png");
0911   canvas->Print("LamFake.pdf");
0912 
0913   delete leg4;
0914 
0915 }
0916 
0917 // Need to fix this to work with 2 plots on each pad
0918 void setStats(TH1* s, TH1* r, 
0919           double startingY, 
0920           double startingX = .1, 
0921           bool fit) {
0922   if(startingY < 0) {
0923     s->SetStats(0);
0924     r->SetStats(0);
0925   }
0926   else {
0927     if(fit) {
0928       s->Fit("gaus");
0929       TF1* f1 = (TF1*) s->GetListOfFunctions()->FindObject("gaus");
0930       f1->SetLineColor(2);
0931       f1->SetLineWidth(1);
0932     }
0933     s->Draw();
0934     gPad->Update();
0935     TPaveStats* st1 = (TPaveStats*) s->GetListOfFunctions()->FindObject("stats");
0936     //TPaveText* tt1 = (TPaveText*) s->GetListOfFunctions()->FindObject("title");
0937     if (fit) {
0938       st1->SetOptFit(0010);
0939       st1->SetOptStat(1001);
0940     }
0941     st1->SetX1NDC(startingX);
0942     st1->SetX2NDC(startingX + 0.30);
0943     st1->SetY1NDC(startingY + 0.20);
0944     st1->SetY2NDC(startingY + 0.35);
0945     st1->SetTextColor(2);
0946     if(fit) {
0947       r->Fit("gaus");
0948       TF1* f2 = (TF1*) r->GetListOfFunctions()->FindObject("gaus");
0949       f2->SetLineColor(4);
0950       f2->SetLineWidth(1);
0951     }
0952     r->Draw();
0953     gPad->Update();
0954     TPaveStats* st2 = (TPaveStats*) r->GetListOfFunctions()->FindObject("stats");
0955     //    TPaveStats* st2 = (TPaveStats*) r->GetListOfFunctions()->FindObject("stats");
0956     if(fit) {
0957       st2->SetOptFit(0010);
0958       st2->SetOptStats(1001);
0959     }
0960     st2->SetX1NDC(startingX);
0961     st2->SetX2NDC(startingX + 0.30);
0962     st2->SetY1NDC(startingY);
0963     st2->SetY2NDC(startingY + 0.15);
0964     st2->SetTextColor(4);
0965   }
0966 }