ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/L1RpcTriggerAnalysis/plugins/L1RpcTreeAnalysis.cc
(Generate patch)

Comparing UserCode/L1RpcTriggerAnalysis/plugins/L1RpcTreeAnalysis.cc (file contents):
Revision 1.7 by konec, Tue Oct 23 20:17:44 2012 UTC vs.
Revision 1.12 by konec, Sun Dec 16 22:56:15 2012 UTC

# Line 16 | Line 16
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"
# Line 23 | Line 24
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   {
# Line 39 | Line 48 | void L1RpcTreeAnalysis::beginJob()
48    theAnaSynch.init(theHistos);
49    theAnaClu.init(theHistos);
50    theAnaTimingL1.init(theHistos);
51 <
51 >  theAnaEvent.init(theHistos);
52 >  theAnaMenu.init(theHistos);
53   }
54  
55   void L1RpcTreeAnalysis::beginRun(const edm::Run& ru, const edm::EventSetup& es)
# Line 88 | Line 98 | void L1RpcTreeAnalysis::analyze(const ed
98    TBranch *bdetsHitsCompatibleWithMuon = 0;
99    TBranch *bdetsSIMU =0;
100  
101 <  L1ObjColl* l1RpcColl = 0;
92 <  L1ObjColl* l1OtherColl = 0;
93 <  L1ObjColl* l1RpcCollEmu = 0;
94 <  L1ObjColl* l1GmtColl = 0;
101 >  L1ObjColl* l1ObjColl = 0;
102  
103    chain.SetBranchAddress("event",&event);
104    chain.SetBranchAddress("muon",&muon);
# Line 105 | Line 112 | void L1RpcTreeAnalysis::analyze(const ed
112    chain.SetBranchAddress("detsHitsCompatibleWithMuon",&detsHitsCompatibleWithMuon,&bdetsHitsCompatibleWithMuon);
113    chain.SetBranchAddress("detsSIMU",&detsSIMU,&bdetsSIMU);
114  
115 <  chain.SetBranchAddress("l1RpcColl",&l1RpcColl);
109 <  chain.SetBranchAddress("l1OtherColl",&l1OtherColl);
110 <  chain.SetBranchAddress("l1RpcCollEmu",&l1RpcCollEmu);
111 <  chain.SetBranchAddress("l1GmtColl",&l1GmtColl);
115 >  chain.SetBranchAddress("l1ObjColl",&l1ObjColl);
116  
117  
118    //
# Line 124 | Line 128 | void L1RpcTreeAnalysis::analyze(const ed
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        lastRun = (*event).run;
135        std::cout <<"RUN:"    << std::setw(7) << (*event).run
136                  <<" event:" << std::setw(8) << ev
137 <                <<" done:"  << std::setw(6)<< std::setiosflags(std::ios::fixed) << std::setprecision(2) << ev*100./nentries<<"%"<<std::endl;
137 >                <<" done:"  << std::setw(6)<< std::setiosflags(std::ios::fixed) << std::setprecision(2) << ev*100./nentries<<"%";
138 >      std::cout<<std::endl;
139      }
140  
135 //    if (ev > 10) break;
141  
142 < //    if (event->run != 178854) continue;
143 < //    if (lastLumi != (*event).lumi) { lastLumi = (*event).lumi; std::cout <<"lumi: " << (*event).lumi<<std::endl; }
144 < //   theAnaDet.debug = false;
145 < //    if ((*event).id==60422922)theAnaRpcMisc.debug = true;
146 <
147 <   static std::vector<std::string>   namesL1;
148 <   if (bitsL1->names.size() != 0)    namesL1=bitsL1->names;
144 <   static std::vector<std::string>   namesHLT;
145 <   if (bitsHLT->names.size() != 0)   namesHLT=bitsHLT->names;
146 <   const std::vector<unsigned int> & algosL1 = bitsL1->firedAlgos;
147 <   const std::vector<unsigned int> & algosHLT = bitsHLT->firedAlgos;
142 >   // EVENT NUMBER, BX structure etc.
143 >   EventObjBXExtra eventBx(*event);
144 >   if ( !theAnaEvent.filter(&eventBx) && theConfig.getParameter<bool>("filterByAnaEvent") ) continue;
145 >   // ANALYSE AND FILTER KINEMCTICS
146 >   if ( !theAnaMuonDistribution.filter(muon) && theConfig.getParameter<bool>("filterByAnaMuonDistribution") ) continue;
147 >   // ANALYSE AND FILTER TRIGGER MENU
148 >   if ( !theAnaMenu.filter(event, muon, bitsL1, bitsHLT) && theConfig.getParameter<bool>("filterByAnaMenu") ) continue;
149  
150   /*
151 <   std::cout <<" Number of bits L1: " <<  bitsL1->names.size()<<"/"<<namesL1.size()<<"/"<<bitsL1->firedAlgos.size()
152 <                           <<" HLT: "<< bitsHLT->names.size()<<"/"<<namesHLT.size()<<"/"<<bitsHLT->firedAlgos.size()<<std::endl;
153 <   std::cout <<"----------------------- L1: "<<std::endl;
154 <   for (std::vector<unsigned int>::const_iterator it=algosL1.begin(); it< algosL1.end(); ++it) std::cout <<"L1 idx: "<<*it<<" "<<namesL1[*it]<< std::endl;
155 <   std::cout <<"----------------------- HLT: "<<std::endl;
156 <   for (std::vector<unsigned int>::const_iterator it=algosHLT.begin(); it< algosHLT.end(); ++it) std::cout<<" HLT idx: "<<*it<<" "<<namesHLT[*it]<< std::endl;
151 > //   theAnaRpcVsOth.run(muon,l1ObjColl);
152 > //   theAnaEff.run(muon, l1ObjColl);
153 > //   theAnaRpcMisc.run(event,muon,l1ObjColl);
154 > //   theAnaDet.run( muon, *detsHitsCompatibleWithMuon,  *detsCrossedByMuon, *detsCrossedByMuonDeepInside);
155 > //   theAnaEmu.run ( event, muon, l1ObjColl);
156 > //   theAnaSynch.run( event, muon, ConverterRPCRawSynchroSynchroCountsObj::toRawSynchro( *counts));
157 > //   theAnaClu.run( event, muon, l1ObjColl, *detsHitsCompatibleWithMuon);
158   */
159 +   theAnaTimingL1.run( &eventBx, muon, l1ObjColl);
160  
158   theAnaMuonDistribution.run(muon);
159   theAnaRpcVsOth.run(muon,l1RpcColl,l1OtherColl);
160   theAnaEff.run(muon,l1RpcColl,l1OtherColl);
161   theAnaRpcMisc.run(event,muon,l1RpcColl,l1OtherColl);
162   theAnaDet.run( muon, *detsHitsCompatibleWithMuon,  *detsCrossedByMuon, *detsCrossedByMuonDeepInside);
163   theAnaEmu.run ( event, muon, l1RpcCollEmu, l1RpcColl);
164   theAnaSynch.run( event, muon, ConverterRPCRawSynchroSynchroCountsObj::toRawSynchro( *counts));
165   theAnaClu.run( event, muon, l1RpcColl, *detsHitsCompatibleWithMuon);
166   theAnaTimingL1.run(event,muon,l1RpcColl,l1OtherColl);
167
168 /*
169   std::cout <<"----------------"<<std::endl;
170   std::cout <<"GmtColl:"<<std::endl; l1GmtColl->print();
171   std::cout <<"RpcColl:"<<std::endl; l1RpcColl->print();
172   std::cout <<"OtherColl:"<<std::endl; l1OtherColl->print();
173 */
174 //   theAnaEmu.debug =theAnaDet.debug;
175 //    std::cout <<"----------"<<std::endl;
176 //   theAnaDet.debug =theAnaEmu.debug;
177 //    if (anaDet.debug) std::cout <<" Event: "<<(*event).id <<" Lumi: "<<(*event).lumi<< std::endl;
178  
161    }
162   }
163  
# Line 186 | Line 168 | void L1RpcTreeAnalysis::endJob()
168    theAnaRpcMisc.resume(theHistos);
169    TGraph* hGraph_RunClu = theAnaClu.resume();
170    theAnaTimingL1.resume(theHistos);
171 +  theAnaMenu.resume(theHistos);
172 +  theAnaEvent.resume(theHistos);
173  
174    theAnaSynch.endJob();
175  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines