#include <L1TLTC.h>
Public Member Functions | |
L1TLTC (const edm::ParameterSet &ps) | |
virtual | ~L1TLTC () |
Protected Member Functions | |
void | analyze (const edm::Event &e, const edm::EventSetup &c) |
void | beginJob (void) |
void | endJob (void) |
Private Attributes | |
DQMStore * | dbe |
MonitorElement * | event |
MonitorElement * | gps_time |
MonitorElement * | h1 |
MonitorElement * | h2 |
MonitorElement * | h3 |
ofstream | logFile_ |
edm::InputTag | ltcSource_ |
bool | monitorDaemon_ |
MonitorElement * | n_inhibit |
int | nev_ |
std::string | outputFile_ |
MonitorElement * | overlaps |
MonitorElement * | run |
bool | verbose_ |
float | XMAX |
float | XMIN |
L1TLTC::L1TLTC | ( | const edm::ParameterSet & | ps | ) |
Definition at line 16 of file L1TLTC.cc.
References gather_cfg::cout, edm::ParameterSet::getUntrackedParameter(), NULL, and cmsCodeRules::cppFunctionSkipper::operator.
{ // verbosity switch verbose_ = ps.getUntrackedParameter<bool>("verbose", false); if(verbose_) cout << "L1TLTC: constructor...." << endl; dbe = NULL; if ( ps.getUntrackedParameter<bool>("DQMStore", false) ) { dbe = Service<DQMStore>().operator->(); dbe->setVerbose(0); } outputFile_ = ps.getUntrackedParameter<string>("outputFile", ""); if ( outputFile_.size() != 0 ) { cout << "L1T Monitoring histograms will be saved to " << outputFile_.c_str() << endl; } bool disable = ps.getUntrackedParameter<bool>("disableROOToutput", false); if(disable){ outputFile_=""; } if ( dbe !=NULL ) { dbe->setCurrentFolder("L1T/L1TLTC"); } }
void L1TLTC::analyze | ( | const edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [protected, virtual] |
Implements edm::EDAnalyzer.
Definition at line 97 of file L1TLTC.cc.
References gather_cfg::cout, edm::Event::getByType(), i, edm::HandleBase::isValid(), j, analyzePatCleaning_cfg::overlaps, and CrabTask::run.
{ nev_++; if(verbose_) cout << "L1TLTC: analyze...." << endl; Handle< LTCDigiCollection > digis ; e.getByType(digis); if (!digis.isValid()) { edm::LogInfo("DataNotFound") << "can't find LTCDigiCollection "; return; } for( LTCDigiCollection::const_iterator digiItr = digis->begin() ; digiItr != digis->end() ; ++digiItr ) { h1->Fill( digiItr->bunchNumber() ) ; h2->Fill( digiItr->orbitNumber() ) ; for( int i = 0 ; i < 6 ; ++i ) { h3->Fill( i, ( digiItr->HasTriggered( i ) ? 1 : 0 ) ) ; } h3->Fill( 6, digiItr->ramTrigger() ) ; h3->Fill( 7, digiItr->vmeTrigger() ) ; // overlaps unsigned int setbits = digiItr->externTriggerMask(); // mock up the VME and RAM triggers if ( digiItr->ramTrigger() ) { setbits |= (0x1UL<<7); } if ( digiItr->vmeTrigger() ) { setbits |= (0x1UL<<8); } for ( int i = 0; i < 8; ++i ) { if ( setbits & (0x1UL<<i) ) { for ( int j = i; j < 8; ++j ) { if ( setbits & (0x1UL<<j) ) { overlaps->Fill(i,j); // do both.... overlaps->Fill(j,i); } } } } // fill floats and ints n_inhibit->Fill(digiItr->triggerInhibitNumber()); run ->Fill(digiItr->runNumber()); event ->Fill(digiItr->eventNumber()); gps_time ->Fill(digiItr->bstGpsTime()); } }
void L1TLTC::beginJob | ( | void | ) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 54 of file L1TLTC.cc.
References DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookInt(), cmsCodeRules::cppFunctionSkipper::operator, analyzePatCleaning_cfg::overlaps, DQMStore::rmdir(), CrabTask::run, and DQMStore::setCurrentFolder().
{ nev_ = 0; // get hold of back-end interface DQMStore* dbe = 0; dbe = Service<DQMStore>().operator->(); if ( dbe ) { dbe->setCurrentFolder("L1T/L1TLTC"); dbe->rmdir("L1T/L1TLTC"); } if ( dbe ) { dbe->setCurrentFolder("L1T/L1TLTC"); h1 = dbe->book1D("Bunch", "Bunch Number", 100, -0.5, 5000.) ; h2 = dbe->book1D("Orbit", "Orbit Number", 100, -0.5, 100000. ) ; h3 = dbe->book1D("Triggers", "Triggers", 8, -0.5, 7.5 ) ; overlaps = dbe->book2D("olaps", "Trigger Overlaps", 8, -0.5, 7.5 , 8, -0.5, 7.5); n_inhibit = dbe->bookInt("n_inhibit"); run = dbe->bookInt("run"); event = dbe->bookInt("event"); gps_time = dbe->bookInt("gps_time"); } }
void L1TLTC::endJob | ( | void | ) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 87 of file L1TLTC.cc.
References gather_cfg::cout.
{ if(verbose_) cout << "L1TLTC: end job...." << endl; LogInfo("EndJob") << "analyzed " << nev_ << " events"; if ( outputFile_.size() != 0 && dbe ) dbe->save(outputFile_); return; }
DQMStore* L1TLTC::dbe [private] |
MonitorElement* L1TLTC::event [private] |
MonitorElement* L1TLTC::gps_time [private] |
MonitorElement* L1TLTC::h1 [private] |
MonitorElement* L1TLTC::h2 [private] |
MonitorElement* L1TLTC::h3 [private] |
ofstream L1TLTC::logFile_ [private] |
edm::InputTag L1TLTC::ltcSource_ [private] |
bool L1TLTC::monitorDaemon_ [private] |
MonitorElement* L1TLTC::n_inhibit [private] |
int L1TLTC::nev_ [private] |
std::string L1TLTC::outputFile_ [private] |
MonitorElement* L1TLTC::overlaps [private] |
MonitorElement* L1TLTC::run [private] |
bool L1TLTC::verbose_ [private] |
float L1TLTC::XMAX [private] |
float L1TLTC::XMIN [private] |