CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 // *******************************************************************
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 
52 private: // methods
53 
54  virtual void produce(edm::Event&, const edm::EventSetup&) override;
55 
57 
58  void unpack(const FEDRawData& d, edm::Event& e, GctUnpackCollections * const colls);
59 
61 
62  bool autoDetectRequiredFormatTranslator(const unsigned char * data);
63 
65  void checkHeaders();
66 
68  void doVerboseOutput(const GctBlockHeaderCollection& bHdrs, const GctUnpackCollections * const colls) const;
69 
70  // add an error to the error collection
71  void addError(const unsigned code);
72 
74  virtual void endJob();
75 
76 
77 private: // members
78 
80  static const unsigned MAX_BLOCKS = 256;
81 
82  // unpacking options
84  int fedId_;
85 
86  const bool hltMode_;
87  const unsigned numberOfGctSamplesToUnpack_;
88  const unsigned numberOfRctSamplesToUnpack_;
89  const bool unpackSharedRegions_;
90  const unsigned formatVersion_;
91  const bool checkHeaders_;
92  const bool verbose_;
93 
94  // format translator
96 
97  // vector of unpacked block headers, for verbostity and/or sync checks
99 
100  // error handling
101  static const unsigned MAX_ERR_CODE = 6;
103  std::vector<unsigned> errorCounters_;
104  unsigned unpackFailures_;
105 
106 };
107 
108 #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:89
GctBlockHeaderCollection blockHeaders_
Definition: GctRawToDigi.h:98
const unsigned numberOfGctSamplesToUnpack_
Number of BXs of GCT data to unpack (assuming they are in the raw data)
Definition: GctRawToDigi.h:87
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:86
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:80
edm::InputTag inputLabel_
FED collection label.
Definition: GctRawToDigi.h:83
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:90
GctRawToDigi(const edm::ParameterSet &)
Definition: GctRawToDigi.cc:34
unsigned unpackFailures_
To count the total number of GCT unpack failures.
Definition: GctRawToDigi.h:104
const unsigned numberOfRctSamplesToUnpack_
Number of BXs of RCT data to unpack (assuming they are in the raw data)
Definition: GctRawToDigi.h:88
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:92
const bool checkHeaders_
If true, check block headers for synchronisation.
Definition: GctRawToDigi.h:91
static const unsigned MAX_ERR_CODE
Definition: GctRawToDigi.h:101
int fedId_
GCT FED ID.
Definition: GctRawToDigi.h:84
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:103
GctFormatTranslateBase * formatTranslator_
pointer to the block-to-digi converter
Definition: GctRawToDigi.h:95
L1TriggerErrorCollection * errors_
pointer to error collection
Definition: GctRawToDigi.h:102