Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4AllStreamingInputManager.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4AllStreamingInputManager.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef FUN4ALLRAW_FUN4ALLSTREAMINGINPUTMANAGER_H
4 #define FUN4ALLRAW_FUN4ALLSTREAMINGINPUTMANAGER_H
5 
7 
8 #include <map>
9 #include <set>
10 #include <string>
11 
13 class Gl1RawHit;
14 class InttRawHit;
15 class MicromegasRawHit;
16 class MvtxRawHit;
17 class PHCompositeNode;
18 class SyncObject;
19 class TpcRawHit;
20 
22 {
23  public:
24  Fun4AllStreamingInputManager(const std::string &name = "DUMMY", const std::string &dstnodename = "DST", const std::string &topnodename = "TOP");
26 
28  {
29  MVTX = 1,
30  INTT = 2,
31  TPC = 3,
33  GL1 = 5
34  };
35 
36  int fileopen(const std::string & /*filenam*/) override { return 0; }
37  // cppcheck-suppress virtualCallInConstructor
38  int fileclose() override;
39  int run(const int nevents = 0) override;
40 
41  void Print(const std::string &what = "ALL") const override;
42  int ResetEvent() override;
43  int PushBackEvents(const int i) override;
44  int GetSyncObject(SyncObject **mastersync) override;
45  int SyncIt(const SyncObject *mastersync) override;
46  int HasSyncObject() const override { return 1; }
47  std::string GetString(const std::string &what) const override;
49  int FillGl1();
50  int FillIntt();
51  int FillMicromegas();
52  int FillMvtx();
53  int FillTpc();
54  void AddGl1RawHit(uint64_t bclk, Gl1RawHit *hit);
55  void AddInttRawHit(uint64_t bclk, InttRawHit *hit);
56  void AddMicromegasRawHit(uint64_t /* bclk */, MicromegasRawHit * /* hit */);
57  void AddMvtxFeeId(uint64_t bclk, uint16_t feeid);
58  void AddMvtxL1TrgBco(uint64_t bclk, uint64_t lv1Bco);
59  void AddMvtxRawHit(uint64_t bclk, MvtxRawHit *hit);
60  void AddTpcRawHit(uint64_t bclk, TpcRawHit *hit);
61  void SetInttBcoRange(const unsigned int i);
62  void SetInttNegativeBco(const unsigned int value);
63  void SetMicromegasBcoRange(const unsigned int i);
64  void SetMicromegasNegativeBco(const unsigned int value);
65  void SetMvtxBcoRange(const unsigned int i);
66  void SetMvtxNegativeBco(const unsigned int value);
67  void SetTpcBcoRange(const unsigned int i);
68  void SetTpcNegativeBco(const unsigned int value);
69  int FillInttPool();
70  int FillMicromegasPool();
71  int FillMvtxPool();
72  int FillTpcPool();
73 
74  private:
76  {
77  std::set<uint16_t> MvtxFeeIds;
78  std::set<uint64_t> MvtxL1TrgBco;
79  std::vector<MvtxRawHit *> MvtxRawHitVector;
80  unsigned int EventFoundCounter = 0;
81  };
82 
84  {
85  std::vector<Gl1RawHit *> Gl1RawHitVector;
86  unsigned int EventFoundCounter = 0;
87  };
88 
90  {
91  std::vector<InttRawHit *> InttRawHitVector;
92  unsigned int EventFoundCounter = 0;
93  };
94 
96  {
97  std::vector<MicromegasRawHit *> MicromegasRawHitVector;
98  unsigned int EventFoundCounter = 0;
99  };
100 
102  {
103  std::vector<TpcRawHit *> TpcRawHitVector;
104  unsigned int EventFoundCounter = 0;
105  };
106 
107  int m_RunNumber = 0;
113  unsigned int m_intt_bco_range{0};
114  unsigned int m_intt_negative_bco{0};
115  unsigned int m_micromegas_bco_range{0};
116  unsigned int m_micromegas_negative_bco{0};
117  unsigned int m_mvtx_bco_range{0};
118  unsigned int m_mvtx_negative_bco{0};
119  unsigned int m_tpc_bco_range{0};
120  unsigned int m_tpc_negative_bco{0};
121  uint64_t m_RefBCO{0};
122 
123  std::vector<SingleStreamingInput *> m_Gl1InputVector;
124  std::vector<SingleStreamingInput *> m_InttInputVector;
125  std::vector<SingleStreamingInput *> m_MicromegasInputVector;
126  std::vector<SingleStreamingInput *> m_MvtxInputVector;
127  std::vector<SingleStreamingInput *> m_TpcInputVector;
130  std::map<uint64_t, Gl1RawHitInfo> m_Gl1RawHitMap;
131  std::map<uint64_t, InttRawHitInfo> m_InttRawHitMap;
132  std::map<uint64_t, MicromegasRawHitInfo> m_MicromegasRawHitMap;
133  std::map<uint64_t, MvtxRawHitInfo> m_MvtxRawHitMap;
134  std::map<uint64_t, TpcRawHitInfo> m_TpcRawHitMap;
135  std::map<int, std::map<int, uint64_t>> m_InttPacketFeeBcoMap;
136 };
137 
138 #endif /* FUN4ALL_FUN4ALLSTREAMINGINPUTMANAGER_H */