CMS 3D CMS Logo

Public Member Functions | Protected Member Functions

DCCEBTCCBlock Class Reference

#include <DCCEBTCCBlock.h>

Inheritance diagram for DCCEBTCCBlock:
DCCTCCBlock DCCDataBlockPrototype

List of all members.

Public Member Functions

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

Protected Member Functions

bool checkTccIdAndNumbTTs ()

Detailed Description

Definition at line 36 of file DCCEBTCCBlock.h.


Constructor & Destructor Documentation

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

Member Function Documentation

void DCCEBTCCBlock::addTriggerPrimitivesToCollection ( ) [virtual]

Reimplemented from DCCTCCBlock.

Definition at line 48 of file DCCEBTCCBlock.cc.

References DCCDataBlockPrototype::data_, DCCTCCBlock::expNumbTTs_, EcalElectronicsMapper::getActiveSM(), EcalElectronicsMapper::getTPPointer(), i, EcalElectronicsMapper::kTowersInPhi, DCCDataBlockPrototype::mapper_, DCCTCCBlock::nTSamples_, NUMB_SM_EB_PLU_MAX, DCCTCCBlock::pTP_, EcalTriggerPrimitiveDigi::setSampleValue(), and DCCTCCBlock::tccId_.

                                                    {

  //point to trigger data
  data_++;

  unsigned int towersInPhi = EcalElectronicsMapper::kTowersInPhi;
  
  const uint16_t * tccP_= reinterpret_cast<const uint16_t * >(data_);
 

  for( unsigned int i = 1; i <= expNumbTTs_; i++){

    unsigned int theTT = i;

    if(NUMB_SM_EB_PLU_MIN<= mapper_->getActiveSM() && mapper_->getActiveSM()<=NUMB_SM_EB_PLU_MAX)
    {
        unsigned int u = (i-1)%towersInPhi;
        u      = towersInPhi-u;
        theTT  = ( (i-1)/towersInPhi )*towersInPhi + u;
    }
   
    pTP_ =  mapper_->getTPPointer(tccId_,theTT);
    for(unsigned int ns = 0; ns<nTSamples_;ns++,tccP_++){
      
      pTP_->setSampleValue(ns, (*tccP_));
      (*tps_)->push_back(*pTP_);
                  
    }
  }


}
bool DCCEBTCCBlock::checkTccIdAndNumbTTs ( ) [protected, virtual]

Reimplemented from DCCTCCBlock.

Definition at line 17 of file DCCEBTCCBlock.cc.

References DCCEventBlock::bx(), DCCDataBlockPrototype::event_, DCCTCCBlock::expNumbTTs_, DCCTCCBlock::expTccId_, EcalElectronicsMapper::getActiveDCC(), EcalElectronicsMapper::getActiveSM(), DCCEventBlock::l1A(), DCCDataBlockPrototype::mapper_, DCCTCCBlock::nTTs_, DCCDataUnpacker::silentMode_, DCCTCCBlock::tccId_, and TCCID_SMID_SHIFT_EB.

                                        {

  expTccId_ = mapper_->getActiveSM()+TCCID_SMID_SHIFT_EB;

  if( tccId_ != expTccId_ ){

    if( ! DCCDataUnpacker::silentMode_ ){
      edm::LogWarning("IncorrectBlock")
        <<"Error on event "<<event_->l1A()<<" with bx "<<event_->bx()<<" in fed "<<mapper_->getActiveDCC()
        <<"\n TCC id is "<<tccId_<<" while expected is "<<expTccId_
        <<"\n TCC Block Skipped ...";  
         //todo : add this to error colection
     }
     return false;
  }
  
  //Check number of TT Flags
  if( nTTs_ != expNumbTTs_ ){
    if( ! DCCDataUnpacker::silentMode_ ){
      edm::LogWarning("IncorrectBlock")
       <<"Unable to unpack TCC block for event "<<event_->l1A()<<" in fed "<<mapper_->getActiveDCC()
       <<"\n Number of TTs "<<nTTs_<<" is different from expected "<<expNumbTTs_
       <<"\n TCC Block Skipped ..."; 
         //todo : add this to error colection
     }
     return false;
  }  
  return true;
}
void DCCEBTCCBlock::updateCollectors ( ) [virtual]