Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
JetProbeInput.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file JetProbeInput.cc
1 #include "JetProbeInput.h"
2 
3 #include "Jet.h"
4 #include "Jetv2.h"
5 #include "JetContainer.h"
6 
7 #include <g4main/PHG4Particle.h>
10 #include <phool/getClass.h>
11 #include <phool/phool.h> // for PHWHERE
12 
13 // standard includes
14 #include <algorithm> // std::find
15 #include <cmath> // for asinh, sqrt
16 #include <cstdlib>
17 #include <iostream>
18 #include <map> // for _Rb_tree_const_iterator
19 #include <utility> // for pair
20 #include <vector>
21 
23  if (!topNode) { return; }
24 
25  JetContainer* jets = findNode::getClass<JetContainer>(topNode, "JetProbeContainer");
26  if (!jets)
27  {
28  std::cout << PHWHERE << "JetProbeContainer node missing, doing nothing." << std::endl;
29  return;
30  }
31  Jet* probe = jets->get_UncheckedAt(0);
32  phi = probe->get_phi();
33  eta = probe->get_eta();
34  pt = probe->get_pt();
35 }
36 
37 void JetProbeInput::identify(std::ostream &os)
38 {
39  os << " JetProbeInput" << std::endl;
40 }
41 
42 std::vector<Jet *> JetProbeInput::get_input(PHCompositeNode *topNode)
43 {
44  if (Verbosity() > 0) { std::cout << "JetProbeInput::process_event -- entered" << std::endl; }
45 
46  JetContainer* jets = findNode::getClass<JetContainer>(topNode, "JetProbeContainer");
47  if (!jets)
48  {
49  std::cout << PHWHERE << "JetProbeContainer node missing, doing nothing." << std::endl;
50  return {};
51  }
52 
53  // Pull the reconstructed track information off the node tree...
54  std::vector<Jet *> pseudojets;
55  Jet* jet = jets->get_UncheckedAt(0);
56  Jet* probe = new Jetv2();
57  probe->set_px(jet->get_px());
58  probe->set_py(jet->get_py());
59  probe->set_pz(jet->get_pz());
60  probe->set_e(jet->get_e());
61  pseudojets.push_back(probe);
62 
63  return pseudojets;
64 }