File indexing completed on 2025-12-17 09:19:47
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 <iostream>
0009 #include <map>
0010 #include <set>
0011 #include <string>
0012 #include <vector>
0013
0014 class InttRawHit;
0015 class Packet;
0016 class PHCompositeNode;
0017 class intt_pool;
0018
0019 class SingleInttPoolInput : public SingleStreamingInput
0020 {
0021 public:
0022 enum InttStreamingMode
0023 {
0024 UNDEFINED = 0,
0025 STREAMING = 1,
0026 TRIGGERED = -1
0027 };
0028 explicit SingleInttPoolInput(const std::string &name);
0029 ~SingleInttPoolInput() override;
0030 void FillPool(const uint64_t minBCO) override;
0031 void CleanupUsedPackets(const uint64_t bclk) override;
0032 bool CheckPoolDepth(const uint64_t bclk) override;
0033 void ClearCurrentEvent() override;
0034 bool GetSomeMoreEvents(const uint64_t ibclk);
0035 void Print(const std::string &what = "ALL") const override;
0036 void CreateDSTNode(PHCompositeNode *topNode) override;
0037
0038 void SetBcoRange(const unsigned int value) { m_BcoRange = value; }
0039 unsigned int GetBcoRange() const { return m_BcoRange; }
0040 void ConfigureStreamingInputManager() override { return; }
0041 void ConfigureStreamingInputManagerLocal(const int runnumber);
0042 void SetNegativeBco(const unsigned int value) { m_NegativeBco = value; }
0043 unsigned int GetNegativeBco() const { return m_NegativeBco; }
0044 const std::set<uint64_t> &BclkStack() const override { return m_BclkStack; }
0045 const std::map<uint64_t, std::set<int>> &BeamClockFEE() const override { return m_BeamClockFEE; }
0046
0047 void streamingMode(const bool isStreaming);
0048 bool IsStreaming(int runnumber);
0049
0050 private:
0051 unsigned int m_NumSpecialEvents{0};
0052 unsigned int m_BcoRange{0};
0053 unsigned int m_NegativeBco{0};
0054 int m_SavedRunNumber{0};
0055 int m_StreamingFlag{InttStreamingMode::UNDEFINED};
0056 bool m_SkipEarlyEvents{true};
0057 std::array<uint64_t, 14> m_PreviousClock{};
0058 std::array<uint64_t, 14> m_Rollover{};
0059 std::map<uint64_t, std::set<int>> m_BeamClockFEE;
0060 std::map<uint64_t, std::vector<InttRawHit *>> m_InttRawHitMap;
0061 std::map<int, uint64_t> m_FEEBclkMap;
0062 std::set<uint64_t> m_BclkStack;
0063
0064 std::map<int, intt_pool *> poolmap;
0065 };
0066
0067 #endif