Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:13:16

0001 #include <vector>
0002 #include <string>
0003 using namespace std;
0004 
0005 int colorList[] = {1,2,3,4,5,6,7,8,9,10}; 
0006 int markerStyleList[] = {21,21,23,23,22,22,23,23,21,21};  
0007 
0008 TObject * getHistogram(TFile * f, string algo,string histoName, string range = "GLOBAL")
0009 {
0010 string prefix = "DQMData/Btag/JetTag";
0011 string d = prefix+"_"+algo+"_"+range;
0012  cout <<" DIR "<<d<<endl;
0013 TDirectory * dir  =(TDirectory *) f->Get(d.c_str());
0014 return dir->Get((histoName+"_"+algo+"_"+range).c_str());
0015 }
0016 
0017 
0018 void setStyle(int i, TH1F *obj)
0019 {
0020 obj->SetMarkerColor(colorList[i]);
0021 obj->SetMarkerStyle(markerStyleList[i]);
0022 }
0023 
0024 
0025 
0026 void drawAll()
0027 {
0028   //  TFile *_file0 = TFile::Open("jetTagAnalysisBoris_standard.root");
0029   TFile *_file1 = TFile::Open("DQM_BTAG.root");
0030   
0031   vector<TFile *> files;
0032   vector<string> algos;
0033   algos.push_back("trackCountingHighPurBJetTags");
0034   algos.push_back("trackCountingHighEffBJetTags");
0035   algos.push_back("jetProbabilityBJetTags");
0036   algos.push_back("jetBProbabilityBJetTags");
0037   algos.push_back("simpleSecondaryVertexHighEffBJetTags");
0038   algos.push_back("simpleSecondaryVertexHighPurBJetTags");
0039   algos.push_back("combinedSecondaryVertexBJetTags");
0040   algos.push_back("ghostTrackBJetTags");
0041   algos.push_back("softMuonBJetTags");
0042   algos.push_back("softMuonNoIPBJetTags");
0043   algos.push_back("softElectronBJetTags");
0044 
0045   files.push_back(_file1);
0046   files.push_back(_file1);
0047   files.push_back(_file1);
0048   files.push_back(_file1);
0049   files.push_back(_file1);
0050   files.push_back(_file1);
0051   files.push_back(_file1);
0052   files.push_back(_file1);
0053   files.push_back(_file1);
0054   files.push_back(_file1);
0055   files.push_back(_file1);
0056   files.push_back(_file1);
0057 
0058 
0059   TLegend * leg = new TLegend(0.4,0.4,0.6,0.6);
0060   TCanvas * c1 = new TCanvas();
0061   c1->SetLogy();  
0062   c1->SetGridy();  
0063   c1->SetGridx();  
0064   for(int i = 0 ; i < algos.size() ; i++)
0065    {
0066       cout << algos[i] << endl;
0067       //TH1F * h = (TH1F *) getHistogram(files[i],algos[i],"FlavEffVsBEff_DUS_discr","ETA_0-1.4");
0068      TH1F * h = (TH1F *) getHistogram(files[i],algos[i],"FlavEffVsBEff_DUS_discr","GLOBAL");
0069      //TH1F * h = (TH1F *) getHistogram(files[i],algos[i],"FlavEffVsBEff_DUS_discr","ETA_1.4-2.4");
0070      cout << h << endl;
0071      if(i==0) h->Draw(); else h->Draw("same"); 
0072      setStyle(i,h);
0073      leg->AddEntry(h,algos[i].c_str(),"p");
0074    }
0075   leg->Draw("same");
0076 
0077 }
0078