16 |
|
|
17 |
|
#include "UserCode/L1RpcTriggerAnalysis/interface/L1Obj.h" |
18 |
|
#include "UserCode/L1RpcTriggerAnalysis/interface/EventObj.h" |
19 |
+ |
#include "UserCode/L1RpcTriggerAnalysis/interface/EventObjBXExtra.h" |
20 |
|
#include "UserCode/L1RpcTriggerAnalysis/interface/TrackObj.h" |
21 |
|
#include "UserCode/L1RpcTriggerAnalysis/interface/MuonObj.h" |
22 |
|
#include "UserCode/L1RpcTriggerAnalysis/interface/L1ObjColl.h" |
23 |
|
#include "UserCode/L1RpcTriggerAnalysis/interface/SynchroCountsObj.h" |
24 |
+ |
#include "UserCode/L1RpcTriggerAnalysis/interface/DetCluDigiObj.h" |
25 |
+ |
#include "UserCode/L1RpcTriggerAnalysis/interface/TriggerMenuResultObj.h" |
26 |
+ |
|
27 |
|
|
28 |
|
#include "UserCode/L1RpcTriggerAnalysis/interface/ConverterRPCRawSynchroSynchroCountsObj.h" |
29 |
|
|
30 |
+ |
L1RpcTreeAnalysis::L1RpcTreeAnalysis(const edm::ParameterSet & cfg) |
31 |
+ |
: theConfig(cfg), |
32 |
+ |
theAnaMuonDistribution( cfg.getParameter<edm::ParameterSet>("anaMuonDistribution") ), |
33 |
+ |
theAnaTimingL1 (cfg.getParameter<edm::ParameterSet>("anaTimingL1") ), |
34 |
+ |
theAnaMenu(cfg.getParameter<edm::ParameterSet>("anaMenu") ), |
35 |
+ |
theAnaEvent(cfg.getParameter<edm::ParameterSet>("anaEvent") ) |
36 |
+ |
{ } |
37 |
|
|
38 |
|
void L1RpcTreeAnalysis::beginJob() |
39 |
|
{ |
47 |
|
theAnaEmu.init(theHistos); |
48 |
|
theAnaSynch.init(theHistos); |
49 |
|
theAnaClu.init(theHistos); |
50 |
< |
|
50 |
> |
theAnaTimingL1.init(theHistos); |
51 |
> |
theAnaEvent.init(theHistos); |
52 |
> |
theAnaMenu.init(theHistos); |
53 |
|
} |
54 |
|
|
55 |
|
void L1RpcTreeAnalysis::beginRun(const edm::Run& ru, const edm::EventSetup& es) |
83 |
|
std::vector<SynchroCountsObj> *counts= 0; |
84 |
|
std::vector<uint32_t> *detsCrossedByMuon = 0; |
85 |
|
std::vector<uint32_t> *detsCrossedByMuonDeepInside = 0; |
86 |
< |
std::vector<uint32_t> *detsHitsCompatibleWithMuon = 0; |
86 |
> |
std::vector<DetCluDigiObj> *detsHitsCompatibleWithMuon = 0; |
87 |
|
std::vector<uint32_t> *detsSIMU = 0; |
75 |
– |
std::vector<uint32_t> *nDigisCompDets = 0; |
88 |
|
|
89 |
|
EventObj * event = 0; |
90 |
|
MuonObj * muon = 0; |
91 |
|
|
92 |
+ |
TriggerMenuResultObj *bitsL1 = 0; |
93 |
+ |
TriggerMenuResultObj *bitsHLT = 0; |
94 |
+ |
|
95 |
|
TBranch *bcounts=0; |
96 |
|
TBranch *bdetsCrossedByMuon =0; |
97 |
|
TBranch *bdetsCrossedByMuonDeepInside =0; |
98 |
|
TBranch *bdetsHitsCompatibleWithMuon = 0; |
99 |
|
TBranch *bdetsSIMU =0; |
85 |
– |
TBranch *bnDigisCompDets =0; |
100 |
|
|
101 |
< |
L1ObjColl* l1RpcColl = 0; |
88 |
< |
L1ObjColl* l1OtherColl = 0; |
89 |
< |
L1ObjColl* l1RpcCollEmu = 0; |
101 |
> |
L1ObjColl* l1ObjColl = 0; |
102 |
|
|
103 |
|
chain.SetBranchAddress("event",&event); |
104 |
|
chain.SetBranchAddress("muon",&muon); |
105 |
|
|
106 |
+ |
chain.SetBranchAddress("bitsL1",&bitsL1); |
107 |
+ |
chain.SetBranchAddress("bitsHLT",&bitsHLT); |
108 |
+ |
|
109 |
|
chain.SetBranchAddress("counts",&counts,&bcounts); |
110 |
|
chain.SetBranchAddress("detsCrossedByMuon",&detsCrossedByMuon,&bdetsCrossedByMuon); |
111 |
|
chain.SetBranchAddress("detsCrossedByMuonDeepInside",&detsCrossedByMuonDeepInside,&bdetsCrossedByMuonDeepInside); |
112 |
|
chain.SetBranchAddress("detsHitsCompatibleWithMuon",&detsHitsCompatibleWithMuon,&bdetsHitsCompatibleWithMuon); |
113 |
|
chain.SetBranchAddress("detsSIMU",&detsSIMU,&bdetsSIMU); |
99 |
– |
chain.SetBranchAddress("nDigisCompDets",&nDigisCompDets, &bnDigisCompDets); |
114 |
|
|
115 |
< |
chain.SetBranchAddress("l1RpcColl",&l1RpcColl); |
102 |
< |
chain.SetBranchAddress("l1OtherColl",&l1OtherColl); |
103 |
< |
chain.SetBranchAddress("l1RpcCollEmu",&l1RpcCollEmu); |
115 |
> |
chain.SetBranchAddress("l1ObjColl",&l1ObjColl); |
116 |
|
|
117 |
|
|
118 |
|
// |
119 |
< |
// number of efents |
119 |
> |
// number of events |
120 |
|
// |
121 |
|
Int_t nentries = (Int_t) chain.GetEntries(); |
122 |
|
std::cout <<" ENTRIES: " << nentries << std::endl; |
128 |
|
unsigned int lastRun = 0; |
129 |
|
for (int ev=0; ev<nentries; ev++) { |
130 |
|
chain.GetEntry(ev); |
131 |
+ |
theAnaMenu.updateMenu(bitsL1->names, bitsHLT->names); |
132 |
|
|
133 |
|
if (lastRun != (*event).run) { |
134 |
+ |
// if (true) { |
135 |
|
lastRun = (*event).run; |
136 |
|
std::cout <<"RUN:" << std::setw(7) << (*event).run |
137 |
|
<<" event:" << std::setw(8) << ev |
138 |
< |
<<" done:" << std::setw(6)<< std::setiosflags(std::ios::fixed) << std::setprecision(2) << ev*100./nentries<<"%"<<std::endl; |
138 |
> |
<<" done:" << std::setw(6)<< std::setiosflags(std::ios::fixed) << std::setprecision(2) << ev*100./nentries<<"%"; |
139 |
> |
std::cout<<std::endl; |
140 |
|
} |
141 |
|
|
142 |
< |
// if (ev > 10) break; |
142 |
> |
/* |
143 |
> |
if ( event->id == 597978012 |
144 |
> |
|| event->id == 14791798 |
145 |
> |
|| event->id == 436261807 |
146 |
> |
|| event->id == 873776280 |
147 |
> |
|| event->id == 960307389 |
148 |
> |
|| event->id == 150097556 |
149 |
> |
|| event->id == 42062946 |
150 |
> |
|| event->id == 1064121551 |
151 |
> |
|| event->id == 1499489591 |
152 |
> |
|| event->id == 60161631 |
153 |
> |
|| event->id == 624624695 |
154 |
> |
|| event->id == 727298833 |
155 |
> |
|| event->id == 835600542 |
156 |
> |
|| event->id == 216373776 |
157 |
> |
|| event->id == 1107585611 |
158 |
> |
|| event->id == 197907027 |
159 |
> |
) theAnaMenu.debug = true; else theAnaMenu.debug = false; |
160 |
> |
*/ |
161 |
> |
|
162 |
> |
// EVENT NUMBER, BX structure etc. |
163 |
> |
EventObjBXExtra eventBx(*event); |
164 |
> |
if ( !theAnaEvent.filter(&eventBx) && theConfig.getParameter<bool>("filterByAnaEvent") ) continue; |
165 |
> |
// ANALYSE AND FILTER KINEMCTICS |
166 |
> |
if ( !theAnaMuonDistribution.filter(muon) && theConfig.getParameter<bool>("filterByAnaMuonDistribution") ) continue; |
167 |
> |
// ANALYSE AND FILTER TRIGGER MENU |
168 |
> |
if ( !theAnaMenu.filter(event, muon, bitsL1, bitsHLT) && theConfig.getParameter<bool>("filterByAnaMenu") ) continue; |
169 |
> |
|
170 |
> |
// theAnaRpcVsOth.run(muon,l1ObjColl); |
171 |
> |
// theAnaEff.run(muon, l1ObjColl); |
172 |
> |
// theAnaRpcMisc.run(event,muon,l1ObjColl); |
173 |
> |
// theAnaDet.run( muon, *detsHitsCompatibleWithMuon, *detsCrossedByMuon, *detsCrossedByMuonDeepInside); |
174 |
> |
// theAnaEmu.run ( event, muon, l1ObjColl); |
175 |
> |
// theAnaSynch.run( event, muon, ConverterRPCRawSynchroSynchroCountsObj::toRawSynchro( *counts)); |
176 |
> |
// theAnaClu.run( event, muon, l1ObjColl, *detsHitsCompatibleWithMuon); |
177 |
> |
theAnaTimingL1.run( &eventBx, muon, l1ObjColl); |
178 |
|
|
129 |
– |
// if (event->run != 178854) continue; |
130 |
– |
// if (lastLumi != (*event).lumi) { lastLumi = (*event).lumi; std::cout <<"lumi: " << (*event).lumi<<std::endl; } |
131 |
– |
// theAnaDet.debug = false; |
132 |
– |
// if ((*event).id==60422922)theAnaRpcMisc.debug = true; |
133 |
– |
|
134 |
– |
theAnaMuonDistribution.run(muon); |
135 |
– |
theAnaRpcVsOth.run(muon,l1RpcColl,l1OtherColl); |
136 |
– |
theAnaEff.run(muon,l1RpcColl,l1OtherColl); |
137 |
– |
theAnaRpcMisc.run(event,muon,l1RpcColl,l1OtherColl); |
138 |
– |
theAnaDet.run( muon, *detsHitsCompatibleWithMuon, *detsCrossedByMuon, *detsCrossedByMuonDeepInside); |
139 |
– |
theAnaEmu.run ( event, muon, l1RpcCollEmu, l1RpcColl); |
140 |
– |
theAnaSynch.run( event, muon, ConverterRPCRawSynchroSynchroCountsObj::toRawSynchro( *counts)); |
141 |
– |
theAnaClu.run( muon, l1RpcColl, *detsHitsCompatibleWithMuon, *nDigisCompDets); |
142 |
– |
|
143 |
– |
// theAnaEmu.debug =theAnaDet.debug; |
144 |
– |
// std::cout <<"----------"<<std::endl; |
145 |
– |
// theAnaDet.debug =theAnaEmu.debug; |
146 |
– |
// if (anaDet.debug) std::cout <<" Event: "<<(*event).id <<" Lumi: "<<(*event).lumi<< std::endl; |
147 |
– |
|
179 |
|
} |
180 |
|
} |
181 |
|
|
182 |
|
void L1RpcTreeAnalysis::endJob() |
183 |
|
{ |
184 |
|
std::cout <<"ENDJOB, summaries:"<<std::endl; |
185 |
< |
TGraph* hGraph_DetEff =theAnaDet.resume(); |
186 |
< |
TGraph* hGraph_RunEff =theAnaRpcMisc.resume(); |
185 |
> |
TGraph* hGraph_DetEff = theAnaDet.resume(); |
186 |
> |
theAnaRpcMisc.resume(theHistos); |
187 |
> |
TGraph* hGraph_RunClu = theAnaClu.resume(); |
188 |
> |
theAnaTimingL1.resume(theHistos); |
189 |
> |
theAnaMenu.resume(theHistos); |
190 |
> |
theAnaEvent.resume(theHistos); |
191 |
|
|
192 |
|
theAnaSynch.endJob(); |
193 |
|
|
195 |
|
TFile f(histoFile.c_str(),"RECREATE"); |
196 |
|
theHistos.Write(); |
197 |
|
hGraph_DetEff->Write("hGraph_DetEff"); |
198 |
< |
hGraph_RunEff->Write("hGraph_RunEff"); |
198 |
> |
hGraph_RunClu->Write("hGraph_RunClu"); |
199 |
|
f.Close(); |
200 |
|
std::cout <<"END"<<std::endl; |
201 |
|
} |