CMS 3D CMS Logo

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

#include <DCCSRPBlock.h>

Inheritance diagram for DCCSRPBlock:
DCCDataBlockPrototype DCCEBSRPBlock DCCEESRPBlock

Public Member Functions

 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 updateCollectors ()
 
virtual void updateEventPointers ()
 
virtual ~DCCDataBlockPrototype ()
 

Protected Member Functions

virtual void addSRFlagToCollection ()
 
virtual bool checkSrpIdAndNumbSRFlags ()
 

Protected Attributes

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 DCCSRPBlock.h.

Constructor & Destructor Documentation

◆ DCCSRPBlock()

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

Definition at line 6 of file DCCSRPBlock.cc.

8  // Todo : include data integrity collections
10  // Set SR flags to zero
11  for (unsigned int i = 0; i < SRP_NUMBFLAGS; i++) {
12  srFlags_[i] = 0;
13  }
14 }

References DCCDataBlockPrototype::blockLength_, mps_fire::i, srFlags_, SRP_BLOCKLENGTH, and SRP_NUMBFLAGS.

Member Function Documentation

◆ addSRFlagToCollection()

virtual void DCCSRPBlock::addSRFlagToCollection ( )
inlineprotectedvirtual

Reimplemented in DCCEBSRPBlock, and DCCEESRPBlock.

Definition at line 41 of file DCCSRPBlock.h.

41 {};

Referenced by unpack().

◆ checkSrpIdAndNumbSRFlags()

virtual bool DCCSRPBlock::checkSrpIdAndNumbSRFlags ( )
inlineprotectedvirtual

Reimplemented in DCCEBSRPBlock, and DCCEESRPBlock.

Definition at line 43 of file DCCSRPBlock.h.

43 { return true; };

Referenced by unpack().

◆ display()

void DCCSRPBlock::display ( std::ostream &  o)
overridevirtual

Reimplemented from DCCDataBlockPrototype.

Definition at line 93 of file DCCSRPBlock.cc.

93  {
94  o << "\n Unpacked Info for SRP Block"
95  << "\n DW1 ============================="
96  << "\n SRP Id " << srpId_ << "\n Numb Flags " << nSRFlags_ << "\n Bx " << bx_ << "\n L1 " << l1_;
97 
98  for (unsigned int i = 0; i < SRP_NUMBFLAGS; i++) {
99  o << "\n SR flag " << (i + 1) << " = " << (srFlags_[i]);
100  }
101 }

References bx_, mps_fire::i, l1_, nSRFlags_, EcalTangentSkim_cfg::o, srFlags_, SRP_NUMBFLAGS, and srpId_.

◆ srFlag()

unsigned short DCCSRPBlock::srFlag ( unsigned int  feChannel)
inline

◆ unpack() [1/2]

virtual int DCCDataBlockPrototype::unpack
inline

Definition at line 40 of file DCCDataBlockPrototype.h.

40 { return BLOCK_UNPACKED; }

◆ unpack() [2/2]

int DCCSRPBlock::unpack ( const uint64_t **  data,
unsigned int *  dwToEnd,
unsigned int  numbFlags = SRP_NUMBFLAGS 
)

Definition at line 16 of file DCCSRPBlock.cc.

