Analysis Software
Documentation for sPHENIX simulation 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 <jetbase/Jet.h>
4 #include <jetbase/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 
15 
17  : DumpObject(NodeName)
18 {
19  return;
20 }
21 
23 {
24  JetMap *jetmap = nullptr;
25  MyNode_t *thisNode = static_cast<MyNode_t *>(myNode);
26  if (thisNode)
27  {
28  jetmap = thisNode->getData();
29  }
30  if (jetmap)
31  {
32  JetMap::ConstIter jiter_beg = jetmap->begin();
33  JetMap::ConstIter jiter_end = jetmap->end();
34  *fout << "size: " << jetmap->size() << std::endl;
35  *fout << "par: " << jetmap->get_par() << std::endl;
36  *fout << "algo: " << jetmap->get_algo() << std::endl;
37  for (JetMap::ConstIter jiter = jiter_beg; jiter != jiter_end; ++jiter)
38  {
39  *fout << "id: " << jiter->second->get_id() << std::endl;
40  *fout << "px: " << jiter->second->get_px() << std::endl;
41  *fout << "py: " << jiter->second->get_py() << std::endl;
42  *fout << "pz: " << jiter->second->get_pz() << std::endl;
43  *fout << "e: " << jiter->second->get_e() << std::endl;
44  *fout << "p: " << jiter->second->get_p() << std::endl;
45  *fout << "pt: " << jiter->second->get_pt() << std::endl;
46  *fout << "et: " << jiter->second->get_et() << std::endl;
47  *fout << "eta: " << jiter->second->get_eta() << std::endl;
48  *fout << "phi: " << jiter->second->get_phi() << std::endl;
49  *fout << "mass: " << jiter->second->get_mass() << std::endl;
50  for (auto ic = 0; ic < UCHAR_MAX; ic++)
51  {
52  Jet::PROPERTY prop_id = static_cast<Jet::PROPERTY>(ic);
53  if (jiter->second->has_property(prop_id))
54  {
55  *fout << "prop id: " << static_cast<unsigned int>(ic)
56  << " value: " << jiter->second->get_property(prop_id)
57  << std::endl;
58  }
59  }
60  Jet::ConstIter jetbegin = jiter->second->begin_comp();
61  Jet::ConstIter jetend = jiter->second->end_comp();
62  for (Jet::ConstIter jetiter = jetbegin; jetiter != jetend; ++jetiter)
63  {
64  *fout << "src: " << jetiter->first << " value: " << jetiter->second << std::endl;
65  }
66  }
67  }
68  return 0;
69 }