CMS 3D CMS Logo

RctRawToDigi.h
Go to the documentation of this file.
1 #ifndef RctRawToDigi_h
2 #define RctRawToDigi_h
3 
4 // -*- C++ -*-
5 //
6 // Package: RctRawToDigi
7 // Class: RctRawToDigi
8 //
17 // system include files
18 #include <memory>
19 #include <ostream>
20 #include <string>
21 
22 // user include files
28 
31 #include "EventFilter/RctRawToDigi/src/RCTInfo.hh"
32 #include "EventFilter/RctRawToDigi/src/CTP7Format.hh"
34 #include "EventFilter/RctRawToDigi/src/RctDataDecoder.hh"
35 
36 // *******************************************************************
37 // *** THE UNPACK PROCESS MUST NEVER THROW ANY KIND OF EXCEPTION! ***
38 // *******************************************************************
39 
41 public:
42  explicit RctRawToDigi(const edm::ParameterSet &);
43  ~RctRawToDigi() override;
44 
45  //do we need this?
46  //static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
47 
48 private: // methods
49  void produce(edm::Event &, const edm::EventSetup &) override;
50 
52 
53  void unpack(const FEDRawData &d, edm::Event &e, RctUnpackCollections *const colls);
54 
55  void unpackCTP7(const uint32_t *data, const unsigned block_id, const unsigned size, RctUnpackCollections *const colls);
56 
57  bool decodeLinkID(const uint32_t inputValue, uint32_t &crateNumber, uint32_t &linkNumber, bool &even);
58 
59  bool printAll(const unsigned char *data, const unsigned size);
62  void checkHeaders();
63 
65  virtual void endJob();
66 
67 private: // members
68  // SLink Header Size: 64bits
69  static const unsigned sLinkHeaderSize_ = 8;
70 
71  // SLink Trailer Size: 64bits
72  static const unsigned sLinkTrailerSize_ = 8;
73 
74  // SLink Header Size: two 64bit words
75  static const unsigned amc13HeaderSize_ = 16;
76 
77  // SLink Trailer Size: 64bits
78  static const unsigned amc13TrailerSize_ = 8;
79 
80  // CTP7 Header Size: 64bits
81  static const unsigned ctp7HeaderSize_ = 8;
82 
83  // CTP7 Trailer Size: 64bits
84  static const unsigned ctp7TrailerSize_ = 8;
85 
87  static const unsigned MAX_DATA = 4680;
88 
90  static const unsigned MIN_DATA = 900;
91 
92  // unpacking options
94  int fedId_;
95 
96  const bool verbose_;
97 
98  // vector of unpacked block headers, for verbostity and/or sync checks
99  //RctBlockHeaderCollection blockHeaders_;
100 
101  // error handling
102  static const unsigned MAX_ERR_CODE = 6;
104  std::vector<unsigned> errorCounters_;
105  unsigned unpackFailures_;
106 };
107 
108 #endif
void checkHeaders()
size
Write out results.
std::vector< unsigned > errorCounters_
Counts number of errors for each code (index)
Definition: RctRawToDigi.h:104
static const unsigned sLinkTrailerSize_
Definition: RctRawToDigi.h:72
static const unsigned sLinkHeaderSize_
Definition: RctRawToDigi.h:69
virtual void endJob()
method called at job end - use to print summary report
std::vector< L1TriggerError > L1TriggerErrorCollection
static const unsigned amc13TrailerSize_
Definition: RctRawToDigi.h:78
L1TriggerErrorCollection * errors_
pointer to error collection
Definition: RctRawToDigi.h:103
static const unsigned MIN_DATA
The minimum number of blocks we will try to unpack before thinking something is wrong (really this sh...
Definition: RctRawToDigi.h:90
void unpackCTP7(const uint32_t *data, const unsigned block_id, const unsigned size, RctUnpackCollections *const colls)
static const unsigned ctp7TrailerSize_
Definition: RctRawToDigi.h:84
~RctRawToDigi() override
Definition: RctRawToDigi.cc:48
static const unsigned ctp7HeaderSize_
Definition: RctRawToDigi.h:81
d
Definition: ztail.py:151
unsigned unpackFailures_
To count the total number of RCT unpack failures.
Definition: RctRawToDigi.h:105
static const unsigned MAX_ERR_CODE
Definition: RctRawToDigi.h:102
RctRawToDigi(const edm::ParameterSet &)
Definition: RctRawToDigi.cc:34
edm::InputTag inputLabel_
FED collection label.
Definition: RctRawToDigi.h:93
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
static const unsigned MAX_DATA
The maximum number of blocks we will try to unpack before thinking something is wrong.
Definition: RctRawToDigi.h:87
void produce(edm::Event &, const edm::EventSetup &) override
Definition: RctRawToDigi.cc:55
bool decodeLinkID(const uint32_t inputValue, uint32_t &crateNumber, uint32_t &linkNumber, bool &even)
void unpack(const FEDRawData &d, edm::Event &e, RctUnpackCollections *const colls)
Unpacks the raw data.
Definition: RctRawToDigi.cc:94
bool printAll(const unsigned char *data, const unsigned size)
int fedId_
RCT FED ID.
Definition: RctRawToDigi.h:94
const bool verbose_
If true, then debug print out for each event.
Definition: RctRawToDigi.h:96
static const unsigned amc13HeaderSize_
Definition: RctRawToDigi.h:75