11 #include <calobase/RawTower.h>
12 #include <calobase/RawTowerContainer.h>
37 _truth_info = findNode::getClass<PHG4TruthInfoContainer>(topNode,
"G4TruthInfo");
40 std::cout <<
"PHG4DstCompressReco::InitRun(): Can't find G4TruthInfo" << std::endl;
66 _recoTruthMap = findNode::getClass<SvtxPHG4ParticleMap>(topNode,
"SvtxPHG4ParticleMap");
69 std::cout << __PRETTY_FUNCTION__ <<
" Fatal error: missing SvtxPHG4ParticleMap while m_keepRecoTrackMatchedParticles is set. "
70 <<
"Was PHG4DstCompressReco called before this module?"
75 _truthRecoMap = findNode::getClass<PHG4ParticleSvtxMap>(topNode,
"PHG4ParticleSvtxMap");
78 std::cout << __PRETTY_FUNCTION__ <<
" Fatal error: missing PHG4ParticleSvtxMap while m_keepRecoTrackMatchedParticles is set. "
79 <<
"Was PHG4DstCompressReco called before this module?"
111 std::set<int> keep_particle_ids;
115 jter != hits->getHits().second;
119 keep_particle_ids.insert(hit->
get_trkid());
130 keep_particle_ids.insert(particle_id);
135 for (
const auto& [track_id, weighted_truth_track_map] : *
_recoTruthMap)
137 for (
const auto& [weight, particle_set] : weighted_truth_track_map)
141 for (
const auto& particle_id : particle_set)
143 keep_particle_ids.insert(particle_id);
151 std::set<int> keep_vertex_ids;
154 iter != range.second;)
156 int id = iter->first;
159 if (keep_particle_ids.find(
id) != keep_particle_ids.end())
162 keep_vertex_ids.insert(particle->
get_vtx_id());
173 iter != vrange.second;)
175 int id = iter->first;
177 if (keep_vertex_ids.find(
id) != keep_vertex_ids.end())
192 iter != srange.second;
207 jter != towers->getTowers().second;
231 while ((thisNode = iter()))
233 if (thisNode->getType() ==
"PHCompositeNode")
237 else if (thisNode->getType() ==
"PHIODataNode")
239 if (thisNode->getName().find(
"G4HIT_") == 0)