#include <DQM/EcalBarrelMonitorTasks/interface/EBStatusFlagsTask.h>
Public Member Functions | |
EBStatusFlagsTask (const edm::ParameterSet &ps) | |
Constructor. | |
virtual | ~EBStatusFlagsTask () |
Destructor. | |
Protected Member Functions | |
void | analyze (const edm::Event &e, const edm::EventSetup &c) |
Analyze. | |
void | beginJob (const edm::EventSetup &c) |
BeginJob. | |
void | beginRun (const edm::Run &r, const edm::EventSetup &c) |
BeginRun. | |
void | cleanup (void) |
Cleanup. | |
void | endJob (void) |
EndJob. | |
void | endRun (const edm::Run &r, const edm::EventSetup &c) |
EndRun. | |
void | reset (void) |
Reset. | |
void | setup (void) |
Setup. | |
Private Attributes | |
DQMStore * | dqmStore_ |
edm::InputTag | EcalRawDataCollection_ |
bool | enableCleanup_ |
int | ievt_ |
bool | init_ |
MonitorElement * | meEvtType_ [36] |
MonitorElement * | meFEchErrors_ [36][2] |
bool | mergeRuns_ |
std::string | prefixME_ |
Definition at line 20 of file EBStatusFlagsTask.h.
EBStatusFlagsTask::EBStatusFlagsTask | ( | const edm::ParameterSet & | ps | ) |
Constructor.
Definition at line 31 of file EBStatusFlagsTask.cc.
References dqmStore_, EcalRawDataCollection_, enableCleanup_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), i, init_, meEvtType_, meFEchErrors_, mergeRuns_, and prefixME_.
00031 { 00032 00033 init_ = false; 00034 00035 dqmStore_ = Service<DQMStore>().operator->(); 00036 00037 prefixME_ = ps.getUntrackedParameter<string>("prefixME", ""); 00038 00039 enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false); 00040 00041 mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false); 00042 00043 EcalRawDataCollection_ = ps.getParameter<edm::InputTag>("EcalRawDataCollection"); 00044 00045 for (int i = 0; i < 36; i++) { 00046 meEvtType_[i] = 0; 00047 00048 meFEchErrors_[i][0] = 0; 00049 meFEchErrors_[i][1] = 0; 00050 } 00051 00052 }
EBStatusFlagsTask::~EBStatusFlagsTask | ( | ) | [virtual] |
void EBStatusFlagsTask::analyze | ( | const edm::Event & | e, | |
const edm::EventSetup & | c | |||
) | [protected, virtual] |
Analyze.
Implements edm::EDAnalyzer.
Definition at line 207 of file EBStatusFlagsTask.cc.
References EcalBarrel, EcalRawDataCollection_, MonitorElement::Fill(), edm::Event::getByLabel(), ievt_, init_, Numbers::iSM(), meEvtType_, meFEchErrors_, MonitorElement::setBinContent(), setup(), StDecayID::status, and Numbers::subDet().
00207 { 00208 00209 if ( ! init_ ) this->setup(); 00210 00211 ievt_++; 00212 00213 Handle<EcalRawDataCollection> dcchs; 00214 00215 if ( e.getByLabel(EcalRawDataCollection_, dcchs) ) { 00216 00217 for ( EcalRawDataCollection::const_iterator dcchItr = dcchs->begin(); dcchItr != dcchs->end(); ++dcchItr ) { 00218 00219 if ( Numbers::subDet( *dcchItr ) != EcalBarrel ) continue; 00220 00221 int ism = Numbers::iSM( *dcchItr, EcalBarrel ); 00222 00223 if ( meEvtType_[ism-1] ) meEvtType_[ism-1]->Fill(dcchItr->getRunType()+0.5); 00224 00225 const vector<short> status = dcchItr->getFEStatus(); 00226 00227 for ( unsigned int itt=1; itt<=status.size(); itt++ ) { 00228 00229 if ( itt > 68 ) continue; 00230 00231 int iet = (itt-1)/4 + 1; 00232 int ipt = (itt-1)%4 + 1; 00233 00234 float xiet = iet - 0.5; 00235 float xipt = ipt - 0.5; 00236 00237 if ( meFEchErrors_[ism-1][0] ) { 00238 if ( meFEchErrors_[ism-1][0]->getBinContent(iet, ipt) == -1 ) { 00239 meFEchErrors_[ism-1][0]->setBinContent(iet, ipt, 0); 00240 } 00241 } 00242 00243 if ( ! ( status[itt-1] == 0 || status[itt-1] == 1 || status[itt-1] == 7 ) ) { 00244 if ( meFEchErrors_[ism-1][0] ) meFEchErrors_[ism-1][0]->Fill(xiet, xipt); 00245 } 00246 00247 if ( meFEchErrors_[ism-1][1] ) meFEchErrors_[ism-1][1]->Fill(status[itt-1]+0.5); 00248 00249 } 00250 00251 } 00252 00253 } else { 00254 00255 LogWarning("EBStatusFlagsTask") << EcalRawDataCollection_ << " not available"; 00256 00257 } 00258 00259 }
void EBStatusFlagsTask::beginJob | ( | const edm::EventSetup & | c | ) | [protected, virtual] |
BeginJob.
Reimplemented from edm::EDAnalyzer.
Definition at line 58 of file EBStatusFlagsTask.cc.
References dqmStore_, ievt_, Numbers::initGeometry(), prefixME_, DQMStore::rmdir(), and DQMStore::setCurrentFolder().
00058 { 00059 00060 ievt_ = 0; 00061 00062 if ( dqmStore_ ) { 00063 dqmStore_->setCurrentFolder(prefixME_ + "/EBStatusFlagsTask"); 00064 dqmStore_->rmdir(prefixME_ + "/EBStatusFlagsTask"); 00065 } 00066 00067 Numbers::initGeometry(c, false); 00068 00069 }
void EBStatusFlagsTask::beginRun | ( | const edm::Run & | r, | |
const edm::EventSetup & | c | |||
) | [protected, virtual] |
BeginRun.
Reimplemented from edm::EDAnalyzer.
Definition at line 71 of file EBStatusFlagsTask.cc.
References mergeRuns_, and reset().
00071 { 00072 00073 if ( ! mergeRuns_ ) this->reset(); 00074 00075 }
Cleanup.
Definition at line 172 of file EBStatusFlagsTask.cc.
References dqmStore_, edm::getName(), i, init_, meEvtType_, meFEchErrors_, prefixME_, DQMStore::removeElement(), and DQMStore::setCurrentFolder().
Referenced by endJob().
00172 { 00173 00174 if ( ! init_ ) return; 00175 00176 if ( dqmStore_ ) { 00177 dqmStore_->setCurrentFolder(prefixME_ + "/EBStatusFlagsTask"); 00178 00179 dqmStore_->setCurrentFolder(prefixME_ + "/EBStatusFlagsTask/EvtType"); 00180 for (int i = 0; i < 36; i++) { 00181 if ( meEvtType_[i] ) dqmStore_->removeElement( meEvtType_[i]->getName() ); 00182 meEvtType_[i] = 0; 00183 } 00184 00185 dqmStore_->setCurrentFolder(prefixME_ + "/EBStatusFlagsTask/FEStatus"); 00186 for (int i = 0; i < 36; i++) { 00187 if ( meFEchErrors_[i][0] ) dqmStore_->removeElement( meFEchErrors_[i][0]->getName() ); 00188 meFEchErrors_[i][0] = 0; 00189 if ( meFEchErrors_[i][1] ) dqmStore_->removeElement( meFEchErrors_[i][1]->getName() ); 00190 meFEchErrors_[i][1] = 0; 00191 } 00192 00193 } 00194 00195 init_ = false; 00196 00197 }
EndJob.
Reimplemented from edm::EDAnalyzer.
Definition at line 199 of file EBStatusFlagsTask.cc.
References cleanup(), enableCleanup_, and ievt_.
00199 { 00200 00201 LogInfo("EBStatusFlagsTask") << "analyzed " << ievt_ << " events"; 00202 00203 if ( enableCleanup_ ) this->cleanup(); 00204 00205 }
void EBStatusFlagsTask::endRun | ( | const edm::Run & | r, | |
const edm::EventSetup & | c | |||
) | [protected, virtual] |
Reset.
Definition at line 81 of file EBStatusFlagsTask.cc.
References i, meEvtType_, meFEchErrors_, and MonitorElement::Reset().
Referenced by beginRun().
00081 { 00082 00083 for (int i = 0; i < 36; i++) { 00084 if ( meEvtType_[i] ) meEvtType_[i]->Reset(); 00085 00086 if ( meFEchErrors_[i][0] ) meFEchErrors_[i][0]->Reset(); 00087 if ( meFEchErrors_[i][1] ) meFEchErrors_[i][1]->Reset(); 00088 } 00089 00090 }
Setup.
Definition at line 92 of file EBStatusFlagsTask.cc.
References EcalDCCHeaderBlock::BEAMH2, EcalDCCHeaderBlock::BEAMH4, DQMStore::book1D(), DQMStore::book2D(), EcalDCCHeaderBlock::COSMIC, EcalDCCHeaderBlock::COSMICS_GLOBAL, EcalDCCHeaderBlock::COSMICS_LOCAL, dqmStore_, EcalDCCHeaderBlock::HALO_GLOBAL, EcalDCCHeaderBlock::HALO_LOCAL, histo, i, init_, EcalDCCHeaderBlock::LASER_DELAY_SCAN, EcalDCCHeaderBlock::LASER_GAP, EcalDCCHeaderBlock::LASER_POWER_SCAN, EcalDCCHeaderBlock::LASER_STD, EcalDCCHeaderBlock::LED_GAP, EcalDCCHeaderBlock::LED_STD, meEvtType_, meFEchErrors_, EcalDCCHeaderBlock::MTCC, EcalDCCHeaderBlock::PEDESTAL_25NS_SCAN, EcalDCCHeaderBlock::PEDESTAL_GAP, EcalDCCHeaderBlock::PEDESTAL_OFFSET_SCAN, EcalDCCHeaderBlock::PEDESTAL_STD, EcalDCCHeaderBlock::PHYSICS_GLOBAL, EcalDCCHeaderBlock::PHYSICS_LOCAL, prefixME_, Numbers::sEB(), MonitorElement::setAxisTitle(), MonitorElement::setBinContent(), MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), MonitorElement::setEntries(), DQMStore::tag(), EcalDCCHeaderBlock::TESTPULSE_GAP, EcalDCCHeaderBlock::TESTPULSE_MGPA, and EcalDCCHeaderBlock::TESTPULSE_SCAN_MEM.
Referenced by analyze().
00092 { 00093 00094 init_ = true; 00095 00096 char histo[200]; 00097 00098 if ( dqmStore_ ) { 00099 dqmStore_->setCurrentFolder(prefixME_ + "/EBStatusFlagsTask"); 00100 00101 dqmStore_->setCurrentFolder(prefixME_ + "/EBStatusFlagsTask/EvtType"); 00102 for (int i = 0; i < 36; i++) { 00103 sprintf(histo, "EBSFT EVTTYPE %s", Numbers::sEB(i+1).c_str()); 00104 meEvtType_[i] = dqmStore_->book1D(histo, histo, 31, -1., 30.); 00105 meEvtType_[i]->setBinLabel(1, "UNKNOWN", 1); 00106 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::COSMIC, "COSMIC", 1); 00107 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::BEAMH4, "BEAMH4", 1); 00108 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::BEAMH2, "BEAMH2", 1); 00109 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::MTCC, "MTCC", 1); 00110 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::LASER_STD, "LASER_STD", 1); 00111 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::LASER_POWER_SCAN, "LASER_POWER_SCAN", 1); 00112 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::LASER_DELAY_SCAN, "LASER_DELAY_SCAN", 1); 00113 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::TESTPULSE_SCAN_MEM, "TESTPULSE_SCAN_MEM", 1); 00114 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::TESTPULSE_MGPA, "TESTPULSE_MGPA", 1); 00115 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::PEDESTAL_STD, "PEDESTAL_STD", 1); 00116 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::PEDESTAL_OFFSET_SCAN, "PEDESTAL_OFFSET_SCAN", 1); 00117 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::PEDESTAL_25NS_SCAN, "PEDESTAL_25NS_SCAN", 1); 00118 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::LED_STD, "LED_STD", 1); 00119 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::PHYSICS_GLOBAL, "PHYSICS_GLOBAL", 1); 00120 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::COSMICS_GLOBAL, "COSMICS_GLOBAL", 1); 00121 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::HALO_GLOBAL, "HALO_GLOBAL", 1); 00122 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::LASER_GAP, "LASER_GAP", 1); 00123 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::TESTPULSE_GAP, "TESTPULSE_GAP"); 00124 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::PEDESTAL_GAP, "PEDESTAL_GAP"); 00125 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::LED_GAP, "LED_GAP", 1); 00126 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::PHYSICS_LOCAL, "PHYSICS_LOCAL", 1); 00127 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::COSMICS_LOCAL, "COSMICS_LOCAL", 1); 00128 meEvtType_[i]->setBinLabel(2+EcalDCCHeaderBlock::HALO_LOCAL, "HALO_LOCAL", 1); 00129 dqmStore_->tag(meEvtType_[i], i+1); 00130 } 00131 00132 dqmStore_->setCurrentFolder(prefixME_ + "/EBStatusFlagsTask/FEStatus"); 00133 for (int i = 0; i < 36; i++) { 00134 sprintf(histo, "EBSFT front-end status %s", Numbers::sEB(i+1).c_str()); 00135 meFEchErrors_[i][0] = dqmStore_->book2D(histo, histo, 17, 0., 17., 4, 0., 4.); 00136 meFEchErrors_[i][0]->setAxisTitle("ieta'", 1); 00137 meFEchErrors_[i][0]->setAxisTitle("iphi'", 2); 00138 dqmStore_->tag(meFEchErrors_[i][0], i+1); 00139 00140 for ( int ie = 1; ie <= 17; ie++ ) { 00141 for ( int ip = 1; ip <= 4; ip++ ) { 00142 meFEchErrors_[i][0]->setBinContent( ie, ip, -1. ); 00143 } 00144 } 00145 meFEchErrors_[i][0]->setEntries( 0 ); 00146 00147 sprintf(histo, "EBSFT front-end status bits %s", Numbers::sEB(i+1).c_str()); 00148 meFEchErrors_[i][1] = dqmStore_->book1D(histo, histo, 16, 0., 16.); 00149 meFEchErrors_[i][1]->setBinLabel(1+0, "ACTIVE", 1); 00150 meFEchErrors_[i][1]->setBinLabel(1+1, "DISABLED", 1); 00151 meFEchErrors_[i][1]->setBinLabel(1+2, "TIMEOUT", 1); 00152 meFEchErrors_[i][1]->setBinLabel(1+3, "HEADER", 1); 00153 meFEchErrors_[i][1]->setBinLabel(1+4, "CHANNEL ID", 1); 00154 meFEchErrors_[i][1]->setBinLabel(1+5, "LINK", 1); 00155 meFEchErrors_[i][1]->setBinLabel(1+6, "BLOCKSIZE", 1); 00156 meFEchErrors_[i][1]->setBinLabel(1+7, "SUPPRESSED", 1); 00157 meFEchErrors_[i][1]->setBinLabel(1+8, "FIFO FULL", 1); 00158 meFEchErrors_[i][1]->setBinLabel(1+9, "L1A SYNC", 1); 00159 meFEchErrors_[i][1]->setBinLabel(1+10, "BX SYNC", 1); 00160 meFEchErrors_[i][1]->setBinLabel(1+11, "L1A+BX SYNC", 1); 00161 meFEchErrors_[i][1]->setBinLabel(1+12, "FIFO+L1A", 1); 00162 meFEchErrors_[i][1]->setBinLabel(1+13, "H PARITY", 1); 00163 meFEchErrors_[i][1]->setBinLabel(1+14, "V PARITY", 1); 00164 meFEchErrors_[i][1]->setBinLabel(1+15, "H+V PARITY", 1); 00165 dqmStore_->tag(meFEchErrors_[i][1], i+1); 00166 } 00167 00168 } 00169 00170 }
DQMStore* EBStatusFlagsTask::dqmStore_ [private] |
Definition at line 60 of file EBStatusFlagsTask.h.
Referenced by beginJob(), cleanup(), EBStatusFlagsTask(), and setup().
Definition at line 68 of file EBStatusFlagsTask.h.
Referenced by analyze(), and EBStatusFlagsTask().
bool EBStatusFlagsTask::enableCleanup_ [private] |
int EBStatusFlagsTask::ievt_ [private] |
Definition at line 58 of file EBStatusFlagsTask.h.
Referenced by analyze(), beginJob(), and endJob().
bool EBStatusFlagsTask::init_ [private] |
Definition at line 74 of file EBStatusFlagsTask.h.
Referenced by analyze(), cleanup(), EBStatusFlagsTask(), and setup().
MonitorElement* EBStatusFlagsTask::meEvtType_[36] [private] |
Definition at line 70 of file EBStatusFlagsTask.h.
Referenced by analyze(), cleanup(), EBStatusFlagsTask(), reset(), and setup().
MonitorElement* EBStatusFlagsTask::meFEchErrors_[36][2] [private] |
Definition at line 72 of file EBStatusFlagsTask.h.
Referenced by analyze(), cleanup(), EBStatusFlagsTask(), reset(), and setup().
bool EBStatusFlagsTask::mergeRuns_ [private] |
Definition at line 66 of file EBStatusFlagsTask.h.
Referenced by beginRun(), and EBStatusFlagsTask().
std::string EBStatusFlagsTask::prefixME_ [private] |
Definition at line 62 of file EBStatusFlagsTask.h.
Referenced by beginJob(), cleanup(), EBStatusFlagsTask(), and setup().