18 #include <gsl/gsl_randist.h>
19 #include <gsl/gsl_rng.h>
31 , _g4truth_container(nullptr)
32 , _vertex_error({0.0005, 0.0005, 0.0005})
36 m_RandomGenerator = gsl_rng_alloc(gsl_rng_mt19937);
40 gsl_rng_set(m_RandomGenerator, seed);
72 for (
auto iter = vrange.first; iter != vrange.second; ++iter)
74 const int point_id = iter->first;
77 std::vector<float>
pos;
81 pos[0] = iter->second->get_x();
82 pos[1] = iter->second->get_y();
83 pos[2] = iter->second->get_z();
87 cout <<
" PHTruthVertexing: gembed: " << gembed <<
" nominal position: " <<
" vx " << pos[0] <<
" vy " << pos[1] <<
" vz " << pos[2] << endl;
99 cout << __LINE__ <<
" PHTruthVertexing::Process: point_id " << point_id <<
" gembed " << gembed <<
" {" << pos[0]
100 <<
", " << pos[1] <<
", " << pos[2] <<
"} +- {"
107 vertex->
set_x(pos[0]);
108 vertex->
set_y(pos[1]);
109 vertex->
set_z(pos[2]);
111 for (
int j = 0; j < 3; ++j)
113 for (
int i = j; i < 3; ++i)
143 <<
"Can't find requested track map. Exiting"
149 iter != trackMap->
end();
152 auto trackKey = iter->first;
153 auto track = iter->second;
158 const double trackZ =
track->get_z();
161 int trackVertexId = 9999;
167 auto vertexKey = viter->first;
168 auto vertex = viter->second;
172 const double vertexZ = vertex->get_z();
174 if( fabs(trackZ - vertexZ) < dz )
176 dz = fabs(trackZ - vertexZ);
177 trackVertexId = vertexKey;
182 track->set_vertex_id(trackVertexId);
184 vertex->insert_track(trackKey);
193 _g4truth_container = findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
196 cerr <<
PHWHERE <<
" ERROR: Can't find node G4TruthInfo" << endl;