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.5 by konec, Tue Oct 23 11:12:48 2012 UTC vs.
Revision 1.11 by konec, Tue Dec 11 12:49:33 2012 UTC

# Line 20 | Line 20
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 +    theAnaTimingL1 (cfg.getParameter<edm::ParameterSet>("anaTimingL1") ),
32 +    theAnaMenu(cfg.getParameter<edm::ParameterSet>("anaMenu") )
33 + { }
34  
35   void L1RpcTreeAnalysis::beginJob()
36   {
# Line 38 | Line 45 | void L1RpcTreeAnalysis::beginJob()
45    theAnaSynch.init(theHistos);
46    theAnaClu.init(theHistos);
47    theAnaTimingL1.init(theHistos);
48 <
48 >  theAnaMenu.init(theHistos);
49   }
50  
51   void L1RpcTreeAnalysis::beginRun(const edm::Run& ru, const edm::EventSetup& es)
# Line 72 | Line 79 | void L1RpcTreeAnalysis::analyze(const ed
79    std::vector<SynchroCountsObj> *counts= 0;
80    std::vector<uint32_t> *detsCrossedByMuon = 0;
81    std::vector<uint32_t> *detsCrossedByMuonDeepInside = 0;
82 <  std::vector<uint32_t> *detsHitsCompatibleWithMuon = 0;
82 >  std::vector<DetCluDigiObj> *detsHitsCompatibleWithMuon = 0;
83    std::vector<uint32_t> *detsSIMU = 0;
77  std::vector<uint32_t> *nDigisCompDets = 0;
78  std::vector<uint32_t> *clSizeCompDets = 0;
84  
85    EventObj * event = 0;
86    MuonObj * muon = 0;
# Line 88 | Line 93 | void L1RpcTreeAnalysis::analyze(const ed
93    TBranch *bdetsCrossedByMuonDeepInside =0;
94    TBranch *bdetsHitsCompatibleWithMuon = 0;
95    TBranch *bdetsSIMU =0;
91  TBranch *bnDigisCompDets =0;
92  TBranch *bclSizeCompDets =0;
96  
97 <  L1ObjColl* l1RpcColl = 0;
95 <  L1ObjColl* l1OtherColl = 0;
96 <  L1ObjColl* l1RpcCollEmu = 0;
97 >  L1ObjColl* l1ObjColl = 0;
98  
99    chain.SetBranchAddress("event",&event);
100    chain.SetBranchAddress("muon",&muon);
# Line 106 | Line 107 | void L1RpcTreeAnalysis::analyze(const ed
107    chain.SetBranchAddress("detsCrossedByMuonDeepInside",&detsCrossedByMuonDeepInside,&bdetsCrossedByMuonDeepInside);
108    chain.SetBranchAddress("detsHitsCompatibleWithMuon",&detsHitsCompatibleWithMuon,&bdetsHitsCompatibleWithMuon);
109    chain.SetBranchAddress("detsSIMU",&detsSIMU,&bdetsSIMU);
109  chain.SetBranchAddress("nDigisCompDets",&nDigisCompDets, &bnDigisCompDets);
110  chain.SetBranchAddress("clSizeCompDets",&clSizeCompDets, &bclSizeCompDets);
110  
111 <  chain.SetBranchAddress("l1RpcColl",&l1RpcColl);
113 <  chain.SetBranchAddress("l1OtherColl",&l1OtherColl);
114 <  chain.SetBranchAddress("l1RpcCollEmu",&l1RpcCollEmu);
111 >  chain.SetBranchAddress("l1ObjColl",&l1ObjColl);
112  
113  
114    //
# Line 121 | Line 118 | void L1RpcTreeAnalysis::analyze(const ed
118    std::cout <<" ENTRIES: " << nentries << std::endl;
119  
120  
121 +  std::vector<unsigned int> skipRuns = theConfig.getParameter<std::vector<unsigned int> >("skipRuns");
122    //
123    // main loop
124    //
125    unsigned int lastRun = 0;
126    for (int ev=0; ev<nentries; ev++) {
127      chain.GetEntry(ev);
128 +    theAnaMenu.updateMenu(bitsL1->names, bitsHLT->names);
129  
130 +    bool skip = ( find( skipRuns.begin(), skipRuns.end(), (*event).run) !=  skipRuns.end());
131      if (lastRun != (*event).run) {
132        lastRun = (*event).run;
133        std::cout <<"RUN:"    << std::setw(7) << (*event).run
134                  <<" event:" << std::setw(8) << ev
135 <                <<" done:"  << std::setw(6)<< std::setiosflags(std::ios::fixed) << std::setprecision(2) << ev*100./nentries<<"%"<<std::endl;
135 >                <<" done:"  << std::setw(6)<< std::setiosflags(std::ios::fixed) << std::setprecision(2) << ev*100./nentries<<"%";
136 >      if (skip) std::cout <<"---SKIP";
137 >      std::cout<<std::endl;
138      }
139 +    if (skip) continue;
140  
141 < //    if (ev > 10) break;
139 <
141 > //    if (ev != 417157) continue;
142   //    if (event->run != 178854) continue;
143 + //    std::cout <<"event: "<<ev<<" CMSSW ev: "<<(*event).id << std::endl;
144   //    if (lastLumi != (*event).lumi) { lastLumi = (*event).lumi; std::cout <<"lumi: " << (*event).lumi<<std::endl; }
142 //   theAnaDet.debug = false;
145   //    if ((*event).id==60422922)theAnaRpcMisc.debug = true;
146  
147 <   std::cout <<" Number of bits L1: " <<  bitsL1->names.size()<<"/"<<bitsL1->firedAlgos.size()
148 <                           <<" HLT: "<< bitsHLT->names.size()<<"/"<<bitsHLT->firedAlgos.size()<<std::endl;
149 <
150 <   theAnaMuonDistribution.run(muon);
151 <   theAnaRpcVsOth.run(muon,l1RpcColl,l1OtherColl);
152 <   theAnaEff.run(muon,l1RpcColl,l1OtherColl);
153 <   theAnaRpcMisc.run(event,muon,l1RpcColl,l1OtherColl);
154 <   theAnaDet.run( muon, *detsHitsCompatibleWithMuon,  *detsCrossedByMuon, *detsCrossedByMuonDeepInside);
155 <   theAnaEmu.run ( event, muon, l1RpcCollEmu, l1RpcColl);
156 <   theAnaSynch.run( event, muon, ConverterRPCRawSynchroSynchroCountsObj::toRawSynchro( *counts));
157 <   theAnaClu.run( event, muon, l1RpcColl, *detsHitsCompatibleWithMuon, *nDigisCompDets, *clSizeCompDets);
158 <   theAnaTimingL1.run(event,muon,l1RpcColl,l1OtherColl);
147 >   // ANALYSE AND FILTER KINEMCTICS
148 >   if ( !theAnaMuonDistribution.filter(muon) && theConfig.getParameter<bool>("filterByAnaMuonDistribution") ) continue;
149 >   // ANALYSE AND FILTER TRIGGER MENU
150 > //   if ( !theAnaMenu.filter(event, muon, bitsL1, bitsHLT) && theConfig.getParameter<bool>("fillterByAnaMenu") ) continue;
151 >
152 > //   theAnaRpcVsOth.run(muon,l1ObjColl);
153 >   theAnaEff.run(muon, l1ObjColl);
154 >   theAnaRpcMisc.run(event,muon,l1ObjColl);
155 > //   theAnaDet.run( muon, *detsHitsCompatibleWithMuon,  *detsCrossedByMuon, *detsCrossedByMuonDeepInside);
156 > //   theAnaEmu.run ( event, muon, l1ObjColl);
157 > //   theAnaSynch.run( event, muon, ConverterRPCRawSynchroSynchroCountsObj::toRawSynchro( *counts));
158 >   theAnaClu.run( event, muon, l1ObjColl, *detsHitsCompatibleWithMuon);
159 > //   theAnaTimingL1.run(event,muon, l1ObjColl);
160  
161   //   theAnaEmu.debug =theAnaDet.debug;
162   //    std::cout <<"----------"<<std::endl;
# Line 170 | Line 173 | void L1RpcTreeAnalysis::endJob()
173    theAnaRpcMisc.resume(theHistos);
174    TGraph* hGraph_RunClu = theAnaClu.resume();
175    theAnaTimingL1.resume(theHistos);
176 +  theAnaMenu.resume(theHistos);
177  
178    theAnaSynch.endJob();
179  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines