Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:17:46

0001 #include "JetProbeInput.h"
0002 
0003 #include "Jet.h"
0004 #include "JetContainer.h"
0005 #include "Jetv2.h"
0006 
0007 #include <fun4all/Fun4AllReturnCodes.h>
0008 #include <g4main/PHG4Particle.h>
0009 #include <g4main/PHG4TruthInfoContainer.h>
0010 #include <phool/getClass.h>
0011 #include <phool/phool.h>  // for PHWHERE
0012 
0013 // standard includes
0014 #include <algorithm>  // std::find
0015 #include <cmath>      // for asinh, sqrt
0016 #include <cstdlib>
0017 #include <iostream>
0018 #include <map>      // for _Rb_tree_const_iterator
0019 #include <utility>  // for pair
0020 #include <vector>
0021 
0022 JetProbeInput::JetProbeInput(PHCompositeNode* topNode)
0023 {
0024   if (!topNode)
0025   {
0026     return;
0027   }
0028 
0029   JetContainer* jets = findNode::getClass<JetContainer>(topNode, "JetProbeContainer");
0030   if (!jets)
0031   {
0032     std::cout << PHWHERE << "JetProbeContainer node missing, doing nothing." << std::endl;
0033     return;
0034   }
0035   Jet* probe = jets->get_UncheckedAt(0);
0036   phi = probe->get_phi();
0037   eta = probe->get_eta();
0038   pt = probe->get_pt();
0039 }
0040 
0041 void JetProbeInput::identify(std::ostream& os)
0042 {
0043   os << "   JetProbeInput" << std::endl;
0044 }
0045 
0046 std::vector<Jet*> JetProbeInput::get_input(PHCompositeNode* topNode)
0047 {
0048   if (Verbosity() > 0)
0049   {
0050     std::cout << "JetProbeInput::process_event -- entered" << std::endl;
0051   }
0052 
0053   JetContainer* jets = findNode::getClass<JetContainer>(topNode, "JetProbeContainer");
0054   if (!jets)
0055   {
0056     std::cout << PHWHERE << "JetProbeContainer node missing, doing nothing." << std::endl;
0057     return {};
0058   }
0059 
0060   // Pull the reconstructed track information off the node tree...
0061   std::vector<Jet*> pseudojets;
0062   Jet* jet = jets->get_UncheckedAt(0);
0063   Jet* probe = new Jetv2();
0064   probe->set_px(jet->get_px());
0065   probe->set_py(jet->get_py());
0066   probe->set_pz(jet->get_pz());
0067   probe->set_e(jet->get_e());
0068   pseudojets.push_back(probe);
0069 
0070   return pseudojets;
0071 }