ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/Development/Plotting/Modules/EventInfo.C
Revision: 1.3
Committed: Wed Sep 19 14:55:59 2012 UTC (12 years, 7 months ago) by buchmann
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
Error occurred while calculating annotation data.
Log Message:
Updated Z window; added new trigger requirement

File Contents

# Content
1 #include <iostream>
2 #include <vector>
3 #include <sstream>
4
5 #include <TFile.h>
6 #include <TTree.h>
7 #include <TError.h>
8 #include <TMath.h>
9
10 using namespace std;
11
12
13 int main() {
14 TFile *f = new TFile("/scratch/buchmann/AllData_Jun10___486pb_MoreTriggers4_DCS_incl_ch_id.root");
15 TTree *PFevents = (TTree*)f->Get("PFevents");
16 TTree *events = (TTree*)f->Get("events");
17
18 int pfJetGoodNum,eventNum,lumi,runNum;
19 float mll,jzb[30],met[30],pt1,pt2,pt;
20
21 vector<string> summary;
22 vector<int> VrunNum, VeventNum, Vlumi;
23
24 PFevents->SetBranchAddress("pfJetGoodNum",&pfJetGoodNum);
25 PFevents->SetBranchAddress("runNum",&runNum);
26 PFevents->SetBranchAddress("eventNum",&eventNum);
27 PFevents->SetBranchAddress("lumi",&lumi);
28 PFevents->SetBranchAddress("mll",&mll);
29 PFevents->SetBranchAddress("jzb",&jzb);
30 PFevents->SetBranchAddress("met",&met);
31 PFevents->SetBranchAddress("pt1",&pt1);
32 PFevents->SetBranchAddress("pt2",&pt2);
33 PFevents->SetBranchAddress("pt",&pt);
34
35
36 for(long int ientry=1;ientry<=PFevents->GetEntries();ientry++) {
37 PFevents->GetEntry(ientry);
38 if(!(pfJetGoodNum>=3)) continue;
39 if(TMath::Abs(mll-91)>10) continue;
40 if(TMath::Abs(jzb[1])<100) continue;
41 stringstream hit;
42 hit << runNum <<":"<<lumi<<":"<<eventNum<<":"<<jzb[1]<<":"<<met[4]<<":"<<pt1<<":"<<pt2<<":"<<pt<<":"<<mll<<":"<<pfJetGoodNum;
43 summary.push_back(hit.str());
44 VrunNum.push_back(runNum);
45 VeventNum.push_back(eventNum);
46 Vlumi.push_back(lumi);
47 }
48
49 events->SetBranchAddress("pfJetGoodNum",&pfJetGoodNum);
50 events->SetBranchAddress("runNum",&runNum);
51 events->SetBranchAddress("eventNum",&eventNum);
52 events->SetBranchAddress("lumi",&lumi);
53 events->SetBranchAddress("mll",&mll);
54 events->SetBranchAddress("jzb",&jzb);
55 events->SetBranchAddress("met",&met);
56 events->SetBranchAddress("pt1",&pt1);
57 events->SetBranchAddress("pt2",&pt2);
58 events->SetBranchAddress("pt",&pt);
59
60 for(long int ientry=1;ientry<events->GetEntries();ientry++) {
61 events->GetEntry(ientry);
62 for(int jhits=0;jhits<VrunNum.size();jhits++) {
63 if(runNum==VrunNum[jhits]&&eventNum==VeventNum[jhits]&&lumi==Vlumi[jhits]) {
64 //present all findings here.
65 cout << "PF:"<<summary[jhits]<<endl;
66 cout << "RC:"<<runNum <<":"<<lumi<<":"<<eventNum<<":"<<jzb[1]<<":"<<met[4]<<":"<<pt1<<":"<<pt2<<":"<<pt<<":"<<mll<<":"<<pfJetGoodNum<<endl;
67 /* VrunNum.erase(VrunNum.begin()+jhits);
68 VeventNum.erase(VeventNum.begin()+jhits);
69 Vlumi.erase(Vlumi.begin()+jhits);
70 summary.erase(summary.begin()+jhits);*/
71 }
72 else continue;
73 }
74 }
75
76 return 0;
77 }
78