Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DumpGlobalVertexMap.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DumpGlobalVertexMap.cc
1 #include "DumpGlobalVertexMap.h"
2 
5 
6 #include <phool/PHIODataNode.h>
7 
8 #include <map>
9 #include <ostream>
10 #include <string>
11 #include <utility>
12 
14 
16  : DumpObject(NodeName)
17 {
18  return;
19 }
20 
22 {
23  GlobalVertexMap *globalvertexmap = nullptr;
24  MyNode_t *thisNode = static_cast<MyNode_t *>(myNode);
25  if (thisNode)
26  {
27  globalvertexmap = thisNode->getData();
28  }
29  if (globalvertexmap)
30  {
31  GlobalVertexMap::ConstIter viter_beg = globalvertexmap->begin();
32  GlobalVertexMap::ConstIter viter_end = globalvertexmap->end();
33  *fout << "size: " << globalvertexmap->size() << std::endl;
34  for (GlobalVertexMap::ConstIter viter = viter_beg; viter != viter_end; ++viter)
35  {
36  *fout << "id: " << viter->second->get_id() << std::endl;
37  *fout << "t: " << viter->second->get_t() << std::endl;
38  *fout << "t_err: " << viter->second->get_t_err() << std::endl;
39  *fout << "x: " << viter->second->get_x() << std::endl;
40  *fout << "y: " << viter->second->get_y() << std::endl;
41  *fout << "z: " << viter->second->get_z() << std::endl;
42  *fout << "chisq: " << viter->second->get_chisq() << std::endl;
43  *fout << "ndor: " << viter->second->get_ndof() << std::endl;
44  for (int i = 0; i < 3; i++)
45  {
46  for (int j = 0; j < 3; j++)
47  {
48  *fout << "err[" << i << "][" << j << "]: " << viter->second->get_error(i, j) << std::endl;
49  }
50  }
51  GlobalVertex::ConstVtxIter vtxbegin = viter->second->begin_vtxids();
52  GlobalVertex::ConstVtxIter vtxend = viter->second->end_vtxids();
53  for (GlobalVertex::ConstVtxIter vtxiter = vtxbegin; vtxiter != vtxend; ++vtxiter)
54  {
55  *fout << "type " << vtxiter->first << " id: " << vtxiter->second << std::endl;
56  }
57  }
58  }
59  return 0;
60 }