CMS 3D CMS Logo

DCCEBTCCBlock Class Reference

#include <EventFilter/EcalRawToDigiDev/interface/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)
 Class constructor.
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 
)

Class constructor.

Definition at line 6 of file DCCEBTCCBlock.cc.

References DCCDataBlockPrototype::blockLength_, DCCTCCBlock::expNumbTTs_, EcalElectronicsMapper::getEBTCCBlockLength(), DCCDataBlockPrototype::mapper_, and TCC_EB_NUMBTTS.

00007 : DCCTCCBlock(u,m,e,unpack)
00008 {
00009   blockLength_ = mapper_->getEBTCCBlockLength();
00010   expNumbTTs_  = TCC_EB_NUMBTTS;
00011 }


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_.

00048                                                     {
00049 
00050   //point to trigger data
00051   data_++;
00052 
00053   uint towersInPhi = EcalElectronicsMapper::kTowersInPhi;
00054   
00055   uint16_t * tccP_= reinterpret_cast< uint16_t * >(data_);
00056  
00057 
00058   for( uint i = 1; i <= expNumbTTs_; i++){
00059 
00060     uint theTT = i;
00061 
00062     if(NUMB_SM_EB_PLU_MIN<= mapper_->getActiveSM() && mapper_->getActiveSM()<=NUMB_SM_EB_PLU_MAX)
00063     {
00064         uint u = (i-1)%towersInPhi;
00065         u      = towersInPhi-u;
00066         theTT  = ( (i-1)/towersInPhi )*towersInPhi + u;
00067     }
00068    
00069     pTP_ =  mapper_->getTPPointer(tccId_,theTT);
00070     for(uint ns = 0; ns<nTSamples_;ns++,tccP_++){
00071       
00072       pTP_->setSampleValue(ns, (*tccP_));
00073       (*tps_)->push_back(*pTP_);
00074                   
00075     }
00076   }
00077 
00078 
00079 }

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.

00017                                         {
00018     
00019   expTccId_ = mapper_->getActiveSM()+TCCID_SMID_SHIFT_EB;
00020 
00021   if( tccId_ != expTccId_ ){
00022 
00023     if( ! DCCDataUnpacker::silentMode_ ){
00024       edm::LogWarning("EcalRawToDigiDevTCC")
00025         <<"\n Error on event "<<event_->l1A()<<" with bx "<<event_->bx()<<" in fed "<<mapper_->getActiveDCC()
00026         <<"\n TCC id is "<<tccId_<<" while expected is "<<expTccId_
00027         <<"\n TCC Block Skipped ...";  
00028          //todo : add this to error colection
00029      }
00030      return false;
00031   }
00032   
00033   //Check number of TT Flags
00034   if( nTTs_ != expNumbTTs_ ){
00035     if( ! DCCDataUnpacker::silentMode_ ){
00036       edm::LogWarning("EcalRawToDigiDevTCC")
00037        <<"\n Unable to unpack TCC block for event "<<event_->l1A()<<" in fed "<<mapper_->getActiveDCC()
00038        <<"\n Number of TTs "<<nTTs_<<" is different from expected "<<expNumbTTs_
00039        <<"\n TCC Block Skipped ..."; 
00040          //todo : add this to error colection
00041      }
00042      return false;
00043   }  
00044   return true;
00045 }

void DCCEBTCCBlock::updateCollectors (  )  [virtual]

Reimplemented from DCCDataBlockPrototype.

Definition at line 13 of file DCCEBTCCBlock.cc.

References DCCDataUnpacker::ecalTpsCollection(), DCCTCCBlock::tps_, and DCCDataBlockPrototype::unpacker_.

00013                                     {
00014   tps_ = unpacker_->ecalTpsCollection();
00015 }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:17:41 2009 for CMSSW by  doxygen 1.5.4