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 
15 // ************************************************************************
16 // *** THE TRANSLATION PROCESS MUST NEVER THROW ANY KIND OF EXCEPTION! ***
17 // ************************************************************************
18 
20 {
21 public:
22 
23  /* PUBLIC METHODS */
24 
26 
28  explicit GctFormatTranslateV38(bool hltMode = false,
29  bool unpackSharedRegions = false,
30  unsigned numberOfGctSamplesToUnpack=1,
31  unsigned numberOfRctSamplesToUnpack=1);
32 
33  virtual ~GctFormatTranslateV38();
34 
36  virtual GctBlockHeader generateBlockHeader(const unsigned char * data) const;
37 
39  virtual bool convertBlock(const unsigned char * d, const GctBlockHeader& hdr);
40 
41 
42  /* ------------------------------ */
43  /* Public Block Packing Functions */
44  /* ------------------------------ */
45 
46  // -- TO DO --
47 
48 
49 protected:
50 
51  /* PROTECTED METHODS */
52 
53  /* Static data member access methods */
55  virtual const BlockLengthMap& blockLengthMap() const { return m_blockLength; }
56 
57  virtual BlockNameMap& blockNameMap() { return m_blockName; }
58  virtual const BlockNameMap& blockNameMap() const { return m_blockName; }
59 
61  virtual const BlkToRctCrateMap& rctEmCrateMap() const { return m_rctEmCrate; }
62 
64  virtual const BlkToRctCrateMap& rctJetCrateMap() const { return m_rctJetCrate; }
65 
68 
69 
70  /* Other general methods */
72  virtual uint32_t generateRawHeader(const uint32_t blockId,
73  const uint32_t nSamples,
74  const uint32_t bxId,
75  const uint32_t eventId) const;
76 
77 
78 private:
79 
80  /* PRIVATE TYPEDEFS */
81 
83  typedef void (GctFormatTranslateV38::*PtrToUnpackFn)(const unsigned char *, const GctBlockHeader&);
85  typedef std::map<unsigned int, PtrToUnpackFn> BlockIdToUnpackFnMap;
86 
87 
88  /* PRIVATE MEMBER DATA */
89 
92 
95 
98 
101 
105 
108 
111 
114 
115  /* PRIVATE METHODS */
116 
117  /* --------------------------------- */
118  /* Private Block Unpacking Functions */
119  /* --------------------------------- */
120 
122  void blockToGctEmCandsAndEnergySums(const unsigned char * d, const GctBlockHeader& hdr);
123 
125  void blockToGctJetCandsAndCounts(const unsigned char * d, const GctBlockHeader& hdr);
126 
128  void blockToGctInternEmCand(const unsigned char * d, const GctBlockHeader& hdr);
129 
131  void blockToRctEmCand(const unsigned char * d, const GctBlockHeader& hdr);
132 
134  void blockToRctCaloRegions(const unsigned char * d, const GctBlockHeader& hdr);
135 
137  void blockToFibres(const unsigned char * d, const GctBlockHeader& hdr);
138 
140  void blockToFibresAndToRctEmCand(const unsigned char * d, const GctBlockHeader& hdr);
141 
143  void blockToGctInternEtSums(const unsigned char * d, const GctBlockHeader& hdr);
144 
146  void blockToGctInternEtSumsAndJetCluster(const unsigned char * d, const GctBlockHeader& hdr);
147 
149  void blockToGctTrigObjects(const unsigned char * d, const GctBlockHeader& hdr);
150 
152  void blockToGctJetClusterMinimal(const unsigned char * d, const GctBlockHeader& hdr);
153 
155  void blockToGctJetPreCluster(const unsigned char * d, const GctBlockHeader& hdr);
156 
158  void blockToGctInternRingSums(const unsigned char * d, const GctBlockHeader& hdr);
159 
161  void blockToGctWheelOutputInternEtAndRingSums(const unsigned char * d, const GctBlockHeader& hdr);
162 
164  void blockToGctWheelInputInternEtAndRingSums(const unsigned char * d, const GctBlockHeader& hdr);
165 
167  void blockToGctInternHtMissPreWheel(const unsigned char* d, const GctBlockHeader& hdr);
168 
170  void blockToGctInternHtMissPostWheel(const unsigned char* d, const GctBlockHeader& hdr);
171 };
172 
173 #endif
virtual bool convertBlock(const unsigned char *d, const GctBlockHeader &hdr)
Get digis from the block - will return true if it succeeds, false otherwise.
virtual const BlkToRctCrateMap & rctJetCrateMap() const
get the static block ID to RCT crate map for jets
static BlockLengthMap m_blockLength
Map to translate block number to fundamental size of a block (i.e. for 1 time-sample).
void blockToGctInternEmCand(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal EM Candidates
virtual BlockIdToEmCandIsoBoundMap & internEmIsoBounds()
get the static intern EM cand isolated boundary map.
static BlkToRctCrateMap m_rctJetCrate
Map to relate capture block ID to the RCT crate the data originated from (for jets).
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
Generate a block header from four 8-bit values.
static BlockIdToEmCandIsoBoundMap m_internEmIsoBounds
Unpacks/packs the V38 raw format.
GctFormatTranslateV38(bool hltMode=false, bool unpackSharedRegions=false, unsigned numberOfGctSamplesToUnpack=1, unsigned numberOfRctSamplesToUnpack=1)
Constructor.
virtual const BlockNameMap & blockNameMap() const
get the static block ID to blockname map.
void blockToGctInternRingSums(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal HF ring sums
static BlockIdToUnpackFnMap m_blockUnpackFn
Block ID to unpack function map.
void blockToGctInternEtSums(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal Et sums
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
static BlockNameMap m_blockName
Map to hold a description for each block number.
static BlkToRctCrateMap m_rctEmCrate
Map to relate capture block ID to the RCT crate the data originated from (for electrons).
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.
virtual BlkToRctCrateMap & rctJetCrateMap()
get the static block ID to RCT crate map for jets
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
virtual const BlkToRctCrateMap & rctEmCrateMap() const
get static the block ID to RCT crate map for electrons.
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
virtual BlockLengthMap & blockLengthMap()
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
virtual const BlockIdToEmCandIsoBoundMap & internEmIsoBounds() const
get the static intern EM cand isolated boundary map.
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
void blockToRctEmCand(const unsigned char *d, const GctBlockHeader &hdr)
unpack RCT EM Candidates
virtual uint32_t generateRawHeader(const uint32_t blockId, const uint32_t nSamples, const uint32_t bxId, const uint32_t eventId) const
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.
virtual BlockNameMap & blockNameMap()
get the static block ID to block-name map.
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.
virtual BlkToRctCrateMap & rctEmCrateMap()
get the static block ID to RCT crate map for electrons.
virtual const BlockLengthMap & blockLengthMap() const
get the static block ID to block-length 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).