#include <DQM/L1TMonitor/interface/L1TRPCTF.h>
Definition at line 45 of file L1TRPCTF.h.
L1TRPCTF::L1TRPCTF | ( | const edm::ParameterSet & | ps | ) |
Definition at line 21 of file L1TRPCTF.cc.
References GenMuonPlsPt100GeV_cfg::cout, dbe, lat::endl(), edm::ParameterSet::getUntrackedParameter(), NULL, outputFile_, DQMStore::setCurrentFolder(), DQMStore::setVerbose(), and verbose_.
00022 : rpctfSource_( ps.getParameter< InputTag >("rpctfSource") ), 00023 // digiSource_( ps.getParameter< InputTag >("rpctfRPCDigiSource") ), 00024 // m_rpcDigiFine(false), 00025 // m_useRpcDigi(true), 00026 m_ntracks(0) 00027 // m_rpcDigiWithBX0(0), 00028 // m_rpcDigiWithBXnon0(0) 00029 00030 { 00031 00032 // verbosity switch 00033 verbose_ = ps.getUntrackedParameter<bool>("verbose", false); 00034 00035 if(verbose_) cout << "L1TRPCTF: constructor...." << endl; 00036 00037 00038 dbe = NULL; 00039 if ( ps.getUntrackedParameter<bool>("DQMStore", false) ) 00040 { 00041 dbe = Service<DQMStore>().operator->(); 00042 dbe->setVerbose(0); 00043 } 00044 00045 outputFile_ = ps.getUntrackedParameter<string>("outputFile", ""); 00046 if ( outputFile_.size() != 0 ) { 00047 cout << "L1T Monitoring histograms will be saved to " << outputFile_.c_str() << endl; 00048 } 00049 00050 bool disable = ps.getUntrackedParameter<bool>("disableROOToutput", false); 00051 if(disable){ 00052 outputFile_=""; 00053 } 00054 00055 00056 if ( dbe !=NULL ) { 00057 dbe->setCurrentFolder("L1T/L1TRPCTF"); 00058 } 00059 00060 00061 }
L1TRPCTF::~L1TRPCTF | ( | ) | [virtual] |
void L1TRPCTF::analyze | ( | const edm::Event & | e, | |
const edm::EventSetup & | c | |||
) | [protected, virtual] |
Implements edm::EDAnalyzer.
Definition at line 182 of file L1TRPCTF.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), MonitorElement::Fill(), fillNorm(), edm::Event::getByLabel(), L1MuGMTReadoutCollection::getRecords(), edm::Handle< T >::isValid(), edm::InputTag::label(), m_muonsEtaPhi, m_ntracks, m_phipacked, m_qualVsEta, nev_, edm::Handle< T >::product(), rpctfbx, rpctfchargevalue, rpctfetavalue, rpctfntrack, rpctfphivalue, rpctfptvalue, rpctfquality, rpctfSource_, and verbose_.
00183 { 00184 nev_++; 00185 if(verbose_) cout << "L1TRPCTF: analyze...." << endl; 00186 00187 edm::Handle<L1MuGMTReadoutCollection> pCollection; 00188 e.getByLabel(rpctfSource_,pCollection); 00189 00190 if (!pCollection.isValid()) { 00191 edm::LogInfo("DataNotFound") << "can't find L1MuGMTReadoutCollection with label " 00192 << rpctfSource_.label() ; 00193 return; 00194 } 00195 00196 // edm::Handle<RPCDigiCollection> rpcdigis; 00197 00198 // if (m_useRpcDigi){ 00199 // try { 00200 // e.getByLabel(digiSource_, rpcdigis); 00201 // } catch(const edm::Exception& e) { 00202 // //if ( e.categoryCode() != edm::errors::ProductNotFound ) { 00203 // //wrong reason for exception 00204 // // throw; 00205 // //} 00206 // edm::LogInfo("DataNotFound") << "can't find RPCDigiCollection with label "<< digiSource_ << endl; 00207 // m_useRpcDigi = false; 00208 // } 00209 // } 00210 // 00211 // if (m_useRpcDigi){ 00212 // m_rpcDigiFine = !rpcdigis.isValid(); 00213 // } else { 00214 // m_rpcDigiFine = false; 00215 // } 00216 00217 L1MuGMTReadoutCollection const* gmtrc = pCollection.product(); 00218 vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->getRecords(); 00219 vector<L1MuGMTReadoutRecord>::const_iterator RRItr; 00220 00221 static int nrpctftrack;/*, nDTTrack, nCSCTrack;*/ 00222 nrpctftrack = 0; 00223 /* nDTTrack = 0; 00224 nCSCTrack = 0;*/ 00225 // Calculate the number of DT and CSC cands present 00226 // for( RRItr = gmt_records.begin() ; 00227 // RRItr != gmt_records.end() ; 00228 // RRItr++ ) 00229 // { 00230 // // DTs 00231 // vector<L1MuRegionalCand> DTCands = RRItr->getDTBXCands(); 00232 // for( vector<L1MuRegionalCand>::const_iterator 00233 // ECItr = DTCands.begin() ; 00234 // ECItr != DTCands.end() ; 00235 // ++ECItr ) 00236 // { 00237 // if (!ECItr->empty()) { ++nDTTrack; } 00238 // } 00239 // // CSCs 00240 // vector<L1MuRegionalCand> CSCCands = RRItr->getCSCCands(); 00241 // for( vector<L1MuRegionalCand>::const_iterator 00242 // ECItr = CSCCands.begin() ; 00243 // ECItr != CSCCands.end() ; 00244 // ++ECItr ) 00245 // { 00246 // if (!ECItr->empty()) { ++nCSCTrack; } 00247 // } 00248 // 00249 // 00250 // 00251 // } 00252 00253 00254 00255 00256 for( RRItr = gmt_records.begin() ; 00257 RRItr != gmt_records.end() ; 00258 RRItr++ ) 00259 { 00260 00261 if (verbose_) cout << "Readout Record " << RRItr->getBxInEvent() << endl; 00262 00263 vector<vector<L1MuRegionalCand> > brlAndFwdCands; 00264 brlAndFwdCands.push_back(RRItr->getBrlRPCCands()); 00265 brlAndFwdCands.push_back(RRItr->getFwdRPCCands()); 00266 00267 //if (verbose_) cout << "RPCTFCands " << RPCTFCands.size() << endl; 00268 00269 vector<vector<L1MuRegionalCand> >::iterator RPCTFCands = brlAndFwdCands.begin(); 00270 for(; RPCTFCands!= brlAndFwdCands.end(); ++RPCTFCands) 00271 { 00272 for( vector<L1MuRegionalCand>::const_iterator 00273 ECItr = RPCTFCands->begin() ; 00274 ECItr != RPCTFCands->end() ; 00275 ++ECItr ) 00276 { 00277 00278 int bxindex = ECItr->bx() + 1; 00279 00280 if (!ECItr->empty()) { 00281 00282 nrpctftrack++; 00283 00284 if (verbose_) cout << "RPCTFCand bx " << ECItr->bx() << endl; 00285 rpctfbx->Fill(ECItr->bx()); 00286 00287 rpctfetavalue[bxindex]->Fill(ECItr->etaValue()); 00288 if (verbose_) cout << "\tRPCTFCand eta value " << ECItr->etaValue() << endl; 00289 00290 rpctfphivalue[bxindex]->Fill(ECItr->phiValue()); 00291 if (verbose_) cout << "\tRPCTFCand phi value " << ECItr->phiValue() << endl; 00292 00293 rpctfptvalue[bxindex]->Fill(ECItr->ptValue()); 00294 if (verbose_) cout << "\tRPCTFCand pt value " << ECItr->ptValue()<< endl; 00295 00296 rpctfchargevalue[bxindex]->Fill(ECItr->chargeValue()); 00297 if (verbose_) cout << "\tRPCTFCand charge value " << ECItr->chargeValue() << endl; 00298 00299 rpctfquality[bxindex]->Fill(ECItr->quality()); 00300 if (verbose_) cout << "\tRPCTFCand quality " << ECItr->quality() << endl; 00301 00302 00303 int tower = ECItr->eta_packed(); 00304 if (tower > 16) { 00305 tower = - ( (~tower & 63) + 1); 00306 } 00307 00308 //m_muonsEtaPhi->Fill(ECItr->etaValue(), ECItr->phi_packed()); 00309 //m_qualVsEta->Fill(ECItr->etaValue(), ECItr->quality()); 00310 m_qualVsEta->Fill(tower, ECItr->quality()); 00311 m_muonsEtaPhi->Fill(tower, ECItr->phi_packed()); 00312 m_phipacked->Fill(ECItr->phi_packed()); 00313 00314 } // if !empty 00315 } // end candidates iteration 00316 } // end brl/endcap iteration 00317 } // end GMT records iteration 00318 00319 rpctfntrack->Fill(nrpctftrack); 00320 00321 m_ntracks += nrpctftrack; 00322 00323 00324 // if (m_rpcDigiFine) { // do we have valid digis? 00325 // 00326 // ++nevRPC_; 00327 // RPCDigiCollection::DigiRangeIterator collectionItr; 00328 // for(collectionItr=rpcdigis->begin(); collectionItr!=rpcdigis->end(); ++collectionItr){ 00329 // 00330 // //RPCDetId detId=(*collectionItr ).first; 00331 // 00332 // RPCDigiCollection::const_iterator digiItr; 00333 // for (digiItr = ((*collectionItr ).second).first; 00334 // digiItr!=((*collectionItr).second).second; ++digiItr){ 00335 // 00336 // int bx=(*digiItr).bx(); 00337 // 00338 // m_digiBx->Fill(bx); 00339 // m_digiBxLast->Fill(bx); 00340 // 00341 // if ( nrpctftrack != 0 && nDTTrack == 0 && nCSCTrack == 0){ 00342 // m_digiBxRPC->Fill(bx); 00343 // 00344 // m_bxs.insert(bx); 00345 // if (bx == 0) { 00346 // ++m_rpcDigiWithBX0; 00347 // } else { 00348 // ++m_rpcDigiWithBXnon0; 00349 // } 00350 // } 00351 // 00352 // 00353 // if ( nrpctftrack == 0 && nDTTrack != 0 && nCSCTrack == 0){ 00354 // m_digiBxDT->Fill(bx); 00355 // } 00356 // if ( nrpctftrack == 0 && nDTTrack == 0 && nCSCTrack != 0){ 00357 // m_digiBxCSC->Fill(bx); 00358 // } 00359 // 00360 // } 00361 // 00362 // 00363 // } 00364 // 00365 // 00366 // 00367 // 00368 // } 00369 // if (nevRPC_%3000 == 0) { 00370 // std::cout.flush(); 00371 // m_digiBxLast->Reset(); 00372 // } 00373 00374 00375 if (nev_%1000 == 0) fillNorm(); 00376 00377 if (verbose_) cout << "\tRPCTFCand ntrack " << nrpctftrack << endl; 00378 00379 }
void L1TRPCTF::beginJob | ( | const edm::EventSetup & | c | ) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 67 of file L1TRPCTF.cc.
References DQMStore::book1D(), DQMStore::book2D(), dbe, m_muonsEtaPhi, m_muonsEtaPhiNorm, m_phipacked, m_phipackednorm, m_qualVsEta, nev_, nevRPC_, DQMStore::rmdir(), rpctfbx, rpctfchargevalue, rpctfetavalue, rpctfntrack, rpctfphivalue, rpctfptvalue, rpctfquality, and DQMStore::setCurrentFolder().
00068 { 00069 00070 nev_ = 0; 00071 nevRPC_ = 0; 00072 00073 // get hold of back-end interface 00074 DQMStore* dbe = 0; 00075 dbe = Service<DQMStore>().operator->(); 00076 00077 if ( dbe ) { 00078 dbe->setCurrentFolder("L1T/L1TRPCTF"); 00079 dbe->rmdir("L1T/L1TRPCTF"); 00080 } 00081 00082 00083 if ( dbe ) 00084 { 00085 dbe->setCurrentFolder("L1T/L1TRPCTF"); 00086 00087 rpctfetavalue[1] = dbe->book1D("RPCTF_eta_value", 00088 "RPCTF eta value", 100, -2.5, 2.5 ) ; 00089 rpctfetavalue[2] = dbe->book1D("RPCTF_eta_value_+1", 00090 "RPCTF eta value bx +1", 100, -2.5, 2.5 ) ; 00091 rpctfetavalue[0] = dbe->book1D("RPCTF_eta_value_-1", 00092 "RPCTF eta value bx -1", 100, -2.5, 2.5 ) ; 00093 rpctfphivalue[1] = dbe->book1D("RPCTF_phi_value", 00094 "RPCTF phi value", 144, 0.0, 6.2832 ) ; 00095 rpctfphivalue[2] = dbe->book1D("RPCTF_phi_value_+1", 00096 "RPCTF phi value bx +1", 144, 0.0, 6.2832 ) ; 00097 rpctfphivalue[0] = dbe->book1D("RPCTF_phi_value_-1", 00098 "RPCTF phi value bx -1", 144, 0.0, 6.2832 ) ; 00099 rpctfptvalue[1] = dbe->book1D("RPCTF_pt_value", 00100 "RPCTF pt value", 160, -0.5, 159.5 ) ; 00101 rpctfptvalue[2] = dbe->book1D("RPCTF_pt_value_+1", 00102 "RPCTF pt value bx +1", 160, -0.5, 159.5 ) ; 00103 rpctfptvalue[0] = dbe->book1D("RPCTF_pt_value_-1", 00104 "RPCTF pt value bx -1", 160, -0.5, 159.5 ) ; 00105 rpctfchargevalue[1] = dbe->book1D("RPCTF_charge_value", 00106 "RPCTF charge value", 3, -1.5, 1.5 ) ; 00107 rpctfchargevalue[2] = dbe->book1D("RPCTF_charge_value_+1", 00108 "RPCTF charge value bx +1", 3, -1.5, 1.5 ) ; 00109 rpctfchargevalue[0] = dbe->book1D("RPCTF_charge_value_-1", 00110 "RPCTF charge value bx -1", 3, -1.5, 1.5 ) ; 00111 00112 rpctfquality[1] = dbe->book1D("RPCTF_quality", 00113 "RPCTF quality", 6, -0.5, 5.5 ) ; 00114 rpctfquality[2] = dbe->book1D("RPCTF_quality_+1", 00115 "RPCTF quality bx +1", 6, -0.5, 5.5 ) ; 00116 rpctfquality[0] = dbe->book1D("RPCTF_quality_-1", 00117 "RPCTF quality bx -1", 6, -0.5, 5.5 ) ; 00118 00119 rpctfntrack = dbe->book1D("RPCTF_ntrack", 00120 "RPCTF ntrack", 20, -0.5, 19.5 ) ; 00121 rpctfbx = dbe->book1D("RPCTF_bx", 00122 "RPCTF bx", 3, -1.5, 1.5 ) ; 00123 00124 // m_digiBx = dbe->book1D("RPCDigi_bx", 00125 // "RPC digis bx", 9, -4.5, 4.5 ) ; 00126 00127 // m_digiBxRPC = dbe->book1D("RPCDigiRPC_bx", 00128 // "RPC digis bx - events with RPC mu only", 9, -4.5, 4.5 ) ; 00129 // 00130 // m_digiBxDT = dbe->book1D("RPCDigiDT_bx", 00131 // "RPC digis bx - events with DT mu only", 9, -4.5, 4.5 ) ; 00132 // 00133 // m_digiBxCSC = dbe->book1D("RPCDigiCSC_bx", 00134 // "RPC digis bx - events with CSC mu only", 9, -4.5, 4.5 ) ; 00135 00136 // m_digiBxLast = dbe->book1D("RPCDigi_bx_last", 00137 // "RPC digis bx (last X events)", 9, -4.5, 4.5 ) ; 00138 00139 m_qualVsEta = dbe->book2D("RPCTF_quality_vs_tower", 00140 "RPCTF quality vs eta", 00141 //100, -2.5, 2.5, 00142 33, -16.5, 16.5, 00143 6, -0.5, 5.5); // Currently only 0...3 quals are possible 00144 00145 m_muonsEtaPhi = dbe->book2D("RPCTF_muons_tower_phipacked", 00146 "RPCTF muons(tower,phi)", 00147 // 100, -2.5, 2.5, 00148 33, -16.5, 16.5, 00149 144, -0.5, 143.5); 00150 00151 m_muonsEtaPhiNorm = dbe->book2D("RPCTF_muons_tower_phipacked_norm", 00152 "RPCTF muons(tower,phi) normalized", 00153 // 100, -2.5, 2.5, 00154 33, -16.5, 16.5, 00155 144, -0.5, 143.5); 00156 00157 00158 m_phipacked = dbe->book1D("RPCTF_phi_valuepacked", 00159 "RPCTF phi valuepacked", 144, -0.5, 143.5 ) ; 00160 00161 m_phipackednorm = dbe->book1D("RPCTF_phi_valuepacked_norm", 00162 "RPCTF phi valuepacked", 144, -0.5, 143.5 ) ; 00163 00164 //m_floatSynchro = dbe->bookFloat("RPCTF_bx0vsOther"); // no qtests for float 00165 // m_floatSynchro = dbe->book1D("RPCTF_synchronization", "RPCTF synchronization", 3, -1.5, 1.5 ); 00166 00167 } 00168 }
void L1TRPCTF::beginLuminosityBlock | ( | const edm::LuminosityBlock & | lumiSeg, | |
const edm::EventSetup & | context | |||
) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 382 of file L1TRPCTF.cc.
References m_ntracks.
00384 { 00385 m_ntracks = 0; 00386 // m_rpcDigiWithBX0=0; 00387 // m_rpcDigiWithBXnon0=0; 00388 // m_bxs.clear(); 00389 // m_useRpcDigi = true; 00390 00391 00392 }
Reimplemented from edm::EDAnalyzer.
Definition at line 171 of file L1TRPCTF.cc.
References GenMuonPlsPt100GeV_cfg::cout, dbe, lat::endl(), nev_, outputFile_, DQMStore::save(), and verbose_.
00172 { 00173 if(verbose_) cout << "L1TRPCTF: end job...." << endl; 00174 LogInfo("EndJob") << "analyzed " << nev_ << " events"; 00175 00176 if ( outputFile_.size() != 0 && dbe ) dbe->save(outputFile_); 00177 00178 return; 00179 00180 }
void L1TRPCTF::endLuminosityBlock | ( | const edm::LuminosityBlock & | lumiSeg, | |
const edm::EventSetup & | c | |||
) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 395 of file L1TRPCTF.cc.
References fillNorm().
00397 { 00398 fillNorm(); 00399 00400 }
void L1TRPCTF::fillNorm | ( | ) | [private] |
Definition at line 404 of file L1TRPCTF.cc.
References MonitorElement::getBinContent(), MonitorElement::getNbinsX(), MonitorElement::getNbinsY(), m_muonsEtaPhi, m_muonsEtaPhiNorm, m_ntracks, m_phipacked, m_phipackednorm, and MonitorElement::setBinContent().
Referenced by analyze(), and endLuminosityBlock().
00405 { 00406 00407 float ntracks = m_ntracks; 00408 // todo check if m_phipackednorm and RPCTF_phi_valuepacked have same number of bins 00409 if (ntracks > 0.5) { 00410 for (int bin = 0; bin <= m_phipackednorm->getNbinsX(); ++bin) { 00411 m_phipackednorm->setBinContent(bin, m_phipacked->getBinContent(bin)/ntracks); 00412 } 00413 00414 for (int binX = 0; binX <= m_muonsEtaPhi->getNbinsX(); ++binX) { 00415 for (int binY = 0; binY <= m_muonsEtaPhi->getNbinsY(); ++binY) { 00416 m_muonsEtaPhiNorm->setBinContent(binX, binY, m_muonsEtaPhi->getBinContent(binX, binY)/ntracks); 00417 } 00418 } 00419 00420 } 00421 00422 // int nBX = m_bxs.size(); 00423 // float fs = 0; 00424 // if (nBX > 1 && m_rpcDigiWithBX0 != 0){ 00425 // fs = (float)m_rpcDigiWithBXnon0/(nBX-1)/m_rpcDigiWithBX0; 00426 // } 00427 00428 // m_floatSynchro->setBinContent(2,fs); 00429 00430 }
DQMStore* L1TRPCTF::dbe [private] |
fills normalized histograms
Definition at line 76 of file L1TRPCTF.h.
Referenced by beginJob(), endJob(), and L1TRPCTF().
ofstream L1TRPCTF::logFile_ [private] |
Definition at line 112 of file L1TRPCTF.h.
MonitorElement* L1TRPCTF::m_muonsEtaPhi [private] |
MonitorElement* L1TRPCTF::m_muonsEtaPhiNorm [private] |
unsigned long L1TRPCTF::m_ntracks [private] |
Definition at line 110 of file L1TRPCTF.h.
Referenced by analyze(), beginLuminosityBlock(), and fillNorm().
MonitorElement* L1TRPCTF::m_phipacked [private] |
MonitorElement* L1TRPCTF::m_phipackednorm [private] |
MonitorElement* L1TRPCTF::m_qualVsEta [private] |
bool L1TRPCTF::monitorDaemon_ [private] |
Definition at line 106 of file L1TRPCTF.h.
int L1TRPCTF::nev_ [private] |
int L1TRPCTF::nevRPC_ [private] |
std::string L1TRPCTF::outputFile_ [private] |
MonitorElement* L1TRPCTF::rpctfbx [private] |
MonitorElement* L1TRPCTF::rpctfchargevalue[3] [private] |
MonitorElement* L1TRPCTF::rpctfetavalue[3] [private] |
MonitorElement* L1TRPCTF::rpctfntrack [private] |
MonitorElement* L1TRPCTF::rpctfphivalue[3] [private] |
MonitorElement* L1TRPCTF::rpctfptvalue[3] [private] |
MonitorElement* L1TRPCTF::rpctfquality[3] [private] |
edm::InputTag L1TRPCTF::rpctfSource_ [private] |
bool L1TRPCTF::verbose_ [private] |