CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GctFormatTranslateV38.h
Go to the documentation of this file.
1 #ifndef GctFormatTranslateV38_h_
2 #define GctFormatTranslateV38_h_
3 
5 
13 // ************************************************************************
14 // *** THE TRANSLATION PROCESS MUST NEVER THROW ANY KIND OF EXCEPTION! ***
15 // ************************************************************************
16 
18 {
19 public:
20 
21  /* PUBLIC METHODS */
22 
24 
26  explicit GctFormatTranslateV38(bool hltMode = false,
27  bool unpackSharedRegions = false,
28  unsigned numberOfGctSamplesToUnpack=1,
29  unsigned numberOfRctSamplesToUnpack=1);
30 
31  virtual ~GctFormatTranslateV38();
32 
34  virtual GctBlockHeader generateBlockHeader(const unsigned char * data) const override;
35 
37  virtual bool convertBlock(const unsigned char * d, const GctBlockHeader& hdr) override;
38 
39 
40  /* ------------------------------ */
41  /* Public Block Packing Functions */
42  /* ------------------------------ */
43 
44  // -- TO DO --
45 
46 
47 protected:
48 
49  /* PROTECTED METHODS */
50 
51  /* Static data member access methods */
52  virtual const BlockLengthMap& blockLengthMap() const override final { return m_blockLength; }
53 
54  virtual const BlockNameMap& blockNameMap() const override final { return m_blockName; }
55 
56  virtual const BlkToRctCrateMap& rctEmCrateMap() const override final { return m_rctEmCrate; }
57 
58  virtual const BlkToRctCrateMap& rctJetCrateMap() const override final { return m_rctJetCrate; }
59 
60  virtual const BlockIdToEmCandIsoBoundMap& internEmIsoBounds() const override final { return m_internEmIsoBounds; }
61 
62 
63  /* Other general methods */
65  virtual uint32_t generateRawHeader(const uint32_t blockId,
66  const uint32_t nSamples,
67  const uint32_t bxId,
68  const uint32_t eventId) const override;
69 
70 
71 private:
72 
73  /* PRIVATE TYPEDEFS */
74 
76  typedef void (GctFormatTranslateV38::*PtrToUnpackFn)(const unsigned char *, const GctBlockHeader&);
78  typedef std::map<unsigned int, PtrToUnpackFn> BlockIdToUnpackFnMap;
79 
80 
81  /* PRIVATE MEMBER DATA */
82 
85 
87  static const BlockNameMap m_blockName;
88 
91 
94 
98 
101 
104 
107 
108  /* PRIVATE METHODS */
109 
110  /* --------------------------------- */
111  /* Private Block Unpacking Functions */
112  /* --------------------------------- */
113 
115  void blockToGctEmCandsAndEnergySums(const unsigned char * d, const GctBlockHeader& hdr);
116 
118  void blockToGctJetCandsAndCounts(const unsigned char * d, const GctBlockHeader& hdr);
119 
121  void blockToGctInternEmCand(const unsigned char * d, const GctBlockHeader& hdr);
122 
124  void blockToRctEmCand(const unsigned char * d, const GctBlockHeader& hdr);
125 
127  void blockToRctCaloRegions(const unsigned char * d, const GctBlockHeader& hdr);
128 
130  void blockToFibres(const unsigned char * d, const GctBlockHeader& hdr);
131 
133  void blockToFibresAndToRctEmCand(const unsigned char * d, const GctBlockHeader& hdr);
134 
136  void blockToGctInternEtSums(const unsigned char * d, const GctBlockHeader& hdr);
137 
139  void blockToGctInternEtSumsAndJetCluster(const unsigned char * d, const GctBlockHeader& hdr);
140 
142  void blockToGctTrigObjects(const unsigned char * d, const GctBlockHeader& hdr);
143 
145  void blockToGctJetClusterMinimal(const unsigned char * d, const GctBlockHeader& hdr);
146 
148  void blockToGctJetPreCluster(const unsigned char * d, const GctBlockHeader& hdr);
149 
151  void blockToGctInternRingSums(const unsigned char * d, const GctBlockHeader& hdr);
152 
154  void blockToGctWheelOutputInternEtAndRingSums(const unsigned char * d, const GctBlockHeader& hdr);
155 
157  void blockToGctWheelInputInternEtAndRingSums(const unsigned char * d, const GctBlockHeader& hdr);
158 
160  void blockToGctInternHtMissPreWheel(const unsigned char* d, const GctBlockHeader& hdr);
161 
163  void blockToGctInternHtMissPostWheel(const unsigned char* d, const GctBlockHeader& hdr);
164 };
165 
166 #endif
static const BlockNameMap m_blockName
Map to hold a description for each block number.
void blockToGctInternEmCand(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal EM Candidates
virtual const BlockIdToEmCandIsoBoundMap & internEmIsoBounds() const overridefinal
get the static intern EM cand isolated boundary map.
Abstract interface for RawToDigi/DigiToRaw conversions of GCT data.
void blockToGctWheelInputInternEtAndRingSums(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal input to wheel
virtual GctBlockHeader generateBlockHeader(const unsigned char *data) const override
Generate a block header from four 8-bit values.
virtual const BlkToRctCrateMap & rctJetCrateMap() const overridefinal
get the static block ID to RCT crate map for jets
Unpacks/packs the V38 raw format.
GctFormatTranslateV38(bool hltMode=false, bool unpackSharedRegions=false, unsigned numberOfGctSamplesToUnpack=1, unsigned numberOfRctSamplesToUnpack=1)
Constructor.
void blockToGctInternRingSums(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal HF ring sums
static const BlockIdToUnpackFnMap m_blockUnpackFn
Block ID to unpack function map.
virtual const BlockLengthMap & blockLengthMap() const overridefinal
get the static block ID to block-length map.
void blockToGctInternEtSums(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal Et sums
static const BlkToRctCrateMap m_rctJetCrate
Map to relate capture block ID to the RCT crate the data originated from (for jets).
const unsigned m_numberOfGctSamplesToUnpack
Number of BXs of GCT data to unpack (assuming they are in the raw data)
void blockToGctJetPreCluster(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal shared jet finder info
void blockToGctInternEtSumsAndJetCluster(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal output of leaf jet finder
virtual ~GctFormatTranslateV38()
Destructor.
Simple class for holding the basic attributes of an 32-bit block header.
std::map< unsigned int, PtrToUnpackFn > BlockIdToUnpackFnMap
Typedef for a block ID to unpack function map.
void blockToGctWheelOutputInternEtAndRingSums(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal output of wheel
std::map< unsigned int, unsigned int > BlockLengthMap
Block ID to Block Length map.
bool hltMode() const
Protected interface to get HLT optimisation mode flag.
void blockToFibres(const unsigned char *d, const GctBlockHeader &hdr)
unpack Fibres
static const BlockLengthMap m_blockLength
Map to translate block number to fundamental size of a block (i.e. for 1 time-sample).
void blockToRctCaloRegions(const unsigned char *d, const GctBlockHeader &hdr)
Unpack RCT Calo Regions.
void blockToFibresAndToRctEmCand(const unsigned char *d, const GctBlockHeader &hdr)
unpack Fibres and RCT EM Candidates
void blockToGctInternHtMissPreWheel(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal Missing Ht data that is being input to the wheels.
const unsigned m_numberOfRctSamplesToUnpack
static const BlockIdToEmCandIsoBoundMap m_internEmIsoBounds
string const
Definition: compareJSON.py:14
void blockToGctTrigObjects(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal wheel and conc jets
virtual const BlkToRctCrateMap & rctEmCrateMap() const overridefinal
get static the block ID to RCT crate map for electrons.
void blockToGctJetClusterMinimal(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal input to wheel jet sort
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
virtual const BlockNameMap & blockNameMap() const overridefinal
get the static block ID to blockname map.
void blockToRctEmCand(const unsigned char *d, const GctBlockHeader &hdr)
unpack RCT EM Candidates
static const BlkToRctCrateMap m_rctEmCrate
Map to relate capture block ID to the RCT crate the data originated from (for electrons).
virtual bool convertBlock(const unsigned char *d, const GctBlockHeader &hdr) override
Get digis from the block - will return true if it succeeds, false otherwise.
virtual uint32_t generateRawHeader(const uint32_t blockId, const uint32_t nSamples, const uint32_t bxId, const uint32_t eventId) const override
Returns a raw 32-bit header word generated from the blockId, number of time samples, bunch-crossing and event IDs.
void blockToGctJetCandsAndCounts(const unsigned char *d, const GctBlockHeader &hdr)
Unpack GCT Jet Candidates and jet counts.
std::map< unsigned int, IsoBoundaryPair > BlockIdToEmCandIsoBoundMap
A typdef for mapping Block IDs to IsoBoundaryPairs.
void(GctFormatTranslateV38::* PtrToUnpackFn)(const unsigned char *, const GctBlockHeader &)
Function pointer typdef to a block unpack function.
std::map< unsigned int, unsigned int > BlkToRctCrateMap
Typedef for mapping block ID to RCT crate.
std::map< unsigned int, std::string > BlockNameMap
Block ID to Block Description map.
void blockToGctEmCandsAndEnergySums(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT EM Candidates and energy sums.
void blockToGctInternHtMissPostWheel(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal Missing Ht data that is either wheel output or concJet input (i.e. after wheel processing).