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