00001 #include "EventFilter/EcalRawToDigiDev/interface/DCCEESRPBlock.h" 00002 #include "EventFilter/EcalRawToDigiDev/interface/DCCDataBlockPrototype.h" 00003 #include "EventFilter/EcalRawToDigiDev/interface/DCCDataUnpacker.h" 00004 #include "EventFilter/EcalRawToDigiDev/interface/EcalElectronicsMapper.h" 00005 00006 00007 00008 DCCEESRPBlock::DCCEESRPBlock( DCCDataUnpacker * u,EcalElectronicsMapper * m, DCCEventBlock * e, bool unpack ) : 00009 DCCSRPBlock(u,m,e,unpack) 00010 {} 00011 00012 00013 void DCCEESRPBlock::updateCollectors(){ 00014 // Set SR flag digis 00015 eeSrFlagsDigis_ = unpacker_->eeSrFlagsCollection(); 00016 } 00017 00018 00019 void DCCEESRPBlock::addSRFlagToCollection(){ 00020 00021 // Point to SR flags 00022 data_++; 00023 uint16_t * my16Bitp_ = reinterpret_cast<uint16_t *> (data_); 00024 00025 00026 for( uint n=0; n<expNumbSrFlags_ ;n++,pSCDetId_++ ){ 00027 00028 if( n!=0 && n%4==0 ) my16Bitp_++; 00029 00030 ushort srFlag = ( *my16Bitp_ >> ( (n-(n/4)*4) * 3 ) ) & SRP_SRFLAG_MASK ; 00031 srFlags_[n] = srFlag; 00032 if(unpackInternalData_){ 00033 EESrFlag * sr = (EESrFlag*) mapper_->getSrFlagPointer(n+1); 00034 if(sr){ 00035 sr->setValue(srFlag); 00036 (*eeSrFlagsDigis_)->push_back(*sr); 00037 } 00038 } 00039 00040 } 00041 00042 } 00043 00044 bool DCCEESRPBlock::checkSrpIdAndNumbSRFlags(){ 00045 00046 expNumbSrFlags_=36;//to be corrected 00047 00048 int dccId = mapper_->getActiveDCC() - 600; 00049 if (dccId == SECTOR_EEM_CCU_JUMP || dccId == SECTOR_EEP_CCU_JUMP) expNumbSrFlags_ = 41; 00050 00051 //todo : checks to be implemented... 00052 return true; 00053 00054 } 00055 00056 00057 00058