CMS 3D CMS Logo

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

#include <DCCTCCBlock.h>

Inheritance diagram for DCCTCCBlock:
DCCDataBlockPrototype DCCEBTCCBlock DCCEETCCBlock

Public Member Functions

virtual void addTriggerPrimitivesToCollection ()
 
 DCCTCCBlock (DCCDataUnpacker *u, EcalElectronicsMapper *m, DCCEventBlock *e, bool unpack)
 
void display (std::ostream &o) override
 
virtual int unpack (const uint64_t **data, unsigned int *dwToEnd)
 
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 updateCollectors ()
 
virtual void updateEventPointers ()
 
virtual ~DCCDataBlockPrototype ()
 

Protected Member Functions

virtual bool checkTccIdAndNumbTTs ()
 

Protected Attributes

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_
 
EcalTrigTowerDetIdpTTDetId_
 
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 33 of file DCCTCCBlock.h.

Constructor & Destructor Documentation

◆ DCCTCCBlock()

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

Class constructor

Definition at line 7 of file DCCTCCBlock.cc.

Member Function Documentation

◆ addTriggerPrimitivesToCollection()

virtual void DCCTCCBlock::addTriggerPrimitivesToCollection ( )
inlinevirtual

Reimplemented in DCCEBTCCBlock, and DCCEETCCBlock.

Definition at line 40 of file DCCTCCBlock.h.

40 {};

Referenced by unpack().

◆ checkTccIdAndNumbTTs()

virtual bool DCCTCCBlock::checkTccIdAndNumbTTs ( )
inlineprotectedvirtual

Reimplemented in DCCEBTCCBlock, and DCCEETCCBlock.

Definition at line 51 of file DCCTCCBlock.h.

51 { return true; };

Referenced by unpack().

◆ display()

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

Reimplemented from DCCDataBlockPrototype.

Definition at line 112 of file DCCTCCBlock.cc.

112  {
113  o << "\n Unpacked Info for DCC TCC Block"
114  << "\n DW1 ============================="
115  << "\n TCC Id " << tccId_ << "\n Bx " << bx_ << "\n L1 " << l1_ << "\n Numb TT " << nTTs_ << "\n Numb Samp "
116  << nTSamples_;
117 }

References bx_, l1_, nTSamples_, nTTs_, EcalTangentSkim_cfg::o, and tccId_.

◆ unpack() [1/2]

virtual int DCCDataBlockPrototype::unpack
inline

Unpacks TCC data

Definition at line 40 of file DCCDataBlockPrototype.h.

40 { return BLOCK_UNPACKED; }

◆ unpack() [2/2]

int DCCTCCBlock::unpack ( const uint64_t **  data,
unsigned int *  dwToEnd,
short  tccChId = 0 
)

Definition at line 10 of file DCCTCCBlock.cc.

