ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/cbrown/AnalysisFramework/Plotting/Modules/EventInfo.C
Revision: 1.2
Committed: Mon Oct 24 15:05:37 2011 UTC (13 years, 6 months ago) by buchmann
Content type: text/plain
Branch: MAIN
CVS Tags: cbaf_4_98ifb_paper, beforeFR20120418, cbaf_4p7ifb, HEAD
Changes since 1.1: +12 -0 lines
Error occurred while calculating annotation data.
Log Message:
Upgrade from HoneyPot to IceCreamBowl: merged in offpeak stuff, different warning color for frederic, saving to rootfile, only 3 attempts when computing limits and much, much more

File Contents

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