#include <DCCEBTCCBlock.h>
Public Member Functions | |
void | addTriggerPrimitivesToCollection () |
DCCEBTCCBlock (DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack) | |
void | updateCollectors () |
Protected Member Functions | |
bool | checkTccIdAndNumbTTs () |
Definition at line 36 of file DCCEBTCCBlock.h.
DCCEBTCCBlock::DCCEBTCCBlock | ( | DCCDataUnpacker * | u, |
EcalElectronicsMapper * | m, | ||
DCCEventBlock * | e, | ||
bool | unpack | ||
) |
Class constructor
Definition at line 6 of file DCCEBTCCBlock.cc.
References DCCDataBlockPrototype::blockLength_, DCCTCCBlock::expNumbTTs_, EcalElectronicsMapper::getEBTCCBlockLength(), DCCDataBlockPrototype::mapper_, and TCC_EB_NUMBTTS.
: DCCTCCBlock(u,m,e,unpack) { blockLength_ = mapper_->getEBTCCBlockLength(); expNumbTTs_ = TCC_EB_NUMBTTS; }
void DCCEBTCCBlock::addTriggerPrimitivesToCollection | ( | ) | [virtual] |
Reimplemented from DCCTCCBlock.
Definition at line 48 of file DCCEBTCCBlock.cc.
References DCCDataBlockPrototype::data_, DCCTCCBlock::expNumbTTs_, EcalElectronicsMapper::getActiveSM(), EcalElectronicsMapper::getTPPointer(), i, EcalElectronicsMapper::kTowersInPhi, DCCDataBlockPrototype::mapper_, DCCTCCBlock::nTSamples_, NUMB_SM_EB_PLU_MAX, DCCTCCBlock::pTP_, EcalTriggerPrimitiveDigi::setSampleValue(), and DCCTCCBlock::tccId_.
{ //point to trigger data data_++; unsigned int towersInPhi = EcalElectronicsMapper::kTowersInPhi; uint16_t * tccP_= reinterpret_cast< uint16_t * >(data_); for( unsigned int i = 1; i <= expNumbTTs_; i++){ unsigned int theTT = i; if(NUMB_SM_EB_PLU_MIN<= mapper_->getActiveSM() && mapper_->getActiveSM()<=NUMB_SM_EB_PLU_MAX) { unsigned int u = (i-1)%towersInPhi; u = towersInPhi-u; theTT = ( (i-1)/towersInPhi )*towersInPhi + u; } pTP_ = mapper_->getTPPointer(tccId_,theTT); for(unsigned int ns = 0; ns<nTSamples_;ns++,tccP_++){ pTP_->setSampleValue(ns, (*tccP_)); (*tps_)->push_back(*pTP_); } } }
bool DCCEBTCCBlock::checkTccIdAndNumbTTs | ( | ) | [protected, virtual] |
Reimplemented from DCCTCCBlock.
Definition at line 17 of file DCCEBTCCBlock.cc.
References DCCEventBlock::bx(), DCCDataBlockPrototype::event_, DCCTCCBlock::expNumbTTs_, DCCTCCBlock::expTccId_, EcalElectronicsMapper::getActiveDCC(), EcalElectronicsMapper::getActiveSM(), DCCEventBlock::l1A(), DCCDataBlockPrototype::mapper_, DCCTCCBlock::nTTs_, DCCDataUnpacker::silentMode_, DCCTCCBlock::tccId_, and TCCID_SMID_SHIFT_EB.
{ expTccId_ = mapper_->getActiveSM()+TCCID_SMID_SHIFT_EB; if( tccId_ != expTccId_ ){ if( ! DCCDataUnpacker::silentMode_ ){ edm::LogWarning("IncorrectBlock") <<"Error on event "<<event_->l1A()<<" with bx "<<event_->bx()<<" in fed "<<mapper_->getActiveDCC() <<"\n TCC id is "<<tccId_<<" while expected is "<<expTccId_ <<"\n TCC Block Skipped ..."; //todo : add this to error colection } return false; } //Check number of TT Flags if( nTTs_ != expNumbTTs_ ){ if( ! DCCDataUnpacker::silentMode_ ){ edm::LogWarning("IncorrectBlock") <<"Unable to unpack TCC block for event "<<event_->l1A()<<" in fed "<<mapper_->getActiveDCC() <<"\n Number of TTs "<<nTTs_<<" is different from expected "<<expNumbTTs_ <<"\n TCC Block Skipped ..."; //todo : add this to error colection } return false; } return true; }
void DCCEBTCCBlock::updateCollectors | ( | ) | [virtual] |
Reimplemented from DCCDataBlockPrototype.
Definition at line 13 of file DCCEBTCCBlock.cc.
References DCCDataUnpacker::ecalTpsCollection(), DCCTCCBlock::tps_, and DCCDataBlockPrototype::unpacker_.
{ tps_ = unpacker_->ecalTpsCollection(); }