#include <EventFilter/EcalRawToDigiDev/interface/DCCEETCCBlock.h>
Public Member Functions | |
void | addTriggerPrimitivesToCollection () |
DCCEETCCBlock (DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpacking) | |
Class constructor. | |
void | updateCollectors () |
Protected Member Functions | |
bool | checkTccIdAndNumbTTs () |
Definition at line 32 of file DCCEETCCBlock.h.
DCCEETCCBlock::DCCEETCCBlock | ( | DCCDataUnpacker * | u, | |
EcalElectronicsMapper * | m, | |||
DCCEventBlock * | e, | |||
bool | unpacking | |||
) |
Class constructor.
Definition at line 7 of file DCCEETCCBlock.cc.
References DCCDataBlockPrototype::blockLength_, EcalElectronicsMapper::getEETCCBlockLength(), and DCCDataBlockPrototype::mapper_.
00007 : 00008 DCCTCCBlock(u,m,e,unpack) 00009 { 00010 blockLength_ = mapper_->getEETCCBlockLength(); 00011 }
void DCCEETCCBlock::addTriggerPrimitivesToCollection | ( | ) | [virtual] |
Reimplemented from DCCTCCBlock.
Definition at line 20 of file DCCEETCCBlock.cc.
References DCCDataBlockPrototype::data_, DCCTCCBlock::expNumbTTs_, EcalElectronicsMapper::getTPPointer(), i, DCCDataBlockPrototype::mapper_, DCCTCCBlock::nTSamples_, DCCTCCBlock::pTP_, EcalTriggerPrimitiveDigi::setSample(), and DCCTCCBlock::tccId_.
00020 { 00021 00022 //point to trigger data 00023 data_++; 00024 00025 uint16_t * tccP_= reinterpret_cast< uint16_t * >(data_); 00026 00027 for( uint i = 1; i <= expNumbTTs_; i++){ 00028 00029 pTP_ = mapper_->getTPPointer(tccId_,i); 00030 00031 if(pTP_){ 00032 00033 pTP_ = mapper_->getTPPointer(tccId_,i); 00034 00035 for(uint ns = 0; ns<nTSamples_;ns++,tccP_++){ 00036 pTP_->setSample(ns, *tccP_ ); 00037 (*tps_)->push_back(*pTP_); 00038 } 00039 }else{ break; } //if invalid we dont have more tts 00040 00041 } 00042 00043 }
bool DCCEETCCBlock::checkTccIdAndNumbTTs | ( | ) | [protected, virtual] |
Reimplemented from DCCTCCBlock.
Definition at line 46 of file DCCEETCCBlock.cc.
References DCCEventBlock::bx(), DCCDataBlockPrototype::event_, DCCTCCBlock::expNumbTTs_, EcalElectronicsMapper::getActiveDCC(), EcalElectronicsMapper::getActiveSM(), EcalElectronicsMapper::getTccs(), it, DCCEventBlock::l1A(), m, DCCDataBlockPrototype::mapper_, DCCDataUnpacker::silentMode_, and DCCTCCBlock::tccId_.
00046 { 00047 00048 00049 bool tccFound(false); 00050 int activeDCC = mapper_->getActiveSM(); 00051 std::vector<uint> * m = mapper_->getTccs(activeDCC); 00052 std::vector<uint>::iterator it; 00053 for(it= m->begin();it!=m->end();it++){ 00054 if((*it) == tccId_){ 00055 tccFound=true; 00056 expNumbTTs_= 28; //separate from inner and outer tcc 00057 00058 /* 00059 For inner TCCs you expect 28 TTs (4 in phi, 7 in eta). 00060 For outer TCCs you expect 16 TTs (4 in phi, 4 in eta). 00061 */ 00062 00063 00064 /* 00065 to implement : map tccid-> number of tts 00066 if( nTTs_ != xxx ){ 00067 ostringstream output; 00068 output<<"EcalRawToDigi@SUB=DCCTCCBlock::unpack" 00069 <<"\n Unable to unpack TCC block for event "<<event_->l1A()<<" in fed "<<mapper_->getActiveDCC() 00070 <<"\n Number of TTs "<<nTTs_<<" while "<<xxx<<" are expected"; 00071 //Note : add to error collection ? 00072 throw ECALUnpackerException(output.str()); 00073 } 00074 */ 00075 break; 00076 } 00077 00078 } 00079 00080 if(!tccFound){ 00081 00082 if( ! DCCDataUnpacker::silentMode_ ){ 00083 edm::LogWarning("EcalRawToDigiDevTCC") 00084 <<"\n Error on event "<<event_->l1A()<<" with bx "<<event_->bx()<<" in fed <<"<<mapper_->getActiveDCC() 00085 <<"\n TCC id "<<tccId_<<" is not valid for this dcc " 00086 <<"\n => Skipping to next fed block..."; 00087 //todo : add to error collection 00088 } 00089 } 00090 00091 return tccFound; 00092 00093 }
void DCCEETCCBlock::updateCollectors | ( | ) | [virtual] |
Reimplemented from DCCDataBlockPrototype.
Definition at line 13 of file DCCEETCCBlock.cc.
References DCCDataUnpacker::ecalTpsCollection(), DCCTCCBlock::tps_, and DCCDataBlockPrototype::unpacker_.
00013 { 00014 tps_ = unpacker_->ecalTpsCollection(); 00015 }