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

8  : DCCSRPBlock(u, m, e, unpack) {
10 }

References DCCSRPBlock::expNumbSrFlags_, and SRP_EB_NUMBFLAGS.

Member Function Documentation

◆ addSRFlagToCollection()

void DCCEBSRPBlock::addSRFlagToCollection ( )
overrideprotectedvirtual

Reimplemented from DCCSRPBlock.

Definition at line 17 of file DCCEBSRPBlock.cc.

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 }

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

◆ checkSrpIdAndNumbSRFlags()

bool DCCEBSRPBlock::checkSrpIdAndNumbSRFlags ( )
overrideprotectedvirtual

Reimplemented from DCCSRPBlock.

Definition at line 53 of file DCCEBSRPBlock.cc.

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 }

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

◆ updateCollectors()

void DCCEBSRPBlock::updateCollectors ( )
overridevirtual

Reimplemented from DCCDataBlockPrototype.

Definition at line 12 of file DCCEBSRPBlock.cc.

12  {
13  // Set SR flag digis
15 }

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

Member Data Documentation

◆ ebSrFlagsDigis_

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

Definition at line 41 of file DCCEBSRPBlock.h.

Referenced by updateCollectors().

◆ pTTDetId_

EcalTrigTowerDetId* DCCEBSRPBlock::pTTDetId_
protected

Definition at line 43 of file DCCEBSRPBlock.h.

mps_fire.i
i
Definition: mps_fire.py:355
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
SRP_EB_NUMBFLAGS
Definition: DCCRawDataDefinitions.h:33
DCCSRPBlock::srFlags_
unsigned short srFlags_[SRP_NUMBFLAGS]
Definition: DCCSRPBlock.h:51
DCCSRPBlock::nSRFlags_
unsigned int nSRFlags_
Definition: DCCSRPBlock.h:48
DCCDataBlockPrototype::data_
const uint64_t * data_
Definition: DCCDataBlockPrototype.h:73
DCCSRPBlock::expNumbSrFlags_
unsigned int expNumbSrFlags_
Definition: DCCSRPBlock.h:49
SRP_SRFLAG_MASK
Definition: DCCRawDataDefinitions.h:209
EcalElectronicsMapper::getActiveSM
unsigned int getActiveSM()
Definition: EcalElectronicsMapper.h:128
DCCDataUnpacker::silentMode_
static std::atomic< bool > silentMode_
Definition: DCCDataUnpacker.h:185
DCCEventBlock::fov
unsigned int fov()
Definition: DCCEventBlock.h:55
EcalElectronicsMapper::kTowersInPhi
Definition: EcalElectronicsMapper.h:161
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
EBSrFlag
Definition: EBSrFlag.h:13
DCCSRPBlock::srFlag
unsigned short srFlag(unsigned int feChannel)
Definition: DCCSRPBlock.h:38
DCCDataBlockPrototype::unpacker_
DCCDataUnpacker * unpacker_
Definition: DCCDataBlockPrototype.h:67
EcalElectronicsMapper::getActiveDCC
unsigned int getActiveDCC()
Definition: EcalElectronicsMapper.h:126
DCCSRPBlock::DCCSRPBlock
DCCSRPBlock(DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack)
Definition: DCCSRPBlock.cc:6
edm::LogWarning
Definition: MessageLogger.h:141
EcalElectronicsMapper::getSrFlagPointer
std::vector< EcalSrFlag * > getSrFlagPointer(unsigned int feChannel)
Definition: EcalElectronicsMapper.h:122
NUMB_SM_EB_PLU_MAX
Definition: DCCRawDataDefinitions.h:57
DCCEBSRPBlock::ebSrFlagsDigis_
std::unique_ptr< EBSrFlagCollection > * ebSrFlagsDigis_
Definition: DCCEBSRPBlock.h:41
DCCDataBlockPrototype::event_
DCCEventBlock * event_
Definition: DCCDataBlockPrototype.h:70
DCCSRPBlock::unpack
int unpack(const uint64_t **data, unsigned int *dwToEnd, unsigned int numbFlags=SRP_NUMBFLAGS)
Definition: DCCSRPBlock.cc:16
DCCEventBlock::l1A
unsigned int l1A()
Definition: DCCEventBlock.h:57
DCCDataBlockPrototype::mapper_
EcalElectronicsMapper * mapper_
Definition: DCCDataBlockPrototype.h:69
DCCDataBlockPrototype::unpackInternalData_
bool unpackInternalData_
Definition: DCCDataBlockPrototype.h:77
DCCDataUnpacker::ebSrFlagsCollection
std::unique_ptr< EBSrFlagCollection > * ebSrFlagsCollection()
Definition: DCCDataUnpacker.h:126
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37