16  {
17  // Set SR flags to zero
18  for (unsigned int i = 0; i < SRP_NUMBFLAGS; i++) {
19  srFlags_[i] = 0;
20  }
21 
22  expNumbSrFlags_ = numbFlags;
23  error_ = false;
24  datap_ = data;
25  data_ = *data;
26  dwToEnd_ = dwToEnd;
27 
28  // Check SRP Length
29  if ((*dwToEnd_) < blockLength_) {
31  edm::LogWarning("IncorrectEvent") << "\n Event " << l1_ << "\n Unable to unpack SRP block for event "
32  << event_->l1A() << " in fed <<" << mapper_->getActiveDCC() << "\n Only "
33  << ((*dwToEnd_) * 8) << " bytes are available while " << (blockLength_ * 8)
34  << " are needed!";
35  }
36 
37  //Note : add to error collection
38 
39  return STOP_EVENT_UNPACKING;
40  }
41 
42  // Point to begin of block
43  data_++;
44 
45  srpId_ = (*data_) & SRP_ID_MASK;
46  bx_ = (*data_ >> SRP_BX_B) & SRP_BX_MASK;
47  l1_ = (*data_ >> SRP_L1_B) & SRP_L1_MASK;
49 
51 
52  if (!checkSrpIdAndNumbSRFlags()) {
54  //return STOP_EVENT_UNPACKING;
56  return SKIP_BLOCK_UNPACKING;
57  }
58 
59  // Check synchronization
60  if (sync_) {
61  const unsigned int dccL1 = (event_->l1A()) & SRP_L1_MASK;
62  const unsigned int dccBx = (event_->bx()) & SRP_BX_MASK;
63  const unsigned int fov = (event_->fov()) & H_FOV_MASK;
64 
65  if (!isSynced(dccBx, bx_, dccL1, l1_, TCC_SRP, fov)) {
67  edm::LogWarning("IncorrectEvent")
68  << "Synchronization error for SRP block"
69  << " (L1A " << event_->l1A() << " bx " << event_->bx() << " fed " << mapper_->getActiveDCC() << ")\n"
70  << " dccBx = " << dccBx << " bx_ = " << bx_ << " dccL1 = " << dccL1 << " l1_ = " << l1_ << "\n"
71  << " => Stop event unpacking";
72  }
73  //Note : add to error collection ?
75  // return STOP_EVENT_UNPACKING;
77  return SKIP_BLOCK_UNPACKING;
78  }
79  }
80 
81  // initialize array, protecting in case of inconsistently formatted data
82  for (int dccCh = 0; dccCh < SRP_NUMBFLAGS; dccCh++)
83  srFlags_[dccCh] = 0;
84 
85  //display(cout);
87 
89 
90  return true;
91 }

References addSRFlagToCollection(), DCCDataBlockPrototype::blockLength_, DCCEventBlock::bx(), bx_, checkSrpIdAndNumbSRFlags(), data, DCCDataBlockPrototype::data_, DCCDataBlockPrototype::datap_, DCCDataBlockPrototype::dwToEnd_, DCCDataBlockPrototype::error_, DCCDataBlockPrototype::event_, expNumbSrFlags_, DCCEventBlock::fov(), EcalElectronicsMapper::getActiveDCC(), H_FOV_MASK, mps_fire::i, isSynced(), l1_, DCCEventBlock::l1A(), DCCDataBlockPrototype::mapper_, nSRFlags_, DCCEventBlock::setSRPSyncNumbers(), DCCDataUnpacker::silentMode_, SKIP_BLOCK_UNPACKING, srFlags_, SRP_BX_B, SRP_BX_MASK, SRP_ID_MASK, SRP_L1_B, SRP_L1_MASK, SRP_NFLAGS_B, SRP_NFLAGS_MASK, SRP_NUMBFLAGS, srpId_, STOP_EVENT_UNPACKING, DCCDataBlockPrototype::sync_, TCC_SRP, and DCCDataBlockPrototype::updateEventPointers().

Referenced by DCCEEEventBlock::unpack(), and DCCEBEventBlock::unpack().

Member Data Documentation

◆ bx_

unsigned int DCCSRPBlock::bx_
protected

Definition at line 46 of file DCCSRPBlock.h.

Referenced by display(), and unpack().

◆ expNumbSrFlags_

unsigned int DCCSRPBlock::expNumbSrFlags_
protected

◆ l1_

unsigned int DCCSRPBlock::l1_
protected

Definition at line 47 of file DCCSRPBlock.h.

Referenced by display(), and unpack().

◆ nSRFlags_

unsigned int DCCSRPBlock::nSRFlags_
protected

Definition at line 48 of file DCCSRPBlock.h.

Referenced by DCCEBSRPBlock::checkSrpIdAndNumbSRFlags(), display(), and unpack().

◆ srFlags_

unsigned short DCCSRPBlock::srFlags_[SRP_NUMBFLAGS]
protected

◆ srpId_

unsigned int DCCSRPBlock::srpId_
protected

Definition at line 43 of file DCCSRPBlock.h.

Referenced by display(), and unpack().

