Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ParticleFlowJetInput.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ParticleFlowJetInput.cc
1 #include "ParticleFlowJetInput.h"
2 
3 #include "ParticleFlowElement.h"
5 
6 #include <jetbase/Jet.h>
7 #include <jetbase/Jetv2.h>
8 
9 #include <phool/getClass.h>
10 
11 // standard includes
12 #include <cassert>
13 #include <iostream>
14 #include <map> // for _Rb_tree_const_iterator
15 #include <utility> // for pair
16 #include <vector>
17 
19 {
20  os << " ParticleFlowJetInput: ";
21  os << std::endl;
22 }
23 
25 {
26  if (_verbosity > 0) std::cout << "ParticleFlowJetInput::process_event -- entered" << std::endl;
27 
28  ParticleFlowElementContainer *pflowContainer = findNode::getClass<ParticleFlowElementContainer>(topNode, "ParticleFlowElements");
29  if (!pflowContainer)
30  {
31  return std::vector<Jet *>();
32  }
33 
34  std::vector<Jet *> pseudojets;
37 
38 
39  for (rtiter = begin_end.first; rtiter != begin_end.second; ++rtiter)
40  {
41  ParticleFlowElement *pflow = rtiter->second;
42 
43  Jet *jet = new Jetv2();
44  jet->set_px( pflow->get_px() );
45  jet->set_py( pflow->get_py() );
46  jet->set_pz( pflow->get_pz() );
47  jet->set_e( pflow->get_e() );
48  jet->insert_comp( Jet::SRC::PARTICLE , pflow->get_id() );
49  pseudojets.push_back( jet );
50  if (_verbosity > 15) for (auto c : pseudojets[pseudojets.size()-1]->get_comp_vec()) std::cout << " GOT " << ((int)c.first) << " and " << ((int)c.second) << std::endl;
51  }
52 
53  if (_verbosity > 0) std::cout << "ParticleFlowJetInput::process_event -- exited" << std::endl;
54 
55  return pseudojets;
56 }