File indexing completed on 2023-10-25 09:53:35
0001 run(string fname1,string fname2,string v1,string v2,string path,string folder = "DQMData/Run 123/HLT/Run summary/HLTTAU" )
0002 {
0003
0004 gStyle->SetOptTitle(1);
0005 L1Val(fname1,fname2,v1,v2,folder+"/L1");
0006 L2Val(fname1,fname2,v1,v2,folder+"/"+path+"/L2");
0007 L25Val(fname1,fname2,v1,v2,folder+"/"+path+"/L25");
0008 if(path=="SingleTau"||path=="SingleTauMET")
0009 L3Val(fname1,fname2,v1,v2,folder+"/"+path+"/L3");
0010 if(path=="ElectronTau")
0011 ElectronVal(fname1,fname2,v1,v2,folder+"/"+path+"/Electron");
0012
0013 }
0014
0015
0016 draw(string fname1,string fname2,string v1,string v2,string path,string folder = "DQMData/Run 123/HLT/Run summary/HLTTAU" )
0017 {
0018 gStyle->SetOptTitle(1);
0019 L1Draw(fname1,fname2,v1,v2,folder+"/L1");
0020 L2Draw(fname1,fname2,v1,v2,folder+"/"+path+"/L2");
0021 L25Draw(fname1,fname2,v1,v2,folder+"/"+path+"/L25");
0022 if(path=="SingleTau"||path=="SingleTauMET")
0023 L3Draw(fname1,fname2,v1,v2,folder+"/"+path+"/L3");
0024 if(path=="ElectronTau")
0025 ElectronDraw(fname1,fname2,v1,v2,folder+"/"+path+"/Electron");
0026
0027 }
0028
0029
0030 L1Draw(string fname1,string fname2,string v1,string v2,string folder)
0031 {
0032 TCanvas *l1 = new TCanvas;
0033 l1->Divide(5,6);
0034 l1->cd(1);
0035 DrawHistos(fname1,fname2,v1,v2,folder,"L1TauEt","L1 E_{t}","n #tau cands","L1 Tau inclusive E_{t}",0,false);
0036 l1->cd(2);
0037 DrawHistos(fname1,fname2,v1,v2,folder,"L1TauEta","L1 #eta","n #tau cands","L1 Tau inclusive #eta",0,false);
0038 l1->cd(3);
0039 DrawHistos(fname1,fname2,v1, v2,folder,"L1TauPhi","L1 #phi","n #tau cands","L1 Tau inclusive #phi",0,false);
0040 l1->cd(4);
0041 DrawHistos(fname1,fname2, v1, v2,folder,"L1Tau1Et","L1 E_{t}","n #tau cands","LeadingL1 Tau E_{t}",0,false);
0042 l1->cd(5);
0043 DrawHistos(fname1,fname2, v1, v2,folder,"L1Tau1Eta","L1 #eta","n #tau cands","Leading L1 Tau #eta",0,false);
0044 l1->cd(6);
0045 DrawHistos(fname1,fname2, v1, v2,folder,"L1Tau1Phi","L1 #phi","n #tau cands","Leading L1Tau #phi",0,false);
0046 l1->cd(7);
0047 DrawHistos(fname1,fname2, v1, v2,folder,"L1Tau2Et","L1 E_{t}","n #tau cands","2nd L1 Tau E_{t}",0,false);
0048 l1->cd(8);
0049 DrawHistos(fname1,fname2, v1, v2,folder,"L1Tau2Eta","L1 #eta","n #tau cands","2nd L1 Tau #eta",0,false);
0050 l1->cd(9);
0051 DrawHistos(fname1,fname2, v1, v2,folder,"L1Tau2Phi","L1 #phi","n #tau cands","2nd L1Tau #phi",0,false);
0052 l1->cd(10);
0053 DrawHistos(fname1,fname2, v1, v2,folder,"L1minusRefTauEt","#Delta E_{t}","n #tau cands","L1 Tau E_{t} - Ref E_{t}",0,false);
0054 l1->cd(11);
0055 DrawHistos(fname1,fname2, v1, v2,folder,"L1minusMCoverRefTauEt","#Delta E_{t}/E_{t}","n #tau cands","(L1 Tau E_{t} - Ref E_{t})/RefE_{t}",0,false);
0056 l1->cd(12);
0057
0058
0059 DrawEffHistos(fname1,fname2, v1, v2,folder,"L1RefMatchedTauEt","RefTauHadEt","Ref E_{t}","Efficiency","Regional Tau Efficiency vs E_{t}");
0060 l1->cd(13);
0061 DrawEffHistos(fname1,fname2, v1, v2,folder,"L1RefMatchedTauEta","RefTauHadEta","Ref #eta","Efficiency","Regional Tau Efficiency vs #eta");
0062 l1->cd(14);
0063 DrawEffHistos(fname1,fname2, v1, v2,folder,"L1RefMatchedTauPhi","RefTauHadPhi","Ref #phi","Efficiency","Regional Tau Efficiency vs #phi");
0064 l1->cd(15);
0065 DrawEffHistos(fname1,fname2, v1, v2,folder,"L1RefMatchedTauMuonEt","RefTauMuonEt","Ref E_{t}","Efficiency","Regional Muon Efficiency vs E_{t}");
0066 l1->cd(16);
0067 DrawEffHistos(fname1,fname2, v1, v2,folder,"L1RefMatchedTauMuonEta","RefTauMuonEta","Ref #eta","Efficiency","Regional Muon Efficiency vs #eta");
0068 l1->cd(17);
0069 DrawEffHistos(fname1,fname2, v1, v2,folder,"L1RefMatchedTauMuonPhi","RefTauMuonPhi","Ref #phi","Efficiency","Regional Muon Efficiency vs #phi");
0070 l1->cd(18);
0071 DrawEffHistos(fname1,fname2, v1, v2,folder,"L1RefMatchedTauElecEt","RefTauElecEt","Ref E_{t}","Efficiency","Regional Eg Efficiency vs E_{t}");
0072 l1->cd(19);
0073 DrawEffHistos(fname1,fname2, v1, v2,folder,"L1RefMatchedTauElecEta","RefTauElecEta","Ref #eta","Efficiency","Regional Eg Efficiency vs #eta");
0074 l1->cd(20);
0075 DrawEffHistos(fname1,fname2, v1, v2,folder,"L1RefMatchedTauElecPhi","RefTauElecPhi","Ref #phi","Efficiency","Regional Eg Efficiency vs #phi");
0076
0077 l1->cd(21);
0078 DrawHistos(fname1,fname2,v1,v2,folder,"L1SingleTauEffEt","E_{t} Threshold","Efficiency","Single Tau Efficiency Vs Threshold",1,false);
0079 l1->cd(22);
0080 DrawHistos(fname1,fname2,v1,v2,folder,"L1SingleTauEffRefMatchEt","E_{t} Threshold","Efficiency","Single Tau Matched Efficiency Vs Threshold",1,false);
0081 l1->cd(23);
0082 DrawHistos(fname1,fname2,v1,v2,folder,"L1TauMETfixEffEt","E_{t} Threshold","Efficiency","Single Tau +MET Efficiency Vs Threshold",1,false);
0083 l1->cd(24);
0084 DrawHistos(fname1,fname2,v1,v2,folder,"L1TauMETfixEffRefMatchEt","E_{t} Threshold","Efficiency","Single Tau +MET Matched Efficiency Vs Threshold",1,false);
0085 l1->cd(25);
0086 DrawHistos(fname1,fname2,v1,v2,folder,"L1DoubleTauEffEt","E_{t} Threshold","Efficiency","Double Tau Efficiency Vs Threshold",1,false);
0087 l1->cd(26);
0088 DrawHistos(fname1,fname2,v1,v2,folder,"L1DoubleTauEffRefMatchEt","E_{t} Threshold","Efficiency","Double Tau Matched Efficiency Vs Threshold",1,false);
0089 l1->cd(27);
0090 DrawHistos(fname1,fname2,v1,v2,folder,"L1TauIsoEgfixEffEt","E_{t} Threshold","Efficiency","EGamma+ Tau Efficiency Vs Threshold",1,false);
0091 l1->cd(28);
0092 DrawHistos(fname1,fname2,v1,v2,folder,"L1TauIsoEgfixEffRefMatchEt","E_{t} Threshold","Efficiency","EGamma+ Tau (Matched)Efficiency Vs Threshold",1,false);
0093 l1->cd(29);
0094 DrawHistos(fname1,fname2,v1,v2,folder,"L1TauMuonfixEffEt","E_{t} Threshold","Efficiency","Muon+ Tau Efficiency Vs Threshold",1,false);
0095 l1->cd(30);
0096 DrawHistos(fname1,fname2,v1,v2,folder,"L1TauMuonfixEffRefMatchEt","E_{t} Threshold","Efficiency","Muon+ Tau (Matched)Efficiency Vs Threshold",1,false);
0097
0098
0099
0100
0101
0102
0103
0104 }
0105
0106
0107 L1Val(string fname1,string fname2,string v1,string v2,string folder)
0108 {
0109
0110 GetHistos(fname1,fname2,v1,v2,folder,"L1TauEt","L1 E_{t}","n #tau cands","L1 Tau inclusive E_{t}",0,false);
0111 GetHistos(fname1,fname2,v1,v2,folder,"L1TauEta","L1 #eta","n #tau cands","L1 Tau inclusive #eta",0,false);
0112 GetHistos(fname1,fname2,v1, v2,folder,"L1TauPhi","L1 #phi","n #tau cands","L1 Tau inclusive #phi",0,false);
0113 GetHistos(fname1,fname2, v1, v2,folder,"L1Tau1Et","L1 E_{t}","n #tau cands","LeadingL1 Tau E_{t}",0,false);
0114 GetHistos(fname1,fname2, v1, v2,folder,"L1Tau1Eta","L1 #eta","n #tau cands","Leading L1 Tau #eta",0,false);
0115 GetHistos(fname1,fname2, v1, v2,folder,"L1Tau1Phi","L1 #phi","n #tau cands","Leading L1Tau #phi",0,false);
0116 GetHistos(fname1,fname2, v1, v2,folder,"L1Tau2Et","L1 E_{t}","n #tau cands","2nd L1 Tau E_{t}",0,false);
0117 GetHistos(fname1,fname2, v1, v2,folder,"L1Tau2Eta","L1 #eta","n #tau cands","2nd L1 Tau #eta",0,false);
0118 GetHistos(fname1,fname2, v1, v2,folder,"L1Tau2Phi","L1 #phi","n #tau cands","2nd L1Tau #phi",0,false);
0119 GetHistos(fname1,fname2, v1, v2,folder,"L1minusRefTauEt","#Delta E_{t}","n #tau cands","L1 Tau E_{t} - Ref E_{t}",0,false);
0120 GetHistos(fname1,fname2, v1, v2,folder,"L1minusMCoverRefTauEt","#Delta E_{t}/E_{t}","n #tau cands","(L1 Tau E_{t} - Ref E_{t})/RefE_{t}",0,false);
0121 GetEffHistos(fname1,fname2, v1, v2,folder,"L1RefMatchedTauEt","RefTauHadEt","Ref E_{t}","Efficiency","Regional Tau Efficiency vs E_{t}");
0122 GetEffHistos(fname1,fname2, v1, v2,folder,"L1RefMatchedTauEta","RefTauHadEta","Ref #eta","Efficiency","Regional Tau Efficiency vs #eta");
0123 GetEffHistos(fname1,fname2, v1, v2,folder,"L1RefMatchedTauPhi","RefTauHadPhi","Ref #phi","Efficiency","Regional Tau Efficiency vs #phi");
0124 GetEffHistos(fname1,fname2, v1, v2,folder,"L1RefMatchedTauMuonEt","RefTauMuonEt","Ref E_{t}","Efficiency","Regional Muon Efficiency vs E_{t}");
0125 GetEffHistos(fname1,fname2, v1, v2,folder,"L1RefMatchedTauMuonEta","RefTauMuonEta","Ref #eta","Efficiency","Regional Muon Efficiency vs #eta");
0126 GetEffHistos(fname1,fname2, v1, v2,folder,"L1RefMatchedTauMuonPhi","RefTauMuonPhi","Ref #phi","Efficiency","Regional Muon Efficiency vs #phi");
0127 GetEffHistos(fname1,fname2, v1, v2,folder,"L1RefMatchedTauElecEt","RefTauElecEt","Ref E_{t}","Efficiency","Regional Eg Efficiency vs E_{t}");
0128 GetEffHistos(fname1,fname2, v1, v2,folder,"L1RefMatchedTauElecEta","RefTauElecEta","Ref #eta","Efficiency","Regional Eg Efficiency vs #eta");
0129 GetEffHistos(fname1,fname2, v1, v2,folder,"L1RefMatchedTauElecPhi","RefTauElecPhi","Ref #phi","Efficiency","Regional Eg Efficiency vs #phi");
0130 GetIntHistos(fname1,fname2,v1,v2,folder,"L1SingleTauEffEt","nfidCounter",1,"E_{t} Threshold","Efficiency","Single Tau Efficiency Vs Threshold");
0131
0132 GetHistos(fname1,fname2,v1,v2,folder,"L1SingleTauEffEt","E_{t} Threshold","Efficiency","Single Tau Efficiency Vs Threshold",1,false);
0133 GetHistos(fname1,fname2,v1,v2,folder,"L1SingleTauEffRefMatchEt","E_{t} Threshold","Efficiency","Single Tau Matched Efficiency Vs Threshold",1,false);
0134 GetHistos(fname1,fname2,v1,v2,folder,"L1TauMETfixEffEt","E_{t} Threshold","Efficiency","Single Tau +MET Efficiency Vs Threshold",1,false);
0135 GetHistos(fname1,fname2,v1,v2,folder,"L1TauMETfixEffRefMatchEt","E_{t} Threshold","Efficiency","Single Tau +MET Matched Efficiency Vs Threshold",1,false);
0136 GetHistos(fname1,fname2,v1,v2,folder,"L1DoubleTauEffEt","E_{t} Threshold","Efficiency","Double Tau Efficiency Vs Threshold",1,false);
0137 GetHistos(fname1,fname2,v1,v2,folder,"L1DoubleTauEffRefMatchEt","E_{t} Threshold","Efficiency","Double Tau Matched Efficiency Vs Threshold",1,false);
0138 GetHistos(fname1,fname2,v1,v2,folder,"L1TauIsoEgfixEffEt","E_{t} Threshold","Efficiency","EGamma+ Tau Efficiency Vs Threshold",1,false);
0139 GetHistos(fname1,fname2,v1,v2,folder,"L1TauIsoEgfixEffRefMatchEt","E_{t} Threshold","Efficiency","EGamma+ Tau (Matched)Efficiency Vs Threshold",1,false);
0140 GetHistos(fname1,fname2,v1,v2,folder,"L1TauMuonfixEffEt","E_{t} Threshold","Efficiency","Muon+ Tau Efficiency Vs Threshold",1,false);
0141 GetHistos(fname1,fname2,v1,v2,folder,"L1TauMuonfixEffRefMatchEt","E_{t} Threshold","Efficiency","Muon+ Tau (Matched)Efficiency Vs Threshold",1,false);
0142
0143
0144
0145 GetIntHistos(fname1,fname2,v1,v2,folder,"L1SingleTauEffRefMatchEt","nfidCounter",2,"E_{t} Threshold","Efficiency","Single Tau Matched Efficiency Vs Threshold");
0146 GetIntHistos(fname1,fname2,v1,v2,folder,"L1TauMETfixEffEt","nfidCounter",1,"E_{t} Threshold","Efficiency","Single Tau +MET Efficiency Vs Threshold");
0147 GetIntHistos(fname1,fname2,v1,v2,folder,"L1TauMETfixEffRefMatchEt","nfidCounter",2,"E_{t} Threshold","Efficiency","Single Tau +MET Matched Efficiency Vs Threshold");
0148 GetIntHistos(fname1,fname2,v1,v2,folder,"L1DoubleTauEffEt","nfidCounter",1,"E_{t} Threshold","Efficiency","Double Tau Efficiency Vs Threshold");
0149 GetIntHistos(fname1,fname2,v1,v2,folder,"L1DoubleTauEffRefMatchEt","nfidCounter",3,"E_{t} Threshold","Efficiency","Double Tau Matched Efficiency Vs Threshold");
0150 GetIntHistos(fname1,fname2,v1,v2,folder,"L1TauIsoEgfixEffEt","nfidCounter",1,"E_{t} Threshold","Efficiency","EGamma+ Tau Efficiency Vs Threshold");
0151 GetIntHistos(fname1,fname2,v1,v2,folder,"L1TauIsoEgfixEffRefMatchEt","nfidCounter",5,"E_{t} Threshold","Efficiency","EGamma+ Tau (Matched)Efficiency Vs Threshold");
0152 GetIntHistos(fname1,fname2,v1,v2,folder,"L1TauMuonfixEffEt","nfidCounter",1,"E_{t} Threshold","Efficiency","Muon+ Tau Efficiency Vs Threshold");
0153 GetIntHistos(fname1,fname2,v1,v2,folder,"L1TauMuonfixEffRefMatchEt","nfidCounter",4,"E_{t} Threshold","Efficiency","Muon+ Tau (Matched)Efficiency Vs Threshold");
0154
0155 }
0156
0157
0158 L2Val(string fname1,string fname2,string v1,string v2,string folder)
0159 {
0160
0161 GetHistos(fname1,fname2,v1,v2,folder,"L2tauCandEt","L2 jet E_{t}","n. #tau cands."," L2 jet E_{t}",0,false );
0162 GetHistos(fname1,fname2,v1,v2,folder,"L2tauCandEta","L2 jet #eta","n. #tau cands."," L2 jet #eta",0,false );
0163 GetHistos(fname1,fname2,v1,v2,folder,"L2ecalIsolEt","L2 ECAL Isol. E_{t}","n. #tau cands.","ECAL #Sigma E_{t} in annulus",0,false );
0164 GetHistos(fname1,fname2,v1,v2,folder,"L2seedTowerEt","L2 Seed Tower E_{t}","n. #tau cands.","Seed Tower E_{t} in annulus",0,false );
0165 GetHistos(fname1,fname2,v1,v2,folder,"L2towerIsolEt","L2 Tower isol E_{t}","n. #tau cands.","Tower #Sigma E_{t} in annulus",0,false );
0166 GetHistos(fname1,fname2,v1,v2,folder,"L2nClusters","L2 Number of Clusters","n. #tau cands.","Number of clusters",0,false );
0167 GetHistos(fname1,fname2,v1,v2,folder,"L2clusterEtaRMS","L2 Cluster #eta RMS","n. #tau cands.","Cluster #eta RMS",0,false );
0168 GetHistos(fname1,fname2,v1,v2,folder,"L2clusterPhiRMS","L2 Cluster #phi RMS","n. #tau cands.","Cluster #phi RMS",0,false );
0169 GetHistos(fname1,fname2,v1,v2,folder,"L2clusterDeltaRRMS","L2 Cluster #DeltaR RMS","n. #tau cands.","Cluster #DeltaR RMS",0,false );
0170 GetHistos(fname1,fname2,v1,v2,folder,"MET","MET [GeV]","n. events","Missing E_{t}",0,false );
0171 GetEffHistos(fname1,fname2,v1,v2,folder,"L2EtEffNum","L2EtEffDenom","Ref. E_{t}[GeV]","Efficiency","L2 Efficiency vs E_{t}");
0172
0173
0174
0175 }
0176
0177 L25Val(string fname1,string fname2,string v1,string v2,string folder)
0178 {
0179
0180 GetHistos(fname1,fname2,v1,v2,folder,"L25jetEt","L25 Jet E_{t} [GeV]","n. #tau cands.","L25 Jet E_{t} [GeV]",0,false );
0181 GetHistos(fname1,fname2,v1,v2,folder,"L25jetEta","L25 Jet #eta","n. #tau cands.","L25 Jet #eta",0,false );
0182
0183
0184 GetHistos(fname1,fname2,v1,v2,folder,"L25nTrksInJet","L25 Number of Pixel Tracks","n. #tau cands.","# Pixel Tracks in L25 Jet",0,false );
0185 GetHistos(fname1,fname2,v1,v2,folder,"L25nQTrksInJet","L25 Number of Q Pixel Tracks","n. #tau cands.","# Quality Pixel Tracks in L25 Jet",0,false );
0186 GetHistos(fname1,fname2,v1,v2,folder,"L25signalLeadTrkPt","L25 Lead Track P_{t}[GeV]","n. #tau cands.","Lead Track P_{t} [GeV]",0,false );
0187 GetEffHistos(fname1,fname2,v1,v2,folder,"L25IsoJetEt","L25jetEt","Ref. E_{t}[GeV]","Efficiency","L25 Efficiency vs E_{t}");
0188 GetEffHistos(fname1,fname2,v1,v2,folder,"L25IsoJetEta","L25jetEta","#eta","Efficiency","L25 Efficiency vs #eta");
0189
0190
0191 }
0192
0193 L3Val(string fname1,string fname2,string v1,string v2,string folder)
0194 {
0195 GetHistos(fname1,fname2,v1,v2,folder,"L3jetEt","L3 Jet E_{t} [GeV]","n. #tau cands.","L3 Jet E_{t} [GeV]",0,false );
0196 GetHistos(fname1,fname2,v1,v2,folder,"L3jetEta","L3 Jet #eta","n. #tau cands.","L3 Jet #eta",0,false );
0197
0198
0199
0200 GetHistos(fname1,fname2,v1,v2,folder,"L3nTrksInJet","L3 Number of Silicon Tracks","n. #tau cands.","# Si Tracks in L3 Jet",0,false );
0201 GetHistos(fname1,fname2,v1,v2,folder,"L3nQTrksInJet","L3 Number of Quality Si Tracks","n. #tau cands.","# Quality Si. Tracks in L3 Jet",0,false );
0202 GetHistos(fname1,fname2,v1,v2,folder,"L3signalLeadTrkPt","L3 Lead Track P_{t}[GeV]","n. #tau cands.","Lead Track P_{t} [GeV]",0,false );
0203 GetEffHistos(fname1,fname2,v1,v2,folder,"L3IsoJetEt","L3jetEt","Ref. E_{t}[GeV]","Efficiency","L25 Efficiency vs E_{t}");
0204 GetEffHistos(fname1,fname2,v1,v2,folder,"L3IsoJetEta","L3jetEta","#eta","Efficiency","L25 Efficiency vs #eta");
0205
0206 }
0207
0208
0209
0210
0211 ElectronVal(string fname1,string fname2,string v1,string v2,string f)
0212 {
0213 string folder=f;
0214 gStyle->SetOptTitle(1);
0215 TFile* file1 = new TFile(fname1.c_str());
0216 string Histo_path = folder+"/total eff";
0217 TH1F* hf1 = (TH1F*)file1->Get(Histo_path.c_str());
0218
0219 std::vector<string> vars;
0220 vars.push_back("et");
0221 vars.push_back("eta");
0222
0223
0224 for(int i=0;i<vars.size();++i)
0225 for(int filter=1; filter < hf1->GetNbinsX() -2 ; filter++)
0226 {
0227 string name1(hf1->GetXaxis()->GetBinLabel(filter));
0228 string name2(hf1->GetXaxis()->GetBinLabel(filter+1));
0229 hname1=name1+vars[i];
0230 hname2=name2+vars[i];
0231 GetEffHistos(fname1,fname2,v1,v2,folder,hname2,hname1,vars[i].c_str(),"Efficiency",name1.c_str());
0232 }
0233
0234
0235 }
0236
0237
0238 ElectronDraw(string fname1,string fname2,string v1,string v2,string f)
0239 {
0240 string folder=f;
0241 gStyle->SetOptTitle(1);
0242
0243 TFile* file1 = new TFile(fname1.c_str());
0244 string Histo_path = folder+"/total eff";
0245 TH1F* hf1 = (TH1F*)file1->Get(Histo_path.c_str());
0246
0247 std::vector<string> vars;
0248 vars.push_back("et");
0249 vars.push_back("eta");
0250 TCanvas *el =new TCanvas("el","el");
0251 el->Divide(3,3);
0252 int pad=1;
0253 for(int i=0;i<vars.size();++i)
0254 for(int filter=1; filter < hf1->GetNbinsX() -2 ; filter++)
0255 {
0256 el->cd(pad);
0257 string name1(hf1->GetXaxis()->GetBinLabel(filter));
0258 string name2(hf1->GetXaxis()->GetBinLabel(filter+1));
0259 string hname1=name1+vars[i];
0260 string hname2=name2+vars[i];
0261 DrawEffHistos(fname1,fname2,v1,v2,folder,hname2,hname1,vars[i].c_str(),"Efficiency",name1.c_str());
0262 pad+=1;
0263 }
0264
0265
0266 }
0267
0268
0269
0270
0271
0272
0273 L2Draw(string fname1,string fname2,string v1,string v2,string folder)
0274 {
0275 TCanvas *l2 = new TCanvas;
0276 l2->Divide(3,3);
0277 l2->cd(1);
0278 DrawHistos(fname1,fname2,v1,v2,folder,"L2tauCandEt","L2 jet E_{t}","n. #tau cands."," L2 jet E_{t}",0,false );
0279 l2->cd(2);
0280 DrawHistos(fname1,fname2,v1,v2,folder,"L2tauCandEta","L2 jet #eta","n. #tau cands."," L2 jet #eta",0,false );
0281 l2->cd(3);
0282 DrawHistos(fname1,fname2,v1,v2,folder,"L2ecalIsolEt","L2 ECAL Isol. E_{t}","n. #tau cands.","ECAL #Sigma E_{t} in annulus",0,false );
0283
0284
0285
0286
0287 l2->cd(4);
0288 DrawHistos(fname1,fname2,v1,v2,folder,"L2nClusters","L2 Number of Clusters","n. #tau cands.","Number of clusters",0,false );
0289 l2->cd(5);
0290 DrawHistos(fname1,fname2,v1,v2,folder,"L2clusterEtaRMS","L2 Cluster #eta RMS","n. #tau cands.","Cluster #eta RMS",0,false );
0291 l2->cd(6);
0292 DrawHistos(fname1,fname2,v1,v2,folder,"L2clusterPhiRMS","L2 Cluster #phi RMS","n. #tau cands.","Cluster #phi RMS",0,false );
0293 l2->cd(7);
0294 DrawHistos(fname1,fname2,v1,v2,folder,"L2clusterDeltaRRMS","L2 Cluster #DeltaR RMS","n. #tau cands.","Cluster #DeltaR RMS",0,false );
0295 l2->cd(8);
0296 DrawHistos(fname1,fname2,v1,v2,folder,"MET","MET [GeV]","n. events","Missing E_{t}",0,false );
0297 l2->cd(9);
0298 DrawEffHistos(fname1,fname2,v1,v2,folder,"L2EtEffNum","L2EtEffDenom","Ref. E_{t}[GeV]","Efficiency","L2 Efficiency vs E_{t}");
0299
0300
0301 }
0302
0303
0304
0305 L25Draw(string fname1,string fname2,string v1,string v2,string folder)
0306 {
0307 TCanvas *l25 = new TCanvas;
0308 l25->Divide(3,3);
0309 l25->cd(1);
0310 DrawHistos(fname1,fname2,v1,v2,folder,"L25jetEt","L25 Jet E_{t} [GeV]","n. #tau cands.","L25 Jet E_{t} [GeV]",0,false );
0311 l25->cd(2);
0312 DrawHistos(fname1,fname2,v1,v2,folder,"L25jetEta","L25 Jet #eta","n. #tau cands.","L25 Jet #eta",0,false );
0313
0314
0315
0316
0317 l25->cd(5);
0318 DrawHistos(fname1,fname2,v1,v2,folder,"L25nTrksInJet","L25 Number of Pixel Tracks","n. #tau cands.","# Pixel Tracks in L25 Jet",0,false );
0319 l25->cd(6);
0320 DrawHistos(fname1,fname2,v1,v2,folder,"L25nQTrksInJet","L25 Number of Q Pixel Tracks","n. #tau cands.","# Quality Pixel Tracks in L25 Jet",0,false );
0321 l25->cd(7);
0322 DrawHistos(fname1,fname2,v1,v2,folder,"L25signalLeadTrkPt","L25 Lead Track P_{t}[GeV]","n. #tau cands.","Lead Track P_{t} [GeV]",0,false );
0323 l25->cd(3);
0324 DrawEffHistos(fname1,fname2,v1,v2,folder,"L25IsoJetEt","L25jetEt","Ref. E_{t}[GeV]","Efficiency","L25 Efficiency vs E_{t}");
0325 l25->cd(4);
0326 DrawEffHistos(fname1,fname2,v1,v2,folder,"L25IsoJetEta","L25jetEta","#eta","Efficiency","L25 Efficiency vs #eta");
0327
0328
0329 }
0330
0331 L3Draw(string fname1,string fname2,string v1,string v2,string folder)
0332 {
0333 TCanvas *l33 = new TCanvas;
0334 l33->Divide(3,2);
0335 l33->cd(1);
0336 DrawHistos(fname1,fname2,v1,v2,folder,"L3jetEt","L3 Jet E_{t} [GeV]","n. #tau cands.","L3 Jet E_{t} [GeV]",0,false );
0337 l33->cd(2);
0338 DrawHistos(fname1,fname2,v1,v2,folder,"L3jetEta","L3 Jet #eta","n. #tau cands.","L3 Jet #eta",0,false );
0339 l33->cd(3);
0340 DrawHistos(fname1,fname2,v1,v2,folder,"L3nTrksInJet","L3 Number of Silicon Tracks","n. #tau cands.","# Si Tracks in L3 Jet",0,false );
0341 l33->cd(4);
0342 DrawHistos(fname1,fname2,v1,v2,folder,"L3nQTrksInJet","L3 Number of Quality Si Tracks","n. #tau cands.","# Quality Si. Tracks in L3 Jet",0,false );
0343 l33->cd(5);
0344 DrawHistos(fname1,fname2,v1,v2,folder,"L3signalLeadTrkPt","L3 Lead Track P_{t}[GeV]","n. #tau cands.","Lead Track P_{t} [GeV]",0,false );
0345 l33->cd(6);
0346
0347
0348
0349
0350 }
0351
0352 GetHistos(string f1,string f2,string v1,string v2,string modName,string histo,char* xlabel = "",char *ylabel = "",char *title, double scale = 1,bool eff)
0353 {
0354 TCanvas *c = new TCanvas;
0355 c->cd();
0356 TFile *f = new TFile(f1.c_str());
0357 TFile *ff = new TFile(f2.c_str());
0358
0359 TH1F *h = ((TH1F*)f->Get((modName+"/"+histo).c_str()))->Clone();
0360 TH1F *hh = ((TH1F*)ff->Get((modName+"/"+histo).c_str()))->Clone();
0361
0362
0363 if(!eff)
0364 h->Sumw2();
0365
0366 h->GetXaxis()->SetLabelSize(0.06);
0367 h->GetXaxis()->SetNdivisions(509);
0368 h->GetYaxis()->SetNdivisions(509);
0369 h->GetYaxis()->SetLabelSize(0.06);
0370 h->GetXaxis()->SetTitleSize(0.06);
0371 h->GetYaxis()->SetTitleSize(0.06);
0372 h->GetYaxis()->SetTitleOffset(1.25);
0373
0374 h->SetMarkerColor(kYellow);
0375 h->SetMarkerStyle(20);
0376 h->SetFillColor(kYellow);
0377 h->GetXaxis()->SetTitle(xlabel);
0378 h->GetYaxis()->SetTitle(ylabel);
0379 h->SetTitle(title);
0380 if(!eff)
0381 {
0382 if(h->Integral()>0)
0383 if(scale==0) h->Scale(1/h->Integral());
0384 else
0385 h->Scale(scale);
0386
0387 hh->Sumw2();
0388 }
0389 hh->GetXaxis()->SetLabelSize(0.06);
0390 hh->GetYaxis()->SetLabelSize(0.06);
0391 hh->GetXaxis()->SetTitleSize(0.06);
0392 hh->GetYaxis()->SetTitleSize(0.06);
0393 hh->SetLineColor(kRed);
0394 hh->SetMarkerColor(kRed);
0395 hh->SetMarkerStyle(20);
0396 hh->GetXaxis()->SetTitle(xlabel);
0397 hh->GetYaxis()->SetTitle(ylabel);
0398 hh->SetTitle(title);
0399 if(!eff)
0400 {
0401 if(hh->Integral()>0)
0402 if(scale==0) hh->Scale(1/hh->Integral());
0403 else
0404 hh->Scale(scale);
0405
0406
0407 }
0408
0409
0410
0411 double max = h->GetMaximum();
0412 if(hh->GetMaximum() > max)
0413 max=hh->GetMaximum();
0414
0415 h->GetYaxis()->SetRangeUser(0,max);
0416
0417 h->Draw("HIST");
0418 hh->Draw("SAME");
0419
0420
0421
0422 TLegend *l = new TLegend(0.7,0.5,0.9,0.7);
0423 l->AddEntry(h,v1.c_str());
0424 l->AddEntry(hh,v2.c_str());
0425 l->Draw();
0426
0427 c->SaveAs((histo+".gif").c_str());
0428 delete c;
0429 f->Close();
0430 ff->Close();
0431
0432 }
0433
0434
0435 GetEffHistos(string f1,string f2,string v1,string v2,string modName,string histo1,string histo2,char* xlabel = "",char *ylabel = "",char *title)
0436 {
0437 TCanvas *c = new TCanvas;
0438 c->cd();
0439 TFile *f = new TFile(f1.c_str());
0440 TFile *ff = new TFile(f2.c_str());
0441
0442 TH1F *h = ((TH1F*)f->Get((modName+"/"+histo1).c_str()))->Clone();
0443 TH1F *hd = ((TH1F*)f->Get((modName+"/"+histo2).c_str()))->Clone();
0444
0445 TH1F *hh = ((TH1F*)ff->Get((modName+"/"+histo1).c_str()))->Clone();
0446 TH1F *hhd = ((TH1F*)ff->Get((modName+"/"+histo2).c_str()))->Clone();
0447
0448 h->Sumw2();
0449 hd->Sumw2();
0450 hh->Sumw2();
0451 hhd->Sumw2();
0452
0453
0454 h->Divide(h,hd,1.,1.,"b");
0455 hh->Divide(hh,hhd,1.,1.,"b");
0456
0457
0458 h->GetXaxis()->SetLabelSize(0.06);
0459 h->GetXaxis()->SetNdivisions(509);
0460 h->GetYaxis()->SetNdivisions(509);
0461 h->GetYaxis()->SetLabelSize(0.06);
0462 h->GetXaxis()->SetTitleSize(0.06);
0463 h->GetYaxis()->SetTitleSize(0.06);
0464 h->GetYaxis()->SetTitleOffset(1.25);
0465 h->GetYaxis()->SetRangeUser(0.,1.01);
0466
0467 double max = h->GetMaximum();
0468 if(hh->GetMaximum() > max)
0469 max==hh->GetMaximum();
0470 h->GetYaxis()->SetRangeUser(0,max);
0471
0472
0473 h->SetMarkerColor(kYellow);
0474 h->SetMarkerStyle(20);
0475 h->SetFillColor(kYellow);
0476 h->GetXaxis()->SetTitle(xlabel);
0477 h->GetYaxis()->SetTitle(ylabel);
0478 h->SetTitle(title);
0479 hh->GetXaxis()->SetLabelSize(0.06);
0480 hh->GetYaxis()->SetLabelSize(0.06);
0481 hh->GetXaxis()->SetTitleSize(0.06);
0482 hh->GetYaxis()->SetTitleSize(0.06);
0483 hh->SetLineColor(kRed);
0484 hh->SetMarkerColor(kRed);
0485 hh->SetMarkerStyle(20);
0486 hh->GetXaxis()->SetTitle(xlabel);
0487 hh->GetYaxis()->SetTitle(ylabel);
0488 hh->SetTitle(title);
0489 h->Draw("HIST");
0490 hh->Draw("SAME");
0491 TLegend *l = new TLegend(0.7,0.5,0.9,0.7);
0492 l->AddEntry(h,v1.c_str());
0493 l->AddEntry(hh,v2.c_str());
0494 l->Draw();
0495
0496 c->SaveAs((histo1+"Eff.gif").c_str());
0497 delete c;
0498 f->Close();
0499 ff->Close();
0500
0501 }
0502
0503
0504 DrawHistos(string f1,string f2,string v1,string v2,string modName,string histo,char* xlabel = "",char *ylabel = "",char *title, double scale = 1,bool eff)
0505 {
0506
0507 TFile *f = new TFile(f1.c_str());
0508 TFile *ff = new TFile(f2.c_str());
0509
0510 TH1F *h = ((TH1F*)f->Get((modName+"/"+histo).c_str()))->Clone();
0511 TH1F *hh = ((TH1F*)ff->Get((modName+"/"+histo).c_str()))->Clone();
0512
0513 if(!eff)
0514 h->Sumw2();
0515
0516 h->GetXaxis()->SetLabelSize(0.06);
0517 h->GetXaxis()->SetNdivisions(509);
0518 h->GetYaxis()->SetNdivisions(509);
0519 h->GetYaxis()->SetLabelSize(0.06);
0520 h->GetXaxis()->SetTitleSize(0.06);
0521 h->GetYaxis()->SetTitleSize(0.06);
0522
0523 h->GetYaxis()->SetTitleOffset(1.25);
0524 h->SetMarkerColor(kYellow);
0525 h->SetMarkerStyle(20);
0526 h->SetFillColor(kYellow);
0527 h->GetXaxis()->SetTitle(xlabel);
0528 h->GetYaxis()->SetTitle(ylabel);
0529 h->SetTitle(title);
0530
0531 if(!eff)
0532 {
0533 if(h->Integral()>0)
0534 if(scale==0) h->Scale(1/h->Integral());
0535 else
0536 h->Scale(scale);
0537
0538 hh->Sumw2();
0539 }
0540 hh->GetXaxis()->SetLabelSize(0.06);
0541 hh->GetYaxis()->SetLabelSize(0.06);
0542 hh->GetXaxis()->SetTitleSize(0.06);
0543 hh->GetYaxis()->SetTitleSize(0.06);
0544 hh->SetLineColor(kRed);
0545 hh->SetMarkerColor(kRed);
0546 hh->SetMarkerStyle(20);
0547 hh->GetXaxis()->SetTitle(xlabel);
0548 hh->GetYaxis()->SetTitle(ylabel);
0549 hh->SetTitle(title);
0550 if(!eff)
0551 {
0552 if(hh->Integral()>0)
0553 if(scale==0) hh->Scale(1/hh->Integral());
0554 else
0555 hh->Scale(scale);
0556
0557
0558 }
0559
0560
0561 double max = h->GetMaximum();
0562 if(hh->GetMaximum() > max)
0563 max==hh->GetMaximum();
0564
0565 h->GetYaxis()->SetRangeUser(0,max);
0566
0567
0568 h->Draw("HIST");
0569 hh->Draw("SAME");
0570 TLegend *l = new TLegend(0.7,0.5,0.9,0.7);
0571 l->AddEntry(h,v1.c_str());
0572 l->AddEntry(hh,v2.c_str());
0573 l->Draw();
0574
0575 }
0576
0577
0578
0579 DrawEffHistos(string f1,string f2,string v1,string v2,string modName,string histo1,string histo2,char* xlabel = "",char *ylabel = "",char *title)
0580 {
0581
0582 TFile *f = new TFile(f1.c_str());
0583 TFile *ff = new TFile(f2.c_str());
0584
0585 TH1F *h = ((TH1F*)f->Get((modName+"/"+histo1).c_str()))->Clone();
0586 TH1F *hd = ((TH1F*)f->Get((modName+"/"+histo2).c_str()))->Clone();
0587
0588 TH1F *hh = ((TH1F*)ff->Get((modName+"/"+histo1).c_str()))->Clone();
0589 TH1F *hhd = ((TH1F*)ff->Get((modName+"/"+histo2).c_str()))->Clone();
0590
0591 h->Sumw2();
0592 hd->Sumw2();
0593 hh->Sumw2();
0594 hhd->Sumw2();
0595
0596 TGraphAsymmErrors* g1 = new TGraphAsymmErrors;
0597 g1->SetName(h->GetName());
0598 g1->BayesDivide(h,hd);
0599
0600 g1->GetXaxis()->SetLabelSize(0.06);
0601 g1->GetXaxis()->SetNdivisions(509);
0602 g1->GetYaxis()->SetNdivisions(509);
0603 g1->GetYaxis()->SetLabelSize(0.06);
0604 g1->GetXaxis()->SetTitleSize(0.06);
0605 g1->GetYaxis()->SetTitleSize(0.06);
0606 g1->GetYaxis()->SetTitleOffset(1.25);
0607
0608 TGraphAsymmErrors* g2 = new TGraphAsymmErrors;
0609 g2->SetName(h->GetName());
0610 g2->BayesDivide(hh,hhd);
0611
0612 g2->GetXaxis()->SetLabelSize(0.06);
0613 g2->GetXaxis()->SetNdivisions(509);
0614 g2->GetYaxis()->SetNdivisions(509);
0615 g2->GetYaxis()->SetLabelSize(0.06);
0616 g2->GetXaxis()->SetTitleSize(0.06);
0617 g2->GetYaxis()->SetTitleSize(0.06);
0618 g2->GetYaxis()->SetTitleOffset(1.25);
0619
0620
0621
0622
0623 g1->SetMarkerColor(kYellow);
0624 g1->SetMarkerStyle(20);
0625 g1->SetFillColor(kYellow);
0626 g1->GetXaxis()->SetTitle(xlabel);
0627 g1->GetYaxis()->SetTitle(ylabel);
0628 g1->SetTitle(title);
0629
0630
0631 g2->SetLineColor(kRed);
0632 g2->SetMarkerColor(kRed);
0633 g2->SetMarkerStyle(20);
0634 g2->GetXaxis()->SetTitle(xlabel);
0635 g2->GetYaxis()->SetTitle(ylabel);
0636 g2->SetTitle(title);
0637
0638
0639 g1->Draw("AP");
0640 g2->Draw("Psame");
0641 TLegend *l = new TLegend(0.7,0.5,0.9,0.7);
0642 l->AddEntry(g1,v1.c_str());
0643 l->AddEntry(g2,v2.c_str());
0644 l->Draw();
0645 }
0646
0647
0648
0649
0650 DrawIntHistos(string f1,string f2,string v1,string v2,string modName,string histo,string nfid,int dBin,char* xlabel = "",char *ylabel = "",char *title = "")
0651 {
0652
0653 TFile *f = new TFile(f1.c_str());
0654 TFile *ff = new TFile(f2.c_str());
0655
0656 TH1F *h = ((TH1F*)f->Get((modName+"/"+histo).c_str()))->Clone();
0657 TH1F *hh = ((TH1F*)ff->Get((modName+"/"+histo).c_str()))->Clone();
0658 TH1F *nfid1 = ((TH1F*)f->Get((modName+"/"+nfid).c_str()))->Clone();
0659 TH1F *nfid2 = ((TH1F*)ff->Get((modName+"/"+nfid).c_str()))->Clone();
0660
0661 double denom1 = nfid1->GetBinContent(dBin);
0662 double denom2 = nfid2->GetBinContent(dBin);
0663
0664
0665 convertToIntegratedEff(h,denom1);
0666 convertToIntegratedEff(hh,denom2);
0667
0668
0669 h->GetXaxis()->SetLabelSize(0.06);
0670 h->GetXaxis()->SetNdivisions(509);
0671 h->GetYaxis()->SetNdivisions(509);
0672 h->GetYaxis()->SetLabelSize(0.06);
0673 h->GetXaxis()->SetTitleSize(0.06);
0674 h->GetYaxis()->SetTitleSize(0.06);
0675
0676 h->GetYaxis()->SetTitleOffset(1.25);
0677 h->SetMarkerColor(kYellow);
0678 h->SetMarkerStyle(20);
0679 h->SetFillColor(kYellow);
0680 h->GetXaxis()->SetTitle(xlabel);
0681 h->GetYaxis()->SetTitle(ylabel);
0682 h->SetTitle(title);
0683 hh->GetXaxis()->SetLabelSize(0.06);
0684 hh->GetYaxis()->SetLabelSize(0.06);
0685 hh->GetXaxis()->SetTitleSize(0.06);
0686 hh->GetYaxis()->SetTitleSize(0.06);
0687 hh->SetLineColor(kRed);
0688 hh->SetMarkerColor(kRed);
0689 hh->SetMarkerStyle(20);
0690 hh->GetXaxis()->SetTitle(xlabel);
0691 hh->GetYaxis()->SetTitle(ylabel);
0692 hh->SetTitle(title);
0693
0694 double max = h->GetMaximum();
0695 if(hh->GetMaximum() > max)
0696 max==hh->GetMaximum();
0697
0698
0699
0700 h->Draw("HIST");
0701 hh->Draw("SAME");
0702
0703 h->GetYaxis()->SetRangeUser(0,max);
0704 hh->GetYaxis()->SetRangeUser(0,max);
0705
0706
0707 TLegend *l = new TLegend(0.7,0.5,0.9,0.7);
0708 l->AddEntry(h,v1.c_str());
0709 l->AddEntry(hh,v2.c_str());
0710 l->Draw();
0711
0712 }
0713
0714
0715 GetIntHistos(string f1,string f2,string v1,string v2,string modName,string histo,string nfid,int dBin,char* xlabel = "",char *ylabel = "",char *title = "")
0716 {
0717 TCanvas *c = new TCanvas;
0718 c->cd();
0719
0720 TFile *f = new TFile(f1.c_str());
0721 TFile *ff = new TFile(f2.c_str());
0722
0723 TH1F *h = ((TH1F*)f->Get((modName+"/"+histo).c_str()))->Clone();
0724 TH1F *hh = ((TH1F*)ff->Get((modName+"/"+histo).c_str()))->Clone();
0725 TH1F *nfid1 = ((TH1F*)f->Get((modName+"/"+nfid).c_str()))->Clone();
0726 TH1F *nfid2 = ((TH1F*)ff->Get((modName+"/"+nfid).c_str()))->Clone();
0727
0728 double denom1 = nfid1->GetBinContent(dBin);
0729 double denom2 = nfid2->GetBinContent(dBin);
0730
0731
0732 convertToIntegratedEff(h,denom1);
0733 convertToIntegratedEff(hh,denom2);
0734
0735
0736 h->GetXaxis()->SetLabelSize(0.06);
0737 h->GetXaxis()->SetNdivisions(509);
0738 h->GetYaxis()->SetNdivisions(509);
0739 h->GetYaxis()->SetLabelSize(0.06);
0740 h->GetXaxis()->SetTitleSize(0.06);
0741 h->GetYaxis()->SetTitleSize(0.06);
0742
0743 h->GetYaxis()->SetTitleOffset(1.25);
0744 h->SetMarkerColor(kYellow);
0745 h->SetMarkerStyle(20);
0746 h->SetFillColor(kYellow);
0747 h->GetXaxis()->SetTitle(xlabel);
0748 h->GetYaxis()->SetTitle(ylabel);
0749 h->SetTitle(title);
0750 hh->GetXaxis()->SetLabelSize(0.06);
0751 hh->GetYaxis()->SetLabelSize(0.06);
0752 hh->GetXaxis()->SetTitleSize(0.06);
0753 hh->GetYaxis()->SetTitleSize(0.06);
0754 hh->SetLineColor(kRed);
0755 hh->SetMarkerColor(kRed);
0756 hh->SetMarkerStyle(20);
0757 hh->GetXaxis()->SetTitle(xlabel);
0758 hh->GetYaxis()->SetTitle(ylabel);
0759 hh->SetTitle(title);
0760
0761 double max = h->GetMaximum();
0762 if(hh->GetMaximum() > max)
0763 max==hh->GetMaximum();
0764
0765 h->GetYaxis()->SetRangeUser(0,max);
0766
0767
0768
0769 h->Draw("HIST");
0770 hh->Draw("SAME");
0771
0772
0773
0774 TLegend *l = new TLegend(0.7,0.5,0.9,0.7);
0775 l->AddEntry(h,v1.c_str());
0776 l->AddEntry(hh,v2.c_str());
0777 l->Draw();
0778
0779 c->SaveAs((histo+"IntEff.gif").c_str());
0780 delete c;
0781 f->Close();
0782 ff->Close();
0783
0784
0785 }
0786
0787
0788
0789
0790
0791 void
0792 convertToIntegratedEff(TH1F* histo, double nGenerated)
0793 {
0794
0795
0796
0797
0798 int nbins = histo->GetNbinsX();
0799 double integral = histo->GetBinContent(nbins+1);
0800 if (nGenerated<=0) {
0801 return;
0802 }
0803 for(int i = nbins; i >= 1; i--)
0804 {
0805 double thisBin = histo->GetBinContent(i);
0806 integral += thisBin;
0807 double integralEff;
0808 double integralError;
0809 integralEff = (integral / nGenerated);
0810 histo->SetBinContent(i, integralEff);
0811 integralError = (sqrt(integral) / nGenerated);
0812 histo->SetBinError(i, integralError);
0813 }
0814 }