CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
DCCEBSRPBlock Class Reference

#include <DCCEBSRPBlock.h>

Inheritance diagram for DCCEBSRPBlock:
DCCSRPBlock DCCDataBlockPrototype

Public Member Functions

 DCCEBSRPBlock (DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack)
 
void updateCollectors () override
 
- Public Member Functions inherited from DCCSRPBlock
 DCCSRPBlock (DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack)
 
void display (std::ostream &o) override
 
unsigned short srFlag (unsigned int feChannel)
 
virtual int unpack (const uint64_t **data, unsigned int *dwToEnd)
 
int unpack (const uint64_t **data, unsigned int *dwToEnd, unsigned int numbFlags=SRP_NUMBFLAGS)
 
- 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

void addSRFlagToCollection () override
 
bool checkSrpIdAndNumbSRFlags () override
 

Protected Attributes

std::unique_ptr< EBSrFlagCollection > * ebSrFlagsDigis_
 
- Protected Attributes inherited from DCCSRPBlock
unsigned int bx_
 
unsigned int expNumbSrFlags_
 
unsigned int l1_
 
unsigned int nSRFlags_
 
unsigned short srFlags_ [SRP_NUMBFLAGS]
 
unsigned int srpId_
 
- 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 30 of file DCCEBSRPBlock.h.

Constructor & Destructor Documentation

◆ DCCEBSRPBlock()

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

Definition at line 7 of file DCCEBSRPBlock.cc.

References DCCSRPBlock::expNumbSrFlags_, and SRP_EB_NUMBFLAGS.

8  : DCCSRPBlock(u, m, e, unpack) {
10 }
unsigned int expNumbSrFlags_
Definition: DCCSRPBlock.h:49
DCCSRPBlock(DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack)
Definition: DCCSRPBlock.cc:6
int unpack(const uint64_t **data, unsigned int *dwToEnd, unsigned int numbFlags=SRP_NUMBFLAGS)
Definition: DCCSRPBlock.cc:16

Member Function Documentation

◆ addSRFlagToCollection()

void DCCEBSRPBlock::addSRFlagToCollection ( )
overrideprotectedvirtual

Reimplemented from DCCSRPBlock.

Definition at line 17 of file DCCEBSRPBlock.cc.

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

17  {
18  // Point to SR flags
19  data_++;
20  const uint16_t *my16Bitp_ = reinterpret_cast<const uint16_t *>(data_);
21 
22  unsigned int towersInPhi = EcalElectronicsMapper::kTowersInPhi;
23 
24  unsigned int fov = event_->fov();
25 
26  for (unsigned int n = 0; n < expNumbSrFlags_; n++) {
27  if (n > 0 && n % 4 == 0)
28  my16Bitp_++;
29 
30  unsigned short srFlag = (*my16Bitp_ >> ((n - (n / 4) * 4) * 3)) & SRP_SRFLAG_MASK;
31 
32  unsigned int theSRPi = n;
33 
34  if (NUMB_SM_EB_PLU_MIN <= mapper_->getActiveSM() && mapper_->getActiveSM() <= NUMB_SM_EB_PLU_MAX && fov >= 1) {
35  unsigned int u = n % towersInPhi;
36  u = towersInPhi - u;
37  theSRPi = (n / towersInPhi) * towersInPhi + u - 1;
38  }
39 
40  srFlags_[theSRPi] = srFlag;
41 
42  if (unpackInternalData_) {
43  std::vector<EcalSrFlag *> srs = mapper_->getSrFlagPointer(theSRPi + 1);
44 
45  for (size_t i = 0; i < srs.size(); ++i) {
46  srs[i]->setValue(srFlag);
47  (*ebSrFlagsDigis_)->push_back(*((EBSrFlag *)srs[i]));
48  }
49  }
50  }
51 }
unsigned short srFlags_[SRP_NUMBFLAGS]
Definition: DCCSRPBlock.h:51
std::vector< EcalSrFlag * > getSrFlagPointer(unsigned int feChannel)
unsigned int expNumbSrFlags_
Definition: DCCSRPBlock.h:49
unsigned short srFlag(unsigned int feChannel)
Definition: DCCSRPBlock.h:38
unsigned int fov()
Definition: DCCEventBlock.h:55
EcalElectronicsMapper * mapper_

◆ checkSrpIdAndNumbSRFlags()

bool DCCEBSRPBlock::checkSrpIdAndNumbSRFlags ( )
overrideprotectedvirtual

Reimplemented from DCCSRPBlock.

Definition at line 53 of file DCCEBSRPBlock.cc.

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

53  {
54  //todo : check srp id based on sm...
55 
56  // Check number of SR flags
57  if (nSRFlags_ != expNumbSrFlags_) {
59  edm::LogWarning("IncorrectBlock") << "Unable to unpack SRP block for event " << event_->l1A() << " in fed <<"
60  << mapper_->getActiveDCC() << "\nNumber of flags " << nSRFlags_
61  << " is different from expected " << expNumbSrFlags_;
62  }
63  //Note : add to error collection ?
64  return false;
65  }
66  return true;
67 }
unsigned int expNumbSrFlags_
Definition: DCCSRPBlock.h:49
static std::atomic< bool > silentMode_
EcalElectronicsMapper * mapper_
Log< level::Warning, false > LogWarning
unsigned int nSRFlags_
Definition: DCCSRPBlock.h:48
unsigned int l1A()
Definition: DCCEventBlock.h:57

◆ updateCollectors()

void DCCEBSRPBlock::updateCollectors ( )
overridevirtual

Reimplemented from DCCDataBlockPrototype.

Definition at line 12 of file DCCEBSRPBlock.cc.

References DCCDataUnpacker::ebSrFlagsCollection(), ebSrFlagsDigis_, and DCCDataBlockPrototype::unpacker_.

12  {
13  // Set SR flag digis
15 }
std::unique_ptr< EBSrFlagCollection > * ebSrFlagsCollection()
std::unique_ptr< EBSrFlagCollection > * ebSrFlagsDigis_
Definition: DCCEBSRPBlock.h:41
DCCDataUnpacker * unpacker_

Member Data Documentation

◆ ebSrFlagsDigis_

std::unique_ptr<EBSrFlagCollection>* DCCEBSRPBlock::ebSrFlagsDigis_
protected

Definition at line 41 of file DCCEBSRPBlock.h.

Referenced by updateCollectors().