20 |
|
#include "UserCode/L1RpcTriggerAnalysis/interface/MuonObj.h" |
21 |
|
#include "UserCode/L1RpcTriggerAnalysis/interface/L1ObjColl.h" |
22 |
|
#include "UserCode/L1RpcTriggerAnalysis/interface/SynchroCountsObj.h" |
23 |
+ |
#include "UserCode/L1RpcTriggerAnalysis/interface/DetCluDigiObj.h" |
24 |
+ |
#include "UserCode/L1RpcTriggerAnalysis/interface/TriggerMenuResultObj.h" |
25 |
|
|
26 |
|
#include "UserCode/L1RpcTriggerAnalysis/interface/ConverterRPCRawSynchroSynchroCountsObj.h" |
27 |
|
|
28 |
+ |
L1RpcTreeAnalysis::L1RpcTreeAnalysis(const edm::ParameterSet & cfg) |
29 |
+ |
: theConfig(cfg), |
30 |
+ |
theAnaMuonDistribution( cfg.getParameter<edm::ParameterSet>("anaMuonDistribution") ) |
31 |
+ |
{ } |
32 |
|
|
33 |
|
void L1RpcTreeAnalysis::beginJob() |
34 |
|
{ |
42 |
|
theAnaEmu.init(theHistos); |
43 |
|
theAnaSynch.init(theHistos); |
44 |
|
theAnaClu.init(theHistos); |
45 |
< |
|
45 |
> |
theAnaTimingL1.init(theHistos); |
46 |
> |
theAnaMenu.init(theHistos); |
47 |
|
} |
48 |
|
|
49 |
|
void L1RpcTreeAnalysis::beginRun(const edm::Run& ru, const edm::EventSetup& es) |
77 |
|
std::vector<SynchroCountsObj> *counts= 0; |
78 |
|
std::vector<uint32_t> *detsCrossedByMuon = 0; |
79 |
|
std::vector<uint32_t> *detsCrossedByMuonDeepInside = 0; |
80 |
< |
std::vector<uint32_t> *detsHitsCompatibleWithMuon = 0; |
80 |
> |
std::vector<DetCluDigiObj> *detsHitsCompatibleWithMuon = 0; |
81 |
|
std::vector<uint32_t> *detsSIMU = 0; |
75 |
– |
std::vector<uint32_t> *nDigisCompDets = 0; |
82 |
|
|
83 |
|
EventObj * event = 0; |
84 |
|
MuonObj * muon = 0; |
85 |
|
|
86 |
+ |
TriggerMenuResultObj *bitsL1 = 0; |
87 |
+ |
TriggerMenuResultObj *bitsHLT = 0; |
88 |
+ |
|
89 |
|
TBranch *bcounts=0; |
90 |
|
TBranch *bdetsCrossedByMuon =0; |
91 |
|
TBranch *bdetsCrossedByMuonDeepInside =0; |
92 |
|
TBranch *bdetsHitsCompatibleWithMuon = 0; |
93 |
|
TBranch *bdetsSIMU =0; |
85 |
– |
TBranch *bnDigisCompDets =0; |
94 |
|
|
95 |
< |
L1ObjColl* l1RpcColl = 0; |
88 |
< |
L1ObjColl* l1OtherColl = 0; |
89 |
< |
L1ObjColl* l1RpcCollEmu = 0; |
95 |
> |
L1ObjColl* l1ObjColl = 0; |
96 |
|
|
97 |
|
chain.SetBranchAddress("event",&event); |
98 |
|
chain.SetBranchAddress("muon",&muon); |
99 |
|
|
100 |
+ |
chain.SetBranchAddress("bitsL1",&bitsL1); |
101 |
+ |
chain.SetBranchAddress("bitsHLT",&bitsHLT); |
102 |
+ |
|
103 |
|
chain.SetBranchAddress("counts",&counts,&bcounts); |
104 |
|
chain.SetBranchAddress("detsCrossedByMuon",&detsCrossedByMuon,&bdetsCrossedByMuon); |
105 |
|
chain.SetBranchAddress("detsCrossedByMuonDeepInside",&detsCrossedByMuonDeepInside,&bdetsCrossedByMuonDeepInside); |
106 |
|
chain.SetBranchAddress("detsHitsCompatibleWithMuon",&detsHitsCompatibleWithMuon,&bdetsHitsCompatibleWithMuon); |
107 |
|
chain.SetBranchAddress("detsSIMU",&detsSIMU,&bdetsSIMU); |
99 |
– |
chain.SetBranchAddress("nDigisCompDets",&nDigisCompDets, &bnDigisCompDets); |
108 |
|
|
109 |
< |
chain.SetBranchAddress("l1RpcColl",&l1RpcColl); |
102 |
< |
chain.SetBranchAddress("l1OtherColl",&l1OtherColl); |
103 |
< |
chain.SetBranchAddress("l1RpcCollEmu",&l1RpcCollEmu); |
109 |
> |
chain.SetBranchAddress("l1ObjColl",&l1ObjColl); |
110 |
|
|
111 |
|
|
112 |
|
// |
113 |
< |
// number of efents |
113 |
> |
// number of events |
114 |
|
// |
115 |
|
Int_t nentries = (Int_t) chain.GetEntries(); |
116 |
|
std::cout <<" ENTRIES: " << nentries << std::endl; |
130 |
|
<<" done:" << std::setw(6)<< std::setiosflags(std::ios::fixed) << std::setprecision(2) << ev*100./nentries<<"%"<<std::endl; |
131 |
|
} |
132 |
|
|
133 |
< |
// if (ev > 10) break; |
133 |
> |
// if (ev > 100) break; |
134 |
|
|
135 |
|
// if (event->run != 178854) continue; |
136 |
|
// if (lastLumi != (*event).lumi) { lastLumi = (*event).lumi; std::cout <<"lumi: " << (*event).lumi<<std::endl; } |
137 |
|
// theAnaDet.debug = false; |
138 |
|
// if ((*event).id==60422922)theAnaRpcMisc.debug = true; |
139 |
|
|
140 |
< |
theAnaMuonDistribution.run(muon); |
141 |
< |
theAnaRpcVsOth.run(muon,l1RpcColl,l1OtherColl); |
142 |
< |
theAnaEff.run(muon,l1RpcColl,l1OtherColl); |
143 |
< |
theAnaRpcMisc.run(event,muon,l1RpcColl,l1OtherColl); |
140 |
> |
// ANALYSE AND FILTER KINEMCTICS |
141 |
> |
if (!theAnaMuonDistribution.filter(muon)) continue; |
142 |
> |
// ANALYSE AND FILTER TRIGGER MENU |
143 |
> |
if (!theAnaMenu.filter(event, muon, bitsL1, bitsHLT)) continue; |
144 |
> |
|
145 |
> |
theAnaRpcVsOth.run(muon,l1ObjColl); |
146 |
> |
theAnaEff.run(muon, l1ObjColl); |
147 |
> |
theAnaRpcMisc.run(event,muon,l1ObjColl); |
148 |
|
theAnaDet.run( muon, *detsHitsCompatibleWithMuon, *detsCrossedByMuon, *detsCrossedByMuonDeepInside); |
149 |
< |
theAnaEmu.run ( event, muon, l1RpcCollEmu, l1RpcColl); |
149 |
> |
theAnaEmu.run ( event, muon, l1ObjColl); |
150 |
|
theAnaSynch.run( event, muon, ConverterRPCRawSynchroSynchroCountsObj::toRawSynchro( *counts)); |
151 |
< |
theAnaClu.run( muon, l1RpcColl, *detsHitsCompatibleWithMuon, *nDigisCompDets); |
151 |
> |
theAnaClu.run( event, muon, l1ObjColl, *detsHitsCompatibleWithMuon); |
152 |
> |
theAnaTimingL1.run(event,muon, l1ObjColl); |
153 |
|
|
154 |
|
// theAnaEmu.debug =theAnaDet.debug; |
155 |
|
// std::cout <<"----------"<<std::endl; |
162 |
|
void L1RpcTreeAnalysis::endJob() |
163 |
|
{ |
164 |
|
std::cout <<"ENDJOB, summaries:"<<std::endl; |
165 |
< |
TGraph* hGraph_DetEff =theAnaDet.resume(); |
166 |
< |
TGraph* hGraph_RunEff =theAnaRpcMisc.resume(); |
165 |
> |
TGraph* hGraph_DetEff = theAnaDet.resume(); |
166 |
> |
theAnaRpcMisc.resume(theHistos); |
167 |
> |
TGraph* hGraph_RunClu = theAnaClu.resume(); |
168 |
> |
theAnaTimingL1.resume(theHistos); |
169 |
> |
theAnaMenu.resume(theHistos); |
170 |
|
|
171 |
|
theAnaSynch.endJob(); |
172 |
|
|
174 |
|
TFile f(histoFile.c_str(),"RECREATE"); |
175 |
|
theHistos.Write(); |
176 |
|
hGraph_DetEff->Write("hGraph_DetEff"); |
177 |
< |
hGraph_RunEff->Write("hGraph_RunEff"); |
177 |
> |
hGraph_RunClu->Write("hGraph_RunClu"); |
178 |
|
f.Close(); |
179 |
|
std::cout <<"END"<<std::endl; |
180 |
|
} |