CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Protected Attributes

DCCEBSRPBlock Class Reference

#include <DCCEBSRPBlock.h>

Inheritance diagram for DCCEBSRPBlock:
DCCSRPBlock DCCDataBlockPrototype

List of all members.

Public Member Functions

 DCCEBSRPBlock (DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack)
void updateCollectors ()

Protected Member Functions

void addSRFlagToCollection ()
bool checkSrpIdAndNumbSRFlags ()

Protected Attributes

std::auto_ptr
< EBSrFlagCollection > * 
ebSrFlagsDigis_
EcalTrigTowerDetIdpTTDetId_

Detailed Description

Definition at line 35 of file DCCEBSRPBlock.h.


Constructor & Destructor Documentation

DCCEBSRPBlock::DCCEBSRPBlock ( DCCDataUnpacker u,
EcalElectronicsMapper m,
DCCEventBlock e,
bool  unpack 
)

Member Function Documentation

void DCCEBSRPBlock::addSRFlagToCollection ( ) [protected, virtual]

Reimplemented from DCCSRPBlock.

Definition at line 25 of file DCCEBSRPBlock.cc.

References DCCDataBlockPrototype::data_, DCCDataBlockPrototype::event_, DCCSRPBlock::expNumbSrFlags_, DCCEventBlock::fov(), EcalElectronicsMapper::getActiveSM(), EcalElectronicsMapper::getSrFlagPointer(), i, EcalElectronicsMapper::kTowersInPhi, DCCDataBlockPrototype::mapper_, n, NUMB_SM_EB_PLU_MAX, DCCSRPBlock::srFlag(), DCCSRPBlock::srFlags_, SRP_SRFLAG_MASK, and DCCDataBlockPrototype::unpackInternalData_.

                                         {
  
  // Point to SR flags 
  data_++;
  const uint16_t * my16Bitp_ = reinterpret_cast<const uint16_t *> (data_);
  
  unsigned int towersInPhi = EcalElectronicsMapper::kTowersInPhi;

  unsigned int fov = event_->fov();


  for( unsigned int n=0; n<expNumbSrFlags_ ; n++ ){
    
    if(n>0&&n%4==0) my16Bitp_++;
   
    unsigned short  srFlag =  ( *my16Bitp_ >> ( (n-(n/4)*4) * 3 ) )  &  SRP_SRFLAG_MASK ;

    unsigned int theSRPi = n ;


    if(NUMB_SM_EB_PLU_MIN<= mapper_->getActiveSM() && mapper_->getActiveSM()<=NUMB_SM_EB_PLU_MAX && fov>=1 ){
      unsigned int u   = n%towersInPhi;
      u        = towersInPhi-u;
      theSRPi  = ( n/towersInPhi )*towersInPhi + u - 1;
    }

    
    srFlags_[theSRPi] = srFlag;

    if(unpackInternalData_){  
    
      std::vector<EcalSrFlag*> srs = mapper_->getSrFlagPointer(theSRPi+1);

      for(size_t i = 0; i < srs.size(); ++i){
        srs[i]->setValue(srFlag); 
        (*ebSrFlagsDigis_)->push_back(*((EBSrFlag*)srs[i]));
      } 
    }
  } 
}
bool DCCEBSRPBlock::checkSrpIdAndNumbSRFlags ( ) [protected, virtual]

Reimplemented from DCCSRPBlock.

Definition at line 68 of file DCCEBSRPBlock.cc.

References DCCDataBlockPrototype::event_, DCCSRPBlock::expNumbSrFlags_, EcalElectronicsMapper::getActiveDCC(), DCCEventBlock::l1A(), DCCDataBlockPrototype::mapper_, DCCSRPBlock::nSRFlags_, and DCCDataUnpacker::silentMode_.

                                            {

   //todo : check srp id based on sm...

  // Check number of SR flags
  if (nSRFlags_ != expNumbSrFlags_) {
    if (! DCCDataUnpacker::silentMode_) {
      edm::LogWarning("IncorrectBlock")
        <<"Unable to unpack SRP block for event " << event_->l1A()<<" in fed <<"<<mapper_->getActiveDCC()
        <<"\nNumber of flags "<<nSRFlags_<<" is different from expected "<<expNumbSrFlags_;
     }
    //Note : add to error collection ?
    return false;
  }
  return true;

} 
void DCCEBSRPBlock::updateCollectors ( ) [virtual]

Member Data Documentation

Definition at line 51 of file DCCEBSRPBlock.h.

Referenced by updateCollectors().

Definition at line 53 of file DCCEBSRPBlock.h.