CMS 3D CMS Logo

GctFormatTranslateV35.h
Go to the documentation of this file.
1 #ifndef GctFormatTranslateV35_h_
2 #define GctFormatTranslateV35_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 GctFormatTranslateV35(bool hltMode = false, bool unpackSharedRegions = false);
25 
26  ~GctFormatTranslateV35() override;
27 
29  GctBlockHeader generateBlockHeader(const unsigned char* data) const override;
30 
32  bool convertBlock(const unsigned char* d, const GctBlockHeader& hdr) override;
33 
34  /* ------------------------------ */
35  /* Public Block Packing Functions */
36  /* ------------------------------ */
37 
38  // -- TO DO --
39 
40 protected:
41  /* PROTECTED METHODS */
42 
43  /* Static data member access methods */
45  return m_blockLength;
46  }
47 
48  const BlockNameMap& blockNameMap() const final { return m_blockName; }
49 
51  return m_rctEmCrate;
52  }
53 
55  return m_rctJetCrate;
56  }
57 
59  return m_internEmIsoBounds;
60  }
61 
62  /* Other general methods */
64  uint32_t generateRawHeader(const uint32_t blockId,
65  const uint32_t nSamples,
66  const uint32_t bxId,
67  const uint32_t eventId) const override;
68 
69 private:
70  /* PRIVATE TYPEDEFS */
71 
73  typedef void (GctFormatTranslateV35::*PtrToUnpackFn)(const unsigned char*, const GctBlockHeader&);
75  typedef std::map<unsigned int, PtrToUnpackFn> BlockIdToUnpackFnMap;
76 
77  /* PRIVATE MEMBER DATA */
78 
81 
83  static const BlockNameMap m_blockName;
84 
87 
90 
94 
97 
98  /* PRIVATE METHODS */
99 
100  /* --------------------------------- */
101  /* Private Block Unpacking Functions */
102  /* --------------------------------- */
103 
105  void blockToGctEmCandsAndEnergySums(const unsigned char* d, const GctBlockHeader& hdr);
106 
108  void blockToGctJetCandsAndCounts(const unsigned char* d, const GctBlockHeader& hdr);
109 
111  void blockToGctInternEmCand(const unsigned char* d, const GctBlockHeader& hdr);
112 
114  void blockToRctEmCand(const unsigned char* d, const GctBlockHeader& hdr);
115 
117  void blockToRctCaloRegions(const unsigned char* d, const GctBlockHeader& hdr);
118 
120  void blockToFibres(const unsigned char* d, const GctBlockHeader& hdr);
121 
123  void blockToFibresAndToRctEmCand(const unsigned char* d, const GctBlockHeader& hdr);
124 
126  void blockToGctInternEtSums(const unsigned char* d, const GctBlockHeader& hdr);
127 
129  void blockToGctInternEtSumsAndJetCluster(const unsigned char* d, const GctBlockHeader& hdr);
130 
132  void blockToGctTrigObjects(const unsigned char* d, const GctBlockHeader& hdr);
133 
135  void blockToGctJetClusterMinimal(const unsigned char* d, const GctBlockHeader& hdr);
136 
138  void blockToGctJetPreCluster(const unsigned char* d, const GctBlockHeader& hdr);
139 
141  void blockToGctInternRingSums(const unsigned char* d, const GctBlockHeader& hdr);
142 
144  void blockToGctWheelOutputInternEtAndRingSums(const unsigned char* d, const GctBlockHeader& hdr);
145 
147  void blockToGctWheelInputInternEtAndRingSums(const unsigned char* d, const GctBlockHeader& hdr);
148 };
149 
150 #endif
static const BlkToRctCrateMap m_rctJetCrate
Map to relate capture block ID to the RCT crate the data originated from (for jets).
const BlkToRctCrateMap & rctEmCrateMap() const final
get static the block ID to RCT crate map for electrons.
void blockToRctCaloRegions(const unsigned char *d, const GctBlockHeader &hdr)
Unpack RCT Calo Regions.
GctFormatTranslateV35(bool hltMode=false, bool unpackSharedRegions=false)
Constructor.
void blockToGctJetCandsAndCounts(const unsigned char *d, const GctBlockHeader &hdr)
Unpack GCT Jet Candidates and jet counts.
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.
Abstract interface for RawToDigi/DigiToRaw conversions of GCT data.
void blockToGctJetPreCluster(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal shared jet finder info
void(GctFormatTranslateV35::* PtrToUnpackFn)(const unsigned char *, const GctBlockHeader &)
Function pointer typdef to a block unpack function.
void blockToFibres(const unsigned char *d, const GctBlockHeader &hdr)
unpack Fibres
void blockToGctInternRingSums(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal HF ring sums
const BlockNameMap & blockNameMap() const final
get the static block ID to blockname map.
const BlockIdToEmCandIsoBoundMap & internEmIsoBounds() const final
get the static intern EM cand isolated boundary map.
TEMPL(T2) struct Divides void
Definition: Factorize.h:24
const BlockLengthMap & blockLengthMap() const final
get the static block ID to block-length map.
void blockToGctTrigObjects(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal wheel and conc jets
void blockToGctEmCandsAndEnergySums(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT EM Candidates and energy sums.
~GctFormatTranslateV35() override
Destructor.
static const BlockIdToEmCandIsoBoundMap m_internEmIsoBounds
void blockToGctWheelInputInternEtAndRingSums(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal input to wheel
Simple class for holding the basic attributes of an 32-bit block header.
GctBlockHeader generateBlockHeader(const unsigned char *data) const override
Generate a block header from four 8-bit values.
Unpacks/packs the V35 raw format.
bool hltMode() const
Protected interface to get HLT optimisation mode flag.
void blockToGctInternEmCand(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal EM Candidates
void blockToGctJetClusterMinimal(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal input to wheel jet sort
std::map< unsigned int, unsigned int > BlockLengthMap
Block ID to Block Length map.
static const BlockLengthMap m_blockLength
Map to translate block number to fundamental size of a block (i.e. for 1 time-sample).
d
Definition: ztail.py:151
const BlkToRctCrateMap & rctJetCrateMap() const final
get the static block ID to RCT crate map for jets
void blockToGctInternEtSums(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal Et sums
void blockToGctInternEtSumsAndJetCluster(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal output of leaf jet finder
void blockToFibresAndToRctEmCand(const unsigned char *d, const GctBlockHeader &hdr)
unpack Fibres and RCT EM Candidates
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
void blockToRctEmCand(const unsigned char *d, const GctBlockHeader &hdr)
unpack RCT EM Candidates
std::map< unsigned int, IsoBoundaryPair > BlockIdToEmCandIsoBoundMap
A typdef for mapping Block IDs to IsoBoundaryPairs.
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.
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 blockToGctWheelOutputInternEtAndRingSums(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal output of wheel
static const BlockNameMap m_blockName
Map to hold a description for each block number.
static const BlockIdToUnpackFnMap m_blockUnpackFn
Block ID to unpack function map.
std::map< unsigned int, PtrToUnpackFn > BlockIdToUnpackFnMap
Typedef for a block ID to unpack function map.