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 // $Id: GctRawToDigi.h,v 1.33 2009/12/24 17:48:08 jbrooke Exp $
20 //
21 //
22 
23 // system include files
24 #include <memory>
25 #include <ostream>
26 #include <string>
27 
28 // user include files
34 
36 
39 
40 
41 // *******************************************************************
42 // *** THE UNPACK PROCESS MUST NEVER THROW ANY KIND OF EXCEPTION! ***
43 // *******************************************************************
44 
46 {
47 public:
48 
49  explicit GctRawToDigi(const edm::ParameterSet&);
50  ~GctRawToDigi();
51 
52 
53 private: // methods
54 
55  virtual void beginJob();
56  virtual void produce(edm::Event&, const edm::EventSetup&);
57 
59 
60  void unpack(const FEDRawData& d, edm::Event& e, GctUnpackCollections * const colls);
61 
63 
64  bool autoDetectRequiredFormatTranslator(const unsigned char * data);
65 
67  void checkHeaders();
68 
70  void doVerboseOutput(const GctBlockHeaderCollection& bHdrs, const GctUnpackCollections * const colls) const;
71 
72  // add an error to the error collection
73  void addError(const unsigned code);
74 
76  virtual void endJob();
77 
78 
79 private: // members
80 
82  static const unsigned MAX_BLOCKS = 256;
83 
84  // unpacking options
86  int fedId_;
87 
88  const bool hltMode_;
89  const unsigned numberOfGctSamplesToUnpack_;
90  const unsigned numberOfRctSamplesToUnpack_;
91  const bool unpackSharedRegions_;
92  const unsigned formatVersion_;
93  const bool checkHeaders_;
94  const bool verbose_;
95 
96  // format translator
98 
99  // vector of unpacked block headers, for verbostity and/or sync checks
101 
102  // error handling
103  static const unsigned MAX_ERR_CODE = 6;
105  std::vector<unsigned> errorCounters_;
106  unsigned unpackFailures_;
107 
108 };
109 
110 #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:91
GctBlockHeaderCollection blockHeaders_
Definition: GctRawToDigi.h:100
const unsigned numberOfGctSamplesToUnpack_
Number of BXs of GCT data to unpack (assuming they are in the raw data)
Definition: GctRawToDigi.h:89
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:88
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...
virtual void produce(edm::Event &, const edm::EventSetup &)
void checkHeaders()
check block headers for consistency
virtual void endJob()
method called at job end - use to print summary report
static const unsigned MAX_BLOCKS
The maximum number of blocks we will try to unpack before thinking something is wrong.
Definition: GctRawToDigi.h:82
edm::InputTag inputLabel_
FED collection label.
Definition: GctRawToDigi.h:85
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:92
virtual void beginJob()
GctRawToDigi(const edm::ParameterSet &)
Definition: GctRawToDigi.cc:34
unsigned unpackFailures_
To count the total number of GCT unpack failures.
Definition: GctRawToDigi.h:106
const unsigned numberOfRctSamplesToUnpack_
Number of BXs of RCT data to unpack (assuming they are in the raw data)
Definition: GctRawToDigi.h:90
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:94
const bool checkHeaders_
If true, check block headers for synchronisation.
Definition: GctRawToDigi.h:93
static const unsigned MAX_ERR_CODE
Definition: GctRawToDigi.h:103
int fedId_
GCT FED ID.
Definition: GctRawToDigi.h:86
void unpack(const FEDRawData &d, edm::Event &e, GctUnpackCollections *const colls)
Unpacks the raw data.
std::vector< unsigned > errorCounters_
Counts number of errors for each code (index)
Definition: GctRawToDigi.h:105
GctFormatTranslateBase * formatTranslator_
pointer to the block-to-digi converter
Definition: GctRawToDigi.h:97
L1TriggerErrorCollection * errors_
pointer to error collection
Definition: GctRawToDigi.h:104