65 cout <<
"PHTruthSiliconAssociation::process_event(PHCompositeNode *topNode) Processing Event" << endl;
71 if(
Verbosity() > 0) std::cout <<
" track map last key = " << original_track_map_lastkey << std::endl;
78 if(phtrk_iter->first > original_track_map_lastkey)
break;
85 <<
": Processing seed itrack: " << phtrk_iter->first
86 <<
": nhits: " <<
_tracklet-> size_cluster_keys()
97 if(
Verbosity() > 0) std::cout <<
" g4particle_vec.size() " << g4particle_vec.size() << std::endl;
99 if(g4particle_vec.size() < 1)
continue;
101 bool test_phi_matching =
false;
102 if(test_phi_matching)
105 if(g4particle_vec.size() == 1)
109 double si_phi = atan2(g4particle_vec[0]->get_py(), g4particle_vec[0]->get_px());
110 double si_eta = asinh(g4particle_vec[0]->get_pz() / sqrt( pow(g4particle_vec[0]->get_px(),2)+pow( g4particle_vec[0]->get_py(),2)));
111 double si_pt = sqrt(pow(g4particle_vec[0]->get_px(),2)+pow( g4particle_vec[0]->get_py(),2));
116 cout <<
" Try: " <<
" pt " << si_pt <<
" tpc_phi " << tpc_phi <<
" si_phi " << si_phi
117 <<
" tpc_eta " << tpc_eta <<
" si_eta " << si_eta << endl;
123 std::vector<SvtxTrack*> extraTrack;
124 for(
unsigned int ig4=0;ig4 < g4particle_vec.size()-1; ++ig4)
131 newTrack->
set_id(lastTrackKey + 1);
141 for(
int i = 0; i < 6; ++i)
143 for(
int j = 0; j < 6; ++j)
158 extraTrack.push_back(newTrack);
165 std::cout <<
" original track:" << endl;
173 for (std::set<TrkrDefs::cluskey>::iterator jter = clusters.begin();
174 jter != clusters.end();
180 if (
Verbosity() >= 1) std::cout <<
" found silicon cluster with key: " << cluster_key <<
" in layer " << layer << std::endl;
185 if (
Verbosity() >= 1) std::cout <<
" cluster belongs to MVTX or INTT, add to track " << std::endl;
193 std::cout <<
" updated original track:" << std::endl;
196 std::cout <<
"Done with original track " << phtrk_iter->first << std::endl;
200 if(g4particle_vec.size() > 1)
202 for(
unsigned int ig4=0;ig4 < g4particle_vec.size()-1; ++ ig4)
206 const int vertexID = g4particle->
get_vtx_id();
209 std::cout <<
" ig4 " << ig4 <<
" g4particleID " << g4particle->
get_track_id()
210 <<
" px " << g4particle->
get_px()
211 <<
" py " << g4particle->
get_py()
212 <<
" phi " << atan2(g4particle->
get_py(), g4particle->
get_px() )
222 extraTrack[ig4]->set_id(lastTrackKey + 1);
226 std::cout <<
" original (copy) track:" << endl;
227 extraTrack[ig4]->identify();
232 for (std::set<TrkrDefs::cluskey>::iterator jter = clusters.begin();
233 jter != clusters.end();
239 if (
Verbosity() >= 1) std::cout <<
" found cluster with key: " << cluster_key <<
" in layer " << layer << std::endl;
244 if (
Verbosity() >= 1) std::cout <<
" cluster belongs to MVTX or INTT, add to track " << std::endl;
245 extraTrack[ig4]->insert_cluster_key(cluster_key);
257 extraTrack[ig4]->set_x(g4vertex->get_x() * (1 + random));
258 extraTrack[ig4]->set_y(g4vertex->get_y() * (1 + random));
259 extraTrack[ig4]->set_z(g4vertex->get_z() * (1 + random));
263 std::cout <<
" updated additional track:" << std::endl;
264 extraTrack[ig4]->identify();
265 std::cout <<
" new cluster keys size " << extraTrack[ig4]->size_cluster_keys() << endl;
266 std::cout <<
"Done with extra track " << extraTrack[ig4]->get_id() << std::endl;
277 cout <<
"PHTruthSiliconAssociation::process_event(PHCompositeNode *topNode) Leaving process_event" << endl;
319 _g4truth_container = findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
322 cerr <<
PHWHERE <<
" ERROR: Can't find node G4TruthInfo" << endl;
329 std::cout <<
" Found CORRECTED_TRKR_CLUSTER node " << std::endl;
332 _cluster_map = findNode::getClass<TrkrClusterContainer>(topNode,
"TRKR_CLUSTER");
335 cerr <<
PHWHERE <<
" ERROR: Can't find node TRKR_CLUSTER" << endl;
338 _hitsets = findNode::getClass<TrkrHitSetContainer>(topNode,
"TRKR_HITSET");
341 std::cout <<
PHWHERE <<
"No hitset container on node tree. Bailing."
346 _track_map = findNode::getClass<SvtxTrackMap>(topNode,
"SvtxTrackMap");
349 cerr <<
PHWHERE <<
" ERROR: Can't find SvtxTrackMap: " << endl;
353 _assoc_container = findNode::getClass<AssocInfoContainer>(topNode,
"AssocInfoContainer");
356 cerr <<
PHWHERE <<
" ERROR: Can't find AssocInfoContainer." << endl;
360 _hit_truth_map = findNode::getClass<TrkrHitTruthAssoc>(topNode,
"TRKR_HITTRUTHASSOC");
363 cerr <<
PHWHERE <<
" ERROR: Can't find TrkrHitTruthAssoc." << endl;
367 _cluster_hit_map = findNode::getClass<TrkrClusterHitAssoc>(topNode,
"TRKR_CLUSTERHITASSOC");
370 cerr <<
PHWHERE <<
" ERROR: Can't find TrkrClusterHitAssoc." << endl;
382 std::cerr <<
"DST Node missing, quitting" << std::endl;
383 throw std::runtime_error(
"failed to find DST node in PHActsSourceLinks::createNodes");
401 _g4hits_tpc = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_TPC");
402 _g4hits_intt = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_INTT");
403 _g4hits_mvtx = findNode::getClass<PHG4HitContainer>(topNode,
"G4HIT_MVTX");
412 std::vector<PHG4Particle*> g4part_vec;
414 std::multimap<int, int> pid_count;
426 std::pair<std::multimap<TrkrDefs::cluskey, TrkrDefs::hitkey>::const_iterator, std::multimap<TrkrDefs::cluskey, TrkrDefs::hitkey>::const_iterator>
429 for(std::multimap<TrkrDefs::cluskey, TrkrDefs::hitkey>::const_iterator
430 clushititer = hitrange.first; clushititer != hitrange.second; ++clushititer)
437 std::multimap< TrkrDefs::hitsetkey, std::pair<TrkrDefs::hitkey, PHG4HitDefs::keytype> > temp_map;
439 for(std::multimap<
TrkrDefs::hitsetkey, std::pair<TrkrDefs::hitkey, PHG4HitDefs::keytype> >::iterator htiter = temp_map.begin(); htiter != temp_map.end(); ++htiter)
458 pid_count.insert(std::make_pair(g4hit->
get_trkid(), cnt));
466 for(
auto it = pid.begin();
it != pid.end(); ++
it)
468 if(*
it < 0)
continue;
471 std::pair<std::multimap<int, int>::iterator, std::multimap<int,int>::iterator> this_pid = pid_count.equal_range(*
it);
472 for(
auto cnt_it = this_pid.first; cnt_it != this_pid.second; ++cnt_it)
477 if(
Verbosity() >= 1) std::cout <<
" pid: " << *
it <<
" nfound " << nfound << std::endl;
478 if(nfound > minfound)
492 std::set<TrkrDefs::cluskey> clusters;
496 for (
auto hitsetitr = hitsetrange.first;
497 hitsetitr != hitsetrange.second;
500 for(
auto clusIter = range.first; clusIter != range.second; ++clusIter ){
504 if(layer > 6)
continue;
508 std::pair<std::multimap<TrkrDefs::cluskey, TrkrDefs::hitkey>::const_iterator, std::multimap<TrkrDefs::cluskey, TrkrDefs::hitkey>::const_iterator>
511 for(std::multimap<TrkrDefs::cluskey, TrkrDefs::hitkey>::const_iterator
512 clushititer = hitrange.first; clushititer != hitrange.second; ++clushititer)
519 std::multimap< TrkrDefs::hitsetkey, std::pair<TrkrDefs::hitkey, PHG4HitDefs::keytype> > temp_map;
521 for(std::multimap<
TrkrDefs::hitsetkey, std::pair<TrkrDefs::hitkey, PHG4HitDefs::keytype> >::iterator htiter = temp_map.begin(); htiter != temp_map.end(); ++htiter)
539 clusters.insert(cluster_key);