Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SinglePrdfInput.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SinglePrdfInput.h
1 #ifndef FUN4ALLRAW_SINGLEPRDFINPUT_H
2 #define FUN4ALLRAW_SINGLEPRDFINPUT_H
3 
4 #include <fun4all/Fun4AllBase.h>
6 
7 #include <array>
8 #include <limits>
9 #include <map>
10 #include <set>
11 #include <string>
12 #include <utility> // for pair
13 #include <vector>
14 
15 class Eventiterator;
17 class Packet;
18 
20 {
21  public:
23  ~SinglePrdfInput() override;
25  virtual void FillPool(const unsigned int nevents);
26  int RunNumber() const { return m_RunNumber; }
27  void RunNumber(const int irun) { m_RunNumber = irun; }
28  int fileopen(const std::string &filename) override;
29  int fileclose() override;
30  int AllDone() const { return m_AllDone; }
31  void AllDone(const int i) { m_AllDone = i; }
32  void EventNumberOffset(const int i) { m_EventNumberOffset = i; } // if beam clk are out of sync, tweak this one
33  int EventNumberOffset() const { return m_EventNumberOffset; }
35  void MakeReference(const bool b);
36  bool ReferenceFlag() const { return m_MeReferenceFlag; }
37 
38  private:
40  int majority_beamclock();
41  void adjust_eventnumber_offset(const int decided_evtno);
42  struct PacketInfo
43  {
44  std::vector<Packet *> PacketVector;
45  unsigned int EventFoundCounter = 0;
46  };
49  Packet **plist = nullptr;
50  unsigned int m_NumSpecialEvents = 0;
51  int m_EventNumberOffset = 1; // packet event counters start at 0 but we start with event number 1
52  int *m_PacketEventNumberOffset = nullptr; // packet event counters start at 0 but we start with event number 1
53  int m_RunNumber = 0;
55  int m_AllDone = 0;
56  bool m_MeReferenceFlag = false;
57  std::map<int, std::vector<Packet *>> m_PacketMap;
58  std::set<int> m_EvtSet;
59  std::vector<std::pair<int, int>> m_Event;
60  std::array<unsigned int,100> rollover;
61  std::array<int,100> previous_eventnumber;
62 };
63 
64 #endif