File indexing completed on 2025-12-16 09:19:34
0001
0002
0003 #ifndef FUN4ALL_FUN4ALLDSTINPUTMANAGER_H
0004 #define FUN4ALL_FUN4ALLDSTINPUTMANAGER_H
0005
0006 #include "Fun4AllInputManager.h"
0007
0008 #include <phool/PHNodeIOManager.h>
0009
0010 #include <map>
0011 #include <string>
0012
0013 class PHCompositeNode;
0014 class PHNodeIOManager;
0015 class SyncObject;
0016
0017 class Fun4AllDstInputManager : public Fun4AllInputManager
0018 {
0019 public:
0020 Fun4AllDstInputManager(const std::string &name = "DUMMY", const std::string &nodename = "DST", const std::string &topnodename = "TOP");
0021 ~Fun4AllDstInputManager() override;
0022 int fileopen(const std::string &filenam) override;
0023 int fileclose() override;
0024 int run(const int nevents = 0) override;
0025 int GetSyncObject(SyncObject **mastersync) override;
0026 int SyncIt(const SyncObject *mastersync) override;
0027 int BranchSelect(const std::string &branch, const int iflag) override;
0028 int setBranches() override;
0029 void CacheSize(uint64_t size) { m_IManager->CacheSize(size); }
0030 virtual int setSyncBranches(PHNodeIOManager *iman);
0031 void Print(const std::string &what = "ALL") const override;
0032 int PushBackEvents(const int i) override;
0033 int HasSyncObject() const override;
0034
0035 protected:
0036 int ReadNextEventSyncObject();
0037 void ReadRunTTree(const int i) { m_ReadRunTTree = i; }
0038 void IManager(PHNodeIOManager *iman) { m_IManager = iman; }
0039 PHNodeIOManager *IManager() { return m_IManager; }
0040 void runNode(PHCompositeNode *node) { m_RunNode = node; }
0041 PHCompositeNode *runNode() { return m_RunNode; }
0042 void runNodeCopy(PHCompositeNode *node) { m_RunNodeCopy = node; }
0043 PHCompositeNode *runNodeCopy() { return m_RunNodeCopy; }
0044 void runNodeSum(PHCompositeNode *node) { m_RunNodeSum = node; }
0045 PHCompositeNode *runNodeSum() { return m_RunNodeSum; }
0046 const std::string &RunNodeName() const { return RunNode; }
0047 std::string fullfilename;
0048
0049 private:
0050 PHCompositeNode *dstNode{nullptr};
0051 PHCompositeNode *m_RunNode{nullptr};
0052 PHCompositeNode *m_RunNodeCopy{nullptr};
0053 PHCompositeNode *m_RunNodeSum{nullptr};
0054 PHNodeIOManager *m_IManager{nullptr};
0055 SyncObject *syncobject{nullptr};
0056 int m_ReadRunTTree{1};
0057 int events_total{0};
0058 int events_thisfile{0};
0059 int events_skipped_during_sync{0};
0060 int m_HaveSyncObject{0};
0061 std::map<const std::string, int> branchread;
0062 std::string syncbranchname;
0063 std::string RunNode{"RUN"};
0064 };
0065
0066 #endif