CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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;
32 
34  virtual bool convertBlock(const unsigned char * d, const GctBlockHeader& hdr);
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 */
50  virtual const BlockLengthMap& blockLengthMap() const { return m_blockLength; }
51 
52  virtual BlockNameMap& blockNameMap() { return m_blockName; }
53  virtual const BlockNameMap& blockNameMap() const { return m_blockName; }
54 
56  virtual const BlkToRctCrateMap& rctEmCrateMap() const { return m_rctEmCrate; }
57 
59  virtual const BlkToRctCrateMap& rctJetCrateMap() const { return m_rctJetCrate; }
60 
63 
64 
65  /* Other general methods */
67  virtual uint32_t generateRawHeader(const uint32_t blockId,
68  const uint32_t nSamples,
69  const uint32_t bxId,
70  const uint32_t eventId) const;
71 
72 
73 private:
74 
75  /* PRIVATE TYPEDEFS */
76 
78  typedef void (GctFormatTranslateV35::*PtrToUnpackFn)(const unsigned char *, const GctBlockHeader&);
80  typedef std::map<unsigned int, PtrToUnpackFn> BlockIdToUnpackFnMap;
81 
82 
83  /* PRIVATE MEMBER DATA */
84 
87 
90 
93 
96 
100 
103 
104 
105  /* PRIVATE METHODS */
106 
107  /* --------------------------------- */
108  /* Private Block Unpacking Functions */
109  /* --------------------------------- */
110 
112  void blockToGctEmCandsAndEnergySums(const unsigned char * d, const GctBlockHeader& hdr);
113 
115  void blockToGctJetCandsAndCounts(const unsigned char * d, const GctBlockHeader& hdr);
116 
118  void blockToGctInternEmCand(const unsigned char * d, const GctBlockHeader& hdr);
119 
121  void blockToRctEmCand(const unsigned char * d, const GctBlockHeader& hdr);
122 
124  void blockToRctCaloRegions(const unsigned char * d, const GctBlockHeader& hdr);
125 
127  void blockToFibres(const unsigned char * d, const GctBlockHeader& hdr);
128 
130  void blockToFibresAndToRctEmCand(const unsigned char * d, const GctBlockHeader& hdr);
131 
133  void blockToGctInternEtSums(const unsigned char * d, const GctBlockHeader& hdr);
134 
136  void blockToGctInternEtSumsAndJetCluster(const unsigned char * d, const GctBlockHeader& hdr);
137 
139  void blockToGctTrigObjects(const unsigned char * d, const GctBlockHeader& hdr);
140 
142  void blockToGctJetClusterMinimal(const unsigned char * d, const GctBlockHeader& hdr);
143 
145  void blockToGctJetPreCluster(const unsigned char * d, const GctBlockHeader& hdr);
146 
148  void blockToGctInternRingSums(const unsigned char * d, const GctBlockHeader& hdr);
149 
151  void blockToGctWheelOutputInternEtAndRingSums(const unsigned char * d, const GctBlockHeader& hdr);
152 
154  void blockToGctWheelInputInternEtAndRingSums(const unsigned char * d, const GctBlockHeader& hdr);
155 };
156 
157 #endif
virtual BlkToRctCrateMap & rctJetCrateMap()
get the static block ID to RCT crate map for jets
virtual GctBlockHeader generateBlockHeader(const unsigned char *data) const
Generate a block header from four 8-bit values.
virtual const BlkToRctCrateMap & rctEmCrateMap() const
get static the block ID to RCT crate map for electrons.
static BlockLengthMap m_blockLength
Map to translate block number to fundamental size of a block (i.e. for 1 time-sample).
void blockToRctCaloRegions(const unsigned char *d, const GctBlockHeader &hdr)
Unpack RCT Calo Regions.
virtual const BlockNameMap & blockNameMap() const
get the static block ID to blockname map.
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
virtual bool convertBlock(const unsigned char *d, const GctBlockHeader &hdr)
Get digis from the block - will return true if it succeeds, false otherwise.
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.
virtual const BlockIdToEmCandIsoBoundMap & internEmIsoBounds() const
get the static intern EM cand isolated boundary map.
virtual BlkToRctCrateMap & rctEmCrateMap()
get the static block ID to RCT crate map for electrons.
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 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.
Unpacks/packs the V35 raw format.
static BlkToRctCrateMap m_rctEmCrate
Map to relate capture block ID to the RCT crate the data originated from (for electrons).
void blockToGctInternEmCand(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal EM Candidates
virtual BlockNameMap & blockNameMap()
get the static block ID to block-name map.
void blockToGctJetClusterMinimal(const unsigned char *d, const GctBlockHeader &hdr)
unpack GCT internal input to wheel jet sort
virtual BlockLengthMap & blockLengthMap()
get the static block ID to block-length map.
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 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
static BlkToRctCrateMap m_rctJetCrate
Map to relate capture block ID to the RCT crate the data originated from (for jets).
virtual const BlockLengthMap & blockLengthMap() const
get the static block ID to block-length map.
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.
static BlockIdToUnpackFnMap m_blockUnpackFn
Block ID to unpack function map.
void blockToRctEmCand(const unsigned char *d, const GctBlockHeader &hdr)
unpack RCT EM Candidates
virtual const BlkToRctCrateMap & rctJetCrateMap() const
get the static block ID to RCT crate map for jets
std::map< unsigned int, IsoBoundaryPair > BlockIdToEmCandIsoBoundMap
A typdef for mapping Block IDs to IsoBoundaryPairs.
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 BlockNameMap m_blockName
Map to hold a description for each block number.
virtual BlockIdToEmCandIsoBoundMap & internEmIsoBounds()
get the static intern EM cand isolated boundary map.
void(GctFormatTranslateV35::* PtrToUnpackFn)(const unsigned char *, const GctBlockHeader &)
Function pointer typdef to a block unpack function.
std::map< unsigned int, PtrToUnpackFn > BlockIdToUnpackFnMap
Typedef for a block ID to unpack function map.
static BlockIdToEmCandIsoBoundMap m_internEmIsoBounds