Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef FUN4ALLRAW_SINGLEMVTXPOOLINPUT_H
0002 #define FUN4ALLRAW_SINGLEMVTXPOOLINPUT_H
0003 
0004 #include "SingleStreamingInput.h"
0005 
0006 #include <algorithm>
0007 #include <map>
0008 #include <vector>
0009 
0010 class MvtxRawHit;
0011 class Packet;
0012 class mvtx_pool;
0013 
0014 class SingleMvtxPoolInput : public SingleStreamingInput
0015 {
0016  public:
0017   explicit SingleMvtxPoolInput(const std::string &name);
0018   ~SingleMvtxPoolInput() override;
0019   void FillPool(const uint64_t minBCO) override;
0020   void CleanupUsedPackets(const uint64_t bclk) override;
0021   bool CheckPoolDepth(const uint64_t bclk) override;
0022   void ClearCurrentEvent() override;
0023   bool GetSomeMoreEvents();
0024   void Print(const std::string &what = "ALL") const override;
0025   void CreateDSTNode(PHCompositeNode *topNode) override;
0026 
0027   void SetBcoRange(const unsigned int i) { m_BcoRange = i; }
0028   void ConfigureStreamingInputManager() override;
0029   void SetNegativeBco(const unsigned int value) { m_NegativeBco = value; }
0030   void setRawEventHeaderName(const std::string &name) { m_rawEventHeaderName = name; }
0031   const std::string &getRawEventHeaderName() const { return m_rawEventHeaderName; }
0032 
0033   void  SetReadStrWidthFromDB(const bool val){ m_readStrWidthFromDB = val; }
0034   bool  GetReadStrWidthFromDB(){ return m_readStrWidthFromDB; }
0035   void  SetStrobeWidth(const float val) { m_strobeWidth = val; }
0036   float GetStrobeWidth() { return m_strobeWidth; }
0037 
0038   void runMVTXstandalone() {m_mvtx_is_standalone = true;}
0039 
0040  protected:
0041  private:
0042   Packet **plist{nullptr};
0043   unsigned int m_NumSpecialEvents{0};
0044   unsigned int m_BcoRange{0};
0045   unsigned int m_NegativeBco{0};
0046   std::string m_rawEventHeaderName = "MVTXRAWEVTHEADER";
0047 
0048   std::map<uint64_t, std::vector<MvtxRawHit *>> m_MvtxRawHitMap;
0049   std::map<int, uint64_t> m_FEEBclkMap;
0050   std::map<int, uint64_t> m_FeeStrobeMap;
0051   std::set<uint64_t> m_BclkStack;
0052   std::set<uint64_t> gtmL1BcoSet;  // GTM L1 BCO
0053   std::map<int, mvtx_pool *> poolmap;
0054 
0055   bool m_readStrWidthFromDB = true;
0056   float m_strobeWidth = 0;
0057 
0058   bool m_mvtx_is_standalone{false};
0059 };
0060 
0061 #endif