Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-28 03:58:54

0001 #include "EventFilter/EcalRawToDigi/interface/DCCEESRPBlock.h"
0002 #include "EventFilter/EcalRawToDigi/interface/DCCDataBlockPrototype.h"
0003 #include "EventFilter/EcalRawToDigi/interface/DCCDataUnpacker.h"
0004 #include "EventFilter/EcalRawToDigi/interface/EcalElectronicsMapper.h"
0005 
0006 DCCEESRPBlock::DCCEESRPBlock(DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack)
0007     : DCCSRPBlock(u, m, e, unpack) {}
0008 
0009 void DCCEESRPBlock::updateCollectors() {
0010   // Set SR flag digis
0011   eeSrFlagsDigis_ = unpacker_->eeSrFlagsCollection();
0012 }
0013 
0014 void DCCEESRPBlock::addSRFlagToCollection() {
0015   // Point to SR flags
0016   data_++;
0017   const uint16_t *my16Bitp_ = reinterpret_cast<const uint16_t *>(data_);
0018 
0019   for (unsigned int n = 0; n < expNumbSrFlags_; ++n) {
0020     if (n != 0 && n % 4 == 0)
0021       my16Bitp_++;
0022 
0023     unsigned short srFlag = (*my16Bitp_ >> ((n - (n / 4) * 4) * 3)) & SRP_SRFLAG_MASK;
0024     srFlags_[n] = srFlag;
0025     if (unpackInternalData_) {
0026       std::vector<EcalSrFlag *> srs = mapper_->getSrFlagPointer(n + 1);
0027       for (size_t i = 0; i < srs.size(); ++i) {
0028         srs[i]->setValue(srFlag);
0029         (*eeSrFlagsDigis_)->push_back(*((EESrFlag *)srs[i]));
0030       }
0031     }
0032   }
0033 }
0034 
0035 bool DCCEESRPBlock::checkSrpIdAndNumbSRFlags() {
0036   expNumbSrFlags_ = 36;  //to be corrected
0037 
0038   int dccId = mapper_->getActiveDCC() - 600;
0039   if (dccId == SECTOR_EEM_CCU_JUMP || dccId == SECTOR_EEP_CCU_JUMP)
0040     expNumbSrFlags_ = 41;
0041 
0042   //todo :  checks to be implemented...
0043   return true;
0044 }