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 {
42 public:
43 
44  explicit RctRawToDigi(const edm::ParameterSet&);
45  ~RctRawToDigi();
46 
47  //do we need this?
48  //static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
49 
50 private: // methods
51 
52  void produce(edm::Event&, const edm::EventSetup&);
53 
55 
56  void unpack(const FEDRawData& d, edm::Event& e, RctUnpackCollections * const colls);
57 
58  void unpackCTP7(const uint32_t *data, const unsigned block_id, const unsigned size, RctUnpackCollections * const colls);
59 
60  bool decodeLinkID(const uint32_t inputValue, uint32_t &crateNumber, uint32_t &linkNumber, bool &even);
61 
62  bool printAll(const unsigned char *data, const unsigned size);
65  void checkHeaders();
66 
68  virtual void endJob();
69 
70 
71 private: // members
72 
73  // SLink Header Size: 64bits
74  static const unsigned sLinkHeaderSize_ = 8;
75 
76  // SLink Trailer Size: 64bits
77  static const unsigned sLinkTrailerSize_ = 8;
78 
79  // SLink Header Size: two 64bit words
80  static const unsigned amc13HeaderSize_ = 16;
81 
82  // SLink Trailer Size: 64bits
83  static const unsigned amc13TrailerSize_ = 8;
84 
85  // CTP7 Header Size: 64bits
86  static const unsigned ctp7HeaderSize_ = 8;
87 
88  // CTP7 Trailer Size: 64bits
89  static const unsigned ctp7TrailerSize_ = 8;
90 
92  static const unsigned MAX_DATA = 4680;
93 
95  static const unsigned MIN_DATA = 900;
96 
97  // unpacking options
99  int fedId_;
100 
101  const bool verbose_;
102 
103  // vector of unpacked block headers, for verbostity and/or sync checks
104  //RctBlockHeaderCollection blockHeaders_;
105 
106  // error handling
107  static const unsigned MAX_ERR_CODE = 6;
109  std::vector<unsigned> errorCounters_;
110  unsigned unpackFailures_;
111 
112 };
113 
114 #endif
void checkHeaders()
size
Write out results.
std::vector< unsigned > errorCounters_
Counts number of errors for each code (index)
Definition: RctRawToDigi.h:109
static const unsigned sLinkTrailerSize_
Definition: RctRawToDigi.h:77
static const unsigned sLinkHeaderSize_
Definition: RctRawToDigi.h:74
virtual void endJob()
method called at job end - use to print summary report
std::vector< L1TriggerError > L1TriggerErrorCollection
static const unsigned amc13TrailerSize_
Definition: RctRawToDigi.h:83
L1TriggerErrorCollection * errors_
pointer to error collection
Definition: RctRawToDigi.h:108
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:95
void unpackCTP7(const uint32_t *data, const unsigned block_id, const unsigned size, RctUnpackCollections *const colls)
static const unsigned ctp7TrailerSize_
Definition: RctRawToDigi.h:89
static const unsigned ctp7HeaderSize_
Definition: RctRawToDigi.h:86
unsigned unpackFailures_
To count the total number of RCT unpack failures.
Definition: RctRawToDigi.h:110
static const unsigned MAX_ERR_CODE
Definition: RctRawToDigi.h:107
RctRawToDigi(const edm::ParameterSet &)
Definition: RctRawToDigi.cc:36
edm::InputTag inputLabel_
FED collection label.
Definition: RctRawToDigi.h:98
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
static const unsigned MAX_DATA
The maximum number of blocks we will try to unpack before thinking something is wrong.
Definition: RctRawToDigi.h:92
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.
bool printAll(const unsigned char *data, const unsigned size)
int fedId_
RCT FED ID.
Definition: RctRawToDigi.h:99
void produce(edm::Event &, const edm::EventSetup &)
Definition: RctRawToDigi.cc:61
const bool verbose_
If true, then debug print out for each event.
Definition: RctRawToDigi.h:101
static const unsigned amc13HeaderSize_
Definition: RctRawToDigi.h:80