CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DCCEventBlock.h
Go to the documentation of this file.
1 #ifndef DCCEVENTBLOCK_HH
2 #define DCCEVENTBLOCK_HH
3 
4 /*
5  *\ Class DCCEventBlock
6  *
7  * Class responsible for managing the raw data unpacking.
8  * The class instantes the DCCMemBlock
9  *
10  * \file DCCEventBlock.h
11  *
12  *
13  * \author N. Almeida
14  * \author G. Franzoni
15  *
16 */
17 
20 #include "DCCRawDataDefinitions.h"
21 
22 class DCCFEBlock;
23 class DCCTCCBlock;
24 class DCCSRPBlock;
25 class DCCDataUnpacker;
26 class DCCMemBlock;
28 
30 public:
33  bool hU,
34  bool srpU,
35  bool tccU,
36  bool feU,
37  bool memU,
38  bool forceToKeepFRdata);
39 
40  virtual ~DCCEventBlock();
41 
42  virtual void unpack(const uint64_t* buffer, size_t bufferSize, unsigned int expFedId){};
43 
44  void reset();
45 
46  void enableSyncChecks();
47 
48  void enableFeIdChecks();
49 
50  void updateCollectors();
51 
52  void display(std::ostream& o);
53 
54  unsigned int smId() { return smId_; }
55  unsigned int fov() { return fov_; }
56  unsigned int mem() { return mem_; }
57  unsigned int l1A() { return l1_; }
58  unsigned int bx() { return bx_; }
60 
61  void setSRPSyncNumbers(short l1, short bx) {
62  srpLv1_ = l1;
63  srpBx_ = bx;
64  }
65  void setFESyncNumbers(short l1, short bx, short id) {
66  feLv1_[id] = l1;
67  feBx_[id] = bx;
68  }
69  void setTCCSyncNumbers(short l1, short bx, short id) {
70  tccLv1_[id] = l1;
71  tccBx_[id] = bx;
72  }
73  void setHLTChannel(int channel, short value) { hlt_[channel - 1] = value; }
74  short getHLTChannel(int channel) { return hlt_[channel - 1]; }
75 
76 protected:
77  void addHeaderToCollection();
78 
79  int virtual unpackTCCBlocks() { return BLOCK_UNPACKED; }
80 
82  const uint64_t* data_;
83  unsigned int eventSize_;
84  unsigned int dwToEnd_;
85 
86  unsigned int next_tower_search(const unsigned int current_tower_id);
87 
88  std::vector<short> feChStatus_;
89  std::vector<short> tccChStatus_;
90  std::vector<short> hlt_;
91 
92  std::vector<short> feLv1_;
93  std::vector<short> feBx_;
94  std::vector<short> tccLv1_;
95  std::vector<short> tccBx_;
96  short srpLv1_;
97  short srpBx_;
98 
99  unsigned int srChStatus_;
100 
101  unsigned int fov_;
102  unsigned int fedId_;
103  unsigned int bx_;
104  unsigned int l1_;
105  unsigned int triggerType_;
106  unsigned int smId_;
107  unsigned int blockLength_;
108  unsigned int dccErrors_;
109  unsigned int runNumber_;
110  unsigned int runType_;
111  unsigned int detailedTriggerType_;
112 
113  unsigned int orbitCounter_;
114  unsigned int mem_;
115  unsigned int sr_;
116  unsigned int zs_;
117  unsigned int tzs_;
118 
124 
131 
132  std::unique_ptr<EcalRawDataCollection>* dccHeaders_;
133 };
134 
135 // this code intended for sync checking in files:
136 // DCC(FE|Mem|TCC|SRP)Block.cc
137 
138 enum BlockType { FE_MEM = 1, TCC_SRP = 2 };
139 
140 bool isSynced(const unsigned int dccBx,
141  const unsigned int bx,
142  const unsigned int dccL1,
143  const unsigned int l1,
144  const BlockType type,
145  const unsigned int fov);
146 
147 #endif
bool forceToKeepFRdata_
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)
DCCEventBlock(DCCDataUnpacker *u, EcalElectronicsMapper *m, bool hU, bool srpU, bool tccU, bool feU, bool memU, bool forceToKeepFRdata)
void enableSyncChecks()
uint16_t *__restrict__ id
unsigned int runType_
EcalElectronicsMapper * mapper_
DCCFEBlock * towerBlock_
DCCSRPBlock * srpBlock_
void setTCCSyncNumbers(short l1, short bx, short id)
Definition: DCCEventBlock.h:69
unsigned int dwToEnd_
Definition: DCCEventBlock.h:84
void enableFeIdChecks()
unsigned int mem_
unsigned int smId()
Definition: DCCEventBlock.h:54
DCCMemBlock * memBlock_
unsigned int srChStatus_
Definition: DCCEventBlock.h:99
void setHLTChannel(int channel, short value)
Definition: DCCEventBlock.h:73
unsigned int detailedTriggerType_
std::vector< short > hlt_
Definition: DCCEventBlock.h:90
unsigned int blockLength_
unsigned int triggerType_
const uint64_t * data_
Definition: DCCEventBlock.h:82
DCCDataUnpacker * unpacker_
Definition: DCCEventBlock.h:81
unsigned int runNumber_
std::vector< short > tccBx_
Definition: DCCEventBlock.h:95
unsigned int sr_
unsigned int l1_
unsigned int bx()
Definition: DCCEventBlock.h:58
unsigned int eventSize_
Definition: DCCEventBlock.h:83
std::vector< short > tccLv1_
Definition: DCCEventBlock.h:94
std::vector< short > feBx_
Definition: DCCEventBlock.h:93
unsigned int fov()
Definition: DCCEventBlock.h:55
void setFESyncNumbers(short l1, short bx, short id)
Definition: DCCEventBlock.h:65
unsigned int orbitCounter_
DCCDataUnpacker * unpacker()
Definition: DCCEventBlock.h:59
DCCTCCBlock * tccBlock_
std::vector< short > feChStatus_
Definition: DCCEventBlock.h:88
unsigned long long uint64_t
Definition: Time.h:13
void updateCollectors()
unsigned int fov_
std::vector< short > feLv1_
Definition: DCCEventBlock.h:92
unsigned int bx_
BlockType
short getHLTChannel(int channel)
Definition: DCCEventBlock.h:74
std::unique_ptr< EcalRawDataCollection > * dccHeaders_
virtual ~DCCEventBlock()
unsigned int zs_
virtual void unpack(const uint64_t *buffer, size_t bufferSize, unsigned int expFedId)
Definition: DCCEventBlock.h:42
void addHeaderToCollection()
unsigned int next_tower_search(const unsigned int current_tower_id)
unsigned int tzs_
unsigned int smId_
void display(std::ostream &o)
void setSRPSyncNumbers(short l1, short bx)
Definition: DCCEventBlock.h:61
virtual int unpackTCCBlocks()
Definition: DCCEventBlock.h:79
std::vector< short > tccChStatus_
Definition: DCCEventBlock.h:89
unsigned int fedId_
unsigned int mem()
Definition: DCCEventBlock.h:56
unsigned int l1A()
Definition: DCCEventBlock.h:57
unsigned int dccErrors_