Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DumpJetContainer.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DumpJetContainer.cc
1 #include "DumpJetContainer.h"
2 
3 #include <jetbase/Jet.h>
4 #include <jetbase/JetContainer.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  JetContainer *jets = nullptr;
25  MyNode_t *thisNode = static_cast<MyNode_t *>(myNode);
26  if (thisNode)
27  {
28  jets = thisNode->getData();
29  }
30  if (jets)
31  {
32  *fout << "size: " << jets->size() << std::endl;
33  *fout << "par: " << jets->get_par() << std::endl;
34  *fout << "algo: " << jets->get_algo() << std::endl;
35  /* auto jet_properties = jets->get_property_vec(); */
36  for (auto jet : *jets)
37  {
38  *fout << "id: " << jet->get_id() << std::endl;
39  *fout << "px: " << jet->get_px() << std::endl;
40  *fout << "py: " << jet->get_py() << std::endl;
41  *fout << "pz: " << jet->get_pz() << std::endl;
42  *fout << "e: " << jet->get_e() << std::endl;
43  *fout << "p: " << jet->get_p() << std::endl;
44  *fout << "pt: " << jet->get_pt() << std::endl;
45  *fout << "et: " << jet->get_et() << std::endl;
46  *fout << "eta: " << jet->get_eta() << std::endl;
47  *fout << "phi: " << jet->get_phi() << std::endl;
48  *fout << "mass: " << jet->get_mass() << std::endl;
49  // print out the jet properties
50 
51  for (auto prop : jets->property_indices()) {
52  *fout << "prop id: " << static_cast<unsigned int>(prop.first)
53  << " value: " << jet->get_property(prop.second)
54  << std::endl;
55  }
56  /* Jet::ConstIter jetbegin = jiter->second->begin_comp(); */
57  /* Jet::ConstIter jetend = jiter->second->end_comp(); */
58  /* for (Jet::ConstIter jetiter = jetbegin; jetiter != jetend; ++jetiter) */
59  /* { */
60  for (const auto& comp : jet->get_comp_vec()) {
61  *fout << "src: " << comp.first << " value: " << comp.second << std::endl;
62  }
63  }
64  }
65  return 0;
66 }