ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DumpJetMap.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DumpJetMap.cc
1 #include "DumpJetMap.h"
2 
3 #include <g4jets/Jet.h>
4 #include <g4jets/JetMap.h>
5 
6 #include <phool/PHIODataNode.h>
7 
8 #include <climits>
9 #include <map>
10 #include <ostream>
11 #include <string>
12 #include <utility>
13 
14 using namespace std;
15 
17 
18 DumpJetMap::DumpJetMap(const string &NodeName)
19  : DumpObject(NodeName)
20 {
21  return;
22 }
23 
25 {
26  JetMap *jetmap = nullptr;
27  MyNode_t *thisNode = static_cast<MyNode_t *>(myNode);
28  if (thisNode)
29  {
30  jetmap = thisNode->getData();
31  }
32  if (jetmap)
33  {
34  JetMap::ConstIter jiter_beg = jetmap->begin();
35  JetMap::ConstIter jiter_end = jetmap->end();
36  *fout << "size: " << jetmap->size() << endl;
37  *fout << "par: " << jetmap->get_par() << endl;
38  *fout << "algo: " << jetmap->get_algo() << endl;
39  for (JetMap::ConstIter jiter = jiter_beg; jiter != jiter_end; ++jiter)
40  {
41  *fout << "id: " << jiter->second->get_id() << endl;
42  *fout << "px: " << jiter->second->get_px() << endl;
43  *fout << "py: " << jiter->second->get_py() << endl;
44  *fout << "pz: " << jiter->second->get_pz() << endl;
45  *fout << "e: " << jiter->second->get_e() << endl;
46  *fout << "p: " << jiter->second->get_p() << endl;
47  *fout << "pt: " << jiter->second->get_pt() << endl;
48  *fout << "et: " << jiter->second->get_et() << endl;
49  *fout << "eta: " << jiter->second->get_eta() << endl;
50  *fout << "phi: " << jiter->second->get_phi() << endl;
51  *fout << "mass: " << jiter->second->get_mass() << endl;
52  for (unsigned char ic = 0; ic < UCHAR_MAX; ic++)
53  {
54  Jet::PROPERTY prop_id = static_cast<Jet::PROPERTY>(ic);
55  if (jiter->second->has_property(prop_id))
56  {
57  *fout << "prop id: " << static_cast<unsigned int>(ic)
58  << " value: " << jiter->second->get_property(prop_id)
59  << endl;
60  }
61  }
62  Jet::ConstIter jetbegin = jiter->second->begin_comp();
63  Jet::ConstIter jetend = jiter->second->end_comp();
64  for (Jet::ConstIter jetiter = jetbegin; jetiter != jetend; ++jetiter)
65  {
66  *fout << "src: " << jetiter->first << " value: " << jetiter->second << endl;
67  }
68  }
69  }
70  return 0;
71 }