DCCDataBlockPrototype::dwToEnd_
unsigned int * dwToEnd_
Definition: DCCDataBlockPrototype.h:74
DCCEventBlock::setSRPSyncNumbers
void setSRPSyncNumbers(short l1, short bx)
Definition: DCCEventBlock.h:61
mps_fire.i
i
Definition: mps_fire.py:428
SRP_ID_MASK
Definition: DCCRawDataDefinitions.h:198
SKIP_BLOCK_UNPACKING
Definition: DCCRawDataDefinitions.h:7
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
DCCSRPBlock::addSRFlagToCollection
virtual void addSRFlagToCollection()
Definition: DCCSRPBlock.h:41
isSynced
bool isSynced(const unsigned int dccBx, const unsigned int bx, const unsigned int dccL1, const unsigned int l1, const BlockType type, const unsigned int fov)
Definition: DCCEventBlock.cc:228
SRP_BX_MASK
Definition: DCCRawDataDefinitions.h:200
H_FOV_MASK
Definition: DCCRawDataDefinitions.h:102
SRP_NFLAGS_MASK
Definition: DCCRawDataDefinitions.h:206
SRP_BLOCKLENGTH
Definition: DCCRawDataDefinitions.h:32
DCCDataBlockPrototype::updateEventPointers
virtual void updateEventPointers()
Definition: DCCDataBlockPrototype.h:51
DCCSRPBlock::l1_
unsigned int l1_
Definition: DCCSRPBlock.h:47
DCCDataUnpacker::silentMode_
static std::atomic< bool > silentMode_
Definition: DCCDataUnpacker.h:185
DCCDataBlockPrototype::error_
bool error_
Definition: DCCDataBlockPrototype.h:68
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
DCCEventBlock::fov
unsigned int fov()
Definition: DCCEventBlock.h:55
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
DCCSRPBlock::checkSrpIdAndNumbSRFlags
virtual bool checkSrpIdAndNumbSRFlags()
Definition: DCCSRPBlock.h:43
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
DCCEventBlock::bx
unsigned int bx()
Definition: DCCEventBlock.h:58
EcalElectronicsMapper::getActiveDCC
unsigned int getActiveDCC()
Definition: EcalElectronicsMapper.h:126
STOP_EVENT_UNPACKING
Definition: DCCRawDataDefinitions.h:8
SRP_NFLAGS_B
Definition: DCCRawDataDefinitions.h:207
DCCDataBlockPrototype::sync_
bool sync_
Definition: DCCDataBlockPrototype.h:78
DCCDataBlockPrototype::event_
DCCEventBlock * event_
Definition: DCCDataBlockPrototype.h:70
DCCDataBlockPrototype::DCCDataBlockPrototype
DCCDataBlockPrototype(DCCDataUnpacker *unpacker, EcalElectronicsMapper *mapper, DCCEventBlock *event, bool unpack=true)
Definition: DCCDataBlockPrototype.cc:3
TCC_SRP
Definition: DCCEventBlock.h:138
DCCSRPBlock::unpack
int unpack(const uint64_t **data, unsigned int *dwToEnd, unsigned int numbFlags=SRP_NUMBFLAGS)
Definition: DCCSRPBlock.cc:16
SRP_NUMBFLAGS
Definition: DCCRawDataDefinitions.h:31
DCCSRPBlock::bx_
unsigned int bx_
Definition: DCCSRPBlock.h:46
DCCEventBlock::l1A
unsigned int l1A()
Definition: DCCEventBlock.h:57
SRP_L1_MASK
Definition: DCCRawDataDefinitions.h:203
DCCDataBlockPrototype::mapper_
EcalElectronicsMapper * mapper_
Definition: DCCDataBlockPrototype.h:69
SRP_L1_B
Definition: DCCRawDataDefinitions.h:204
DCCDataBlockPrototype::datap_
const uint64_t ** datap_
Definition: DCCDataBlockPrototype.h:72
SRP_BX_B
Definition: DCCRawDataDefinitions.h:201
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
DCCDataBlockPrototype::blockLength_
unsigned int blockLength_
Definition: DCCDataBlockPrototype.h:76
DCCSRPBlock::srpId_
unsigned int srpId_
Definition: DCCSRPBlock.h:43
BLOCK_UNPACKED
Definition: DCCRawDataDefinitions.h:6
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37