ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4VertexSelection.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4VertexSelection.cc
1 // This is the new trackbase container version
2 
8 #include "PHG4VertexSelection.h"
9 
10 #include "PHG4TruthInfoContainer.h"
11 #include "PHG4VtxPoint.h"
12 
14 
15 #include <phool/getClass.h>
16 
17 #include <iostream> // for operator<<, basic_ostream, endl
18 
19 //____________________________________________________________________________
21  : SubsysReco(name)
22  , PHParameterInterface(name)
23 {
25 }
26 
27 //____________________________________________________________________________
29 {
31 
32  // load parameters
33  m_vertex_zcut = get_double_param("vertex_zcut");
34 
35  // printout
36  std::cout
37  << "PHG4VertexSelection::InitRun\n"
38  << " m_vertex_zcut: " << m_vertex_zcut << " cm\n"
39  << std::endl;
40 
42 }
43 
44 //____________________________________________________________________________
46 {
47  // g4 truth info
48  auto g4truthinfo = findNode::getClass<PHG4TruthInfoContainer>(topNode, "G4TruthInfo");
49 
50  // main vertex
51  const auto main_vertex_id = g4truthinfo->GetPrimaryVertexIndex();
52  const auto vertex = g4truthinfo->GetPrimaryVtx(main_vertex_id);
53  if (!vertex) return false;
54 
55  // check vertex position along the beam
57 }
58 
59 //___________________________________________________________________________
61 {
62  set_default_double_param("vertex_zcut", 10);
63 }