Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:11:26

0001 {
0002 gROOT->SetStyle("Plain");
0003 gStyle->SetOptStat(000000);
0004 string dir0 = "gsWithMaterial_AssociatorByHits";
0005 string dir = "cutsGS_AssociatorByHits";
0006 string dir2 = "cutsCKF_AssociatorByHits";
0007 string plot = "effic";
0008 double min = 0.70;
0009 double max = 1.025;
0010 TFile *_file0 = TFile::Open("valid_muon_1GeV.root");
0011 TFile *_file1 = TFile::Open("valid_muon_10GeV.root");
0012 TFile *_file2 = TFile::Open("valid_muon_100GeV.root");
0013 
0014 //170pre12 fullsim
0015 //TFile *_file3 = TFile::Open("/localscratch/azzi/FAMOS/FULLSIMVALID/CMSSW_1_7_0_pre12/src/valid_muon_10gev_RelVal_id.root");
0016 
0017 TDirectory * dqm0 = _file0->Get("DQMData/Track");
0018 TDirectory * CTF0 = dqm0->Get(dir.c_str());
0019 
0020 TDirectory * dqm1 = _file1->Get("DQMData/Track");
0021 TDirectory * CTF1 = dqm1->Get(dir.c_str());
0022 
0023 TDirectory * dqm2 = _file2->Get("DQMData/Track");
0024 TDirectory * CTF2 = dqm2->Get(dir.c_str());
0025 
0026 //TDirectory * dqm3 = _file3->Get("DQMData/Track");
0027 //TDirectory * CTF3 = dqm3->Get(dir2.c_str());
0028 
0029 TCanvas * c = new TCanvas("c", "c") ;
0030 
0031 TH1F * histo0 = CTF0->Get(plot.c_str());
0032 TH1F * histo1 = CTF1->Get(plot.c_str());
0033 TH1F * histo2 = CTF2->Get(plot.c_str());
0034 //TH1F * histo3 = CTF3->Get(plot.c_str());
0035 
0036 
0037 histo0->Scale(1);
0038 histo1->Scale(1);
0039 histo2->Scale(1);
0040 //histo3->Scale(1);
0041 histo0->GetYaxis().SetRangeUser(min,max);
0042 histo0->GetYaxis().SetNdivisions(512,kTRUE);
0043 histo0->Draw("P");
0044 histo1->Draw("P,same");
0045 histo2->Draw("P,same");
0046 //histo3->Draw("P,same");
0047 
0048 histo0->SetMarkerStyle(20);
0049 histo0->SetMarkerColor(kBlack);
0050 
0051 histo1->SetMarkerStyle(22);
0052 histo1->SetMarkerColor(kBlue);
0053 
0054 histo2->SetMarkerStyle(21);
0055 histo2->SetMarkerColor(kRed);
0056 
0057 //histo3->SetMarkerStyle(21);
0058 //histo3->SetMarkerColor(kGreen);
0059 
0060 c.Update();
0061 c.SetGridx();
0062 c.SetGridy();
0063 TLegend * ll = new TLegend(0.5,0.1,0.8,0.25);
0064 ll->AddEntry(histo0,"#mu pt=1 GeV","P");
0065 ll->AddEntry(histo1,"#mu pt=10 GeV","P");
0066 ll->AddEntry(histo2,"#mu pt=100 GeV","P");
0067 //ll->AddEntry(histo3,"#mu pt=10 GeV","P");
0068 
0069 ll->SetFillColor(kWhite);
0070 ll->Draw();
0071 c.SaveAs( "muon_eff.gif" );
0072 //c.Clear();
0073 
0074 }