#include <DQM/L1TMonitor/interface/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 (const edm::EventSetup &c) |
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 |
Definition at line 41 of file L1TLTC.h.
L1TLTC::L1TLTC | ( | const edm::ParameterSet & | ps | ) |
Definition at line 16 of file L1TLTC.cc.
References GenMuonPlsPt100GeV_cfg::cout, dbe, lat::endl(), edm::ParameterSet::getUntrackedParameter(), NULL, outputFile_, DQMStore::setCurrentFolder(), DQMStore::setVerbose(), and verbose_.
00017 { 00018 00019 // verbosity switch 00020 verbose_ = ps.getUntrackedParameter<bool>("verbose", false); 00021 00022 if(verbose_) cout << "L1TLTC: constructor...." << endl; 00023 00024 00025 dbe = NULL; 00026 if ( ps.getUntrackedParameter<bool>("DQMStore", false) ) 00027 { 00028 dbe = Service<DQMStore>().operator->(); 00029 dbe->setVerbose(0); 00030 } 00031 00032 outputFile_ = ps.getUntrackedParameter<string>("outputFile", ""); 00033 if ( outputFile_.size() != 0 ) { 00034 cout << "L1T Monitoring histograms will be saved to " << outputFile_.c_str() << endl; 00035 } 00036 00037 bool disable = ps.getUntrackedParameter<bool>("disableROOToutput", false); 00038 if(disable){ 00039 outputFile_=""; 00040 } 00041 00042 00043 if ( dbe !=NULL ) { 00044 dbe->setCurrentFolder("L1T/L1TLTC"); 00045 } 00046 00047 00048 }
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 GenMuonPlsPt100GeV_cfg::cout, lat::endl(), MonitorElement::Fill(), edm::Event::getByType(), gps_time, h1, h2, h3, i, edm::Handle< T >::isValid(), j, n_inhibit, nev_, overlaps, run, UL, and verbose_.
00098 { 00099 nev_++; 00100 if(verbose_) cout << "L1TLTC: analyze...." << endl; 00101 Handle< LTCDigiCollection > digis ; 00102 e.getByType(digis); 00103 00104 if (!digis.isValid()) { 00105 edm::LogInfo("DataNotFound") << "can't find LTCDigiCollection "; 00106 return; 00107 } 00108 00109 for( LTCDigiCollection::const_iterator digiItr = digis->begin() ; 00110 digiItr != digis->end() ; 00111 ++digiItr ) 00112 { 00113 h1->Fill( digiItr->bunchNumber() ) ; 00114 h2->Fill( digiItr->orbitNumber() ) ; 00115 00116 for( int i = 0 ; i < 6 ; ++i ) { 00117 h3->Fill( i, ( digiItr->HasTriggered( i ) ? 1 : 0 ) ) ; 00118 } 00119 00120 h3->Fill( 6, digiItr->ramTrigger() ) ; 00121 h3->Fill( 7, digiItr->vmeTrigger() ) ; 00122 // overlaps 00123 unsigned int setbits = digiItr->externTriggerMask(); 00124 // mock up the VME and RAM triggers 00125 if ( digiItr->ramTrigger() ) { 00126 setbits |= (0x1UL<<7); 00127 } 00128 if ( digiItr->vmeTrigger() ) { 00129 setbits |= (0x1UL<<8); 00130 } 00131 for ( int i = 0; i < 8; ++i ) { 00132 if ( setbits & (0x1UL<<i) ) { 00133 for ( int j = i; j < 8; ++j ) { 00134 if ( setbits & (0x1UL<<j) ) { 00135 overlaps->Fill(i,j); // do both.... 00136 overlaps->Fill(j,i); 00137 } 00138 } 00139 } 00140 } 00141 // fill floats and ints 00142 n_inhibit->Fill(digiItr->triggerInhibitNumber()); 00143 run ->Fill(digiItr->runNumber()); 00144 event ->Fill(digiItr->eventNumber()); 00145 gps_time ->Fill(digiItr->bstGpsTime()); 00146 } 00147 00148 }
void L1TLTC::beginJob | ( | const edm::EventSetup & | c | ) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 54 of file L1TLTC.cc.
References DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookInt(), dbe, gps_time, h1, h2, h3, n_inhibit, nev_, overlaps, DQMStore::rmdir(), run, and DQMStore::setCurrentFolder().
00055 { 00056 00057 nev_ = 0; 00058 00059 // get hold of back-end interface 00060 DQMStore* dbe = 0; 00061 dbe = Service<DQMStore>().operator->(); 00062 00063 if ( dbe ) { 00064 dbe->setCurrentFolder("L1T/L1TLTC"); 00065 dbe->rmdir("L1T/L1TLTC"); 00066 } 00067 00068 00069 if ( dbe ) 00070 { 00071 dbe->setCurrentFolder("L1T/L1TLTC"); 00072 h1 = dbe->book1D("Bunch", "Bunch Number", 100, -0.5, 5000.) ; 00073 h2 = dbe->book1D("Orbit", "Orbit Number", 100, -0.5, 100000. ) ; 00074 h3 = dbe->book1D("Triggers", "Triggers", 8, -0.5, 7.5 ) ; 00075 00076 overlaps = dbe->book2D("olaps", "Trigger Overlaps", 8, -0.5, 7.5 , 00077 8, -0.5, 7.5); 00078 00079 n_inhibit = dbe->bookInt("n_inhibit"); 00080 run = dbe->bookInt("run"); 00081 event = dbe->bookInt("event"); 00082 gps_time = dbe->bookInt("gps_time"); 00083 } 00084 }
Reimplemented from edm::EDAnalyzer.
Definition at line 87 of file L1TLTC.cc.
References GenMuonPlsPt100GeV_cfg::cout, dbe, lat::endl(), nev_, outputFile_, DQMStore::save(), and verbose_.
00088 { 00089 if(verbose_) cout << "L1TLTC: end job...." << endl; 00090 LogInfo("EndJob") << "analyzed " << nev_ << " events"; 00091 00092 if ( outputFile_.size() != 0 && dbe ) dbe->save(outputFile_); 00093 00094 return; 00095 }
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] |