EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fun4AllOutputManager.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Fun4AllOutputManager.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef FUN4ALL_FUN4ALLOUTPUTMANAGER_H
4 #define FUN4ALL_FUN4ALLOUTPUTMANAGER_H
5 
6 #include "Fun4AllBase.h"
7 
8 #include <cstddef> // for size_t
9 #include <string>
10 #include <vector>
11 
12 class PHCompositeNode;
13 
15 {
16  public:
19  {
20  }
21 
23  void Print(const std::string &what = "ALL") const override;
24 
26  virtual int AddNode(const std::string & /*nodename*/)
27  {
28  return 0;
29  }
30 
32  virtual int AddRunNode(const std::string & /*nodename*/)
33  {
34  return 0;
35  }
36 
38  virtual int StripNode(const std::string & /*nodename*/)
39  {
40  return 0;
41  }
42 
44  virtual int StripRunNode(const std::string & /*nodename*/)
45  {
46  return 0;
47  }
48 
49  virtual void SaveRunNode(const int) {return;}
50 
56  virtual int AddEventSelector(const std::string &recomodule);
57 
59  virtual int outfileopen(const std::string & /*nodename*/)
60  {
61  return 0;
62  }
63 
65  int WriteGeneric(PHCompositeNode *startNode);
66 
68  virtual int Write(PHCompositeNode * /*startNode*/)
69  {
70  return 0;
71  }
72 
74  virtual int WriteNode(PHCompositeNode * /*thisNode*/)
75  {
76  return 0;
77  }
78 
80  virtual std::vector<std::string> *EventSelector()
81  {
82  return &m_EventSelectorsVector;
83  }
84 
86  virtual std::vector<unsigned> *RecoModuleIndex()
87  {
89  }
90 
92  virtual int DoNotWriteEvent(std::vector<int> *retcodes) const;
93 
95  virtual size_t EventsWritten() const { return m_NEvents; }
97  virtual void IncrementEvents(const unsigned int i) { m_NEvents += i; }
99  virtual std::string OutFileName() const { return m_OutFileName; }
100  void OutFileName(const std::string &name) { m_OutFileName = name; }
101 
102  protected:
107  Fun4AllOutputManager(const std::string &myname);
108  Fun4AllOutputManager(const std::string &myname, const std::string &outfname);
109 
110  private:
112  unsigned int m_NEvents;
113 
115  std::string m_OutFileName;
116 
118  std::vector<std::string> m_EventSelectorsVector;
119 
121  std::vector<unsigned> m_RecoModuleIndexVector;
122 };
123 
124 #endif