#include <DCCEBSRPBlock.h>
Public Member Functions | |
DCCEBSRPBlock (DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack) | |
void | updateCollectors () |
Protected Member Functions | |
void | addSRFlagToCollection () |
bool | checkSrpIdAndNumbSRFlags () |
Protected Attributes | |
std::auto_ptr < EBSrFlagCollection > * | ebSrFlagsDigis_ |
EcalTrigTowerDetId * | pTTDetId_ |
Definition at line 35 of file DCCEBSRPBlock.h.
DCCEBSRPBlock::DCCEBSRPBlock | ( | DCCDataUnpacker * | u, |
EcalElectronicsMapper * | m, | ||
DCCEventBlock * | e, | ||
bool | unpack | ||
) |
Definition at line 9 of file DCCEBSRPBlock.cc.
References DCCSRPBlock::expNumbSrFlags_, and SRP_EB_NUMBFLAGS.
: DCCSRPBlock(u,m,e,unpack) { expNumbSrFlags_ = SRP_EB_NUMBFLAGS; }
void DCCEBSRPBlock::addSRFlagToCollection | ( | ) | [protected, virtual] |
Reimplemented from DCCSRPBlock.
Definition at line 25 of file DCCEBSRPBlock.cc.
References DCCDataBlockPrototype::data_, DCCDataBlockPrototype::event_, DCCSRPBlock::expNumbSrFlags_, DCCEventBlock::fov(), EcalElectronicsMapper::getActiveSM(), EcalElectronicsMapper::getSrFlagPointer(), i, EcalElectronicsMapper::kTowersInPhi, DCCDataBlockPrototype::mapper_, n, NUMB_SM_EB_PLU_MAX, DCCSRPBlock::srFlag(), DCCSRPBlock::srFlags_, SRP_SRFLAG_MASK, and DCCDataBlockPrototype::unpackInternalData_.
{ // Point to SR flags data_++; uint16_t * my16Bitp_ = reinterpret_cast<uint16_t *> (data_); unsigned int towersInPhi = EcalElectronicsMapper::kTowersInPhi; unsigned int fov = event_->fov(); for( unsigned int n=0; n<expNumbSrFlags_ ; n++ ){ if(n>0&&n%4==0) my16Bitp_++; unsigned short srFlag = ( *my16Bitp_ >> ( (n-(n/4)*4) * 3 ) ) & SRP_SRFLAG_MASK ; unsigned int theSRPi = n ; if(NUMB_SM_EB_PLU_MIN<= mapper_->getActiveSM() && mapper_->getActiveSM()<=NUMB_SM_EB_PLU_MAX && fov>=1 ){ unsigned int u = n%towersInPhi; u = towersInPhi-u; theSRPi = ( n/towersInPhi )*towersInPhi + u - 1; } srFlags_[theSRPi] = srFlag; if(unpackInternalData_){ std::vector<EcalSrFlag*> srs = mapper_->getSrFlagPointer(theSRPi+1); for(size_t i = 0; i < srs.size(); ++i){ srs[i]->setValue(srFlag); (*ebSrFlagsDigis_)->push_back(*((EBSrFlag*)srs[i])); } } } }
bool DCCEBSRPBlock::checkSrpIdAndNumbSRFlags | ( | ) | [protected, virtual] |
Reimplemented from DCCSRPBlock.
Definition at line 68 of file DCCEBSRPBlock.cc.
References DCCDataBlockPrototype::event_, DCCSRPBlock::expNumbSrFlags_, EcalElectronicsMapper::getActiveDCC(), DCCEventBlock::l1A(), DCCDataBlockPrototype::mapper_, DCCSRPBlock::nSRFlags_, and DCCDataUnpacker::silentMode_.
{ //todo : check srp id based on sm... // Check number of SR flags if (nSRFlags_ != expNumbSrFlags_) { if (! DCCDataUnpacker::silentMode_) { edm::LogWarning("IncorrectBlock") <<"Unable to unpack SRP block for event " << event_->l1A()<<" in fed <<"<<mapper_->getActiveDCC() <<"\nNumber of flags "<<nSRFlags_<<" is different from expected "<<expNumbSrFlags_; } //Note : add to error collection ? return false; } return true; }
void DCCEBSRPBlock::updateCollectors | ( | ) | [virtual] |
Reimplemented from DCCDataBlockPrototype.
Definition at line 19 of file DCCEBSRPBlock.cc.
References DCCDataUnpacker::ebSrFlagsCollection(), ebSrFlagsDigis_, and DCCDataBlockPrototype::unpacker_.
{ // Set SR flag digis ebSrFlagsDigis_ = unpacker_->ebSrFlagsCollection(); }
std::auto_ptr<EBSrFlagCollection>* DCCEBSRPBlock::ebSrFlagsDigis_ [protected] |
Definition at line 51 of file DCCEBSRPBlock.h.
Referenced by updateCollectors().
EcalTrigTowerDetId* DCCEBSRPBlock::pTTDetId_ [protected] |
Definition at line 53 of file DCCEBSRPBlock.h.