Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4AllPrdfInputPoolManager.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4AllPrdfInputPoolManager.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef FUN4ALLRAW_FUN4ALLPRDFINPUTPOOLMANAGER_H
4 #define FUN4ALLRAW_FUN4ALLPRDFINPUTPOOLMANAGER_H
5 
7 
8 #include <Event/phenixTypes.h>
9 
10 #include <map>
11 #include <string>
12 #include <utility>
13 #include <vector>
14 
15 class Event;
16 class SinglePrdfInput;
17 class oEvent;
18 class Packet;
19 class PHCompositeNode;
20 class SyncObject;
21 
23 {
24  public:
25  Fun4AllPrdfInputPoolManager(const std::string &name = "DUMMY", const std::string &prdfnodename = "PRDF", const std::string &topnodename = "TOP");
27  int fileopen(const std::string & /* filenam */) override { return 0; }
28  // cppcheck-suppress virtualCallInConstructor
29  int fileclose() override;
30  int run(const int nevents = 0) override;
31 
32  void Print(const std::string &what = "ALL") const override;
33  int ResetEvent() override;
34  int PushBackEvents(const int i) override;
35  int GetSyncObject(SyncObject **mastersync) override;
36  int SyncIt(const SyncObject *mastersync) override;
37  int HasSyncObject() const override { return 1; }
38  std::string GetString(const std::string &what) const override;
42  void AddPacket(const int evtno, Packet *p);
43  void UpdateEventFoundCounter(const int evtno);
44  void UpdateDroppedPacket(const int packetid);
45  void AddBeamClock(const int evtno, const int bclk, SinglePrdfInput *prdfin);
46  void SetReferenceClock(const int evtno, const int bclk);
48  void CreateBclkOffsets();
49  int CalcDiffBclk(const int bclk1, const int bclk2);
50  void DitchEvent(const int eventno);
51  void Resynchronize();
52  void ClearAllEvents();
53  void SetPoolDepth(unsigned int d) { m_PoolDepth = d; }
54 
55  private:
56  struct PacketInfo
57  {
58  std::vector<Packet *> PacketVector;
59  unsigned int EventFoundCounter = 0;
60  };
61 
63  {
64  int bclkoffset = 0;
65  };
66 
67  bool m_StartUpFlag = true;
68  int m_RunNumber = 0;
69  unsigned int m_PoolDepth = 100;
70  unsigned int m_InitialPoolDepth = 20;
71  std::vector<SinglePrdfInput *> m_PrdfInputVector;
74  Event *m_Event = nullptr;
75  PHDWORD workmem[4 * 1024 * 1024] = {};
76  oEvent *oph = nullptr;
78  std::map<int, PacketInfo> m_PacketMap;
80  std::map<int, int> m_DroppedPacketMap;
81  std::map<int, std::vector<std::pair<int, SinglePrdfInput *>>> m_ClockCounters;
82  std::map<int, int> m_RefClockCounters;
83  std::map<SinglePrdfInput *, SinglePrdfInputInfo> m_SinglePrdfInputInfo;
84 };
85 
86 #endif /* FUN4ALL_FUN4ALLPRDFINPUTPOOLMANAGER_H */