Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:18:51

0001 {
0002 gROOT->Reset();
0003 
0004 TH1F::SetDefaultSumw2();
0005 
0006 TFile f1("dqm_Wenu_versionA.root");
0007 TFile f2("dqm_Wenu_versionB.root");
0008 
0009 const int nf = 7;
0010 
0011 string filters[nf] = {
0012         "l1seedSingle",
0013         "hltL1IsoSingleL1MatchFilter",
0014         "hltL1IsoSingleElectronEtFilter",
0015         "hltL1IsoSingleElectronHcalIsolFilter",
0016         "hltL1IsoSingleElectronPixelMatchFilter",
0017         "hltL1IsoSingleElectronHOneOEMinusOneOPFilter",
0018         "hltL1IsoSingleElectronTrackIsolFilter"
0019         }
0020 
0021 string pathname="singleElectronDQM";
0022 string histosEt[nf];
0023 string histosEta[nf];
0024 for (int i=0; i<nf; i++){
0025   histosEt[i]=pathname+"/"+filters[i]+"et";
0026   histosEta[i]=pathname+"/"+filters[i]+"eta";
0027 }
0028 TH1F* het1[nf];
0029 TH1F* heta1[nf];
0030 TH1F* het2[nf];
0031 TH1F* heta2[nf];
0032 for (int i=0; i<nf; i++){
0033 het1[i] = (TH1F*) f1.Get(histosEt[i].c_str());
0034 het1[i]->GetXaxis()->SetTitle("E_{T}");
0035 heta1[i] = (TH1F*) f1.Get(histosEta[i].c_str());
0036 heta1[i]->GetXaxis()->SetTitle("\\eta");
0037 
0038 het2[i] = (TH1F*) f2.Get(histosEt[i].c_str());
0039 het2[i]->GetXaxis()->SetTitle("E_{T}");
0040 heta2[i] = (TH1F*) f2.Get(histosEta[i].c_str());
0041 heta2[i]->GetXaxis()->SetTitle("\\eta");
0042 
0043  het2[i]->SetLineColor(2);
0044  heta2[i]->SetLineColor(2);
0045 
0046 }
0047 
0048 TH1F* effEt1[nf-1];
0049 TH1F* effEta1[nf-1];
0050 for (int i=2; i<nf; i++){//non ha senso per L1 e L1 match
0051   string nameEff = "eff" + string(het1[i]->GetTitle())+"_1";
0052   effEt1[i-2]= new TH1F(nameEff.c_str(),nameEff.c_str(),40,0.,200.);
0053   effEt1[i-2]->SetTitle(nameEff.c_str());
0054   effEt1[i-2]->GetXaxis()->SetTitle("E_{T}");
0055   effEt1[i-2]->GetYaxis()->SetTitle("eff");
0056   effEt1[i-2]->Divide(het1[i], het1[i-1],1.,1.,"B");
0057 
0058   string nameEffeta = "eff" + string(heta1[i]->GetTitle())+"_1";
0059   effEta1[i-2]= new TH1F(nameEffeta.c_str(),nameEffeta.c_str(),40,-2.7,2.7.);
0060   effEta1[i-2]->SetTitle(nameEffeta.c_str());
0061   effEta1[i-2]->GetXaxis()->SetTitle("\\eta");
0062   effEta1[i-2]->GetYaxis()->SetTitle("eff");
0063   effEta1[i-2]->Divide(heta1[i], heta1[i-1],1.,1.,"B");
0064 }
0065 cout<<"AAAAAAAAAAA"<<endl;
0066 effEt1[nf-2]=new TH1F("HLT_L1_et_1","HLT/L1",40,0.,200.);
0067 effEt1[nf-2]->GetXaxis()->SetTitle("E_{T}");
0068 effEt1[nf-2]->GetYaxis()->SetTitle("eff");
0069 effEt1[nf-2]->Divide(het1[nf-1], het1[nf-6],1.,1.,"B");
0070 
0071 effEta1[nf-2]= new TH1F("HLT_L1_eta_1","HLT/L1",40,-2.7,2.7.);
0072 effEta1[nf-2]->GetXaxis()->SetTitle("\\eta");
0073 effEta1[nf-2]->GetYaxis()->SetTitle("eff");
0074 effEta1[nf-2]->Divide(heta1[nf-1], heta1[nf-6],1.,1.,"B");
0075 cout<<"BBBAAAAAAAAAAA"<<endl;
0076 TH1F* effEt2[nf-1];
0077 TH1F* effEta2[nf-1];
0078 for (int i=2; i<nf; i++){//non ha senso per L1 e L1 match
0079   string nameEff = "eff" + string(het2[i]->GetTitle())+"_2";
0080   effEt2[i-2]= new TH1F(nameEff.c_str(),nameEff.c_str(),40,0.,200.);
0081   effEt2[i-2]->SetTitle(nameEff.c_str());
0082   effEt2[i-2]->GetXaxis()->SetTitle("E_{T}");
0083   effEt2[i-2]->GetYaxis()->SetTitle("eff");
0084   effEt2[i-2]->Divide(het2[i], het2[i-1],1.,1.,"B");
0085 
0086   string nameEffeta = "eff" + string(heta2[i]->GetTitle())+"_2";
0087   effEta2[i-2]= new TH1F(nameEffeta.c_str(),nameEffeta.c_str(),40,-2.7,2.7.);
0088   effEta2[i-2]->SetTitle(nameEffeta.c_str());
0089   effEta2[i-2]->GetXaxis()->SetTitle("\\eta");
0090   effEta2[i-2]->GetYaxis()->SetTitle("eff");
0091   effEta2[i-2]->Divide(heta2[i], heta2[i-1],1.,1.,"B");
0092 
0093   effEt2[i-2]->SetLineColor(2);
0094   effEta2[i-2]->SetLineColor(2);
0095  }
0096 cout<<"CCCCAAAAAAAAAAA"<<endl;
0097 effEt2[nf-2]=new TH1F("HLT_L1_et_2","HLT/L1",40,0.,200.);
0098 effEt2[nf-2]->GetXaxis()->SetTitle("E_{T}");
0099 effEt2[nf-2]->GetYaxis()->SetTitle("eff");
0100 effEt2[nf-2]->Divide(het2[nf-1], het2[nf-6],1.,1.,"B");
0101 effEta2[nf-2]= new TH1F("HLT_L1_eta_2","HLT/L1",40,-2.7,2.7.);
0102 effEta2[nf-2]->GetXaxis()->SetTitle("\\eta");
0103 effEta2[nf-2]->GetYaxis()->SetTitle("eff");
0104 effEta2[nf-2]->Divide(heta2[nf-1], heta2[nf-6],1.,1.,"B");
0105 effEt2[nf-2]->SetLineColor(2);
0106 effEta2[nf-2]->SetLineColor(2);
0107 cout<<"DDDDDDDDAAAAAAAAAAA"<<endl;
0108 TCanvas* cEt[nf];
0109 TCanvas* cEta[nf];
0110 TCanvas* ceffEt[nf-1];
0111 TCanvas* ceffEta[nf-1];
0112 
0113 for (int i=0; i<nf; i++){
0114   cEt[i] = new TCanvas();
0115   cEt[i]->Draw();
0116   het1[i]->DrawNormalized();
0117   het2[i]->DrawNormalized("same");
0118   string imName= "images/"+string(het1[i]->GetTitle())+".gif";
0119   cEt[i]->Print(imName.c_str());
0120 
0121   cEta[i] = new TCanvas();
0122   cEta[i]->Draw();
0123   heta1[i]->DrawNormalized();
0124   heta2[i]->DrawNormalized("same");
0125   imName= "images/"+string(heta1[i]->GetTitle())+".gif";
0126   cEta[i]->Print(imName.c_str());
0127 }
0128 
0129 for (int i=0; i<nf-1; i++){
0130   ceffEt[i] = new TCanvas();
0131   ceffEt[i]->Draw();
0132   effEt1[i]->Draw("e");
0133   effEt2[i]->Draw("esame");
0134   string imName= "images/"+string(effEt1[i]->GetTitle())+".gif";
0135   ceffEt[i]->Print(imName.c_str());
0136 
0137   ceffEta[i] = new TCanvas();
0138   ceffEta[i]->Draw();
0139   effEta1[i]->Draw("e");
0140   effEta2[i]->Draw("esame");
0141   imName= "images/"+string(effEta1[i]->GetTitle())+".gif";
0142   ceffEta[i]->Print(imName.c_str());
0143 }
0144 
0145 }