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