CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/EventFilter/GctRawToDigi/src/GctFormatTranslateV38.h

Go to the documentation of this file.
00001 #ifndef GctFormatTranslateV38_h_
00002 #define GctFormatTranslateV38_h_
00003 
00004 #include "EventFilter/GctRawToDigi/src/GctFormatTranslateBase.h"
00005 
00015 // ************************************************************************
00016 // ***  THE TRANSLATION PROCESS MUST NEVER THROW ANY KIND OF EXCEPTION! *** 
00017 // ************************************************************************
00018 
00019 class GctFormatTranslateV38 : public GctFormatTranslateBase
00020 {
00021 public:
00022 
00023   /* PUBLIC METHODS */
00024 
00026 
00028   explicit GctFormatTranslateV38(bool hltMode = false, 
00029                                  bool unpackSharedRegions = false, 
00030                                  unsigned numberOfGctSamplesToUnpack=1,
00031                                  unsigned numberOfRctSamplesToUnpack=1);
00032   
00033   virtual ~GctFormatTranslateV38(); 
00034 
00036   virtual GctBlockHeader generateBlockHeader(const unsigned char * data) const;
00037   
00039   virtual bool convertBlock(const unsigned char * d, const GctBlockHeader& hdr);
00040 
00041 
00042   /* ------------------------------ */
00043   /* Public Block Packing Functions */
00044   /* ------------------------------ */
00045 
00046   // -- TO DO --
00047 
00048 
00049 protected:
00050   
00051   /* PROTECTED METHODS */
00052 
00053   /* Static data member access methods */
00054   virtual BlockLengthMap& blockLengthMap() { return m_blockLength; } 
00055   virtual const BlockLengthMap& blockLengthMap() const { return m_blockLength; } 
00056   
00057   virtual BlockNameMap& blockNameMap() { return m_blockName; }  
00058   virtual const BlockNameMap& blockNameMap() const { return m_blockName; }  
00059   
00060   virtual BlkToRctCrateMap& rctEmCrateMap() { return m_rctEmCrate; }  
00061   virtual const BlkToRctCrateMap& rctEmCrateMap() const { return m_rctEmCrate; }  
00062  
00063   virtual BlkToRctCrateMap& rctJetCrateMap() { return m_rctJetCrate; }  
00064   virtual const BlkToRctCrateMap& rctJetCrateMap() const { return m_rctJetCrate; }  
00065 
00066   virtual BlockIdToEmCandIsoBoundMap& internEmIsoBounds() { return m_internEmIsoBounds; }  
00067   virtual const BlockIdToEmCandIsoBoundMap& internEmIsoBounds() const { return m_internEmIsoBounds; }  
00068 
00069 
00070   /* Other general methods */
00072   virtual uint32_t generateRawHeader(const uint32_t blockId,
00073                                      const uint32_t nSamples,
00074                                      const uint32_t bxId,
00075                                      const uint32_t eventId) const;
00076 
00077 
00078 private:
00079 
00080   /* PRIVATE TYPEDEFS */
00081  
00083   typedef void (GctFormatTranslateV38::*PtrToUnpackFn)(const unsigned char *, const GctBlockHeader&);
00085   typedef std::map<unsigned int, PtrToUnpackFn> BlockIdToUnpackFnMap;
00086 
00087 
00088   /* PRIVATE MEMBER DATA */
00089   
00091   static BlockLengthMap m_blockLength;
00092   
00094   static BlockNameMap m_blockName;
00095   
00097   static BlkToRctCrateMap m_rctEmCrate;
00098 
00100   static BlkToRctCrateMap m_rctJetCrate;
00101   
00104   static BlockIdToEmCandIsoBoundMap m_internEmIsoBounds;
00105 
00107   static BlockIdToUnpackFnMap m_blockUnpackFn;
00108   
00110   const unsigned m_numberOfGctSamplesToUnpack; 
00111 
00113   const unsigned m_numberOfRctSamplesToUnpack; 
00114 
00115   /* PRIVATE METHODS */
00116 
00117   /* --------------------------------- */
00118   /* Private Block Unpacking Functions */
00119   /* --------------------------------- */
00120   
00122   void blockToGctEmCandsAndEnergySums(const unsigned char * d, const GctBlockHeader& hdr);
00123   
00125   void blockToGctJetCandsAndCounts(const unsigned char * d, const GctBlockHeader& hdr);
00126 
00128   void blockToGctInternEmCand(const unsigned char * d, const GctBlockHeader& hdr);
00129 
00131   void blockToRctEmCand(const unsigned char * d, const GctBlockHeader& hdr);
00132 
00134   void blockToRctCaloRegions(const unsigned char * d, const GctBlockHeader& hdr);
00135 
00137   void blockToFibres(const unsigned char * d, const GctBlockHeader& hdr);
00138   
00140   void blockToFibresAndToRctEmCand(const unsigned char * d, const GctBlockHeader& hdr);
00141 
00143   void blockToGctInternEtSums(const unsigned char * d, const GctBlockHeader& hdr);
00144 
00146   void blockToGctInternEtSumsAndJetCluster(const unsigned char * d, const GctBlockHeader& hdr);
00147 
00149   void blockToGctTrigObjects(const unsigned char * d, const GctBlockHeader& hdr);
00150 
00152   void blockToGctJetClusterMinimal(const unsigned char * d, const GctBlockHeader& hdr);
00153 
00155   void blockToGctJetPreCluster(const unsigned char * d, const GctBlockHeader& hdr);
00156 
00158   void blockToGctInternRingSums(const unsigned char * d, const GctBlockHeader& hdr);
00159 
00161   void blockToGctWheelOutputInternEtAndRingSums(const unsigned char * d, const GctBlockHeader& hdr);
00162 
00164   void blockToGctWheelInputInternEtAndRingSums(const unsigned char * d, const GctBlockHeader& hdr);
00165 
00167   void blockToGctInternHtMissPreWheel(const unsigned char* d, const GctBlockHeader& hdr); 
00168 
00170   void blockToGctInternHtMissPostWheel(const unsigned char* d, const GctBlockHeader& hdr);
00171 };
00172 
00173 #endif