ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Dumper.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Dumper.cc
1 #include "Dumper.h"
2 #include "PHNodeDump.h"
3 
4 #include <fun4all/SubsysReco.h>
5 
7 #include <phool/PHNode.h>
8 #include <phool/PHNodeIterator.h>
9 
10 #include <vector>
11 
12 Dumper::Dumper(const std::string &name)
13  : SubsysReco(name)
14 {
15  nodedump = new PHNodeDump();
16  return;
17 }
18 
20 {
21  delete nodedump;
22  return;
23 }
24 
26 {
27  PHNodeIterator iter(topNode);
28  nodedump->GetGlobalVars(topNode);
29  PHCompositeNode *dstNode = dynamic_cast<PHCompositeNode *>(iter.findFirst("PHCompositeNode", "DST"));
30  if (dstNode)
31  {
32  iter.cd("DST");
33  iter.forEach(*nodedump);
34  iter.cd();
35  }
36  return 0;
37 }
38 
40 {
41  PHNodeIterator nodeiter(topNode);
42  std::vector<std::string> DumpNodeList;
43  DumpNodeList.push_back("RUN");
44  DumpNodeList.push_back("PAR");
45  for (std::vector<std::string>::const_iterator iter = DumpNodeList.begin();
46  iter != DumpNodeList.end(); ++iter)
47  {
48  if (nodeiter.cd(*iter))
49  {
50  nodeiter.forEach(*nodedump);
51  nodeiter.cd();
52  }
53  }
55  return 0;
56 }
57 
58 void Dumper::SetOutDir(const std::string &outdir)
59 {
60  nodedump->SetOutDir(outdir);
61  return;
62 }
63 
64 void Dumper::SetPrecision(const int digits)
65 {
66  nodedump->SetPrecision(digits);
67  return;
68 }
69 
70 int Dumper::AddIgnore(const std::string &name)
71 {
72  return nodedump->AddIgnore(name);
73 }
74 
75 int Dumper::Select(const std::string &name)
76 {
77  return nodedump->Select(name);
78 }