Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:17:22

0001 #ifndef FUN4ALLRAW_SINGLEGL1TRIGGEREDINPUT_H
0002 #define FUN4ALLRAW_SINGLEGL1TRIGGEREDINPUT_H
0003 
0004 #include "SingleTriggeredInput.h"
0005 
0006 #include <cstdint>
0007 #include <map>
0008 #include <set>
0009 #include <string>
0010 #include <vector>
0011 
0012 class OfflinePacket;
0013 class Packet;
0014 class PHCompositeNode;
0015 
0016 class SingleGl1TriggeredInput : public SingleTriggeredInput
0017 {
0018  public:
0019   explicit SingleGl1TriggeredInput(const std::string &name);
0020   ~SingleGl1TriggeredInput() override = default;
0021   void FillPool() override;
0022   // void CleanupUsedPackets(const int eventno);
0023   // void ClearCurrentEvent();
0024   void Print(const std::string &what = "ALL") const override;
0025   void CreateDSTNodes(Event *evt) override;
0026   uint64_t GetClock(Event *evt, int pid) override;
0027   int GetCurrentPacketNumber() const { return m_PacketNumber; }
0028   int GetLastPacketNumber() const { return m_LastPacketNumber; }
0029   const std::array<int, pooldepth>& GetGl1SkipArray() const { return m_Gl1SkipPerIndex; }
0030   const std::array<uint64_t, pooldepth>& GetPacketNumbers() const { return m_Gl1PacketNumbers; }
0031   int ReadEvent() override;
0032   void SetPacketNumbers(int last, int current)
0033   {
0034     m_LastPacketNumber = last;
0035     m_PacketNumber = current;
0036   }
0037   void SetGl1SkipAtIndex(size_t index, int value)
0038   {
0039     if (index < pooldepth)
0040     {
0041       m_Gl1SkipPerIndex[index] = value;
0042     }
0043   }
0044   void SetGl1PacketNumber(size_t index, uint64_t value)
0045   {
0046     if (index < pooldepth)
0047     {
0048       m_Gl1PacketNumbers[index] = value;
0049     }
0050   }
0051 
0052 
0053  protected:
0054   int m_LastPacketNumber{0};
0055   int m_PacketNumber{0};
0056   std::array<int, pooldepth> m_Gl1SkipPerIndex{};
0057   std::array<uint64_t, pooldepth> m_Gl1PacketNumbers{};
0058 
0059  private:
0060 };
0061 
0062 #endif