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 {
19 public:
20 
21  /* PUBLIC METHODS */
22 
24 
26  explicit GctFormatTranslateV35(bool hltMode = false, bool unpackSharedRegions = false);
27 
28  virtual ~GctFormatTranslateV35();
29 
31  virtual GctBlockHeader generateBlockHeader(const unsigned char * data) const override;
32 
34  virtual bool convertBlock(const unsigned char * d, const GctBlockHeader& hdr) override;
35 
36 
37  /* ------------------------------ */
38  /* Public Block Packing Functions */
39  /* ------------------------------ */
40 
41  // -- TO DO --
42 
43 
44 protected:
45 
46  /* PROTECTED METHODS */
47 
48  /* Static data member access methods */
49  virtual const BlockLengthMap& blockLengthMap() const override final { return m_blockLength; }
50 
51  virtual const BlockNameMap& blockNameMap() const override final { return m_blockName; }
52 
53  virtual const BlkToRctCrateMap& rctEmCrateMap() const override final { return m_rctEmCrate; }
54 
55  virtual const BlkToRctCrateMap& rctJetCrateMap() const override final { return m_rctJetCrate; }
56 
57  virtual const BlockIdToEmCandIsoBoundMap& internEmIsoBounds() const override final { return m_internEmIsoBounds; }
58 
59 
60  /* Other general methods */
62  virtual uint32_t generateRawHeader(const uint32_t blockId,
63  const uint32_t nSamples,
64  const uint32_t bxId,
65  const uint32_t eventId) const override;
66 
67 
68 private:
69 
70  /* PRIVATE TYPEDEFS */
71 
73  typedef void (GctFormatTranslateV35::*PtrToUnpackFn)(const unsigned char *, const GctBlockHeader&);
75  typedef std::map<unsigned int, PtrToUnpackFn> BlockIdToUnpackFnMap;
76 
77 
78  /* PRIVATE MEMBER DATA */
79 
82 
84  static const BlockNameMap m_blockName;
85 
88 
91 
95 
97  static const BlockIdToUnpackFnMap m_blockUnpackFn;
98 
99 
100  /* PRIVATE METHODS */
101 
102  /* --------------------------------- */
103  /* Private Block Unpacking Functions */
104  /* --------------------------------- */
105 
107  void blockToGctEmCandsAndEnergySums(const unsigned char * d, const GctBlockHeader& hdr);
108 
110  void blockToGctJetCandsAndCounts(const unsigned char * d, const GctBlockHeader& hdr);
111 
113  void blockToGctInternEmCand(const unsigned char * d, const GctBlockHeader& hdr);
114 
116  void blockToRctEmCand(const unsigned char * d, const GctBlockHeader& hdr);
117 
119  void blockToRctCaloRegions(const unsigned char * d, const GctBlockHeader& hdr);
120 
122  void blockToFibres(const unsigned char * d, const GctBlockHeader& hdr);
123 
125  void blockToFibresAndToRctEmCand(const unsigned char * d, const GctBlockHeader& hdr);
126 
128  void blockToGctInternEtSums(const unsigned char * d, const GctBlockHeader& hdr);
129 
131  void blockToGctInternEtSumsAndJetCluster(const unsigned char * d, const GctBlockHeader& hdr);
132 
134  void blockToGctTrigObjects(const unsigned char * d, const GctBlockHeader& hdr);
135 
137  void blockToGctJetClusterMinimal(const unsigned char * d, const GctBlockHeader& hdr);
138 
140  void blockToGctJetPreCluster(const unsigned char * d, const GctBlockHeader& hdr);
141 
143  void blockToGctInternRingSums(const unsigned char * d, const GctBlockHeader& hdr);
144 
146  void blockToGctWheelOutputInternEtAndRingSums(const unsigned char * d, const GctBlockHeader& hdr);
147 
149  void blockToGctWheelInputInternEtAndRingSums(const unsigned char * d, const GctBlockHeader& hdr);
150 };
151 
152 #endif
static const BlkToRctCrateMap m_rctJetCrate
Map to relate capture block ID to the RCT crate the data originated from (for jets).
virtual const BlockIdToEmCandIsoBoundMap & internEmIsoBounds() const override final
get the static intern EM cand isolated boundary map.
virtual const BlockLengthMap & blockLengthMap() const override final
get the static block ID to block-length map.
virtual GctBlockHeader generateBlockHeader(const unsigned char *data) const override
Generate a block header from four 8-bit values.
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.
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
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.
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.
virtual const BlockNameMap & blockNameMap() const override final
get the static block ID to blockname map.
Unpacks/packs the V35 raw format.
virtual const BlkToRctCrateMap & rctEmCrateMap() const override final
get static the block ID to RCT crate map for electrons.
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).
bool hltMode() const
Protected interface to get HLT optimisation mode flag.
constexpr size_t nSamples
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:82
virtual ~GctFormatTranslateV35()
Destructor.
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).
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.
virtual 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.
virtual const BlkToRctCrateMap & rctJetCrateMap() const override final
get the static block ID to RCT crate map for jets