ECCE @ EIC 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 <phool/getClass.h>
4 
5 #include <g4jets/Jet.h>
6 #include <g4jets/Jetv1.h>
7 
8 // standard includes
9 #include <cassert>
10 #include <iostream>
11 #include <map> // for _Rb_tree_const_iterator
12 #include <utility> // for pair
13 #include <vector>
14 
15 #include "ParticleFlowElement.h"
17 
18 using namespace std;
19 
21  : _verbosity(0)
22 {
23 }
24 
25 void ParticleFlowJetInput::identify(std::ostream &os)
26 {
27  os << " ParticleFlowJetInput: ";
28  os << std::endl;
29 }
30 
32 {
33  if (_verbosity > 0) cout << "ParticleFlowJetInput::process_event -- entered" << endl;
34 
35  ParticleFlowElementContainer *pflowContainer = findNode::getClass<ParticleFlowElementContainer>(topNode, "ParticleFlowElements");
36  if (!pflowContainer)
37  {
38  return std::vector<Jet *>();
39  }
40 
41  std::vector<Jet *> pseudojets;
44  for (rtiter = begin_end.first; rtiter != begin_end.second; ++rtiter)
45  {
46  ParticleFlowElement *pflow = rtiter->second;
47 
48  Jet *jet = new Jetv1();
49  jet->set_px( pflow->get_px() );
50  jet->set_py( pflow->get_py() );
51  jet->set_pz( pflow->get_pz() );
52  jet->set_e( pflow->get_e() );
53  jet->insert_comp( Jet::SRC::PARTICLE , pflow->get_id() );
54  pseudojets.push_back( jet );
55  }
56 
57  if (_verbosity > 0) cout << "ParticleFlowJetInput::process_event -- exited" << endl;
58 
59  return pseudojets;
60 }