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
RctRawToDigi::MAX_ERR_CODE
static const unsigned MAX_ERR_CODE
Definition: RctRawToDigi.h:102
RctRawToDigi::unpack
void unpack(const FEDRawData &d, edm::Event &e, RctUnpackCollections *const colls)
Unpacks the raw data.
Definition: RctRawToDigi.cc:94
RctRawToDigi::amc13TrailerSize_
static const unsigned amc13TrailerSize_
Definition: RctRawToDigi.h:78
EDProducer.h
RctRawToDigi::~RctRawToDigi
~RctRawToDigi() override
Definition: RctRawToDigi.cc:48
RctRawToDigi::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: RctRawToDigi.cc:55
FEDRawData.h
RctRawToDigi::ctp7TrailerSize_
static const unsigned ctp7TrailerSize_
Definition: RctRawToDigi.h:84
FEDRawData
Definition: FEDRawData.h:19
RctRawToDigi
Definition: RctRawToDigi.h:40
RctUnpackCollections.h
RctRawToDigi::errors_
L1TriggerErrorCollection * errors_
pointer to error collection
Definition: RctRawToDigi.h:103
RctRawToDigi::MAX_DATA
static const unsigned MAX_DATA
The maximum number of blocks we will try to unpack before thinking something is wrong.
Definition: RctRawToDigi.h:87
RctRawToDigi::MIN_DATA
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
L1TriggerErrorCollection
std::vector< L1TriggerError > L1TriggerErrorCollection
Definition: L1TriggerError.h:45
RctRawToDigi::decodeLinkID
bool decodeLinkID(const uint32_t inputValue, uint32_t &crateNumber, uint32_t &linkNumber, bool &even)
RctRawToDigi::inputLabel_
edm::InputTag inputLabel_
FED collection label.
Definition: RctRawToDigi.h:93
RctRawToDigi::unpackFailures_
unsigned unpackFailures_
To count the total number of RCT unpack failures.
Definition: RctRawToDigi.h:105
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
RctRawToDigi::unpackCTP7
void unpackCTP7(const uint32_t *data, const unsigned block_id, const unsigned size, RctUnpackCollections *const colls)
Definition: RctRawToDigi.cc:123
RctRawToDigi::endJob
virtual void endJob()
method called at job end - use to print summary report
Definition: RctRawToDigi.cc:311
RctRawToDigi::errorCounters_
std::vector< unsigned > errorCounters_
Counts number of errors for each code (index)
Definition: RctRawToDigi.h:104
edm::stream::EDProducer
Definition: EDProducer.h:36
RctRawToDigi::ctp7HeaderSize_
static const unsigned ctp7HeaderSize_
Definition: RctRawToDigi.h:81
edm::EventSetup
Definition: EventSetup.h:58
InputTag.h
RctRawToDigi::checkHeaders
void checkHeaders()
RctRawToDigi::RctRawToDigi
RctRawToDigi(const edm::ParameterSet &)
Definition: RctRawToDigi.cc:34
Frameworkfwd.h
RctRawToDigi::printAll
bool printAll(const unsigned char *data, const unsigned size)
Definition: RctRawToDigi.cc:301
RctRawToDigi::verbose_
const bool verbose_
If true, then debug print out for each event.
Definition: RctRawToDigi.h:96
RctUnpackCollections
Definition: RctUnpackCollections.h:18
RctRawToDigi::amc13HeaderSize_
static const unsigned amc13HeaderSize_
Definition: RctRawToDigi.h:75
RctRawToDigi::sLinkTrailerSize_
static const unsigned sLinkTrailerSize_
Definition: RctRawToDigi.h:72
RctRawToDigi::fedId_
int fedId_
RCT FED ID.
Definition: RctRawToDigi.h:94
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
RctRawToDigi::sLinkHeaderSize_
static const unsigned sLinkHeaderSize_
Definition: RctRawToDigi.h:69
ztail.d
d
Definition: ztail.py:151
AMCSpec.h
ParameterSet.h
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37