Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:16:14

0001 #ifndef __MVTX_POOL_H__
0002 #define __MVTX_POOL_H__
0003 
0004 #include "mvtx_decoder/PayLoadCont.h"
0005 #include "mvtx_decoder/GBTLink.h"
0006 #include "mvtx_decoder/StrobeData.h"
0007 
0008 #include <set>
0009 #include <unordered_map>
0010 #include <vector>
0011 
0012 #include <cstdint>
0013 
0014 class Packet;
0015 
0016 class mvtx_pool {
0017 
0018  public:
0019   mvtx_pool() = default;
0020   virtual ~mvtx_pool();
0021 
0022   virtual int addPacket(Packet* p);
0023 
0024   size_t get_feeidSet_size();
0025 
0026   int get_feeid(const uint16_t iLink);
0027   int get_hbfSet_size(const uint16_t iLink);
0028   int get_trgSet_size(const uint16_t iLink);
0029   int get_strbSet_size(const uint16_t iLink);
0030 
0031   int get_L1_IR_BC(const uint16_t iLnk, const uint32_t);
0032   int get_TRG_IR_BC(const uint16_t iLnk, const uint32_t);
0033   int get_TRG_DET_FIELD(const uint16_t iLnk, const uint32_t);
0034   int get_TRG_NR_HITS(const uint16_t iLnk, const uint32_t);
0035 
0036   long long int get_L1_IR_BCO(const uint16_t iLnk, const uint32_t);
0037   long long int get_TRG_IR_BCO(const uint16_t iLnk, const uint32_t);
0038 
0039   int iValue(const int, const char* what);
0040   int iValue(const int, const int, const char* what);
0041   int iValue(const int, const int, const int, const char* what);
0042 
0043   long long int lValue(const int, const int, const char* what);
0044 
0045   std::vector<mvtx::mvtx_hit*>& get_hits(const int feeId,
0046                                          const int i_strb);
0047 
0048   void set_verbosity(const int val) { verbosity = val; }
0049   int  get_verbosity() { return verbosity; }
0050 
0051  protected:
0052    uint32_t get_linkId(const uint16_t i);
0053 
0054  private:
0055   int mvtx_decode();
0056   bool m_is_decoded = false;
0057 
0058   int verbosity = 0;
0059 
0060   struct dumpEntry
0061   {
0062     int entry = -1;
0063   };
0064 
0065   void loadInput(Packet* p);
0066   void setupLinks();
0067 
0068   mvtx::PayLoadCont mBuffer = {};
0069   std::unordered_map<uint16_t, dumpEntry> mFeeId2LinkID; // link fee_id to GBTLinks
0070   std::vector<mvtx::GBTLink> mGBTLinks;
0071   std::set<uint16_t> feeid_set;
0072 
0073   uint8_t* payload = nullptr;
0074   unsigned int payload_position = 0;
0075 };
0076 
0077 #endif /* __MVTX_POOL_H__ */