Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DumpObject.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DumpObject.cc
1 #include "DumpObject.h"
2 
3 #include "PHNodeDump.h"
4 
5 #include <fstream>
6 #include <iostream>
7 #include <string>
8 
10  : ThisName(NodeName)
11 {
12  return;
13 }
14 
16 {
17  if (ThisName != "DUMMY")
18  {
19  OpenOutFile();
20  }
21  return 0;
22 }
23 
25 {
26  if (no_output)
27  {
28  return 0;
29  }
30  std::string fname = OutDir + "/" + ThisName + ".list";
31  fout = new std::ofstream(fname.c_str());
32  return 0;
33 }
34 
35 void DumpObject::Print(const char * /*what*/) const
36 {
37  std::cout << ThisName << " did not implement Print method" << std::endl;
38  return;
39 }
40 
42 {
43  if (fout && write_run_event)
44  {
45  if (fp_precision > 0)
46  {
47  (*fout).precision(fp_precision);
48  }
49  *fout << std::endl
50  << "RunNumber: " << myNodeDump->RunNumber();
51  if (print_evtseq)
52  {
53  *fout << ", Event Sequence: " << myNodeDump->EvtSequence();
54  }
55  *fout << std::endl;
56  }
57  process_Node(myNode);
58  // std::cout << ThisName << " did not implement process_event method" << std::endl;
59  return 0;
60 }
61 
63 {
64  // std::cout << ThisName << " did not implement process_event method" << std::endl;
65  return 0;
66 }
67 
69 {
70  delete fout;
71  fout = nullptr;
72  return 0;
73 }