10  {
11  dwToEnd_ = dwToEnd;
12  datap_ = data;
13  data_ = *data;
14 
15  // Need at least 1 dw to findout if pseudo-strips readout is enabled
16  if (*dwToEnd == 1) {
18  edm::LogWarning("IncorrectEvent") << "EcalRawToDigi@SUB=DCCTCCBlock:unpack"
19  << "\n Unable to unpack TCC block for event " << event_->l1A() << " in fed "
20  << mapper_->getActiveDCC()
21  << "\n Only 8 bytes are available until the end of event ..."
22  << "\n => Skipping to next fed block...";
23  }
24 
25  //todo : add this to error colection
26 
27  return STOP_EVENT_UNPACKING;
28  }
29 
31 
32  if ((*dwToEnd_) < blockLength_) {
34  edm::LogWarning("IncorrectEvent") << "EcalRawToDigi@SUB=DCCTCCBlock:unpack"
35  << "\n Unable to unpack TCC block for event " << event_->l1A() << " in fed "
36  << mapper_->getActiveDCC() << "\n Only " << ((*dwToEnd_) * 8)
37  << " bytes are available until the end of event while " << (blockLength_ * 8)
38  << " are needed!"
39  << "\n => Skipping to next fed block...";
40  }
41 
42  //todo : add this to error colection
43 
44  return STOP_EVENT_UNPACKING;
45  }
46 
47  if (unpackInternalData_) {
48  // Go to the begining of the tcc block
49  data_++;
50 
51  tccId_ = (*data_) & TCC_ID_MASK;
52  ps_ = (*data_ >> TCC_PS_B) & B_MASK;
53  bx_ = (*data_ >> TCC_BX_B) & TCC_BX_MASK;
54  l1_ = (*data_ >> TCC_L1_B) & TCC_L1_MASK;
55  nTTs_ = (*data_ >> TCC_TT_B) & TCC_TT_MASK;
57 
58  event_->setTCCSyncNumbers(l1_, bx_, tccChId);
59 
60  if (!checkTccIdAndNumbTTs()) {
62  return SKIP_BLOCK_UNPACKING;
63  }
64 
65  // Check synchronization
66  if (sync_) {
67  const unsigned int dccBx = (event_->bx()) & TCC_BX_MASK;
68  const unsigned int dccL1 = (event_->l1A()) & TCC_L1_MASK;
69  const unsigned int fov = (event_->fov()) & H_FOV_MASK;
70 
71  if (!isSynced(dccBx, bx_, dccL1, l1_, TCC_SRP, fov)) {
73  edm::LogWarning("IncorrectBlock")
74  << "Synchronization error for TCC block"
75  << " (L1A " << event_->l1A() << " bx " << event_->bx() << " fed " << mapper_->getActiveDCC() << ")\n"
76  << " dccBx = " << dccBx << " bx_ = " << bx_ << " dccL1 = " << dccL1 << " l1_ = " << l1_ << "\n"
77  << " => TCC block skipped";
78  }
79 
80  //Note : add to error collection ?
82  return SKIP_BLOCK_UNPACKING;
83  }
84  }
85 
86  //check numb of samples
87  /*
88  unsigned int expTriggerTSamples(mapper_->numbTriggerTSamples());
89 
90  if( nTSamples_ != expTriggerTSamples ){
91  edm::LogWarning("IncorrectBlock")
92  <<"Unable to unpack TCC block for event "<<event_->l1A()<<" in fed "<<mapper_->getActiveDCC()
93  <<"\n Number of time samples is "<<nTSamples_<<" while "<<expTriggerTSamples<<" is expected"
94  <<"\n TCC block skipped..."<<endl;
95 
96  //Note : add to error collection ?
97  updateEventPointers();
98  return SKIP_BLOCK_UNPACKING;
99  }
100  */
101 
102  // debugging
103  // display(cout);
104 
106  }
107 
109  return BLOCK_UNPACKED;
110 }

References addTriggerPrimitivesToCollection(), B_MASK, BLOCK_UNPACKED, DCCDataBlockPrototype::blockLength_, DCCEventBlock::bx(), bx_, checkTccIdAndNumbTTs(), data, DCCDataBlockPrototype::data_, DCCDataBlockPrototype::datap_, DCCDataBlockPrototype::dwToEnd_, DCCDataBlockPrototype::event_, DCCEventBlock::fov(), EcalElectronicsMapper::getActiveDCC(), DCCDataBlockPrototype::getLength(), H_FOV_MASK, isSynced(), l1_, DCCEventBlock::l1A(), DCCDataBlockPrototype::mapper_, nTSamples_, nTTs_, ps_, DCCEventBlock::setTCCSyncNumbers(), DCCDataUnpacker::silentMode_, SKIP_BLOCK_UNPACKING, STOP_EVENT_UNPACKING, DCCDataBlockPrototype::sync_, TCC_BX_B, TCC_BX_MASK, TCC_ID_MASK, TCC_L1_B, TCC_L1_MASK, TCC_PS_B, TCC_SRP, TCC_TS_B, TCC_TS_MASK, TCC_TT_B, TCC_TT_MASK, tccId_, DCCDataBlockPrototype::unpackInternalData_, and DCCDataBlockPrototype::updateEventPointers().

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

Member Data Documentation

◆ bx_

unsigned int DCCTCCBlock::bx_
protected

Definition at line 54 of file DCCTCCBlock.h.

Referenced by display(), and unpack().

◆ expNumbTTs_

unsigned int DCCTCCBlock::expNumbTTs_
protected

◆ expTccId_

unsigned int DCCTCCBlock::expTccId_
protected

Definition at line 59 of file DCCTCCBlock.h.

Referenced by DCCEBTCCBlock::checkTccIdAndNumbTTs().

◆ l1_

unsigned int DCCTCCBlock::l1_
protected

Definition at line 55 of file DCCTCCBlock.h.

Referenced by display(), and unpack().

◆ nTSamples_

unsigned int DCCTCCBlock::nTSamples_
protected

Definition at line 57 of file DCCTCCBlock.h.

Referenced by DCCEBTCCBlock::addTriggerPrimitivesToCollection(), display(), and unpack().

◆ nTTs_

unsigned int DCCTCCBlock::nTTs_
protected

◆ pPS_

EcalPseudoStripInputDigi* DCCTCCBlock::pPS_
protected

Definition at line 64 of file DCCTCCBlock.h.

Referenced by DCCEETCCBlock::addTriggerPrimitivesToCollection().

