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;
35 
37  virtual bool convertBlock(const unsigned char * d, const GctBlockHeader& hdr);
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 */
53  virtual const BlockLengthMap& blockLengthMap() const { return m_blockLength; }
54 
55  virtual BlockNameMap& blockNameMap() { return m_blockName; }
56  virtual const BlockNameMap& blockNameMap() const { return m_blockName; }
57 
59  virtual const BlkToRctCrateMap& rctEmCrateMap() const { return m_rctEmCrate; }
60 
62  virtual const BlkToRctCrateMap& rctJetCrateMap() const { return m_rctJetCrate; }
63 
66 
67 
68  /* Other general methods */
70  virtual uint32_t generateRawHeader(const uint32_t blockId,
71  const uint32_t nSamples,
72  const uint32_t bxId,
73  const uint32_t eventId) const;
74 
75 
76 private:
77 
78  /* PRIVATE TYPEDEFS */
79 
81  typedef void (GctFormatTranslateV38::*PtrToUnpackFn)(const unsigned char *, const GctBlockHeader&);
83  typedef std::map<unsigned int, PtrToUnpackFn> BlockIdToUnpackFnMap;
84 
85 
86  /* PRIVATE MEMBER DATA */
87 
90 
93 
96 
99 
103 
106 
109 
112 
113  /* PRIVATE METHODS */
114 
115  /* --------------------------------- */
116  /* Private Block Unpacking Functions */
117  /* --------------------------------- */
118 
120  void blockToGctEmCandsAndEnergySums(const unsigned char * d, const GctBlockHeader& hdr);
121 
123  void blockToGctJetCandsAndCounts(const unsigned char * d, const GctBlockHeader& hdr);
124 
126  void blockToGctInternEmCand(const unsigned char * d, const GctBlockHeader& hdr);
127 
129  void blockToRctEmCand(const unsigned char * d, const GctBlockHeader& hdr);
130 
132  void blockToRctCaloRegions(const unsigned char * d, const GctBlockHeader& hdr);
133 
135  void blockToFibres(const unsigned char * d, const GctBlockHeader& hdr);
136 
138  void blockToFibresAndToRctEmCand(const unsigned char * d, const GctBlockHeader& hdr);
139 
141  void blockToGctInternEtSums(const unsigned char * d, const GctBlockHeader& hdr);
142 
144  void blockToGctInternEtSumsAndJetCluster(const unsigned char * d, const GctBlockHeader& hdr);
145 
147  void blockToGctTrigObjects(const unsigned char * d, const GctBlockHeader& hdr);
148 
150  void blockToGctJetClusterMinimal(const unsigned char * d, const GctBlockHeader& hdr);
151 
153  void blockToGctJetPreCluster(const unsigned char * d, const GctBlockHeader& hdr);
154 
156  void blockToGctInternRingSums(const unsigned char * d, const GctBlockHeader& hdr);
157 
159  void blockToGctWheelOutputInternEtAndRingSums(const unsigned char * d, const GctBlockHeader& hdr);
160 
162  void blockToGctWheelInputInternEtAndRingSums(const unsigned char * d, const GctBlockHeader& hdr);
163 
165  void blockToGctInternHtMissPreWheel(const unsigned char* d, const GctBlockHeader& hdr);
166 
168  void blockToGctInternHtMissPostWheel(const unsigned char* d, const GctBlockHeader& hdr);
169 };
170 
171 #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).