CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GctRawToDigi.h
Go to the documentation of this file.
1 #ifndef GctRawToDigi_h
2 #define GctRawToDigi_h
3 
4 // -*- C++ -*-
5 //
6 // Package: GctRawToDigi
7 // Class: GctRawToDigi
8 //
16 //
17 // Original Author: Jim Brooke
18 // Created: Wed Nov 1 11:57:10 CET 2006
19 //
20 //
21 
22 // system include files
23 #include <memory>
24 #include <ostream>
25 #include <string>
26 
27 // user include files
33 
35 
38 
39 // *******************************************************************
40 // *** THE UNPACK PROCESS MUST NEVER THROW ANY KIND OF EXCEPTION! ***
41 // *******************************************************************
42 
44 public:
45  explicit GctRawToDigi(const edm::ParameterSet&);
46  ~GctRawToDigi() override;
47 
48  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
49 
50 private: // methods
51  void produce(edm::Event&, const edm::EventSetup&) override;
52 
54 
55  void unpack(const FEDRawData& d, edm::Event& e, GctUnpackCollections* const colls);
56 
58 
59  bool autoDetectRequiredFormatTranslator(const unsigned char* data);
60 
62  void checkHeaders();
63 
65  void doVerboseOutput(const GctBlockHeaderCollection& bHdrs, const GctUnpackCollections* const colls) const;
66 
67  // add an error to the error collection
68  void addError(const unsigned code);
69 
71  virtual void endJob();
72 
73 private: // members
75  static const unsigned MAX_BLOCKS = 256;
76 
77  // unpacking options
79  int fedId_;
80 
81  const bool
83  const unsigned
85  const unsigned
87  const bool
89  const unsigned formatVersion_;
90  const bool checkHeaders_;
91  const bool verbose_;
92 
93  // format translator
95 
96  // vector of unpacked block headers, for verbostity and/or sync checks
98 
99  // error handling
100  static const unsigned MAX_ERR_CODE = 6;
102  std::vector<unsigned> errorCounters_;
103  unsigned unpackFailures_;
104 };
105 
106 #endif
std::vector< GctBlockHeader > GctBlockHeaderCollection
bool autoDetectRequiredFormatTranslator(const unsigned char *data)
Looks at the firmware version header in the S-Link packet and instantiates relevant format translator...
std::vector< L1TriggerError > L1TriggerErrorCollection
const bool unpackSharedRegions_
Commissioning option: if true, where applicable the shared RCT calo regions will also be unpacked...
Definition: GctRawToDigi.h:88
GctBlockHeaderCollection blockHeaders_
Definition: GctRawToDigi.h:97
const unsigned numberOfGctSamplesToUnpack_
Number of BXs of GCT data to unpack (assuming they are in the raw data)
Definition: GctRawToDigi.h:84
void addError(const unsigned code)
const bool hltMode_
If true, only outputs the GCT data sent to the GT (number of BXs defined by numberOfGctSamplesToUnpac...
Definition: GctRawToDigi.h:82
Abstract interface for RawToDigi/DigiToRaw conversions of GCT data.
void doVerboseOutput(const GctBlockHeaderCollection &bHdrs, const GctUnpackCollections *const colls) const
Prints out a list of blocks and the various numbers of trigger objects that have been unpacked from t...
void checkHeaders()
check block headers for consistency
virtual void endJob()
method called at job end - use to print summary report
void produce(edm::Event &, const edm::EventSetup &) override
static const unsigned MAX_BLOCKS
The maximum number of blocks we will try to unpack before thinking something is wrong.
Definition: GctRawToDigi.h:75
~GctRawToDigi() override
edm::InputTag inputLabel_
FED collection label.
Definition: GctRawToDigi.h:78
tuple d
Definition: ztail.py:151
const unsigned formatVersion_
Defines unpacker verison to be used (e.g.: &quot;Auto-detect&quot;, &quot;MCLegacy&quot;, &quot;V35&quot;, etc).
Definition: GctRawToDigi.h:89
GctRawToDigi(const edm::ParameterSet &)
Definition: GctRawToDigi.cc:34
unsigned unpackFailures_
To count the total number of GCT unpack failures.
Definition: GctRawToDigi.h:103
const unsigned numberOfRctSamplesToUnpack_
Number of BXs of RCT data to unpack (assuming they are in the raw data)
Definition: GctRawToDigi.h:86
RAII and useful methods for the many dataformat collections required by the GCT unpacker.
const bool verbose_
If true, then debug print out for each event.
Definition: GctRawToDigi.h:91
const bool checkHeaders_
If true, check block headers for synchronisation.
Definition: GctRawToDigi.h:90
static const unsigned MAX_ERR_CODE
Definition: GctRawToDigi.h:100
int fedId_
GCT FED ID.
Definition: GctRawToDigi.h:79
void unpack(const FEDRawData &d, edm::Event &e, GctUnpackCollections *const colls)
Unpacks the raw data.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
std::vector< unsigned > errorCounters_
Counts number of errors for each code (index)
Definition: GctRawToDigi.h:102
GctFormatTranslateBase * formatTranslator_
pointer to the block-to-digi converter
Definition: GctRawToDigi.h:94
L1TriggerErrorCollection * errors_
pointer to error collection
Definition: GctRawToDigi.h:101
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)