◆ ps_

unsigned int DCCTCCBlock::ps_
protected

◆ pss_

std::unique_ptr<EcalPSInputDigiCollection>* DCCTCCBlock::pss_
protected

Definition at line 66 of file DCCTCCBlock.h.

Referenced by DCCEETCCBlock::updateCollectors().

◆ pTP_

EcalTriggerPrimitiveDigi* DCCTCCBlock::pTP_
protected

◆ pTTDetId_

EcalTrigTowerDetId* DCCTCCBlock::pTTDetId_
protected

Definition at line 62 of file DCCTCCBlock.h.

◆ tccId_

unsigned int DCCTCCBlock::tccId_
protected

◆ tps_

std::unique_ptr<EcalTrigPrimDigiCollection>* DCCTCCBlock::tps_
protected
DCCDataBlockPrototype::dwToEnd_
unsigned int * dwToEnd_
Definition: DCCDataBlockPrototype.h:74
SKIP_BLOCK_UNPACKING
Definition: DCCRawDataDefinitions.h:7
DCCDataBlockPrototype::data_
const uint64_t * data_
Definition: DCCDataBlockPrototype.h:73
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
TCC_BX_B
Definition: DCCRawDataDefinitions.h:180
H_FOV_MASK
Definition: DCCRawDataDefinitions.h:102
DCCDataBlockPrototype::getLength
virtual unsigned int getLength()
Definition: DCCDataBlockPrototype.h:64
DCCTCCBlock::l1_
unsigned int l1_
Definition: DCCTCCBlock.h:55
TCC_TS_B
Definition: DCCRawDataDefinitions.h:189
DCCDataBlockPrototype::updateEventPointers
virtual void updateEventPointers()
Definition: DCCDataBlockPrototype.h:51
DCCDataUnpacker::silentMode_
static std::atomic< bool > silentMode_
Definition: DCCDataUnpacker.h:185
TCC_ID_MASK
Definition: DCCRawDataDefinitions.h:175
DCCTCCBlock::unpack
int unpack(const uint64_t **data, unsigned int *dwToEnd, short tccChId=0)
Definition: DCCTCCBlock.cc:10
DCCTCCBlock::nTSamples_
unsigned int nTSamples_
Definition: DCCTCCBlock.h:57
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
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
TCC_L1_B
Definition: DCCRawDataDefinitions.h:183
DCCEventBlock::setTCCSyncNumbers
void setTCCSyncNumbers(short l1, short bx, short id)
Definition: DCCEventBlock.h:69
TCC_TT_MASK
Definition: DCCRawDataDefinitions.h:185
STOP_EVENT_UNPACKING
Definition: DCCRawDataDefinitions.h:8
B_MASK
Definition: DCCRawDataDefinitions.h:10
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_BX_MASK
Definition: DCCRawDataDefinitions.h:179
DCCTCCBlock::checkTccIdAndNumbTTs
virtual bool checkTccIdAndNumbTTs()
Definition: DCCTCCBlock.h:51
TCC_SRP
Definition: DCCEventBlock.h:138
TCC_TS_MASK
Definition: DCCRawDataDefinitions.h:188
DCCTCCBlock::addTriggerPrimitivesToCollection
virtual void addTriggerPrimitivesToCollection()
Definition: DCCTCCBlock.h:40
DCCEventBlock::l1A
unsigned int l1A()
Definition: DCCEventBlock.h:57
TCC_PS_B
Definition: DCCRawDataDefinitions.h:177
DCCDataBlockPrototype::mapper_
EcalElectronicsMapper * mapper_
Definition: DCCDataBlockPrototype.h:69
DCCDataBlockPrototype::datap_
const uint64_t ** datap_
Definition: DCCDataBlockPrototype.h:72
DCCTCCBlock::ps_
unsigned int ps_
Definition: DCCTCCBlock.h:60
DCCTCCBlock::bx_
unsigned int bx_
Definition: DCCTCCBlock.h:54
DCCTCCBlock::tccId_
unsigned int tccId_
Definition: DCCTCCBlock.h:51
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
DCCDataBlockPrototype::blockLength_
unsigned int blockLength_
Definition: DCCDataBlockPrototype.h:76
TCC_TT_B
Definition: DCCRawDataDefinitions.h:186
DCCDataBlockPrototype::unpackInternalData_
bool unpackInternalData_
Definition: DCCDataBlockPrototype.h:77
BLOCK_UNPACKED
Definition: DCCRawDataDefinitions.h:6
DCCTCCBlock::nTTs_
unsigned int nTTs_
Definition: DCCTCCBlock.h:56
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
TCC_L1_MASK
Definition: DCCRawDataDefinitions.h:182