CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions
DCCEBTCCBlock Class Reference

#include <DCCEBTCCBlock.h>

Inheritance diagram for DCCEBTCCBlock:
DCCTCCBlock DCCDataBlockPrototype

Public Member Functions

void addTriggerPrimitivesToCollection ()
 
 DCCEBTCCBlock (DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack)
 
void updateCollectors ()
 
- Public Member Functions inherited from DCCTCCBlock
 DCCTCCBlock (DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack)
 
void display (std::ostream &o)
 
int unpack (const uint64_t **data, unsigned int *dwToEnd, short tccChId=0)
 
- Public Member Functions inherited from DCCDataBlockPrototype
 DCCDataBlockPrototype (DCCDataUnpacker *unpacker, EcalElectronicsMapper *mapper, DCCEventBlock *event, bool unpack=true)
 
void enableSyncChecks ()
 
virtual unsigned int getLength ()
 
virtual int unpack (const uint64_t **data, unsigned int *dwToEnd)
 
virtual void updateEventPointers ()
 
virtual ~DCCDataBlockPrototype ()
 

Protected Member Functions

bool checkTccIdAndNumbTTs ()
 

Additional Inherited Members

- Protected Attributes inherited from DCCTCCBlock
unsigned int bx_
 
unsigned int expNumbTTs_
 
unsigned int expTccId_
 
unsigned int l1_
 
unsigned int nTSamples_
 
unsigned int nTTs_
 
EcalPseudoStripInputDigipPS_
 
unsigned int ps_
 
std::auto_ptr
< EcalPSInputDigiCollection > * 
pss_
 
EcalTriggerPrimitiveDigipTP_
 
EcalTrigTowerDetIdpTTDetId_
 
unsigned int tccId_
 
std::auto_ptr
< EcalTrigPrimDigiCollection > * 
tps_
 
- Protected Attributes inherited from DCCDataBlockPrototype
unsigned int blockLength_
 
const uint64_t * data_
 
const uint64_t ** datap_
 
unsigned int * dwToEnd_
 
bool error_
 
DCCEventBlockevent_
 
EcalElectronicsMappermapper_
 
bool sync_
 
DCCDataUnpackerunpacker_
 
bool unpackInternalData_
 

Detailed Description

Definition at line 34 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.

7 : DCCTCCBlock(u,m,e,unpack)
8 {
11 }
int unpack(const uint64_t **data, unsigned int *dwToEnd, short tccChId=0)
Definition: DCCTCCBlock.cc:11
unsigned int getEBTCCBlockLength()
DCCTCCBlock(DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack)
Definition: DCCTCCBlock.cc:7
unsigned int expNumbTTs_
Definition: DCCTCCBlock.h:61
EcalElectronicsMapper * mapper_

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

48  {
49 
50  //point to trigger data
51  data_++;
52 
53  unsigned int towersInPhi = EcalElectronicsMapper::kTowersInPhi;
54 
55  const uint16_t * tccP_= reinterpret_cast<const uint16_t * >(data_);
56 
57 
58  for( unsigned int i = 1; i <= expNumbTTs_; i++){
59 
60  unsigned int theTT = i;
61 
62  if(NUMB_SM_EB_PLU_MIN<= mapper_->getActiveSM() && mapper_->getActiveSM()<=NUMB_SM_EB_PLU_MAX)
63  {
64  unsigned int u = (i-1)%towersInPhi;
65  u = towersInPhi-u;
66  theTT = ( (i-1)/towersInPhi )*towersInPhi + u;
67  }
68 
69  pTP_ = mapper_->getTPPointer(tccId_,theTT);
70  for(unsigned int ns = 0; ns<nTSamples_;ns++,tccP_++){
71 
72  pTP_->setSampleValue(ns, (*tccP_));
73  (*tps_)->push_back(*pTP_);
74 
75  }
76  }
77 
78 
79 }
int i
Definition: DBlmapReader.cc:9
unsigned int nTSamples_
Definition: DCCTCCBlock.h:60
EcalTriggerPrimitiveDigi * pTP_
Definition: DCCTCCBlock.h:66
void setSampleValue(int i, uint16_t value)
unsigned int tccId_
Definition: DCCTCCBlock.h:54
unsigned int expNumbTTs_
Definition: DCCTCCBlock.h:61
EcalTriggerPrimitiveDigi * getTPPointer(unsigned int tccId, unsigned int tower)
EcalElectronicsMapper * mapper_
bool DCCEBTCCBlock::checkTccIdAndNumbTTs ( )
protectedvirtual

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.

17  {
18 
20 
21  if( tccId_ != expTccId_ ){
22 
24  edm::LogWarning("IncorrectBlock")
25  <<"Error on event "<<event_->l1A()<<" with bx "<<event_->bx()<<" in fed "<<mapper_->getActiveDCC()
26  <<"\n TCC id is "<<tccId_<<" while expected is "<<expTccId_
27  <<"\n TCC Block Skipped ...";
28  //todo : add this to error colection
29  }
30  return false;
31  }
32 
33  //Check number of TT Flags
34  if( nTTs_ != expNumbTTs_ ){
36  edm::LogWarning("IncorrectBlock")
37  <<"Unable to unpack TCC block for event "<<event_->l1A()<<" in fed "<<mapper_->getActiveDCC()
38  <<"\n Number of TTs "<<nTTs_<<" is different from expected "<<expNumbTTs_
39  <<"\n TCC Block Skipped ...";
40  //todo : add this to error colection
41  }
42  return false;
43  }
44  return true;
45 }
static std::atomic< bool > silentMode_
unsigned int bx()
Definition: DCCEventBlock.h:55
unsigned int tccId_
Definition: DCCTCCBlock.h:54
unsigned int expNumbTTs_
Definition: DCCTCCBlock.h:61
unsigned int nTTs_
Definition: DCCTCCBlock.h:59
EcalElectronicsMapper * mapper_
unsigned int expTccId_
Definition: DCCTCCBlock.h:62
unsigned int l1A()
Definition: DCCEventBlock.h:54
void DCCEBTCCBlock::updateCollectors ( )
virtual

Reimplemented from DCCDataBlockPrototype.

Definition at line 13 of file DCCEBTCCBlock.cc.

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

13  {
15 }
std::auto_ptr< EcalTrigPrimDigiCollection > * tps_
Definition: DCCTCCBlock.h:68
DCCDataUnpacker * unpacker_
std::auto_ptr< EcalTrigPrimDigiCollection > * ecalTpsCollection()