ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DumpPHHepMCGenEventMap.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DumpPHHepMCGenEventMap.cc
2 
5 
6 #include <HepMC/GenEvent.h>
7 
8 #include <phool/PHIODataNode.h>
9 
10 #include <map>
11 #include <ostream>
12 #include <string>
13 #include <utility>
14 
15 using namespace std;
16 
18 
20  : DumpObject(NodeName)
21 {
22  return;
23 }
24 
26 {
27  PHHepMCGenEventMap *phhepmcgeneventmap = nullptr;
28  MyNode_t *thisNode = static_cast<MyNode_t *>(myNode);
29  if (thisNode)
30  {
31  phhepmcgeneventmap = thisNode->getData();
32  }
33  if (phhepmcgeneventmap)
34  {
35  PHHepMCGenEventMap::ConstIter iter_beg = phhepmcgeneventmap->begin();
36  PHHepMCGenEventMap::ConstIter iter_end = phhepmcgeneventmap->end();
37  *fout << "size: " << phhepmcgeneventmap->size() << endl;
38  for (PHHepMCGenEventMap::ConstIter iter = iter_beg; iter != iter_end; ++iter)
39  {
40  *fout << "map entry: " << iter->first << endl;
41  PHHepMCGenEvent *genevt = iter->second;
42  HepMC::GenEvent *evt = genevt->getEvent();
43  *fout << "Embedding id " << genevt->get_embedding_id() << endl;
44  *fout << "is simulated " << genevt->is_simulated() << endl;
45  *fout << "Collision vertex x: " << genevt->get_collision_vertex().x() << endl;
46  *fout << "Collision vertex y: " << genevt->get_collision_vertex().y() << endl;
47  *fout << "Collision vertex z: " << genevt->get_collision_vertex().z() << endl;
48  *fout << "Collision vertex t: " << genevt->get_collision_vertex().t() << endl;
49  evt->print(*fout);
50  }
51  }
52  return 0;
53 }