CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
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 34 of file DCCTCCBlock.h.

Constructor & Destructor Documentation

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

Class constructor

Definition at line 7 of file DCCTCCBlock.cc.

7  :
int unpack(const uint64_t **data, unsigned int *dwToEnd, short tccChId=0)
Definition: DCCTCCBlock.cc:11
DCCDataBlockPrototype(DCCDataUnpacker *unpacker, EcalElectronicsMapper *mapper, DCCEventBlock *event, bool unpack=true)

Member Function Documentation

virtual void DCCTCCBlock::addTriggerPrimitivesToCollection ( )
inlinevirtual

Reimplemented in DCCEBTCCBlock, and DCCEETCCBlock.

Definition at line 42 of file DCCTCCBlock.h.

Referenced by unpack().

42 {};
virtual bool DCCTCCBlock::checkTccIdAndNumbTTs ( )
inlineprotectedvirtual

Reimplemented in DCCEBTCCBlock, and DCCEETCCBlock.

Definition at line 55 of file DCCTCCBlock.h.

Referenced by unpack().

55 {return true;};
void DCCTCCBlock::display ( std::ostream &  o)
virtual

Reimplemented from DCCDataBlockPrototype.

Definition at line 122 of file DCCTCCBlock.cc.

References bx_, l1_, nTSamples_, nTTs_, and tccId_.

122  {
123 
124  o<<"\n Unpacked Info for DCC TCC Block"
125  <<"\n DW1 ============================="
126  <<"\n TCC Id "<<tccId_
127  <<"\n Bx "<<bx_
128  <<"\n L1 "<<l1_
129  <<"\n Numb TT "<<nTTs_
130  <<"\n Numb Samp "<<nTSamples_;
131 }
unsigned int nTSamples_
Definition: DCCTCCBlock.h:61
unsigned int l1_
Definition: DCCTCCBlock.h:59
unsigned int bx_
Definition: DCCTCCBlock.h:58
unsigned int tccId_
Definition: DCCTCCBlock.h:55
unsigned int nTTs_
Definition: DCCTCCBlock.h:60
int DCCTCCBlock::unpack ( const uint64_t **  data,
unsigned int *  dwToEnd,
short  tccChId = 0 
)

Definition at line 11 of file DCCTCCBlock.cc.

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().

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

Member Data Documentation

unsigned int DCCTCCBlock::bx_
protected

Definition at line 58 of file DCCTCCBlock.h.

Referenced by display(), and unpack().

unsigned int DCCTCCBlock::expNumbTTs_
protected
unsigned int DCCTCCBlock::expTccId_
protected

Definition at line 63 of file DCCTCCBlock.h.

Referenced by DCCEBTCCBlock::checkTccIdAndNumbTTs().

unsigned int DCCTCCBlock::l1_
protected

Definition at line 59 of file DCCTCCBlock.h.

Referenced by display(), and unpack().

unsigned int DCCTCCBlock::nTSamples_
protected

Definition at line 61 of file DCCTCCBlock.h.

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

unsigned int DCCTCCBlock::nTTs_
protected
EcalPseudoStripInputDigi* DCCTCCBlock::pPS_
protected

Definition at line 68 of file DCCTCCBlock.h.

Referenced by DCCEETCCBlock::addTriggerPrimitivesToCollection().

unsigned int DCCTCCBlock::ps_
protected
std::unique_ptr<EcalPSInputDigiCollection>* DCCTCCBlock::pss_
protected

Definition at line 70 of file DCCTCCBlock.h.

Referenced by DCCEETCCBlock::updateCollectors().

EcalTriggerPrimitiveDigi* DCCTCCBlock::pTP_
protected
EcalTrigTowerDetId* DCCTCCBlock::pTTDetId_
protected

Definition at line 66 of file DCCTCCBlock.h.

unsigned int DCCTCCBlock::tccId_
protected
std::unique_ptr<EcalTrigPrimDigiCollection>* DCCTCCBlock::tps_
protected