Analysis Software
Documentation for sPHENIX simulation 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 #pragma GCC diagnostic push
7 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
8 #include <HepMC/GenEvent.h>
9 #pragma GCC diagnostic pop
10 
11 #include <phool/PHIODataNode.h>
12 
13 #include <map>
14 #include <ostream>
15 #include <string>
16 #include <utility>
17 
19 
21  : DumpObject(NodeName)
22 {
23  return;
24 }
25 
27 {
28  PHHepMCGenEventMap *phhepmcgeneventmap = nullptr;
29  MyNode_t *thisNode = static_cast<MyNode_t *>(myNode);
30  if (thisNode)
31  {
32  phhepmcgeneventmap = thisNode->getData();
33  }
34  if (phhepmcgeneventmap)
35  {
36  PHHepMCGenEventMap::ConstIter iter_beg = phhepmcgeneventmap->begin();
37  PHHepMCGenEventMap::ConstIter iter_end = phhepmcgeneventmap->end();
38  *fout << "size: " << phhepmcgeneventmap->size() << std::endl;
39  for (PHHepMCGenEventMap::ConstIter iter = iter_beg; iter != iter_end; ++iter)
40  {
41  *fout << "map entry: " << iter->first << std::endl;
42  PHHepMCGenEvent *genevt = iter->second;
43  HepMC::GenEvent *evt = genevt->getEvent();
44  *fout << "Embedding id " << genevt->get_embedding_id() << std::endl;
45  *fout << "is simulated " << genevt->is_simulated() << std::endl;
46  *fout << "Collision vertex x: " << genevt->get_collision_vertex().x() << std::endl;
47  *fout << "Collision vertex y: " << genevt->get_collision_vertex().y() << std::endl;
48  *fout << "Collision vertex z: " << genevt->get_collision_vertex().z() << std::endl;
49  *fout << "Collision vertex t: " << genevt->get_collision_vertex().t() << std::endl;
50  evt->print(*fout);
51  }
52  }
53  return 0;
54 }