#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.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 * zcand = new TChain("ZCandidatesTree"); Chains.Add(zcand); 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 * elecloose = new TChain("PreselectedLooseElectronTree"); Chains.Add(elecloose); TChain * elecmedium = new TChain("PreselectedMediumElectronTree"); Chains.Add(elecmedium); TChain * elecmediumcaloiso = new TChain("PreselectedMediumCALOISOElectronTree"); Chains.Add(elecmediumcaloiso); for (int i=0; iAdd("Test.root"); chain->Add("/hepstore/store2/dervan/TestNtupleOutput_130GeV.root"); // chain->Add("TestNtupleOutput_300GeV_Higgs.root"); // chain->Add("TestNtupleOutput.root"); } int TruthNum =truth->GetEntries(); // int ZCandidatesNum =zcand->GetEntries(); int TriggerNum = trigg->GetEntries(); int ElectronNum = elec->GetEntries(); int ElectronLooseNum = elecloose->GetEntries(); int ElectronMediumNum = elecmedium->GetEntries(); int ElectronMediumCALOISONum = elecmediumcaloiso->GetEntries(); int RawElectronNum = rawelec->GetEntries(); cout << "Number of truth events = " << TruthNum << endl; // cout << "Number of Z Candidate events = " << ZCandidatesNum << 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 Loose Electron events = " << ElectronLooseNum << endl; cout << "Number of Medium Electron events = " << ElectronMediumNum << endl; cout << "Number of Medium CALOISOElectron events = " << ElectronMediumCALOISONum << endl; getchar(); Truth *TruthTree; // ZCandidates *ZCandidatesTree; Trigger *TrigResultsTree; RawElectron *RawElectronTree; Electron *PreselectedElectronTree; Electron *PreselectedLooseElectronTree; Electron *PreselectedMediumElectronTree; Electron *PreselectedMediumCALOISOElectronTree; TruthTree = new Truth(truth); // ZCandidatesTree = new ZCandidates(zcand); TrigResultsTree = new Trigger(trigg); RawElectronTree = new RawElectron(rawelec); PreselectedElectronTree = new Electron(elec); PreselectedLooseElectronTree = new Electron(elecloose); PreselectedMediumElectronTree = new Electron(elecmedium); PreselectedMediumCALOISOElectronTree = new Electron(elecmediumcaloiso); 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; for (int jentry=0; jentryLoadTree(jentry); TruthTree->GetEntry(jentry); // ZCandidatesTree->LoadTree(jentry); // ZCandidatesTree->GetEntry(jentry); TrigResultsTree->LoadTree(jentry); TrigResultsTree->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); 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++; // 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]); } 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("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_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; }