#include <DQM/EcalBarrelMonitorTasks/interface/EBHltTask.h>
Definition at line 28 of file EBHltTask.h.
EBHltTask::EBHltTask | ( | const edm::ParameterSet & | ps | ) |
Constructor.
Definition at line 37 of file EBHltTask.cc.
References dqmStore_, EBDetIdCollection0_, EBDetIdCollection1_, EBDetIdCollection2_, EBDetIdCollection3_, EcalElectronicsIdCollection1_, EcalElectronicsIdCollection2_, EcalElectronicsIdCollection3_, EcalElectronicsIdCollection4_, EcalElectronicsIdCollection5_, EcalElectronicsIdCollection6_, enableCleanup_, FEDRawDataCollection_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), init_, initGeometry_, meEBFedsIntegrityErrors_, meEBFedsOccupancy_, meEBFedsSizeErrors_, mergeRuns_, and prefixME_.
00037 { 00038 00039 init_ = false; 00040 00041 initGeometry_ = false; 00042 00043 dqmStore_ = Service<DQMStore>().operator->(); 00044 00045 prefixME_ = ps.getUntrackedParameter<string>("prefixME", ""); 00046 00047 enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false); 00048 00049 mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false); 00050 00051 EBDetIdCollection0_ = ps.getParameter<edm::InputTag>("EBDetIdCollection0"); 00052 EBDetIdCollection1_ = ps.getParameter<edm::InputTag>("EBDetIdCollection1"); 00053 EBDetIdCollection2_ = ps.getParameter<edm::InputTag>("EBDetIdCollection2"); 00054 EBDetIdCollection3_ = ps.getParameter<edm::InputTag>("EBDetIdCollection3"); 00055 EcalElectronicsIdCollection1_ = ps.getParameter<edm::InputTag>("EcalElectronicsIdCollection1"); 00056 EcalElectronicsIdCollection2_ = ps.getParameter<edm::InputTag>("EcalElectronicsIdCollection2"); 00057 EcalElectronicsIdCollection3_ = ps.getParameter<edm::InputTag>("EcalElectronicsIdCollection3"); 00058 EcalElectronicsIdCollection4_ = ps.getParameter<edm::InputTag>("EcalElectronicsIdCollection4"); 00059 EcalElectronicsIdCollection5_ = ps.getParameter<edm::InputTag>("EcalElectronicsIdCollection5"); 00060 EcalElectronicsIdCollection6_ = ps.getParameter<edm::InputTag>("EcalElectronicsIdCollection6"); 00061 FEDRawDataCollection_ = ps.getParameter<edm::InputTag>("FEDRawDataCollection"); 00062 00063 meEBFedsOccupancy_ = 0; 00064 meEBFedsSizeErrors_ = 0; 00065 meEBFedsIntegrityErrors_ = 0; 00066 00067 map = 0; 00068 00069 }
EBHltTask::~EBHltTask | ( | ) | [virtual] |
void EBHltTask::analyze | ( | const edm::Event & | e, | |
const edm::EventSetup & | c | |||
) | [protected, virtual] |
Analyze.
Implements edm::EDAnalyzer.
Definition at line 158 of file EBHltTask.cc.
References FEDRawData::data(), EBDetIdCollection0_, EBDetIdCollection1_, EBDetIdCollection2_, EBDetIdCollection3_, EcalBarrel, EcalElectronicsIdCollection1_, EcalElectronicsIdCollection2_, EcalElectronicsIdCollection3_, EcalElectronicsIdCollection4_, EcalElectronicsIdCollection5_, EcalElectronicsIdCollection6_, FEDRawDataCollection_, MonitorElement::Fill(), edm::Event::getByLabel(), i, ievt_, init_, iSM(), meEBFedsIntegrityErrors_, meEBFedsOccupancy_, meEBFedsSizeErrors_, setup(), FEDRawData::size(), and subDet().
00158 { 00159 00160 if ( ! init_ ) this->setup(); 00161 00162 ievt_++; 00163 00164 // ECAL barrel FEDs 00165 int EBFirstFED=610; 00166 00167 int FedsSizeErrors[36]; 00168 for ( int i=0; i<36; i++ ) FedsSizeErrors[i]=0; 00169 00170 edm::Handle<EBDetIdCollection> ids0; 00171 00172 if ( e.getByLabel(EBDetIdCollection0_, ids0) ) { 00173 00174 for ( EBDetIdCollection::const_iterator idItr = ids0->begin(); idItr != ids0->end(); ++idItr ) { 00175 00176 int ism = iSM( *idItr ); 00177 00178 if ( ism > -1 ) FedsSizeErrors[ism-1]++; 00179 00180 } 00181 00182 } else { 00183 00184 // LogWarning("EBHltTask") << EBDetIdCollection0_ << " not available"; 00185 00186 } 00187 00188 edm::Handle<FEDRawDataCollection> allFedRawData; 00189 00190 if ( e.getByLabel(FEDRawDataCollection_, allFedRawData) ) { 00191 00192 for ( int ism=1; ism<=36; ism++ ) { 00193 00194 const FEDRawData& fedData = allFedRawData->FEDData( EBFirstFED + ism - 1 ); 00195 00196 int length = fedData.size()/sizeof(uint64_t); 00197 00198 if ( length > 0 ) { 00199 00200 if ( meEBFedsOccupancy_ ) meEBFedsOccupancy_->Fill( EBFirstFED + ism - 1 ); 00201 00202 uint64_t * pData = (uint64_t *)(fedData.data()); 00203 uint64_t * fedTrailer = pData + (length - 1); 00204 bool crcError = (*fedTrailer >> 2 ) & 0x1; 00205 00206 if (crcError) FedsSizeErrors[ism-1]++; 00207 00208 } 00209 00210 } 00211 00212 } else { 00213 LogWarning("EBHltTask") << FEDRawDataCollection_ << " not available"; 00214 } 00215 00216 00217 for( int ism=1; ism<=36; ism++ ) { 00218 00219 if ( FedsSizeErrors[ism-1] != 0 ) { 00220 00221 if ( meEBFedsSizeErrors_ ) meEBFedsSizeErrors_->Fill( EBFirstFED + ism - 1 ); 00222 00223 } 00224 00225 } 00226 00227 00228 // Integrity errors 00229 Handle<EBDetIdCollection> ids1; 00230 00231 if ( e.getByLabel(EBDetIdCollection1_, ids1) ) { 00232 00233 for ( EBDetIdCollection::const_iterator idItr = ids1->begin(); idItr != ids1->end(); ++idItr ) { 00234 00235 int ism = iSM( *idItr ); 00236 00237 if( ism > -1 ) meEBFedsIntegrityErrors_->Fill( EBFirstFED + ism - 1, 1./1700.); 00238 00239 } 00240 00241 } else { 00242 00243 LogWarning("EBHltTask") << EBDetIdCollection1_ << " not available"; 00244 00245 } 00246 00247 Handle<EBDetIdCollection> ids2; 00248 00249 if ( e.getByLabel(EBDetIdCollection2_, ids2) ) { 00250 00251 for ( EBDetIdCollection::const_iterator idItr = ids2->begin(); idItr != ids2->end(); ++idItr ) { 00252 00253 int ism = iSM( *idItr ); 00254 00255 if ( ism > -1 ) meEBFedsIntegrityErrors_->Fill( EBFirstFED + ism - 1, 1./1700.); 00256 00257 } 00258 00259 } else { 00260 00261 LogWarning("EBHltTask") << EBDetIdCollection2_ << " not available"; 00262 00263 } 00264 00265 Handle<EBDetIdCollection> ids3; 00266 00267 if ( e.getByLabel(EBDetIdCollection3_, ids3) ) { 00268 00269 for ( EBDetIdCollection::const_iterator idItr = ids3->begin(); idItr != ids3->end(); ++idItr ) { 00270 00271 int ism = iSM( *idItr ); 00272 00273 if ( ism > -1 ) meEBFedsIntegrityErrors_->Fill( EBFirstFED + ism - 1, 1./1700.); 00274 00275 } 00276 00277 } else { 00278 00279 LogWarning("EBHltTask") << EBDetIdCollection3_ << " not available"; 00280 00281 } 00282 00283 Handle<EcalElectronicsIdCollection> ids4; 00284 00285 if ( e.getByLabel(EcalElectronicsIdCollection1_, ids4) ) { 00286 00287 for ( EcalElectronicsIdCollection::const_iterator idItr = ids4->begin(); idItr != ids4->end(); ++idItr ) { 00288 00289 if ( subDet( *idItr ) != EcalBarrel ) continue; 00290 00291 int ism = iSM( *idItr ); 00292 00293 if ( ism > -1 ) meEBFedsIntegrityErrors_->Fill( EBFirstFED + ism - 1, 1./68.); 00294 00295 } 00296 00297 } else { 00298 00299 LogWarning("EBHltTask") << EcalElectronicsIdCollection1_ << " not available"; 00300 00301 } 00302 00303 Handle<EcalElectronicsIdCollection> ids5; 00304 00305 if ( e.getByLabel(EcalElectronicsIdCollection2_, ids5) ) { 00306 00307 for ( EcalElectronicsIdCollection::const_iterator idItr = ids5->begin(); idItr != ids5->end(); ++idItr ) { 00308 00309 if ( subDet( *idItr ) != EcalBarrel ) continue; 00310 00311 int ism = iSM( *idItr ); 00312 00313 if ( ism > -1 ) meEBFedsIntegrityErrors_->Fill( EBFirstFED + ism - 1, 1./1700.); 00314 00315 } 00316 00317 } else { 00318 00319 LogWarning("EBHltTask") << EcalElectronicsIdCollection2_ << " not available"; 00320 00321 } 00322 00323 Handle<EcalElectronicsIdCollection> ids6; 00324 00325 if ( e.getByLabel(EcalElectronicsIdCollection3_, ids6) ) { 00326 00327 for ( EcalElectronicsIdCollection::const_iterator idItr = ids6->begin(); idItr != ids6->end(); ++idItr ) { 00328 00329 if ( subDet( *idItr ) != EcalBarrel ) continue; 00330 00331 int ism = iSM( *idItr ); 00332 00333 if ( ism > -1 ) meEBFedsIntegrityErrors_->Fill( EBFirstFED + ism - 1, 1./68.); 00334 00335 } 00336 00337 } else { 00338 00339 LogWarning("EBHltTask") << EcalElectronicsIdCollection3_ << " not available"; 00340 00341 } 00342 00343 Handle<EcalElectronicsIdCollection> ids7; 00344 00345 if ( e.getByLabel(EcalElectronicsIdCollection4_, ids7) ) { 00346 00347 for ( EcalElectronicsIdCollection::const_iterator idItr = ids7->begin(); idItr != ids7->end(); ++idItr ) { 00348 00349 if ( subDet( *idItr ) != EcalBarrel ) continue; 00350 00351 int ism = iSM( *idItr ); 00352 00353 if ( ism > -1 ) meEBFedsIntegrityErrors_->Fill( EBFirstFED + ism - 1, 1./1700.); 00354 00355 } 00356 00357 } else { 00358 00359 LogWarning("EBHltTask") << EcalElectronicsIdCollection4_ << " not available"; 00360 00361 } 00362 00363 Handle<EcalElectronicsIdCollection> ids8; 00364 00365 if ( e.getByLabel(EcalElectronicsIdCollection5_, ids8) ) { 00366 00367 for ( EcalElectronicsIdCollection::const_iterator idItr = ids8->begin(); idItr != ids8->end(); ++idItr ) { 00368 00369 if ( subDet( *idItr ) != EcalBarrel ) continue; 00370 00371 int ism = iSM( *idItr ); 00372 00373 if ( ism > -1 ) meEBFedsIntegrityErrors_->Fill( EBFirstFED + ism - 1, 1./1700.); 00374 00375 } 00376 00377 } else { 00378 00379 LogWarning("EBHltTask") << EcalElectronicsIdCollection5_ << " not available"; 00380 00381 } 00382 00383 Handle<EcalElectronicsIdCollection> ids9; 00384 00385 if ( e.getByLabel(EcalElectronicsIdCollection6_, ids9) ) { 00386 00387 for ( EcalElectronicsIdCollection::const_iterator idItr = ids9->begin(); idItr != ids9->end(); ++idItr ) { 00388 00389 if ( subDet( *idItr ) != EcalBarrel ) continue; 00390 00391 int ism = iSM( *idItr ); 00392 00393 if ( ism > -1 ) meEBFedsIntegrityErrors_->Fill( EBFirstFED + ism - 1, 1./1700.); 00394 00395 } 00396 00397 } else { 00398 00399 LogWarning("EBHltTask") << EcalElectronicsIdCollection6_ << " not available"; 00400 00401 } 00402 00403 }
void EBHltTask::beginJob | ( | const edm::EventSetup & | c | ) | [protected, virtual] |
BeginJob.
Reimplemented from edm::EDAnalyzer.
Definition at line 75 of file EBHltTask.cc.
References dqmStore_, ievt_, initGeometry(), prefixME_, DQMStore::rmdir(), and DQMStore::setCurrentFolder().
00075 { 00076 00077 ievt_ = 0; 00078 00079 if ( dqmStore_ ) { 00080 dqmStore_->setCurrentFolder(prefixME_ + "/FEDIntegrity"); 00081 dqmStore_->rmdir(prefixME_ + "/FEDIntegrity"); 00082 } 00083 00084 initGeometry(c); 00085 00086 }
void EBHltTask::beginRun | ( | const edm::Run & | r, | |
const edm::EventSetup & | c | |||
) | [protected, virtual] |
BeginRun.
Reimplemented from edm::EDAnalyzer.
Definition at line 88 of file EBHltTask.cc.
References mergeRuns_, and reset().
00088 { 00089 00090 if ( ! mergeRuns_ ) this->reset(); 00091 00092 }
Cleanup.
Definition at line 128 of file EBHltTask.cc.
References dqmStore_, MonitorElement::getName(), init_, meEBFedsIntegrityErrors_, meEBFedsOccupancy_, meEBFedsSizeErrors_, prefixME_, DQMStore::removeElement(), and DQMStore::setCurrentFolder().
Referenced by endJob().
00128 { 00129 00130 if ( ! init_ ) return; 00131 00132 if ( dqmStore_ ) { 00133 dqmStore_->setCurrentFolder(prefixME_ + "/FEDIntegrity"); 00134 00135 if ( meEBFedsOccupancy_ ) dqmStore_->removeElement( meEBFedsOccupancy_->getName() ); 00136 meEBFedsOccupancy_ = 0; 00137 00138 if ( meEBFedsSizeErrors_ ) dqmStore_->removeElement( meEBFedsSizeErrors_->getName() ); 00139 meEBFedsSizeErrors_ = 0; 00140 00141 if ( meEBFedsIntegrityErrors_ ) dqmStore_->removeElement( meEBFedsIntegrityErrors_->getName() ); 00142 meEBFedsIntegrityErrors_ = 0; 00143 00144 } 00145 00146 init_ = false; 00147 00148 }
EndJob.
Reimplemented from edm::EDAnalyzer.
Definition at line 150 of file EBHltTask.cc.
References cleanup(), enableCleanup_, and ievt_.
00150 { 00151 00152 LogInfo("EBHltTask") << "analyzed " << ievt_ << " events"; 00153 00154 if ( enableCleanup_ ) this->cleanup(); 00155 00156 }
void EBHltTask::endRun | ( | const edm::Run & | r, | |
const edm::EventSetup & | c | |||
) | [protected, virtual] |
void EBHltTask::initGeometry | ( | const edm::EventSetup & | setup | ) | [protected] |
Definition at line 407 of file EBHltTask.cc.
References edm::EventSetup::get(), initGeometry_, and edm::ESHandle< T >::product().
Referenced by beginJob().
00407 { 00408 00409 if( initGeometry_ ) return; 00410 00411 initGeometry_ = true; 00412 00413 edm::ESHandle< EcalElectronicsMapping > handle; 00414 setup.get< EcalMappingRcd >().get(handle); 00415 map = handle.product(); 00416 00417 if( ! map ) LogWarning("EBHltTask") << "EcalElectronicsMapping not available"; 00418 00419 }
int EBHltTask::iSM | ( | const EcalElectronicsId & | id | ) | [protected] |
Definition at line 436 of file EBHltTask.cc.
00436 { 00437 00438 int idcc = id.dccId(); 00439 00440 // EB-/EB+ 00441 if( idcc >= 10 && idcc <= 45 ) return( idcc - 9 ); 00442 00443 LogWarning("EBHltTask") << "Wrong DCC id: dcc = " << idcc; 00444 return -1; 00445 00446 }
Definition at line 421 of file EBHltTask.cc.
References EcalElectronicsId::dccId().
Referenced by analyze().
00421 { 00422 00423 if( ! map ) return -1; 00424 00425 EcalElectronicsId eid = map->getElectronicsId(id); 00426 int idcc = eid.dccId(); 00427 00428 // EB-/EB+ 00429 if( idcc >= 10 && idcc <= 45 ) return( idcc - 9 ); 00430 00431 LogWarning("EBHltTask") << "Wrong DCC id: dcc = " << idcc; 00432 return -1; 00433 00434 }
Reset.
Definition at line 98 of file EBHltTask.cc.
References meEBFedsIntegrityErrors_, meEBFedsOccupancy_, meEBFedsSizeErrors_, and MonitorElement::Reset().
Referenced by beginRun().
00098 { 00099 00100 if ( meEBFedsOccupancy_ ) meEBFedsOccupancy_->Reset(); 00101 if ( meEBFedsSizeErrors_ ) meEBFedsSizeErrors_->Reset(); 00102 if ( meEBFedsIntegrityErrors_ ) meEBFedsIntegrityErrors_->Reset(); 00103 00104 }
Setup.
Definition at line 106 of file EBHltTask.cc.
References DQMStore::book1D(), dqmStore_, histo, init_, meEBFedsIntegrityErrors_, meEBFedsOccupancy_, meEBFedsSizeErrors_, prefixME_, and DQMStore::setCurrentFolder().
Referenced by analyze().
00106 { 00107 00108 init_ = true; 00109 00110 char histo[200]; 00111 00112 if ( dqmStore_ ) { 00113 dqmStore_->setCurrentFolder(prefixME_ + "/FEDIntegrity"); 00114 00115 sprintf(histo, "FEDEntries"); 00116 meEBFedsOccupancy_ = dqmStore_->book1D(histo, histo, 36, 610, 646); 00117 00118 sprintf(histo, "FEDFatal"); 00119 meEBFedsSizeErrors_ = dqmStore_->book1D(histo, histo, 36, 610, 646); 00120 00121 sprintf(histo, "FEDNonFatal"); 00122 meEBFedsIntegrityErrors_ = dqmStore_->book1D(histo, histo, 36, 610, 646); 00123 00124 } 00125 00126 }
EcalSubdetector EBHltTask::subDet | ( | const EcalElectronicsId & | id | ) | [inline, protected] |
EcalSubdetector EBHltTask::subDet | ( | const EBDetId & | id | ) | [inline, protected] |
DQMStore* EBHltTask::dqmStore_ [private] |
Definition at line 78 of file EBHltTask.h.
Referenced by beginJob(), cleanup(), EBHltTask(), and setup().
edm::InputTag EBHltTask::EBDetIdCollection0_ [private] |
edm::InputTag EBHltTask::EBDetIdCollection1_ [private] |
edm::InputTag EBHltTask::EBDetIdCollection2_ [private] |
edm::InputTag EBHltTask::EBDetIdCollection3_ [private] |
edm::InputTag EBHltTask::EBDetIdCollection4_ [private] |
Definition at line 90 of file EBHltTask.h.
bool EBHltTask::enableCleanup_ [private] |
int EBHltTask::ievt_ [private] |
bool EBHltTask::init_ [private] |
Definition at line 103 of file EBHltTask.h.
Referenced by analyze(), cleanup(), EBHltTask(), and setup().
bool EBHltTask::initGeometry_ [private] |
const EcalElectronicsMapping* EBHltTask::map [private] |
Definition at line 106 of file EBHltTask.h.
Definition at line 101 of file EBHltTask.h.
Referenced by analyze(), cleanup(), EBHltTask(), reset(), and setup().
MonitorElement* EBHltTask::meEBFedsOccupancy_ [private] |
Definition at line 99 of file EBHltTask.h.
Referenced by analyze(), cleanup(), EBHltTask(), reset(), and setup().
MonitorElement* EBHltTask::meEBFedsSizeErrors_ [private] |
Definition at line 100 of file EBHltTask.h.
Referenced by analyze(), cleanup(), EBHltTask(), reset(), and setup().
bool EBHltTask::mergeRuns_ [private] |
std::string EBHltTask::prefixME_ [private] |
Definition at line 80 of file EBHltTask.h.
Referenced by beginJob(), cleanup(), EBHltTask(), and setup().