CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 public:
19  /* PUBLIC METHODS */
20 
22 
24  explicit GctFormatTranslateV38(bool hltMode = false,
25  bool unpackSharedRegions = false,
26  unsigned numberOfGctSamplesToUnpack = 1,
27  unsigned numberOfRctSamplesToUnpack = 1);
28 
29  ~GctFormatTranslateV38() override;
30 
32  GctBlockHeader generateBlockHeader(const unsigned char* data) const override;
33 
35  bool convertBlock(const unsigned char* d, const GctBlockHeader& hdr) override;
36 
37  /* ------------------------------ */
38  /* Public Block Packing Functions */
39  /* ------------------------------ */
40 
41  // -- TO DO --
42 
43 protected:
44  /* PROTECTED METHODS */
45 
46  /* Static data member access methods */
48  return m_blockLength;
49  }
50 
51  const BlockNameMap& blockNameMap() const final { return m_blockName; }
52 
54  return m_rctEmCrate;
55  }
56 
58  return m_rctJetCrate;
59  }
60 
62  return m_internEmIsoBounds;
63  }
64 
65  /* Other general methods */
67  uint32_t generateRawHeader(const uint32_t blockId,
68  const uint32_t nSamples,
69  const uint32_t bxId,
70  const uint32_t eventId) const override;
71 
72 private:
73  /* PRIVATE TYPEDEFS */
74 
76  typedef void (GctFormatTranslateV38::*PtrToUnpackFn)(const unsigned char*, const GctBlockHeader&);
78  typedef std::map<unsigned int, PtrToUnpackFn> BlockIdToUnpackFnMap;
79 
80  /* PRIVATE MEMBER DATA */
81 
84 
86  static const BlockNameMap m_blockName;
87 
90 
93 
97 
100 
103 
106 
107  /* PRIVATE METHODS */
108 
109  /* --------------------------------- */
110  /* Private Block Unpacking Functions */
111  /* --------------------------------- */
112 
114  void blockToGctEmCandsAndEnergySums(const unsigned char* d, const GctBlockHeader& hdr);
115 
117  void blockToGctJetCandsAndCounts(const unsigned char* d, const GctBlockHeader& hdr);
118 
120  void blockToGctInternEmCand(const unsigned char* d, const GctBlockHeader& hdr);
121 
123  void blockToRctEmCand(const unsigned char* d, const GctBlockHeader& hdr);
124 
126  void blockToRctCaloRegions(const unsigned char* d, const GctBlockHeader& hdr);
127 
129  void blockToFibres(const unsigned char* d, const GctBlockHeader& hdr);
130 
132  void blockToFibresAndToRctEmCand(const unsigned char* d, const GctBlockHeader& hdr);
133 
135  void blockToGctInternEtSums(const unsigned char* d, const GctBlockHeader& hdr);
136 
138  void blockToGctInternEtSumsAndJetCluster(const unsigned char* d, const GctBlockHeader& hdr);
139 
141  void blockToGctTrigObjects(const unsigned char* d, const GctBlockHeader& hdr);
142 
144  void blockToGctJetClusterMinimal(const unsigned char* d, const GctBlockHeader& hdr);
145 
147  void blockToGctJetPreCluster(const unsigned char* d, const GctBlockHeader& hdr);
148 
150  void blockToGctInternRingSums(const unsigned char* d, const GctBlockHeader& hdr);
151 
153  void blockToGctWheelOutputInternEtAndRingSums(const unsigned char* d, const GctBlockHeader& hdr);
154 
156  void blockToGctWheelInputInternEtAndRingSums(const unsigned char* d, const GctBlockHeader& hdr);
157 
159  void blockToGctInternHtMissPreWheel(const unsigned char* d, const GctBlockHeader& hdr);
160 
162  void blockToGctInternHtMissPostWheel(const unsigned char* d, const GctBlockHeader& hdr);
163 };
164 
165 #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
tuple numberOfGctSamplesToUnpack
Definition: HLT_Fake_cff.py:51
const BlockNameMap & blockNameMap() const final
get the static block ID to blockname 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
GctBlockHeader generateBlockHeader(const unsigned char *data) const override
Generate a block header from four 8-bit values.
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
~GctFormatTranslateV38() override
Destructor.
static const BlockIdToUnpackFnMap m_blockUnpackFn
Block ID to unpack function map.
const BlkToRctCrateMap & rctEmCrateMap() const final
get static the block ID to RCT crate map for electrons.
tuple d
Definition: ztail.py:151
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
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.
constexpr size_t nSamples
void blockToFibres(const unsigned char *d, const GctBlockHeader &hdr)
unpack Fibres
const BlkToRctCrateMap & rctJetCrateMap() const final
get the static block ID to RCT crate map for jets
static const BlockLengthMap m_blockLength
Map to translate block number to fundamental size of a block (i.e. for 1 time-sample).
tuple numberOfRctSamplesToUnpack
Definition: HLT_Fake_cff.py:52
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
const BlockIdToEmCandIsoBoundMap & internEmIsoBounds() const final
get the static intern EM cand isolated boundary map.
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
const BlockLengthMap & blockLengthMap() const final
get the static block ID to block-length map.
static const BlockIdToEmCandIsoBoundMap m_internEmIsoBounds
void blockToGctTrigObjects(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal wheel and conc jets
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:79
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).
bool convertBlock(const unsigned char *d, const GctBlockHeader &hdr) override
Get digis from the block - will return true if it succeeds, false otherwise.
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).