ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DumpVariableArray.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DumpVariableArray.cc
1 #include "DumpVariableArray.h"
2 
4 
5 #include <phool/PHIODataNode.h>
6 
7 #include <ostream>
8 #include <string>
9 
10 using namespace std;
11 
13 
14 DumpVariableArray::DumpVariableArray(const string &NodeName)
15  : DumpObject(NodeName)
16 {
17  return;
18 }
19 
21 {
22  VariableArray *variablearray = nullptr;
23  MyNode_t *thisNode = static_cast<MyNode_t *>(myNode);
24  if (thisNode)
25  {
26  variablearray = thisNode->getData();
27  }
28  if (variablearray)
29  {
30  *fout << "Id(): " << variablearray->Id() << endl;
31  *fout << "get_array_size(): " << variablearray->get_array_size() << endl;
32  const short *sval = variablearray->get_array();
33  for (unsigned int i = 0; i < variablearray->get_array_size(); i++)
34  {
35  *fout << "val[" << i << "]: " << sval[i] << endl;
36  }
37  }
38  return 0;
39 }