Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:17:55

0001 #ifndef NODEDUMP_DUMPOBJECT_H
0002 #define NODEDUMP_DUMPOBJECT_H
0003 
0004 #include <iosfwd>
0005 #include <string>
0006 
0007 class PHNode;
0008 class PHNodeDump;
0009 
0010 class DumpObject
0011 {
0012  public:
0013   explicit DumpObject(const std::string &NodeName = "DUMMY");
0014   virtual ~DumpObject() {}
0015 
0016   virtual int Init();  // called during intialization
0017   virtual int process_event(PHNode *mynode);
0018   virtual int CloseOutputFile();
0019   virtual const std::string Name() const { return ThisName; }
0020   virtual void Print(const char *what) const;
0021   virtual void SetOutDir(const std::string &outdir) { OutDir = outdir; }
0022   virtual void SetPrecision(const int digits) { fp_precision = digits; }
0023   void SetParentNodeDump(PHNodeDump *nd) { myNodeDump = nd; }
0024   void NoOutput(const int i = 1) { no_output = i; }
0025   void WriteRunEvent(const int i) { write_run_event = i; }
0026   void PrintEvtSeq(const int i) { print_evtseq = i; }
0027 
0028  protected:
0029   virtual int process_Node(PHNode *myNode);
0030   virtual int OpenOutFile();
0031   std::ostream *fout = nullptr;
0032 
0033  private:
0034   std::string ThisName;
0035   int write_run_event = 1;  // flag for not writing info for each event
0036   std::string OutDir = "./";
0037   int fp_precision = -1;
0038   PHNodeDump *myNodeDump = nullptr;
0039   int no_output = 0;
0040   int print_evtseq = 1;
0041 };
0042 
0043 #endif