CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/EventFilter/EcalRawToDigi/src/DCCEESRPBlock.cc

Go to the documentation of this file.
00001 #include "EventFilter/EcalRawToDigi/interface/DCCEESRPBlock.h"
00002 #include "EventFilter/EcalRawToDigi/interface/DCCDataBlockPrototype.h"
00003 #include "EventFilter/EcalRawToDigi/interface/DCCDataUnpacker.h"
00004 #include "EventFilter/EcalRawToDigi/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   const uint16_t * my16Bitp_ = reinterpret_cast<const uint16_t *> (data_);
00024 
00025   
00026   for( unsigned int n=0; n<expNumbSrFlags_ ;n++,pSCDetId_++ ){
00027    
00028     if( n!=0 && n%4==0 ) my16Bitp_++;
00029  
00030      unsigned short srFlag =  ( *my16Bitp_ >> ( (n-(n/4)*4) * 3 ) )  &  SRP_SRFLAG_MASK ;
00031      srFlags_[n] = srFlag;
00032      if(unpackInternalData_){
00033        std::vector<EcalSrFlag*> srs = mapper_->getSrFlagPointer(n+1);
00034        for(size_t i = 0; i < srs.size(); ++i){
00035          srs[i]->setValue(srFlag); 
00036          (*eeSrFlagsDigis_)->push_back(*((EESrFlag*)srs[i]));
00037        } 
00038      }  
00039   }
00040 }
00041 
00042 bool DCCEESRPBlock::checkSrpIdAndNumbSRFlags(){
00043 
00044   expNumbSrFlags_=36;//to be corrected
00045 
00046   int dccId = mapper_->getActiveDCC() - 600;
00047   if (dccId == SECTOR_EEM_CCU_JUMP || dccId == SECTOR_EEP_CCU_JUMP) expNumbSrFlags_ = 41;
00048 
00049   //todo :  checks to be implemented...
00050   return true;
00051 
00052 } 
00053