Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef FUN4ALLRAW_SINGLEINTTPOOLINPUT_H
0002 #define FUN4ALLRAW_SINGLEINTTPOOLINPUT_H
0003 
0004 #include "SingleStreamingInput.h"
0005 
0006 #include <array>
0007 #include <cstdint>  // for uint64_t
0008 #include <map>
0009 #include <set>
0010 #include <string>
0011 #include <vector>
0012 #include <iostream>
0013 class InttRawHit;
0014 class Packet;
0015 class PHCompositeNode;
0016 class intt_pool;
0017 
0018 class SingleInttPoolInput : public SingleStreamingInput
0019 {
0020  public:
0021   explicit SingleInttPoolInput(const std::string &name);
0022   ~SingleInttPoolInput() override;
0023   void FillPool(const uint64_t minBCO) override;
0024   void CleanupUsedPackets(const uint64_t bclk) override;
0025   bool CheckPoolDepth(const uint64_t bclk) override;
0026   void ClearCurrentEvent() override;
0027   bool GetSomeMoreEvents(const uint64_t ibclk);
0028   void Print(const std::string &what = "ALL") const override;
0029   void CreateDSTNode(PHCompositeNode *topNode) override;
0030 
0031   void SetBcoRange(const unsigned int value) { m_BcoRange = value; }
0032   void ConfigureStreamingInputManager() override;
0033   void SetNegativeBco(const unsigned int value) { m_NegativeBco = value; }
0034   const std::set<uint64_t> &BclkStack() const override { return m_BclkStack; }
0035   const std::map<uint64_t, std::set<int>> &BeamClockFEE() const override { return m_BeamClockFEE; }
0036   void streamingMode(const bool isStreaming)
0037   {
0038     if(isStreaming)
0039     {
0040       SetNegativeBco(120 - 23);
0041       SetBcoRange(500);
0042       std::cout << "INTT set to streaming event combining"<<std::endl;
0043       return;
0044     }
0045 
0046     SetNegativeBco(1);
0047     SetBcoRange(2);
0048 
0049     std::cout << "INTT set to triggered event combining with range [-" 
0050               << m_NegativeBco << "," << m_BcoRange << "]" << std::endl;
0051   }
0052 
0053  private:
0054   Packet **plist{nullptr};
0055   unsigned int m_NumSpecialEvents{0};
0056   unsigned int m_BcoRange{0};
0057   unsigned int m_NegativeBco{0};
0058   bool m_SkipEarlyEvents{true};
0059   std::array<uint64_t, 14> m_PreviousClock{};
0060   std::array<uint64_t, 14> m_Rollover{};
0061   std::map<uint64_t, std::set<int>> m_BeamClockFEE;
0062   std::map<uint64_t, std::vector<InttRawHit *>> m_InttRawHitMap;
0063   std::map<int, uint64_t> m_FEEBclkMap;
0064   std::set<uint64_t> m_BclkStack;
0065 
0066   std::map<int, intt_pool *> poolmap;
0067 };
0068 
0069 #endif