#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"Muon.h" #include"RawElectron.h" //______________________________________________________________________________ int main() { TFile hfile("output.root","RECREATE"); FILE *Zmassout; Zmassout = fopen("Zmass.dat","w"); TH1F *hElectronTrigger_pt = new TH1F("hElectronTrigger_pt","ElectronTrigger_pt",96,0.,60.); // TH1F *hElectronTrigger_eff = new TH1F("hElectronTrigger_eff","ElectronTrigger_eff",96,0.,60.); TH1F *hElectronTrigger_L1_pt = new TH1F("hElectronTrigger_L1_pt","ElectronTrigger_L1",96,0.,60.); TH1F *hElectronTrigger_L2_pt = new TH1F("hElectronTrigger_L2_pt","ElectronTrigger_L2",96,0.,60.); TH1F *hElectronTrigger_EF_pt = new TH1F("hElectronTrigger_EF_pt","ElectronTrigger_EF",96,0.,60.); TH1F *hMuonTrigger_pt = new TH1F("hMuonTrigger_pt","MuonTrigger_pt",96,0.,60.); // TH1F *hMuonTrigger_eff = new TH1F("hMuonTrigger_eff","MuonTrigger_eff",96,0.,60.); TH1F *hMuonTrigger_L1_pt = new TH1F("hMuonTrigger_L1_pt","MuonTrigger_L1",96,0.,60.); TH1F *hMuonTrigger_L2_pt = new TH1F("hMuonTrigger_L2_pt","MuonTrigger_L2",96,0.,60.); TH1F *hMuonTrigger_EF_pt = new TH1F("hMuonTrigger_EF_pt","MuonTrigger_EF",96,0.,60.); 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 *hElectronTight_eta = new TH1F("hElectronTight_eta","ElectronTight_eta",14,0.,2.5); TH1F *hElectronTrue_eta = new TH1F("hElectronTrue_eta","ElectronTrue_eta",14,0.,2.5); 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 *hElectronTight_pt = new TH1F("hElectronTight_pt","ElectronTight_pt",11,5.,60.); TH1F *hElectronTrue_pt = new TH1F("hElectronTrue_pt","ElectronTrue_pt",11,5.,60.); // instanciate chains TObjArray Chains; TChain * truth = new TChain("TruthTree"); Chains.Add(truth); TChain * trigg = new TChain("TrigResultTree"); Chains.Add(trigg); TChain * rawelec = new TChain("RawElectronTree"); Chains.Add(rawelec); TChain * elec = new TChain("PreselectedElectronTree"); Chains.Add(elec); TChain * muon = new TChain("PreselectedMuonTree"); Chains.Add(muon); 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 * preelec = new TChain("PreElectronTree"); Chains.Add(preelec); TChain * premuon = new TChain("PreMuonTree"); Chains.Add(premuon); TChain * selelec = new TChain("SelectedElectronTree"); Chains.Add(selelec); TChain * selmuon = new TChain("SelectedMuonTree"); Chains.Add(selmuon); TChain * zcand = new TChain("ZWindowTree"); Chains.Add(zcand); TChain * zcaloisocand = new TChain("ZCaloISOWindowTree"); Chains.Add(zcaloisocand); TChain * ztrkisocand = new TChain("ZTrackISOWindowTree"); Chains.Add(ztrkisocand); TChain * zipcand = new TChain("ZIPWindowTree"); Chains.Add(zipcand); for (int i=0; iAdd("/scratch/dervan/TestNtupleOutput_130GeV_ZZ_1.root"); chain->Add("/scratch/dervan/TestNtupleOutput_130GeV_ZZ_2.root"); chain->Add("/scratch/dervan/TestNtupleOutput_130GeV_ZZ_3.root"); chain->Add("/scratch/dervan/TestNtupleOutput_130GeV_ZZ_4.root"); // chain->Add("/scratch/dervan/TestNtupleOutput_130GeV_Zbb_1.root"); // chain->Add("/scratch/dervan/TestNtupleOutput_130GeV_Zbb_2.root"); // chain->Add("/scratch/dervan/TestNtupleOutput_130GeV_Zbb_3.root"); // chain->Add("/scratch/dervan/TestNtupleOutput_130GeV_Zbb_4.root"); // chain->Add("/scratch/dervan/TestNtupleOutput_130GeV_Zbb_5.root"); // chain->Add("/scratch/dervan/TestNtupleOutput_130GeV_Zbb_6.root"); // chain->Add("/scratch/dervan/TestNtupleOutput_130GeV_Zbb_7.root"); // chain->Add("/scratch/dervan/TestNtupleOutput_130GeV_Zbb_8.root"); // chain->Add("/scratch/dervan/TestNtupleOutput_130GeV_Zbb_9.root"); // chain->Add("/scratch/dervan/TestNtupleOutput_130GeV_Zbb_10.root"); // chain->Add("/scratch/dervan/TestNtupleOutput_130GeV_Zbb_11.root"); // chain->Add("/scratch/dervan/TestNtupleOutput_130GeV_Zbb_12.root"); // chain->Add("/scratch/dervan/TestNtupleOutput_130GeV_Zbb_13.root"); // chain->Add("/scratch/dervan/TestNtupleOutput_130GeV_Zbb_14.root"); // chain->Add("/scratch/dervan/TestNtupleOutput_130GeV_Zbb_15.root"); // chain->Add("/scratch/dervan/TestNtupleOutput_130GeV_Zbb_16.root"); } int TruthNum = truth->GetEntries(); int TriggerNum = trigg->GetEntries(); int ElectronNum = elec->GetEntries(); int MuonNum = muon->GetEntries(); int ElectronLooseNum = elecloose->GetEntries(); int ElectronMediumNum = elecmedium->GetEntries(); int ElectronMediumCALOISONum = elecmediumcaloiso->GetEntries(); int RawElectronNum = rawelec->GetEntries(); int PreElectronNum = preelec->GetEntries(); int PreMuonNum = premuon->GetEntries(); int SelElectronNum = selelec->GetEntries(); int SelMuonNum = selmuon->GetEntries(); int ZCandNum = zcand->GetEntries(); int ZCaloISOCandNum = zcaloisocand->GetEntries(); int ZTrkISOCandNum = ztrkisocand->GetEntries(); int ZIPCandNum = zipcand->GetEntries(); cout << "Number of truth events = " << TruthNum << endl; cout << "Number of Trigger events = " << TriggerNum << endl; cout << "Number of Raw Electron events = " << RawElectronNum << endl; cout << "Number of Electron events = " << ElectronNum << endl; cout << "Number of Muon events = " << MuonNum << 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 Pre-Electron events = " << PreElectronNum << endl; cout << "Number of Pre-Muon events = " << PreMuonNum << endl; cout << "Number of Selected-Electron events = " << SelElectronNum << endl; cout << "Number of Selected-Muon events = " << SelMuonNum << endl; cout << "Number of Z Candidate events = " << ZCandNum << endl; cout << "Number of Z CALO ISO Candidate events = " << ZCaloISOCandNum << endl; cout << "Number of Z TRK ISO Candidate events = " << ZTrkISOCandNum << endl; cout << "Number of Z IP Candidate events = " << ZIPCandNum << endl; getchar(); Truth *TruthTree; Trigger *TrigResultsTree; RawElectron *RawElectronTree; Electron *PreselectedElectronTree; Muon *PreselectedMuonTree; Electron *PreselectedLooseElectronTree; Electron *PreselectedMediumElectronTree; Electron *PreselectedMediumCALOISOElectronTree; Electron *PreElectronTree; Muon *PreMuonTree; Electron *SelectedElectronTree; Muon *SelectedMuonTree; ZCandidates *ZWindowTree; ZCandidates *ZCaloISOWindowTree; ZCandidates *ZTrackISOWindowTree; ZCandidates *ZIPWindowTree; TruthTree = new Truth(truth); TrigResultsTree = new Trigger(trigg); RawElectronTree = new RawElectron(rawelec); PreselectedElectronTree = new Electron(elec); PreselectedMuonTree = new Muon(muon); PreselectedLooseElectronTree = new Electron(elecloose); PreselectedMediumElectronTree = new Electron(elecmedium); PreselectedMediumCALOISOElectronTree = new Electron(elecmediumcaloiso); PreElectronTree = new Electron(preelec); PreMuonTree = new Muon(premuon); SelectedElectronTree = new Electron(selelec); SelectedMuonTree = new Muon(selmuon); ZWindowTree = new ZCandidates(zcand); ZCaloISOWindowTree = new ZCandidates(zcaloisocand); ZTrackISOWindowTree = new ZCandidates(ztrkisocand); ZIPWindowTree = new ZCandidates(zipcand); 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 Zeeee_pass_mu20_e22i_presel = 0; int Zmmmm_pass_mu20_e22i_presel = 0; int Zeemm_pass_mu20_e22i_presel = 0; int Zeeee_pass_mu20_e22i_sel = 0; int Zmmmm_pass_mu20_e22i_sel = 0; int Zeemm_pass_mu20_e22i_sel = 0; int Zeeee_pass_mu20_e22i_z = 0; int Zmmmm_pass_mu20_e22i_z = 0; int Zeemm_pass_mu20_e22i_z = 0; int Zeeee_pass_mu20_e22i_zcaloiso = 0; int Zmmmm_pass_mu20_e22i_zcaloiso = 0; int Zeemm_pass_mu20_e22i_zcaloiso = 0; int Zeeee_pass_mu20_e22i_ztrkiso = 0; int Zmmmm_pass_mu20_e22i_ztrkiso = 0; int Zeemm_pass_mu20_e22i_ztrkiso = 0; int Zeeee_pass_mu20_e22i_zip = 0; int Zmmmm_pass_mu20_e22i_zip = 0; int Zeemm_pass_mu20_e22i_zip = 0; int sum_zee = 0; int sum_zeecaloiso = 0; int sum_zeetrackiso = 0; int sum_zeeip = 0; int sum_zmm = 0; int sum_zmmcaloiso = 0; int sum_zmmtrackiso = 0; int sum_zmmip = 0; for (int jentry=0; jentryLoadTree(jentry); TruthTree->GetEntry(jentry); TrigResultsTree->LoadTree(jentry); TrigResultsTree->GetEntry(jentry); RawElectronTree->LoadTree(jentry); RawElectronTree->GetEntry(jentry); PreselectedElectronTree->LoadTree(jentry); PreselectedElectronTree->GetEntry(jentry); PreselectedMuonTree->LoadTree(jentry); PreselectedMuonTree->GetEntry(jentry); PreselectedLooseElectronTree->LoadTree(jentry); PreselectedLooseElectronTree->GetEntry(jentry); PreselectedMediumElectronTree->LoadTree(jentry); PreselectedMediumElectronTree->GetEntry(jentry); PreselectedMediumCALOISOElectronTree->LoadTree(jentry); PreselectedMediumCALOISOElectronTree->GetEntry(jentry); PreElectronTree->GetEntry(jentry); PreMuonTree->GetEntry(jentry); SelectedElectronTree->GetEntry(jentry); SelectedMuonTree->GetEntry(jentry); ZWindowTree->LoadTree(jentry); ZWindowTree->GetEntry(jentry); ZCaloISOWindowTree->LoadTree(jentry); ZCaloISOWindowTree->GetEntry(jentry); ZTrackISOWindowTree->LoadTree(jentry); ZTrackISOWindowTree->GetEntry(jentry); ZIPWindowTree->LoadTree(jentry); ZIPWindowTree->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(); fprintf(Zmassout,"%f %f \n",TruthTree->truth_Z1_m,TruthTree->truth_Z2_m); if(TruthTree->truth_H_num != 0) { numberofhiggsevents++; } if(TruthTree->truth_Z_num >= 2) { numberofZZevents++; } int d1electrons = 0; int d1muons = 0; int d1taus = 0; for(unsigned int i=0; i< (*(TruthTree->truth_daughter1_pt)).size(); i++) { if(abs((*(TruthTree->truth_daughter1_pdgid))[i]) == 11) d1electrons++; 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(unsigned int i=0; i< (*(TruthTree->truth_daughter2_pt)).size(); i++) { if(abs((*(TruthTree->truth_daughter2_pdgid))[i]) == 11) d2electrons++; 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++; // cout << "Truth: Number of electrons: " << d1electrons << " " << d2electrons << endl; // cout << "Truth: Number of muons: " << d1muons << " " << d2muons << endl; // cout << "Truth: Number of taus: " << d1taus << " " << d2taus << endl; // cout << endl; // 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"); // getchar(); 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(unsigned 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(unsigned 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]); } int num_preelec = (*(PreselectedLooseElectronTree->electron_pt)).size(); int num_premuon = (*(PreselectedMuonTree->muon_pt)).size(); int num_preleptons = num_preelec + num_premuon; // cout << "Number of Pre-selected Electrons " << num_preelec << endl; // cout << "Number of Pre-selected Muons " << num_premuon << endl; // cout << "Number of Pre-selected Leptons " << num_preleptons << endl; if(((d1electrons == 2) && (d2electrons == 2)) && (num_preleptons >= 4) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeeee_pass_mu20_e22i_presel++; if(((d1muons == 2) && (d2muons == 2)) && (num_preleptons >= 4) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zmmmm_pass_mu20_e22i_presel++; if(((d1electrons == 2) && (d2muons == 2)) && (num_preleptons >= 4) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeemm_pass_mu20_e22i_presel++; if(((d2electrons == 2) && (d1muons == 2)) && (num_preleptons >= 4) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeemm_pass_mu20_e22i_presel++; // getchar(); int num_selelec = (*(SelectedElectronTree->electron_pt)).size(); int num_selmuon = (*(SelectedMuonTree->muon_pt)).size(); int num_selleptons = num_selelec + num_selmuon; // cout << "Number of selected Electrons " << num_selelec << endl; // cout << "Number of selected Muons " << num_selmuon << endl; // cout << "Number of selected Leptons " << num_selleptons << endl; if(((d1electrons == 2) && (d2electrons == 2)) && (num_selelec >= 4) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeeee_pass_mu20_e22i_sel++; if(((d1muons == 2) && (d2muons == 2)) && (num_selmuon >= 4) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zmmmm_pass_mu20_e22i_sel++; if(((d1electrons == 2) && (d2muons == 2)) && (num_selleptons >= 4) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeemm_pass_mu20_e22i_sel++; if(((d2electrons == 2) && (d1muons == 2)) && (num_selleptons >= 4) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeemm_pass_mu20_e22i_sel++; // getchar(); int num_zee = (*(ZWindowTree->Zee_m)).size(); int num_zmm = (*(ZWindowTree->Zmumu_m)).size(); sum_zee = sum_zee + num_zee; sum_zmm = sum_zmm + num_zmm; // cout << "Number of selected Zee " << num_zee << endl; // cout << "Number of selected Zmm " << num_zmm << endl; // cout << endl; // getchar(); if(((d1electrons == 2) && (d2electrons == 2)) && (num_zee >= 2) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeeee_pass_mu20_e22i_z++; if(((d1muons == 2) && (d2muons == 2)) && (num_zmm >= 2) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zmmmm_pass_mu20_e22i_z++; if(((d1electrons == 2) && (d2muons == 2)) && ((num_zee >= 1) && (num_zmm >= 1)) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeemm_pass_mu20_e22i_z++; if(((d2electrons == 2) && (d1muons == 2)) && ((num_zee >= 1) && (num_zmm >= 1)) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeemm_pass_mu20_e22i_z++; // getchar(); int num_zeecaloiso = (*(ZCaloISOWindowTree->Zee_m)).size(); int num_zmmcaloiso = (*(ZCaloISOWindowTree->Zmumu_m)).size(); sum_zeecaloiso = sum_zeecaloiso + num_zeecaloiso; sum_zmmcaloiso = sum_zmmcaloiso + num_zmmcaloiso; // cout << "Number of selected Zee calo iso " << num_zeecaloiso << endl; // cout << "Number of selected Zmm calo iso " << num_zmmcaloiso << endl; if(((d1electrons == 2) && (d2electrons == 2)) && (num_zeecaloiso >= 2) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeeee_pass_mu20_e22i_zcaloiso++; if(((d1muons == 2) && (d2muons == 2)) && (num_zmmcaloiso >= 2) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zmmmm_pass_mu20_e22i_zcaloiso++; if(((d1electrons == 2) && (d2muons == 2)) && ((num_zeecaloiso >= 1) && (num_zmm >= 1)) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeemm_pass_mu20_e22i_zcaloiso++; if(((d2electrons == 2) && (d1muons == 2)) && ((num_zeecaloiso >= 1) && (num_zmm >= 1)) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeemm_pass_mu20_e22i_zcaloiso++; // getchar(); int num_zeetrkiso = (*(ZTrackISOWindowTree->Zee_m)).size(); int num_zmmtrkiso = (*(ZTrackISOWindowTree->Zmumu_m)).size(); sum_zeetrackiso = sum_zeetrackiso + num_zeetrkiso; sum_zmmtrackiso = sum_zmmtrackiso + num_zmmtrkiso; // cout << "Number of selected Zee track iso " << num_zeetrkiso << endl; // cout << "Number of selected Zmm track iso " << num_zmmtrkiso << endl; if(((d1electrons == 2) && (d2electrons == 2)) && (num_zeetrkiso >= 2) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeeee_pass_mu20_e22i_ztrkiso++; if(((d1muons == 2) && (d2muons == 2)) && (num_zmmtrkiso >= 2) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zmmmm_pass_mu20_e22i_ztrkiso++; if(((d1electrons == 2) && (d2muons == 2)) && ((num_zeetrkiso >= 1) && (num_zmm >= 1)) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeemm_pass_mu20_e22i_ztrkiso++; if(((d2electrons == 2) && (d1muons == 2)) && ((num_zeetrkiso >= 1) && (num_zmm >= 1)) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeemm_pass_mu20_e22i_ztrkiso++; // getchar(); int num_zeeip = (*(ZIPWindowTree->Zee_m)).size(); int num_zmmip = (*(ZIPWindowTree->Zmumu_m)).size(); sum_zeeip = sum_zeeip + num_zeeip; sum_zmmip = sum_zmmip + num_zmmip; // cout << "Number of selected Zee ip " << num_zeeip << endl; // cout << "Number of selected Zmm ip " << num_zmmip << endl; if(((d1electrons == 2) && (d2electrons == 2)) && (num_zeeip >= 2) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeeee_pass_mu20_e22i_zip++; if(((d1muons == 2) && (d2muons == 2)) && (num_zmmip >= 2) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zmmmm_pass_mu20_e22i_zip++; if(((d1electrons == 2) && (d2muons == 2)) && ((num_zeeip >= 1) && (num_zmm >= 1)) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeemm_pass_mu20_e22i_zip++; if(((d2electrons == 2) && (d1muons == 2)) && ((num_zeeip >= 1) && (num_zmm >= 1)) && ((pass_mu20 == 1) || (pass_e22i == 1))) Zeemm_pass_mu20_e22i_zip++; // getchar(); if((pass_mu20 == 1) || (pass_e22i == 1)) { // cout << "PASSED TRIGGER" << endl; for(unsigned 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(unsigned 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(unsigned 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(unsigned 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 << "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(" | 4e | 4mu | 2e2mu |\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("-----------------------------------------------------\n"); // 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); printf("Trigger Selection |\t%4.1f |\t%4.1f |\t%4.1f |\n",float(Zeeee_pass_mu20_e22i)/NumEntries*100,float(Zmmmm_pass_mu20_e22i)/NumEntries*100,float(Zeemm_pass_mu20_e22i)/NumEntries*100); printf("-----------------------------------------------------\n"); printf("Trigger Selection |\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); printf("-----------------------------------------------------\n"); printf("Pre-Selection |\t%4.1f |\t%4.1f |\t%4.1f |\n",float(Zeeee_pass_mu20_e22i_presel)/NumEntries*100,float(Zmmmm_pass_mu20_e22i_presel)/NumEntries*100,float(Zeemm_pass_mu20_e22i_presel)/NumEntries*100); printf("-----------------------------------------------------\n"); printf("Pre-Selection |\t%4.1f |\t%4.1f |\t%4.1f |\n",float(Zeeee_pass_mu20_e22i_presel)/Zeeee*100,float(Zmmmm_pass_mu20_e22i_presel)/Zmmmm*100,float(Zeemm_pass_mu20_e22i_presel)/Zeemm*100); printf("-----------------------------------------------------\n"); printf("Selection |\t%4.1f |\t%4.1f |\t%4.1f |\n",float(Zeeee_pass_mu20_e22i_sel)/NumEntries*100,float(Zmmmm_pass_mu20_e22i_sel)/NumEntries*100,float(Zeemm_pass_mu20_e22i_sel)/NumEntries*100); printf("-----------------------------------------------------\n"); printf("Selection |\t%4.1f |\t%4.1f |\t%4.1f |\n",float(Zeeee_pass_mu20_e22i_sel)/Zeeee*100,float(Zmmmm_pass_mu20_e22i_sel)/Zmmmm*100,float(Zeemm_pass_mu20_e22i_sel)/Zeemm*100); printf("-----------------------------------------------------\n"); printf("Z window |\t%4.1f |\t%4.1f |\t%4.1f |\n",float(Zeeee_pass_mu20_e22i_z)/NumEntries*100,float(Zmmmm_pass_mu20_e22i_z)/NumEntries*100,float(Zeemm_pass_mu20_e22i_z)/Zeemm*100); printf("-----------------------------------------------------\n"); printf("Z window |\t%4.1f |\t%4.1f |\t%4.1f |\n",float(Zeeee_pass_mu20_e22i_z)/Zeeee*100,float(Zmmmm_pass_mu20_e22i_z)/Zmmmm*100,float(Zeemm_pass_mu20_e22i_z)/Zeemm*100); printf("-----------------------------------------------------\n"); printf("Z CALO ISO window |\t%4.1f |\t%4.1f |\t%4.1f |\n",float(Zeeee_pass_mu20_e22i_zcaloiso)/NumEntries*100,float(Zmmmm_pass_mu20_e22i_zcaloiso)/NumEntries*100,float(Zeemm_pass_mu20_e22i_zcaloiso)/NumEntries*100); printf("-----------------------------------------------------\n"); printf("Z CALO ISO window |\t%4.1f |\t%4.1f |\t%4.1f |\n",float(Zeeee_pass_mu20_e22i_zcaloiso)/Zeeee*100,float(Zmmmm_pass_mu20_e22i_zcaloiso)/Zmmmm*100,float(Zeemm_pass_mu20_e22i_zcaloiso)/Zeemm*100); printf("-----------------------------------------------------\n"); printf("Z CALO TRK window |\t%4.1f |\t%4.1f |\t%4.1f |\n",float(Zeeee_pass_mu20_e22i_ztrkiso)/NumEntries*100,float(Zmmmm_pass_mu20_e22i_ztrkiso)/NumEntries*100,float(Zeemm_pass_mu20_e22i_ztrkiso)/NumEntries*100); printf("-----------------------------------------------------\n"); printf("Z CALO TRK window |\t%4.1f |\t%4.1f |\t%4.1f |\n",float(Zeeee_pass_mu20_e22i_ztrkiso)/Zeeee*100,float(Zmmmm_pass_mu20_e22i_ztrkiso)/Zmmmm*100,float(Zeemm_pass_mu20_e22i_ztrkiso)/Zeemm*100); printf("-----------------------------------------------------\n"); printf("Z IP window |\t%4.1f |\t%4.1f |\t%4.1f |\n",float(Zeeee_pass_mu20_e22i_zip)/NumEntries*100,float(Zmmmm_pass_mu20_e22i_zip)/NumEntries*100,float(Zeemm_pass_mu20_e22i_zip)/NumEntries*100); printf("-----------------------------------------------------\n"); printf("Z IP window |\t%4.1f |\t%4.1f |\t%4.1f |\n",float(Zeeee_pass_mu20_e22i_zip)/Zeeee*100,float(Zmmmm_pass_mu20_e22i_zip)/Zmmmm*100,float(Zeemm_pass_mu20_e22i_zip)/Zeemm*100); printf("zee = %i zmm = %i \n",sum_zee,sum_zmm); printf("zee_caloiso = %i zmm_caloiso = %i \n",sum_zeecaloiso,sum_zmmcaloiso); printf("zee_trackiso = %i zmm_trackiso = %i \n",sum_zeetrackiso,sum_zmmtrackiso); printf("zee_ip = %i zmm_ip = %i \n",sum_zeeip,sum_zmmip); // 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_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 *hElectronTight_eta_test = new TH1F("hElectronTight_eta_test","ElectronTight_eta_test",14,0.,2.5); for(int i=1; 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))))); 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_eta->GetBinContent(i),hElectronTrue_eta->GetBinContent(i),hElectronLoose_eta->GetBinContent(i)/hElectronTrue_eta->GetBinContent(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))))); } fclose(Zmassout); hfile.Write(); return 0; }