CMS 3D CMS Logo

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 // *******************************************************************
41 // *** THE UNPACK PROCESS MUST NEVER THROW ANY KIND OF EXCEPTION! ***
42 // *******************************************************************
43 
45 {
46 public:
47 
48  explicit GctRawToDigi(const edm::ParameterSet&);
49  ~GctRawToDigi();
50 
51  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
52 
53 private: // methods
54 
55  virtual void produce(edm::Event&, const edm::EventSetup&) override;
56 
58 
59  void unpack(const FEDRawData& d, edm::Event& e, GctUnpackCollections * const colls);
60 
62 
63  bool autoDetectRequiredFormatTranslator(const unsigned char * data);
64 
66  void checkHeaders();
67 
69  void doVerboseOutput(const GctBlockHeaderCollection& bHdrs, const GctUnpackCollections * const colls) const;
70 
71  // add an error to the error collection
72  void addError(const unsigned code);
73 
75  virtual void endJob();
76 
77 
78 private: // members
79 
81  static const unsigned MAX_BLOCKS = 256;
82 
83  // unpacking options
85  int fedId_;
86 
87  const bool hltMode_;
88  const unsigned numberOfGctSamplesToUnpack_;
89  const unsigned numberOfRctSamplesToUnpack_;
90  const bool unpackSharedRegions_;
91  const unsigned formatVersion_;
92  const bool checkHeaders_;
93  const bool verbose_;
94 
95  // format translator
97 
98  // vector of unpacked block headers, for verbostity and/or sync checks
100 
101  // error handling
102  static const unsigned MAX_ERR_CODE = 6;
104  std::vector<unsigned> errorCounters_;
105  unsigned unpackFailures_;
106 
107 };
108 
109 #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:90
GctBlockHeaderCollection blockHeaders_
Definition: GctRawToDigi.h:99
const unsigned numberOfGctSamplesToUnpack_
Number of BXs of GCT data to unpack (assuming they are in the raw data)
Definition: GctRawToDigi.h:88
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:87
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
virtual 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:81
edm::InputTag inputLabel_
FED collection label.
Definition: GctRawToDigi.h:84
const unsigned formatVersion_
Defines unpacker verison to be used (e.g.: "Auto-detect", "MCLegacy", "V35", etc).
Definition: GctRawToDigi.h:91
GctRawToDigi(const edm::ParameterSet &)
Definition: GctRawToDigi.cc:36
unsigned unpackFailures_
To count the total number of GCT unpack failures.
Definition: GctRawToDigi.h:105
const unsigned numberOfRctSamplesToUnpack_
Number of BXs of RCT data to unpack (assuming they are in the raw data)
Definition: GctRawToDigi.h:89
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:93
const bool checkHeaders_
If true, check block headers for synchronisation.
Definition: GctRawToDigi.h:92
static const unsigned MAX_ERR_CODE
Definition: GctRawToDigi.h:102
int fedId_
GCT FED ID.
Definition: GctRawToDigi.h:85
void unpack(const FEDRawData &d, edm::Event &e, GctUnpackCollections *const colls)
Unpacks the raw data.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::vector< unsigned > errorCounters_
Counts number of errors for each code (index)
Definition: GctRawToDigi.h:104
GctFormatTranslateBase * formatTranslator_
pointer to the block-to-digi converter
Definition: GctRawToDigi.h:96
L1TriggerErrorCollection * errors_
pointer to error collection
Definition: GctRawToDigi.h:103
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)