CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 () override
 
 DCCEBTCCBlock (DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack)
 
void updateCollectors () override
 
- Public Member Functions inherited from DCCTCCBlock
 DCCTCCBlock (DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack)
 
void display (std::ostream &o) override
 
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 () override
 

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::unique_ptr
< EcalPSInputDigiCollection > * 
pss_
 
EcalTriggerPrimitiveDigipTP_
 
unsigned int tccId_
 
std::unique_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 32 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) {
10 }
int unpack(const uint64_t **data, unsigned int *dwToEnd, short tccChId=0)
Definition: DCCTCCBlock.cc:10
unsigned int getEBTCCBlockLength()
DCCTCCBlock(DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack)
Definition: DCCTCCBlock.cc:7
unsigned int expNumbTTs_
Definition: DCCTCCBlock.h:58
EcalElectronicsMapper * mapper_

Member Function Documentation

void DCCEBTCCBlock::addTriggerPrimitivesToCollection ( )
overridevirtual

Reimplemented from DCCTCCBlock.

Definition at line 40 of file DCCEBTCCBlock.cc.

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

40  {
41  //point to trigger data
42  data_++;
43 
44  unsigned int towersInPhi = EcalElectronicsMapper::kTowersInPhi;
45 
46  const uint16_t* tccP_ = reinterpret_cast<const uint16_t*>(data_);
47 
48  for (unsigned int i = 1; i <= expNumbTTs_; i++) {
49  unsigned int theTT = i;
50 
51  if (NUMB_SM_EB_PLU_MIN <= mapper_->getActiveSM() && mapper_->getActiveSM() <= NUMB_SM_EB_PLU_MAX) {
52  unsigned int u = (i - 1) % towersInPhi;
53  u = towersInPhi - u;
54  theTT = ((i - 1) / towersInPhi) * towersInPhi + u;
55  }
56 
57  pTP_ = mapper_->getTPPointer(tccId_, theTT);
58  for (unsigned int ns = 0; ns < nTSamples_; ns++, tccP_++) {
59  pTP_->setSampleValue(ns, (*tccP_));
60  (*tps_)->push_back(*pTP_);
61  }
62  }
63 }
unsigned int nTSamples_
Definition: DCCTCCBlock.h:57
EcalTriggerPrimitiveDigi * pTP_
Definition: DCCTCCBlock.h:62
void setSampleValue(int i, uint16_t value)
unsigned int tccId_
Definition: DCCTCCBlock.h:51
unsigned int expNumbTTs_
Definition: DCCTCCBlock.h:58
EcalTriggerPrimitiveDigi * getTPPointer(unsigned int tccId, unsigned int tower)
EcalElectronicsMapper * mapper_
bool DCCEBTCCBlock::checkTccIdAndNumbTTs ( )
overrideprotectedvirtual

Reimplemented from DCCTCCBlock.

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

14  {
16 
17  if (tccId_ != expTccId_) {
19  edm::LogWarning("IncorrectBlock") << "Error on event " << event_->l1A() << " with bx " << event_->bx()
20  << " in fed " << mapper_->getActiveDCC() << "\n TCC id is " << tccId_
21  << " while expected is " << expTccId_ << "\n TCC Block Skipped ...";
22  //todo : add this to error colection
23  }
24  return false;
25  }
26 
27  //Check number of TT Flags
28  if (nTTs_ != expNumbTTs_) {
30  edm::LogWarning("IncorrectBlock") << "Unable to unpack TCC block for event " << event_->l1A() << " in fed "
31  << mapper_->getActiveDCC() << "\n Number of TTs " << nTTs_
32  << " is different from expected " << expNumbTTs_ << "\n TCC Block Skipped ...";
33  //todo : add this to error colection
34  }
35  return false;
36  }
37  return true;
38 }
static std::atomic< bool > silentMode_
unsigned int bx()
Definition: DCCEventBlock.h:58
unsigned int tccId_
Definition: DCCTCCBlock.h:51
unsigned int expNumbTTs_
Definition: DCCTCCBlock.h:58
unsigned int nTTs_
Definition: DCCTCCBlock.h:56
EcalElectronicsMapper * mapper_
Log< level::Warning, false > LogWarning
unsigned int expTccId_
Definition: DCCTCCBlock.h:59
unsigned int l1A()
Definition: DCCEventBlock.h:57
void DCCEBTCCBlock::updateCollectors ( )
overridevirtual

Reimplemented from DCCDataBlockPrototype.

Definition at line 12 of file DCCEBTCCBlock.cc.

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

std::unique_ptr< EcalTrigPrimDigiCollection > * tps_
Definition: DCCTCCBlock.h:64
DCCDataUnpacker * unpacker_
std::unique_ptr< EcalTrigPrimDigiCollection > * ecalTpsCollection()