16 #include <gsl/gsl_randist.h>
17 #include <gsl/gsl_rng.h>
29 , _g4truth_container(nullptr)
30 , _vertex_error({0.0005, 0.0005, 0.0005})
34 m_RandomGenerator = gsl_rng_alloc(gsl_rng_mt19937);
70 for (
auto iter = vrange.first; iter != vrange.second; ++iter)
72 const int point_id = iter->first;
75 std::vector<float>
pos;
79 pos[0] = iter->second->get_x();
80 pos[1] = iter->second->get_y();
81 pos[2] = iter->second->get_z();
85 cout <<
" PHTruthVertexing: gembed: " << gembed <<
" nominal position: " <<
" vx " << pos[0] <<
" vy " << pos[1] <<
" vz " << pos[2] << endl;
97 cout << __LINE__ <<
" PHTruthVertexing::Process: point_id " << point_id <<
" gembed " << gembed <<
" {" << pos[0]
98 <<
", " << pos[1] <<
", " << pos[2] <<
"} +- {"
105 vertex->
set_x(pos[0]);
106 vertex->
set_y(pos[1]);
107 vertex->
set_z(pos[2]);
109 for (
int j = 0;
j < 3; ++
j)
111 for (
int i =
j;
i < 3; ++
i)
141 <<
"Can't find requested track map. Exiting"
147 iter != trackMap->
end();
150 auto trackKey = iter->first;
151 auto track = iter->second;
156 const double trackZ = track->get_z();
159 int trackVertexId = 9999;
165 auto vertexKey = viter->first;
166 auto vertex = viter->second;
170 const double vertexZ =
vertex->get_z();
172 if( fabs(trackZ - vertexZ) < dz )
174 dz = fabs(trackZ - vertexZ);
175 trackVertexId = vertexKey;
180 track->set_vertex_id(trackVertexId);
182 vertex->insert_track(trackKey);
191 _g4truth_container = findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
194 cerr <<
PHWHERE <<
" ERROR: Can't find node G4TruthInfo" << endl;