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 // *** 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
GctBlockHeaderCollection
std::vector< GctBlockHeader > GctBlockHeaderCollection
Definition: GctBlockHeader.h:63
GctRawToDigi::endJob
virtual void endJob()
method called at job end - use to print summary report
Definition: GctRawToDigi.cc:340
GctUnpackCollections
RAII and useful methods for the many dataformat collections required by the GCT unpacker.
Definition: GctUnpackCollections.h:21
GctRawToDigi::formatTranslator_
GctFormatTranslateBase * formatTranslator_
pointer to the block-to-digi converter
Definition: GctRawToDigi.h:94
GctRawToDigi::errorCounters_
std::vector< unsigned > errorCounters_
Counts number of errors for each code (index)
Definition: GctRawToDigi.h:102
GctRawToDigi::errors_
L1TriggerErrorCollection * errors_
pointer to error collection
Definition: GctRawToDigi.h:101
GctRawToDigi::~GctRawToDigi
~GctRawToDigi() override
Definition: GctRawToDigi.cc:112
GctRawToDigi::unpackFailures_
unsigned unpackFailures_
To count the total number of GCT unpack failures.
Definition: GctRawToDigi.h:103
EDProducer.h
GctRawToDigi::formatVersion_
const unsigned formatVersion_
Defines unpacker verison to be used (e.g.: "Auto-detect", "MCLegacy", "V35", etc).
Definition: GctRawToDigi.h:89
GctRawToDigi::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: GctRawToDigi.cc:144
FEDRawData.h
GctFormatTranslateBase
Abstract interface for RawToDigi/DigiToRaw conversions of GCT data.
Definition: GctFormatTranslateBase.h:25
FEDRawData
Definition: FEDRawData.h:19
GctUnpackCollections.h
GctRawToDigi::blockHeaders_
GctBlockHeaderCollection blockHeaders_
Definition: GctRawToDigi.h:97
GctRawToDigi::addError
void addError(const unsigned code)
Definition: GctRawToDigi.cc:291
L1TriggerErrorCollection
std::vector< L1TriggerError > L1TriggerErrorCollection
Definition: L1TriggerError.h:45
GctRawToDigi::hltMode_
const bool hltMode_
If true, only outputs the GCT data sent to the GT (number of BXs defined by numberOfGctSamplesToUnpac...
Definition: GctRawToDigi.h:82
GctRawToDigi::checkHeaders_
const bool checkHeaders_
If true, check block headers for synchronisation.
Definition: GctRawToDigi.h:90
GctRawToDigi::verbose_
const bool verbose_
If true, then debug print out for each event.
Definition: GctRawToDigi.h:91
GctRawToDigi::inputLabel_
edm::InputTag inputLabel_
FED collection label.
Definition: GctRawToDigi.h:78
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
edm::ParameterSet
Definition: ParameterSet.h:47
GctRawToDigi::checkHeaders
void checkHeaders()
check block headers for consistency
Definition: GctRawToDigi.cc:276
Event.h
GctRawToDigi::GctRawToDigi
GctRawToDigi(const edm::ParameterSet &)
Definition: GctRawToDigi.cc:34
GctRawToDigi::MAX_BLOCKS
static const unsigned MAX_BLOCKS
The maximum number of blocks we will try to unpack before thinking something is wrong.
Definition: GctRawToDigi.h:75
edm::stream::EDProducer
Definition: EDProducer.h:38
edm::EventSetup
Definition: EventSetup.h:58
InputTag.h
GctRawToDigi::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: GctRawToDigi.cc:118
GctRawToDigi::doVerboseOutput
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...
Definition: GctRawToDigi.cc:280
Frameworkfwd.h
GctRawToDigi::numberOfRctSamplesToUnpack_
const unsigned numberOfRctSamplesToUnpack_
Number of BXs of RCT data to unpack (assuming they are in the raw data)
Definition: GctRawToDigi.h:86
GctRawToDigi
Definition: GctRawToDigi.h:43
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
GctRawToDigi::autoDetectRequiredFormatTranslator
bool autoDetectRequiredFormatTranslator(const unsigned char *data)
Looks at the firmware version header in the S-Link packet and instantiates relevant format translator...
Definition: GctRawToDigi.cc:238
ztail.d
d
Definition: ztail.py:151
ParameterSet.h
GctRawToDigi::unpack
void unpack(const FEDRawData &d, edm::Event &e, GctUnpackCollections *const colls)
Unpacks the raw data.
Definition: GctRawToDigi.cc:194
GctRawToDigi::MAX_ERR_CODE
static const unsigned MAX_ERR_CODE
Definition: GctRawToDigi.h:100
GctFormatTranslateBase.h
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
GctRawToDigi::numberOfGctSamplesToUnpack_
const unsigned numberOfGctSamplesToUnpack_
Number of BXs of GCT data to unpack (assuming they are in the raw data)
Definition: GctRawToDigi.h:84
GctRawToDigi::fedId_
int fedId_
GCT FED ID.
Definition: GctRawToDigi.h:79
GctRawToDigi::unpackSharedRegions_
const bool unpackSharedRegions_
Commissioning option: if true, where applicable the shared RCT calo regions will also be unpacked.
Definition: GctRawToDigi.h:88
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37