ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4AllSyncManager.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4AllSyncManager.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 // This Master manages the reading of the Input.
4 // In principle all of this could be done in the Fun4AllServer
5 // but this is simpler to develop and test while Fun4All is allready in use.
6 
7 #ifndef FUN4ALL_FUN4ALLSYNCMANAGER_H
8 #define FUN4ALL_FUN4ALLSYNCMANAGER_H
9 
10 #include "Fun4AllBase.h"
11 
12 #include <string> // for string
13 #include <vector>
14 
16 class SyncObject;
17 
19 {
20  public:
21  Fun4AllSyncManager(const std::string &name = "SYNCMANAGERNONAME");
22  ~Fun4AllSyncManager() override;
24  Fun4AllInputManager *getInputManager(const std::string &name);
25 
27  int run(const int nevnts = 0);
28 
33  int skip(const int nevnts = 0);
34 
35  int fileopen(const std::string &managername, const std::string &filename);
36  int fileclose(const std::string &managername = "NONE");
37  int CurrentRun() { return m_CurrentRun; }
38  void CurrentRun(const int ival) { m_CurrentRun = ival; }
39  void CurrentEvent(const int evt);
40  void Print(const std::string &what = "ALL") const override;
41  void SegmentNumber(const int iseg) { m_PrdfSegment = iseg; }
42  int SegmentNumber() const { return m_PrdfSegment; }
43  int BranchSelect(const std::string &managername, const std::string &branch, int iflag);
44  int BranchSelect(const std::string &branch, const int iflag);
45  int setBranches(const std::string &managername);
46  int setBranches();
47  void TotalEvents(const int i) { m_EventsTotal = i; }
48  int TotalEvents() const { return m_EventsTotal; }
49  void PrdfEvents(const int i) { m_PrdfEvents = i; }
50  int PrdfEvents() const { return m_PrdfEvents; }
51  void GetInputFullFileList(std::vector<std::string> &fnames) const;
52  void Repeat(const int i = -1) { m_Repeat = i; }
53  void PushBackInputMgrsEvents(const int i);
54  int ResetEvent();
55  const std::vector<Fun4AllInputManager *> GetInputManagers() const { return m_InManager; }
56 
57  private:
58  void PrintSyncProblem() const;
59  int CheckSync(unsigned i);
60  int m_PrdfSegment = 0;
61  int m_PrdfEvents = 0;
62  int m_EventsTotal = 0;
63  int m_CurrentRun = 0;
64  int m_CurrentEvent = 0;
65  int m_Repeat = 0;
67  std::vector<Fun4AllInputManager *> m_InManager;
68  std::vector<int> m_iretInManager;
69 };
70 
71 #endif