#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include"Truth.h" #include"ZCandidates.h" #include"Trigger.h" #include"Electron.h" #include"RawElectron.h" //______________________________________________________________________________ int main() { TFile hfile("output_electron.root","RECREATE"); TH1F *hElectronTrue_eta = new TH1F("hElectronTrue_eta","ElectronTrue_eta",14,0.,2.5); TH1F *hElectronReco_eta = new TH1F("hElectronReco_eta","ElectronReco_eta",14,0.,2.5); TH1F *hElectronLoose_eta = new TH1F("hElectronLoose_eta","ElectronLoose_eta",14,0.,2.5); TH1F *hElectronMedium_eta = new TH1F("hElectronMedium_eta","ElectronMedium_eta",14,0.,2.5); TH1F *hElectronMediumCALOISO_eta = new TH1F("hElectronMediumCALOISO_eta","ElectronMedium_eta",14,0.,2.5); TH1F *hElectronTight_eta = new TH1F("hElectronTight_eta","ElectronTight_eta",14,0.,2.5); TH1F *hElectronTrue_pt = new TH1F("hElectronTrue_pt","ElectronTrue_pt",11,5.,60.); TH1F *hElectronReco_pt = new TH1F("hElectronReco_pt","ElectronReco_pt",11,5.,60.); TH1F *hElectronLoose_pt = new TH1F("hElectronLoose_pt","ElectronLoose_pt",11,5.,60.); TH1F *hElectronMedium_pt = new TH1F("hElectronMedium_pt","ElectronMedium_pt",11,5.,60.); TH1F *hElectronMediumCALOISO_pt = new TH1F("hElectronMediumCALOISO_pt","ElectronMedium_pt",11,5.,60.); TH1F *hElectronTight_pt = new TH1F("hElectronTight_pt","ElectronTight_pt",11,5.,60.); // instanciate chains TObjArray Chains; TChain * truth = new TChain("TruthTree"); Chains.Add(truth); TChain * rawelec = new TChain("RawElectronTree"); Chains.Add(rawelec); TChain * elec = new TChain("PreselectedElectronTree"); Chains.Add(elec); TChain * elecloose = new TChain("PreselectedLooseElectronTree"); Chains.Add(elecloose); TChain * elecmedium = new TChain("PreselectedMediumElectronTree"); Chains.Add(elecmedium); TChain * elecmediumcaloiso = new TChain("PreselectedMediumCALOISOElectronTree"); Chains.Add(elecmediumcaloiso); TChain * electight = new TChain("PreselectedTightElectronTree"); Chains.Add(electight); for (int i=0; iAdd("TestNtupleOutput_130GeV_Higgs.root"); // chain->Add("TestNtupleOutput_300GeV_Higgs.root"); chain->Add("/hepstore/store2/dervan/TestNtupleOutput_130GeV.root"); } int TruthNum =truth->GetEntries(); int RawElectronNum = rawelec->GetEntries(); int ElectronNum = elec->GetEntries(); int ElectronLooseNum = elecloose->GetEntries(); int ElectronMediumNum = elecmedium->GetEntries(); int ElectronMediumCALOISONum = elecmediumcaloiso->GetEntries(); int ElectronTightNum = electight->GetEntries(); cout << "Number of truth events = " << TruthNum << endl; cout << "Number of Raw Electron events = " << RawElectronNum << endl; cout << "Number of Electron events = " << ElectronNum << endl; cout << "Number of Loose Electron events = " << ElectronLooseNum << endl; cout << "Number of Medium Electron events = " << ElectronMediumNum << endl; cout << "Number of Medium CALOISOElectron events = " << ElectronMediumCALOISONum << endl; cout << "Number of Tight Electron events = " << ElectronTightNum << endl; getchar(); Truth *TruthTree; RawElectron *RawElectronTree; Electron *PreselectedElectronTree; Electron *PreselectedLooseElectronTree; Electron *PreselectedMediumElectronTree; Electron *PreselectedMediumCALOISOElectronTree; Electron *PreselectedTightElectronTree; TruthTree = new Truth(truth); RawElectronTree = new RawElectron(rawelec); PreselectedElectronTree = new Electron(elec); PreselectedLooseElectronTree = new Electron(elecloose); PreselectedMediumElectronTree = new Electron(elecmedium); PreselectedMediumCALOISOElectronTree = new Electron(elecmediumcaloiso); PreselectedTightElectronTree = new Electron(electight); int const NumEntries = TruthNum; int numberofhiggsevents = 0; int numberofZZevents = 0; int Z1ee = 0; int Z1mm = 0; int Z1tt = 0; int Z2ee = 0; int Z2mm = 0; int Z2tt = 0; int Zeeee = 0; int Zmmmm = 0; int Zeemm = 0; int Zeett = 0; int Zmmtt = 0; int Ztttt = 0; int Zeeee_pass_e22i = 0; int Zmmmm_pass_e22i = 0; int Zeemm_pass_e22i = 0; int Zeett_pass_e22i = 0; int Zmmtt_pass_e22i = 0; int Ztttt_pass_e22i = 0; int Zeeee_pass_2e15i = 0; int Zmmmm_pass_2e15i = 0; int Zeemm_pass_2e15i = 0; int Zeett_pass_2e15i = 0; int Zmmtt_pass_2e15i = 0; int Ztttt_pass_2e15i = 0; int Zeeee_pass_mu20 = 0; int Zmmmm_pass_mu20 = 0; int Zeemm_pass_mu20 = 0; int Zeett_pass_mu20 = 0; int Zmmtt_pass_mu20 = 0; int Ztttt_pass_mu20 = 0; int Zeeee_pass_mu20_e22i = 0; int Zmmmm_pass_mu20_e22i = 0; int Zeemm_pass_mu20_e22i = 0; int Zeett_pass_mu20_e22i = 0; int Zmmtt_pass_mu20_e22i = 0; int Ztttt_pass_mu20_e22i = 0; int truthelectrons = 0; int truthetaelectrons = 0; int recoelectrons = 0; int recoetaelectrons = 0; int looseelectrons = 0; int mediumelectrons = 0; int mediumcaloisoelectrons = 0; int tightelectrons = 0; for (int jentry=0; jentryLoadTree(jentry); TruthTree->GetEntry(jentry); RawElectronTree->LoadTree(jentry); RawElectronTree->GetEntry(jentry); PreselectedElectronTree->LoadTree(jentry); PreselectedElectronTree->GetEntry(jentry); PreselectedLooseElectronTree->LoadTree(jentry); PreselectedLooseElectronTree->GetEntry(jentry); PreselectedMediumElectronTree->LoadTree(jentry); PreselectedMediumElectronTree->GetEntry(jentry); PreselectedMediumCALOISOElectronTree->LoadTree(jentry); PreselectedMediumCALOISOElectronTree->GetEntry(jentry); PreselectedTightElectronTree->LoadTree(jentry); PreselectedTightElectronTree->GetEntry(jentry); if(!(jentry%1000)) { cout << "event number "<electron_pt)).size()); // printf("Number of loose electrons = %i\n",(*(PreselectedLooseElectronTree->electron_pt)).size()); // printf("Number of medium electrons = %i\n",(*(PreselectedMediumElectronTree->electron_pt)).size()); // printf("Number of medium CALOISO electrons = %i\n",(*(PreselectedMediumCALOISOElectronTree->electron_pt)).size()); // getchar(); if(TruthTree->truth_H_num != 0) { numberofhiggsevents++; } if(TruthTree->truth_Z_num >= 2) { numberofZZevents++; } int d1electrons = 0; int d1muons = 0; int d1taus = 0; int numetaelectrons = 0; for(int i=0; i< (*(TruthTree->truth_daughter1_pt)).size(); i++) { if(abs((*(TruthTree->truth_daughter1_pdgid))[i]) == 11) { d1electrons++; hElectronTrue_eta->Fill(fabs((*(TruthTree->truth_daughter1_eta))[i])); hElectronTrue_pt->Fill(fabs((*(TruthTree->truth_daughter1_pt))[i])); if(fabs((*(TruthTree->truth_daughter1_eta))[i]) < 2.5) numetaelectrons++; } if(abs((*(TruthTree->truth_daughter1_pdgid))[i]) == 13) d1muons++; if(abs((*(TruthTree->truth_daughter1_pdgid))[i]) == 15) d1taus++; } if(d1electrons == 2) Z1ee++; if(d1muons == 2) Z1mm++; if(d1taus == 2) Z1tt++; int d2electrons = 0; int d2muons = 0; int d2taus = 0; for(int i=0; i< (*(TruthTree->truth_daughter2_pt)).size(); i++) { if(abs((*(TruthTree->truth_daughter2_pdgid))[i]) == 11 ) { d2electrons++; hElectronTrue_eta->Fill(fabs((*(TruthTree->truth_daughter2_eta))[i])); hElectronTrue_pt->Fill(fabs((*(TruthTree->truth_daughter2_pt))[i])); if(fabs((*(TruthTree->truth_daughter2_eta))[i]) < 2.5) numetaelectrons++; } if(abs((*(TruthTree->truth_daughter2_pdgid))[i]) == 13) d2muons++; if(abs((*(TruthTree->truth_daughter2_pdgid))[i]) == 15) d2taus++; } if(d2electrons == 2) Z2ee++; if(d2muons == 2) Z2mm++; if(d2taus == 2) Z2tt++; if((d1electrons == 2) && (d2electrons == 2) ) Zeeee++; if((d1muons == 2) && (d2muons == 2) ) Zmmmm++; if((d1electrons == 2) && (d2muons == 2) ) Zeemm++; if((d2electrons == 2) && (d1muons == 2) ) Zeemm++; if((d1electrons == 2) && (d2taus == 2) ) Zeett++; if((d2electrons == 2) && (d1taus == 2) ) Zeett++; if((d1muons == 2) && (d2taus == 2) ) Zmmtt++; if((d2muons == 2) && (d1taus == 2) ) Zmmtt++; if((d1taus == 2) && (d2taus == 2) ) Ztttt++; // if((d1electrons == 2) && (d2electrons == 2) ) printf("h->eeee\n"); // if((d1muons == 2) && (d2muons == 2) ) printf("h->mmmm\n"); // if((d1electrons == 2) && (d2muons == 2) ) printf("h->eemm\n"); // if((d2electrons == 2) && (d1muons == 2) ) printf("h->mmee\n"); // if((d1electrons == 2) && (d2taus == 2) ) printf("h->eett\n"); // if((d2electrons == 2) && (d1taus == 2) ) printf("h->ttee\n"); // if((d1muons == 2) && (d2taus == 2) ) printf("h->mmtt\n"); // if((d2muons == 2) && (d1taus == 2) ) printf("h->ttmm\n"); // if((d1taus == 2) && (d2taus == 2) ) printf("h->tttt\n"); truthelectrons = truthelectrons + d1electrons+d2electrons; truthetaelectrons = truthetaelectrons + numetaelectrons; for(int i=0; i< (*(PreselectedElectronTree->electron_pt)).size(); i++) { if( fabs((*(PreselectedElectronTree->electron_eta))[i]) > 2.5) { printf("eta out of range\n"); getchar(); } } for(int i=0; i< (*(PreselectedElectronTree->electron_pt)).size(); i++) { float deltaeta = 10000.; float deltaphi = 10000.; float deltaR = 10000.; int numofreco = 0; for(int j=0; j< (*(TruthTree->truth_daughter1_pt)).size(); j++) { deltaR = 10000.; if(abs((*(TruthTree->truth_daughter1_pdgid))[j]) == 11 ) { if(fabs((*(TruthTree->truth_daughter1_eta))[j]) < 2.5 && fabs((*(TruthTree->truth_daughter1_pt))[j]) > 5. ) { deltaeta = (*(TruthTree->truth_daughter1_eta))[j] - (*(PreselectedElectronTree->electron_eta))[i]; deltaphi = (*(TruthTree->truth_daughter1_phi))[j] - (*(PreselectedElectronTree->electron_phi))[i]; deltaR = sqrt(pow(deltaeta,2.) + pow(deltaphi,2.) ); } if(deltaR < 0.02) { hElectronReco_eta->Fill(fabs((*(PreselectedElectronTree->electron_eta))[i])); hElectronReco_pt->Fill(fabs((*(PreselectedElectronTree->electron_pt))[i])); recoelectrons++; numofreco++; } } } for(int j=0; j< (*(TruthTree->truth_daughter2_pt)).size(); j++) { deltaR = 10000.; if(abs((*(TruthTree->truth_daughter2_pdgid))[j]) == 11 ) { if(fabs((*(TruthTree->truth_daughter2_eta))[j]) < 2.5 && fabs((*(TruthTree->truth_daughter2_pt))[j]) > 5. ) { deltaeta = (*(TruthTree->truth_daughter2_eta))[j] - (*(PreselectedElectronTree->electron_eta))[i]; deltaphi = (*(TruthTree->truth_daughter2_phi))[j] - (*(PreselectedElectronTree->electron_phi))[i]; deltaR = sqrt(pow(deltaeta,2.) + pow(deltaphi,2.) ); } if(deltaR < 0.02) { hElectronReco_eta->Fill(fabs((*(PreselectedElectronTree->electron_eta))[i])); hElectronReco_pt->Fill(fabs((*(PreselectedElectronTree->electron_pt))[i])); recoelectrons++; numofreco++; } } } if(numofreco > 1) { printf("%i number of RECO = %i\n",i,numofreco); // getchar(); } } for(int i=0; i< (*(PreselectedLooseElectronTree->electron_pt)).size(); i++) { float deltaeta = 10000.; float deltaphi = 10000.; float deltaR = 10000.; for(int j=0; j< (*(TruthTree->truth_daughter1_pt)).size(); j++) { deltaR = 10000.; if(abs((*(TruthTree->truth_daughter1_pdgid))[j]) == 11 ) { deltaeta = (*(TruthTree->truth_daughter1_eta))[j] - (*(PreselectedLooseElectronTree->electron_eta))[i]; deltaphi = (*(TruthTree->truth_daughter1_phi))[j] - (*(PreselectedLooseElectronTree->electron_phi))[i]; deltaR = sqrt(pow(deltaeta,2.) + pow(deltaphi,2.) ); } if(deltaR < 0.02) { hElectronLoose_eta->Fill(fabs((*(PreselectedLooseElectronTree->electron_eta))[i])); hElectronLoose_pt->Fill(fabs((*(PreselectedLooseElectronTree->electron_pt))[i])); looseelectrons++; } } for(int j=0; j< (*(TruthTree->truth_daughter2_pt)).size(); j++) { deltaR = 10000.; if(abs((*(TruthTree->truth_daughter2_pdgid))[j]) == 11 ) { deltaeta = (*(TruthTree->truth_daughter2_eta))[j] - (*(PreselectedLooseElectronTree->electron_eta))[i]; deltaphi = (*(TruthTree->truth_daughter2_phi))[j] - (*(PreselectedLooseElectronTree->electron_phi))[i]; deltaR = sqrt(pow(deltaeta,2.) + pow(deltaphi,2.) ); } if(deltaR < 0.02) { hElectronLoose_eta->Fill(fabs((*(PreselectedLooseElectronTree->electron_eta))[i])); hElectronLoose_pt->Fill(fabs((*(PreselectedLooseElectronTree->electron_pt))[i])); looseelectrons++; } } } for(int i=0; i< (*(PreselectedMediumElectronTree->electron_pt)).size(); i++) { float deltaeta = 10000.; float deltaphi = 10000.; float deltaR = 10000.; for(int j=0; j< (*(TruthTree->truth_daughter1_pt)).size(); j++) { deltaR = 10000.; if(abs((*(TruthTree->truth_daughter1_pdgid))[j]) == 11 ) { deltaeta = (*(TruthTree->truth_daughter1_eta))[j] - (*(PreselectedMediumElectronTree->electron_eta))[i]; deltaphi = (*(TruthTree->truth_daughter1_phi))[j] - (*(PreselectedMediumElectronTree->electron_phi))[i]; deltaR = sqrt(pow(deltaeta,2.) + pow(deltaphi,2.) ); } if(deltaR < 0.02) { hElectronMedium_eta->Fill(fabs((*(PreselectedMediumElectronTree->electron_eta))[i])); hElectronMedium_pt->Fill(fabs((*(PreselectedMediumElectronTree->electron_pt))[i])); mediumelectrons++; } } for(int j=0; j< (*(TruthTree->truth_daughter2_pt)).size(); j++) { deltaR = 10000.; if(abs((*(TruthTree->truth_daughter2_pdgid))[j]) == 11 ) { deltaeta = (*(TruthTree->truth_daughter2_eta))[j] - (*(PreselectedMediumElectronTree->electron_eta))[i]; deltaphi = (*(TruthTree->truth_daughter2_phi))[j] - (*(PreselectedMediumElectronTree->electron_phi))[i]; deltaR = sqrt(pow(deltaeta,2.) + pow(deltaphi,2.) ); } if(deltaR < 0.02) { hElectronMedium_eta->Fill(fabs((*(PreselectedMediumElectronTree->electron_eta))[i])); hElectronMedium_pt->Fill(fabs((*(PreselectedMediumElectronTree->electron_pt))[i])); mediumelectrons++; } } } for(int i=0; i< (*(PreselectedMediumCALOISOElectronTree->electron_pt)).size(); i++) { float deltaeta = 10000.; float deltaphi = 10000.; float deltaR = 10000.; for(int j=0; j< (*(TruthTree->truth_daughter1_pt)).size(); j++) { deltaR = 10000.; if(abs((*(TruthTree->truth_daughter1_pdgid))[j]) == 11 ) { deltaeta = (*(TruthTree->truth_daughter1_eta))[j] - (*(PreselectedMediumCALOISOElectronTree->electron_eta))[i]; deltaphi = (*(TruthTree->truth_daughter1_phi))[j] - (*(PreselectedMediumCALOISOElectronTree->electron_phi))[i]; deltaR = sqrt(pow(deltaeta,2.) + pow(deltaphi,2.) ); } if(deltaR < 0.02) { hElectronMediumCALOISO_eta->Fill(fabs((*(PreselectedMediumCALOISOElectronTree->electron_eta))[i])); hElectronMediumCALOISO_pt->Fill(fabs((*(PreselectedMediumCALOISOElectronTree->electron_pt))[i])); mediumcaloisoelectrons++; } } for(int j=0; j< (*(TruthTree->truth_daughter2_pt)).size(); j++) { deltaR = 10000.; if(abs((*(TruthTree->truth_daughter2_pdgid))[j]) == 11 ) { deltaeta = (*(TruthTree->truth_daughter2_eta))[j] - (*(PreselectedMediumCALOISOElectronTree->electron_eta))[i]; deltaphi = (*(TruthTree->truth_daughter2_phi))[j] - (*(PreselectedMediumCALOISOElectronTree->electron_phi))[i]; deltaR = sqrt(pow(deltaeta,2.) + pow(deltaphi,2.) ); } if(deltaR < 0.02) { hElectronMediumCALOISO_eta->Fill(fabs((*(PreselectedMediumCALOISOElectronTree->electron_eta))[i])); hElectronMediumCALOISO_pt->Fill(fabs((*(PreselectedMediumCALOISOElectronTree->electron_pt))[i])); mediumcaloisoelectrons++; } } } for(int i=0; i< (*(PreselectedTightElectronTree->electron_pt)).size(); i++) { float deltaeta = 10000.; float deltaphi = 10000.; float deltaR = 10000.; for(int j=0; j< (*(TruthTree->truth_daughter1_pt)).size(); j++) { deltaR = 10000.; if(abs((*(TruthTree->truth_daughter1_pdgid))[j]) == 11 ) { deltaeta = (*(TruthTree->truth_daughter1_eta))[j] - (*(PreselectedTightElectronTree->electron_eta))[i]; deltaphi = (*(TruthTree->truth_daughter1_phi))[j] - (*(PreselectedTightElectronTree->electron_phi))[i]; deltaR = sqrt(pow(deltaeta,2.) + pow(deltaphi,2.) ); } if(deltaR < 0.02) { hElectronTight_eta->Fill(fabs((*(PreselectedTightElectronTree->electron_eta))[i])); hElectronTight_pt->Fill(fabs((*(PreselectedTightElectronTree->electron_pt))[i])); tightelectrons++; } } for(int j=0; j< (*(TruthTree->truth_daughter2_pt)).size(); j++) { deltaR = 10000.; if(abs((*(TruthTree->truth_daughter2_pdgid))[j]) == 11 ) { deltaeta = (*(TruthTree->truth_daughter2_eta))[j] - (*(PreselectedTightElectronTree->electron_eta))[i]; deltaphi = (*(TruthTree->truth_daughter2_phi))[j] - (*(PreselectedTightElectronTree->electron_phi))[i]; deltaR = sqrt(pow(deltaeta,2.) + pow(deltaphi,2.) ); } if(deltaR < 0.02) { hElectronTight_eta->Fill(fabs((*(PreselectedTightElectronTree->electron_eta))[i])); hElectronTight_pt->Fill(fabs((*(PreselectedTightElectronTree->electron_pt))[i])); tightelectrons++; } } } int pass_mu20 = 0; int pass_e22i = 0; int pass_2e15i = 0; // // if( ((*(TrigResultsTree->Passed_mu20))[0] == 1) && ((*(TrigResultsTree->Passed_mu20))[1] == 1) && ((*(TrigResultsTree->Passed_mu20))[2] == 1) ) pass_mu20 = 1; // if( ((*(TrigResultsTree->Passed_mu20))[1] == 1) && ((*(TrigResultsTree->Passed_mu20))[2] == 1) ) pass_mu20 = 1; // if( ((*(TrigResultsTree->Passed_e22i_L33))[0] == 1) && ((*(TrigResultsTree->Passed_e22i_L33))[1] == 1) && ((*(TrigResultsTree->Passed_e22i_L33))[2] == 1) ) pass_e22i = 1; /// if( ((*(TrigResultsTree->Passed_2e15i))[0] == 1) && ((*(TrigResultsTree->Passed_2e15i))[1] == 1) && ((*(TrigResultsTree->Passed_2e15i))[2] == 1) ) pass_2e15i = 1; // if((d1electrons == 2) && (d2electrons == 2) && (pass_e22i == 1) ) Zeeee_pass_e22i++; // if((d1muons == 2) && (d2muons == 2) && (pass_e22i == 1) ) Zmmmm_pass_e22i++; // if((d1electrons == 2) && (d2muons == 2) && (pass_e22i == 1) ) Zeemm_pass_e22i++; // if((d2electrons == 2) && (d1muons == 2) && (pass_e22i == 1) ) Zeemm_pass_e22i++; // if((d1electrons == 2) && (d2taus == 2) && (pass_e22i == 1) ) Zeett_pass_e22i++; // if((d2electrons == 2) && (d1taus == 2) && (pass_e22i == 1) ) Zeett_pass_e22i++; // if((d1muons == 2) && (d2taus == 2) && (pass_e22i == 1) ) Zmmtt_pass_e22i++; // if((d2muons == 2) && (d1taus == 2) && (pass_e22i == 1) ) Zmmtt_pass_e22i++; // if((d1taus == 2) && (d2taus == 2) && (pass_e22i == 1) ) Ztttt_pass_e22i++; // if((d1electrons == 2) && (d2electrons == 2) && (pass_2e15i == 1) ) Zeeee_pass_2e15i++; // if((d1muons == 2) && (d2muons == 2) && (pass_2e15i == 1) ) Zmmmm_pass_2e15i++; // if((d1electrons == 2) && (d2muons == 2) && (pass_2e15i == 1) ) Zeemm_pass_2e15i++; // if((d2electrons == 2) && (d1muons == 2) && (pass_2e15i == 1) ) Zeemm_pass_2e15i++; // if((d1electrons == 2) && (d2taus == 2) && (pass_2e15i == 1) ) Zeett_pass_2e15i++; // if((d2electrons == 2) && (d1taus == 2) && (pass_2e15i == 1) ) Zeett_pass_2e15i++; // if((d1muons == 2) && (d2taus == 2) && (pass_2e15i == 1) ) Zmmtt_pass_2e15i++; // if((d2muons == 2) && (d1taus == 2) && (pass_2e15i == 1) ) Zmmtt_pass_2e15i++; // if((d1taus == 2) && (d2taus == 2) && (pass_2e15i == 1) ) Ztttt_pass_2e15i++; // if((d1electrons == 2) && (d2electrons == 2) && (pass_mu20 == 1) ) Zeeee_pass_mu20++; // if((d1muons == 2) && (d2muons == 2) && (pass_mu20 == 1) ) Zmmmm_pass_mu20++; // if((d1electrons == 2) && (d2muons == 2) && (pass_mu20 == 1) ) Zeemm_pass_mu20++; // if((d2electrons == 2) && (d1muons == 2) && (pass_mu20 == 1) ) Zeemm_pass_mu20++; // if((d1electrons == 2) && (d2taus == 2) && (pass_mu20 == 1) ) Zeett_pass_mu20++; // if((d2electrons == 2) && (d1taus == 2) && (pass_mu20 == 1) ) Zeett_pass_mu20++; // if((d1muons == 2) && (d2taus == 2) && (pass_mu20 == 1) ) Zmmtt_pass_mu20++; // if((d2muons == 2) && (d1taus == 2) && (pass_mu20 == 1) ) Zmmtt_pass_mu20++; // if((d1taus == 2) && (d2taus == 2) && (pass_mu20 == 1) ) Ztttt_pass_mu20++; // if(((d1electrons == 2) && (d2electrons == 2)) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeeee_pass_mu20_e22i++; // if(((d1muons == 2) && (d2muons == 2)) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zmmmm_pass_mu20_e22i++; // if(((d1electrons == 2) && (d2muons == 2)) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeemm_pass_mu20_e22i++; // if(((d2electrons == 2) && (d1muons == 2)) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeemm_pass_mu20_e22i++; // if(((d1electrons == 2) && (d2taus == 2)) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeett_pass_mu20_e22i++; // if(((d2electrons == 2) && (d1taus == 2)) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeett_pass_mu20_e22i++; // if(((d1muons == 2) && (d2taus == 2)) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zmmtt_pass_mu20_e22i++; // if(((d2muons == 2) && (d1taus == 2)) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zmmtt_pass_mu20_e22i++; // if(((d1taus == 2) && (d2taus == 2)) && ((pass_mu20 == 1) || (pass_e22i == 1))) Ztttt_pass_mu20_e22i++; // for(int i=0; i< (*(TruthTree->truth_daughter1_pt)).size(); i++) // { // if( (abs((*(TruthTree->truth_daughter1_pdgid))[i]) == 13) ) hMuonTrigger_pt->Fill((*(TruthTree->truth_daughter1_pt))[i]); // if( (abs((*(TruthTree->truth_daughter1_pdgid))[i]) == 11) ) hElectronTrigger_pt->Fill((*(TruthTree->truth_daughter1_pt))[i]); // // if( (abs((*(TruthTree->truth_daughter1_pdgid))[i]) == 13) && ((*(TrigResultsTree->Passed_mu20))[0] == 1) ) hMuonTrigger_L1_pt->Fill((*(TruthTree->truth_daughter1_pt))[i]); // if( (abs((*(TruthTree->truth_daughter1_pdgid))[i]) == 13) && ((*(TrigResultsTree->Passed_mu20))[1] == 1) ) hMuonTrigger_L2_pt->Fill((*(TruthTree->truth_daughter1_pt))[i]); // if( (abs((*(TruthTree->truth_daughter1_pdgid))[i]) == 13) && ((*(TrigResultsTree->Passed_mu20))[2] == 1) ) hMuonTrigger_EF_pt->Fill((*(TruthTree->truth_daughter1_pt))[i]); // if( (abs((*(TruthTree->truth_daughter1_pdgid))[i]) == 11) && ((*(TrigResultsTree->Passed_e22i_L33))[0] == 1) ) hElectronTrigger_L1_pt->Fill((*(TruthTree->truth_daughter1_pt))[i]); // if( (abs((*(TruthTree->truth_daughter1_pdgid))[i]) == 11) && ((*(TrigResultsTree->Passed_e22i_L33))[1] == 1) ) hElectronTrigger_L2_pt->Fill((*(TruthTree->truth_daughter1_pt))[i]); // if( (abs((*(TruthTree->truth_daughter1_pdgid))[i]) == 11) && ((*(TrigResultsTree->Passed_e22i_L33))[2] == 1) ) hElectronTrigger_EF_pt->Fill((*(TruthTree->truth_daughter1_pt))[i]); // } // for(int i=0; i< (*(TruthTree->truth_daughter2_pt)).size(); i++) // { // if( (abs((*(TruthTree->truth_daughter2_pdgid))[i]) == 13) ) hMuonTrigger_pt->Fill((*(TruthTree->truth_daughter2_pt))[i]); // if( (abs((*(TruthTree->truth_daughter2_pdgid))[i]) == 11) ) hElectronTrigger_pt->Fill((*(TruthTree->truth_daughter2_pt))[i]); // if( (abs((*(TruthTree->truth_daughter2_pdgid))[i]) == 13) && ((*(TrigResultsTree->Passed_mu20))[0] == 1) ) hMuonTrigger_L1_pt->Fill((*(TruthTree->truth_daughter2_pt))[i]); // if( (abs((*(TruthTree->truth_daughter2_pdgid))[i]) == 13) && ((*(TrigResultsTree->Passed_mu20))[1] == 1) ) hMuonTrigger_L2_pt->Fill((*(TruthTree->truth_daughter2_pt))[i]); // if( (abs((*(TruthTree->truth_daughter2_pdgid))[i]) == 13) && ((*(TrigResultsTree->Passed_mu20))[2] == 1) ) hMuonTrigger_EF_pt->Fill((*(TruthTree->truth_daughter2_pt))[i]); // if( (abs((*(TruthTree->truth_daughter2_pdgid))[i]) == 11) && ((*(TrigResultsTree->Passed_e22i_L33))[0] == 1) ) hElectronTrigger_L1_pt->Fill((*(TruthTree->truth_daughter2_pt))[i]); // if( (abs((*(TruthTree->truth_daughter2_pdgid))[i]) == 11) && ((*(TrigResultsTree->Passed_e22i_L33))[1] == 1) ) hElectronTrigger_L2_pt->Fill((*(TruthTree->truth_daughter2_pt))[i]); // if( (abs((*(TruthTree->truth_daughter2_pdgid))[i]) == 11) && ((*(TrigResultsTree->Passed_e22i_L33))[2] == 1) ) hElectronTrigger_EF_pt->Fill((*(TruthTree->truth_daughter2_pt))[i]); // } // if((pass_mu20 == 1) || (pass_e22i == 1)) // { // cout << "PASSED TRIGGER" << endl; // for(int i=0; i< (*(TruthTree->truth_daughter1_pt)).size(); i++) // { // if( (abs((*(TruthTree->truth_daughter1_pdgid))[i]) == 11) ) // { // hElectronTrue_eta->Fill(fabs((*(TruthTree->truth_daughter1_eta))[i])); // hElectronTrue_pt->Fill(fabs((*(TruthTree->truth_daughter1_pt))[i])); // cout << "truth particle pt = " << fabs((*(TruthTree->truth_daughter1_pt))[i]) << " eta = " << fabs((*(TruthTree->truth_daughter1_eta))[i]) << endl; // } // } // for(int i=0; i< (*(TruthTree->truth_daughter2_pt)).size(); i++) /// { // if( (abs((*(TruthTree->truth_daughter2_pdgid))[i]) == 11) ) /// { // hElectronTrue_eta->Fill(fabs((*(TruthTree->truth_daughter2_eta))[i])); // hElectronTrue_pt->Fill(fabs((*(TruthTree->truth_daughter2_pt))[i])); // cout << "truth particle pt = " << fabs((*(TruthTree->truth_daughter2_pt))[i]) << " eta = " << fabs((*(TruthTree->truth_daughter2_eta))[i]) << endl;; // } // } // if((d1electrons == 2) && (d2electrons == 2) ) // { // cout << "eeee event" << endl; // } // if((d1muons == 2) && (d2muons == 2) ) // { // cout << "mmmm event" << endl; // } // if((d1electrons == 2) && (d2muons == 2) ) // { // cout << "eemm event" << endl; // } // if((d2electrons == 2) && (d1muons == 2) ) // { // cout << "eemm event" << endl; // } // cout << "Num of preselected electrons = " << (*(PreselectedElectronTree->electron_isloose)).size() << endl; // for(int i=0; i< (*(PreselectedElectronTree->electron_pt)).size(); i++) // { // cout << i << " Loose/Medium/Tight Electron = " << (*(PreselectedElectronTree->electron_isloose))[i] << " "<< (*(PreselectedElectronTree->electron_ismedium))[i] << " " << (*(PreselectedElectronTree->electron_istight))[i] << " pt " << fabs((*(PreselectedElectronTree->electron_pt))[i]) << " eta " << fabs((*(PreselectedElectronTree->electron_eta))[i]) <electron_isloose))[i] == 1) // { // hElectronLoose_eta->Fill(fabs((*(PreselectedElectronTree->electron_eta))[i])); // hElectronLoose_pt->Fill(fabs((*(PreselectedElectronTree->electron_pt))[i])); // } // if((*(PreselectedElectronTree->electron_ismedium))[i] == 1) // { // hElectronMedium_eta->Fill(fabs((*(PreselectedElectronTree->electron_eta))[i])); // hElectronMedium_pt->Fill(fabs((*(PreselectedElectronTree->electron_pt))[i])); // } // if((*(PreselectedElectronTree->electron_istight))[i] == 1) // { // hElectronTight_eta->Fill(fabs((*(PreselectedElectronTree->electron_eta))[i])); // hElectronTight_pt->Fill(fabs((*(PreselectedElectronTree->electron_pt))[i])); // } // } // cout << "Num of raw electrons = " << (*(RawElectronTree->electron_isloose)).size() << endl; // for(int i=0; i< (*(RawElectronTree->electron_pt)).size(); i++) // { // cout << i << " Loose/Medium/Tight Electron = " << (*(RawElectronTree->electron_isloose))[i] << " "<< (*(RawElectronTree->electron_ismedium))[i] << " " << (*(RawElectronTree->electron_istight))[i] << " pt " << fabs((*(RawElectronTree->electron_pt))[i]) << " eta " << fabs((*(RawElectronTree->electron_eta))[i]) <electron_isloose))[i] == 1) // { // hElectronLoose_eta->Fill(fabs((*(RawElectronTree->electron_eta))[i])); // } // } // getchar(); // } } cout << "Number of Higgs events = " << numberofhiggsevents << endl; cout << "Number of ZZ events = " << numberofZZevents << endl; cout << " " << endl; cout << "Number of Z1 ee events = " << Z1ee << endl; cout << "Number of Z1 mm events = " << Z1mm << endl; cout << "Number of Z1 tt events = " << Z1tt << endl; cout << "Number of Z1 events = " << Z1ee+Z1mm+Z1tt << endl; cout << " " << endl; cout << "Number of Z2 ee events = " << Z2ee << endl; cout << "Number of Z2 mm events = " << Z2mm << endl; cout << "Number of Z2 tt events = " << Z2tt << endl; cout << "Number of Z2 events = " << Z2ee+Z2mm+Z2tt << endl; cout << " " << endl; cout << "Number of Zeeee events = " << Zeeee << "\t (" << float(Zeeee)/NumEntries*100 << "%)" << endl; cout << "Number of Zmmmm events = " << Zmmmm << "\t (" << float(Zmmmm)/NumEntries*100 << "%)" << endl; cout << "Number of Zeemm events = " << Zeemm << "\t (" << float(Zeemm)/NumEntries*100 << "%)" << endl; cout << "Number of Zeett events = " << Zeett << "\t (" << float(Zeett)/NumEntries*100 << "%)" << endl; cout << "Number of Zmmtt events = " << Zmmtt << "\t (" << float(Zmmtt)/NumEntries*100 << "%)" << endl; cout << "Number of Ztttt events = " << Ztttt << "\t (" << float(Ztttt)/NumEntries*100 << "%)" << endl; cout << "Number of Zllll events = " << Zeeee+Zmmmm+Zeemm+Zeett+Zmmtt+Ztttt << endl; cout << " " << endl; cout << " " << endl; cout << " " << endl; cout << "Number of truth electrons = " << truthelectrons << endl; cout << "Number of truth electrons (eta < 2.5) = " << truthetaelectrons << "\t (" << (float(truthetaelectrons)/float(truthelectrons))*100. << "%)" << endl; cout << "Number of reco electrons = " << recoelectrons << "\t (" << (float(recoelectrons)/float(truthelectrons))*100. << "%)" << endl; cout << "Number of loose electrons = " << looseelectrons << "\t (" << (float(looseelectrons)/float(truthelectrons))*100. << "%)" << endl; cout << "Number of medium electrons = " << mediumelectrons << "\t (" << (float(mediumelectrons)/float(truthelectrons))*100. << "%)" << endl; cout << "Number of medium caloiso electrons = " << mediumcaloisoelectrons << "\t (" << (float(mediumcaloisoelectrons)/float(truthelectrons))*100. << "%)" << endl; cout << "Number of tight electrons = " << tightelectrons << "\t ( " << (float(tightelectrons)/float(truthelectrons))*100. << "%)" << endl; // cout << "e22i" << endl; // cout << "Number of Zeeee events = " << Zeeee_pass_e22i << "\t (" << float(Zeeee_pass_e22i)/Zeeee*100 << "%)" << endl; // cout << "Number of Zmmmm events = " << Zmmmm_pass_e22i << "\t (" << float(Zmmmm_pass_e22i)/Zmmmm*100 << "%)" << endl; // cout << "Number of Zeemm events = " << Zeemm_pass_e22i << "\t (" << float(Zeemm_pass_e22i)/Zeemm*100 << "%)" << endl; // cout << "Number of Zeett events = " << Zeett_pass_e22i << "\t (" << float(Zeett_pass_e22i)/Zeett*100 << "%)" << endl; // cout << "Number of Zmmtt events = " << Zmmtt_pass_e22i << "\t (" << float(Zmmtt_pass_e22i)/Zmmtt*100 << "%)" << endl; // cout << "Number of Ztttt events = " << Ztttt_pass_e22i << "\t (" << float(Ztttt_pass_e22i)/Ztttt*100 << "%)" << endl; // cout << " " << endl; // cout << " " << endl; // cout << " " << endl; // cout << "2e15i" << endl; // cout << "Number of Zeeee events = " << Zeeee_pass_2e15i << "\t (" << float(Zeeee_pass_2e15i)/Zeeee*100 << "%)" << endl; // cout << "Number of Zmmmm events = " << Zmmmm_pass_2e15i << "\t (" << float(Zmmmm_pass_2e15i)/Zmmmm*100 << "%)" << endl; // cout << "Number of Zeemm events = " << Zeemm_pass_2e15i << "\t (" << float(Zeemm_pass_2e15i)/Zeemm*100 << "%)" << endl; // cout << "Number of Zeett events = " << Zeett_pass_2e15i << "\t (" << float(Zeett_pass_2e15i)/Zeett*100 << "%)" << endl; // cout << "Number of Zmmtt events = " << Zmmtt_pass_2e15i << "\t (" << float(Zmmtt_pass_2e15i)/Zmmtt*100 << "%)" << endl; // cout << "Number of Ztttt events = " << Ztttt_pass_2e15i << "\t (" << float(Ztttt_pass_2e15i)/Ztttt*100 << "%)" << endl; // cout << " " << endl; // cout << " " << endl; // cout << " " << endl; // cout << "mu20" << endl; // cout << "Number of Zeeee events = " << Zeeee_pass_mu20 << "\t (" << float(Zeeee_pass_mu20)/Zeeee*100 << "%)" << endl; // cout << "Number of Zmmmm events = " << Zmmmm_pass_mu20 << "\t (" << float(Zmmmm_pass_mu20)/Zmmmm*100 << "%)" << endl; // cout << "Number of Zeemm events = " << Zeemm_pass_mu20 << "\t (" << float(Zeemm_pass_mu20)/Zeemm*100 << "%)" << endl; // cout << "Number of Zeett events = " << Zeett_pass_mu20 << "\t (" << float(Zeett_pass_mu20)/Zeett*100 << "%)" << endl; // cout << "Number of Zmmtt events = " << Zmmtt_pass_mu20 << "\t (" << float(Zmmtt_pass_mu20)/Zmmtt*100 << "%)" << endl; // cout << "Number of Ztttt events = " << Ztttt_pass_mu20 << "\t (" << float(Ztttt_pass_mu20)/Ztttt*100 << "%)" << endl; // cout << " " << endl; // cout << " " << endl; // cout << " " << endl; // cout << "mu20 or e22i" << endl; // cout << "Number of Zeeee events = " << Zeeee_pass_mu20_e22i << "\t (" << (float(Zeeee_pass_mu20_e22i)/(Zeeee))*100 << "%)" << endl; // cout << "Number of Zmmmm events = " << Zmmmm_pass_mu20_e22i << "\t (" << (float(Zmmmm_pass_mu20_e22i)/(Zmmmm))*100 << "%)" << endl; // cout << "Number of Zeemm events = " << Zeemm_pass_mu20_e22i << "\t (" << (float(Zeemm_pass_mu20_e22i)/(Zeemm))*100 << "%)" << endl; // cout << "Number of Zeett events = " << Zeett_pass_mu20_e22i << "\t (" << (float(Zeett_pass_mu20_e22i)/Zeett)*100 << "%)" << endl; // cout << "Number of Zmmtt events = " << Zmmtt_pass_mu20_e22i << "\t (" << (float(Zmmtt_pass_mu20_e22i)/Zmmtt)*100 << "%)" << endl; // cout << "Number of Ztttt events = " << Ztttt_pass_mu20_e22i << "\t (" << (float(Ztttt_pass_mu20_e22i)/Ztttt)*100 << "%)" << endl; // cout << " " << endl; // cout << " " << endl; // cout << " " << endl; // printf("Trigger Menu |\t 4e |\t 4mu |\t2e2mu |\n"); // printf("-----------------------------------------------------\n"); // printf("1mu20 |\t%4.1f |\t%4.1f |\t%4.1f |\n",float(Zeeee_pass_mu20)/Zeeee*100,float(Zmmmm_pass_mu20)/Zmmmm*100,float(Zeemm_pass_mu20)/Zeemm*100); // printf("1e22i |\t%4.1f |\t%4.1f |\t%4.1f |\n",float(Zeeee_pass_e22i)/Zeeee*100,float(Zmmmm_pass_e22i)/Zmmmm*100,float(Zeemm_pass_e22i)/Zeemm*100); // printf("2e15i |\t%4.1f |\t%4.1f |\t%4.1f |\n",float(Zeeee_pass_2e15i)/Zeeee*100,float(Zmmmm_pass_2e15i)/Zmmmm*100,float(Zeemm_pass_2e15i)/Zeemm*100); // printf("mu20 or e22i |\t%4.1f |\t%4.1f |\t%4.1f |\n",float(Zeeee_pass_mu20_e22i)/Zeeee*100,float(Zmmmm_pass_mu20_e22i)/Zmmmm*100,float(Zeemm_pass_mu20_e22i)/Zeemm*100); // hElectronTrigger_L1_pt->Divide(hElectronTrigger_pt); // hMuonTrigger_L1_pt->Divide(hMuonTrigger_pt); // for(int i=0; i<96; i++) // { // cout << hElectronTrigger_L1_pt->GetBinContent(i) << endl; // cout << hElectronTrigger_L2_pt->GetBinContent(i) << endl; // cout << hElectronTrigger_EF_pt->GetBinContent(i) << endl; // cout << hElectronTrigger_pt->GetBinContent(i) << endl; // } // TH1F *hElectronTrigger_L1_eff = (TH1F*)hElectronTrigger_L1_pt->Clone("hElectronTrigger_L1_eff"); // hElectronTrigger_L1_eff->Divide(hElectronTrigger_pt); // TH1F *hElectronTrigger_L2_eff = (TH1F*)hElectronTrigger_L2_pt->Clone("hElectronTrigger_L2_eff"); // hElectronTrigger_L2_eff->Divide(hElectronTrigger_pt); // TH1F *hElectronTrigger_EF_eff = (TH1F*)hElectronTrigger_EF_pt->Clone("hElectronTrigger_EF_eff"); // hElectronTrigger_EF_eff->Divide(hElectronTrigger_pt); // TH1F *hElectronLoose_eta_eff = (TH1F*)hElectronLoose_eta->Clone("hElectronLoose_eta_eff"); // hElectronLoose_eta_eff->Divide(hElectronTrue_eta); // TH1F *hElectronMedium_eta_eff = (TH1F*)hElectronMedium_eta->Clone("hElectronMedium_eta_eff"); // hElectronMedium_eta_eff->Divide(hElectronTrue_eta); // TH1F *hElectronTight_eta_eff = (TH1F*)hElectronTight_eta->Clone("hElectronTight_eta_eff"); // hElectronTight_eta_eff->Divide(hElectronTrue_eta); // TH1F *hElectronLoose_pt_eff = (TH1F*)hElectronLoose_pt->Clone("hElectronLoose_pt_eff"); // hElectronLoose_pt_eff->Divide(hElectronTrue_pt); // TH1F *hElectronMedium_pt_eff = (TH1F*)hElectronMedium_pt->Clone("hElectronMedium_pt_eff"); // hElectronMedium_pt_eff->Divide(hElectronTrue_pt); // TH1F *hElectronTight_pt_eff = (TH1F*)hElectronTight_pt->Clone("hElectronTight_pt_eff"); // hElectronTight_pt_eff->Divide(hElectronTrue_pt); TH1F *hElectronLoose_pt_test = new TH1F("hElectronLoose_pt_test","ElectronLoose_pt_test",11,5.,60.); TH1F *hElectronMedium_pt_test = new TH1F("hElectronMedium_pt_test","ElectronMedium_pt_test",11,5.,60.); TH1F *hElectronMediumCALOISO_pt_test = new TH1F("hElectronMediumCALOISO_pt_test","ElectronMedium_pt_test",11,5.,60.); TH1F *hElectronTight_pt_test = new TH1F("hElectronTight_pt_test","ElectronTight_pt_test",11,5.,60.); TH1F *hElectronLoose_eta_test = new TH1F("hElectronLoose_eta_test","ElectronLoose_eta_test",14,0.,2.5); TH1F *hElectronMedium_eta_test = new TH1F("hElectronMedium_eta_test","ElectronMedium_eta_test",14,0.,2.5); TH1F *hElectronMediumCALOISO_eta_test = new TH1F("hElectronMediumCALOISO_eta_test","ElectronMedium_eta_test",14,0.,2.5); TH1F *hElectronTight_eta_test = new TH1F("hElectronTight_eta_test","ElectronTight_eta_test",14,0.,2.5); for(int i=0; i<12; i++) { hElectronLoose_pt_test->SetBinContent(i,hElectronLoose_pt->GetBinContent(i)/hElectronTrue_pt->GetBinContent(i)); // hElectronLoose_pt_test->SetBinError(i,((hElectronLoose_pt->GetBinContent(i)/hElectronTrue_pt->GetBinContent(i))*((sqrt(hElectronLoose_pt->GetBinContent(i))/hElectronLoose_pt->GetBinContent(i))+(sqrt(hElectronTrue_pt->GetBinContent(i))/hElectronTrue_pt->GetBinContent(i))))); hElectronMedium_pt_test->SetBinContent(i,hElectronMedium_pt->GetBinContent(i)/hElectronTrue_pt->GetBinContent(i)); // hElectronMedium_pt_test->SetBinError(i,((hElectronMedium_pt->GetBinContent(i)/hElectronTrue_pt->GetBinContent(i))*((sqrt(hElectronMedium_pt->GetBinContent(i))/hElectronMedium_pt->GetBinContent(i))+(sqrt(hElectronTrue_pt->GetBinContent(i))/hElectronTrue_pt->GetBinContent(i))))); hElectronMediumCALOISO_pt_test->SetBinContent(i,hElectronMediumCALOISO_pt->GetBinContent(i)/hElectronTrue_pt->GetBinContent(i)); // hElectronMediumCALOISO_pt_test->SetBinError(i,((hElectronMediumCALOISO_pt->GetBinContent(i)/hElectronTrue_pt->GetBinContent(i))*((sqrt(hElectronMediumCALOISO_pt->GetBinContent(i))/hElectronMediumCALOISO_pt->GetBinContent(i))+(sqrt(hElectronTrue_pt->GetBinContent(i))/hElectronTrue_pt->GetBinContent(i))))); hElectronTight_pt_test->SetBinContent(i,hElectronTight_pt->GetBinContent(i)/hElectronTrue_pt->GetBinContent(i)); // hElectronTight_pt_test->SetBinError(i,((hElectronTight_pt->GetBinContent(i)/hElectronTrue_pt->GetBinContent(i))*((sqrt(hElectronTight_pt->GetBinContent(i))/hElectronTight_pt->GetBinContent(i))+(sqrt(hElectronTrue_pt->GetBinContent(i))/hElectronTrue_pt->GetBinContent(i))))); } for(int i=0; i<15; i++) { hElectronLoose_eta_test->SetBinContent(i,hElectronLoose_eta->GetBinContent(i)/hElectronTrue_eta->GetBinContent(i)); // hElectronLoose_eta_test->SetBinError(i,((hElectronLoose_eta->GetBinContent(i)/hElectronTrue_eta->GetBinContent(i))*((sqrt(hElectronLoose_eta->GetBinContent(i))/hElectronLoose_eta->GetBinContent(i))+(sqrt(hElectronTrue_eta->GetBinContent(i))/hElectronTrue_eta->GetBinContent(i))))); hElectronMedium_eta_test->SetBinContent(i,hElectronMedium_eta->GetBinContent(i)/hElectronTrue_eta->GetBinContent(i)); // hElectronMedium_eta_test->SetBinError(i,((hElectronMedium_eta->GetBinContent(i)/hElectronTrue_eta->GetBinContent(i))*((sqrt(hElectronMedium_eta->GetBinContent(i))/hElectronMedium_eta->GetBinContent(i))+(sqrt(hElectronTrue_eta->GetBinContent(i))/hElectronTrue_eta->GetBinContent(i))))); hElectronMediumCALOISO_eta_test->SetBinContent(i,hElectronMediumCALOISO_eta->GetBinContent(i)/hElectronTrue_eta->GetBinContent(i)); // hElectronMediumCALOISO_eta_test->SetBinError(i,((hElectronMediumCALOISO_eta->GetBinContent(i)/hElectronTrue_eta->GetBinContent(i))*((sqrt(hElectronMediumCALOISO_eta->GetBinContent(i))/hElectronMediumCALOISO_eta->GetBinContent(i))+(sqrt(hElectronTrue_eta->GetBinContent(i))/hElectronTrue_eta->GetBinContent(i))))); hElectronTight_eta_test->SetBinContent(i,hElectronTight_eta->GetBinContent(i)/hElectronTrue_eta->GetBinContent(i)); // hElectronTight_eta_test->SetBinError(i,((hElectronTight_eta->GetBinContent(i)/hElectronTrue_eta->GetBinContent(i))*((sqrt(hElectronTight_eta->GetBinContent(i))/hElectronTight_eta->GetBinContent(i))+(sqrt(hElectronTrue_eta->GetBinContent(i))/hElectronTrue_eta->GetBinContent(i))))); } // // printf("%i %f %f %f %f \n",i,hElectronLoose_pt->GetBinContent(i),hElectronTrue_pt->GetBinContent(i),hElectronLoose_pt->GetBinContent(i)/hElectronTrue_pt->GetBinContent(i),((hElectronLoose_pt->GetBinContent(i)/hElectronTrue_pt->GetBinContent(i))*((sqrt(hElectronLoose_pt->GetBinContent(i))/hElectronLoose_pt->GetBinContent(i))+(sqrt(hElectronTrue_pt->GetBinContent(i))/hElectronTrue_pt->GetBinContent(i))))); hfile.Write(); }