7 #include "Acts/Surfaces/PerigeeSurface.hpp"
12 const std::string&
name,
19 ATH_CHECK( m_prdMultiTruthCollectionNames.initialize() );
20 return StatusCode::SUCCESS;
26 std::vector<ActsTrk::ProtoTrack> & foundProtoTracks )
const {
29 std::vector<const PRD_MultiTruthCollection*> prdMultiTruthCollections;
30 prdMultiTruthCollections.reserve(m_prdMultiTruthCollectionNames.size());
32 for(
const auto& pmtCollNameIter:m_prdMultiTruthCollectionNames)
38 ATH_MSG_WARNING(
"Could not retrieve " << pmtCollNameIter <<
". Ignoring ... ");
42 ATH_MSG_INFO(
"Added " << pmtCollNameIter <<
" to collection list for truth track creation.");
43 prdMultiTruthCollections.push_back(curColl.
cptr());
48 std::map<Identifier, HepMC::ConstGenParticlePtr> identToHepMCMap;
49 for (
auto & PRD_truthCollec: prdMultiTruthCollections )
52 PRD_MultiTruthCollection::const_iterator prdMtCIter = PRD_truthCollec->begin();
53 PRD_MultiTruthCollection::const_iterator prdMtCIterE = PRD_truthCollec->end();
54 for ( ; prdMtCIter != prdMtCIterE; ++ prdMtCIter ){
63 Identifier curIdentifier = (*prdMtCIter).first;
66 if ( curGenP->momentum().perp() < 500. )
continue;
70 identToHepMCMap[curIdentifier] = curGenP;
75 std::map<HepMC::ConstGenParticlePtr, std::vector<ActsTrk::ATLASUncalibSourceLink>> trackCollections;
80 auto identifierList = cluster->rdoList();
83 for(
auto&
id: identifierList)
86 if(identToHepMCMap.find(
id) != identToHepMCMap.end())
88 auto truthParticle = identToHepMCMap.at(
id);
97 auto identifierList = cluster->rdoList();
100 for(
auto&
id: identifierList)
103 if(identToHepMCMap.find(
id) != identToHepMCMap.end())
105 auto truthParticle = identToHepMCMap.at(
id);
111 for(
const auto&
var: trackCollections)
114 if(
var.second.size() < 3)
continue;
117 auto inputPerigee = makeDummyParams(
var.first);
118 ATH_MSG_INFO(
"Found " <<
var.second.size() <<
" clusters for truth partcle "<<
var.first);
119 foundProtoTracks.push_back({
var.second,std::move(inputPerigee)});
124 return StatusCode::SUCCESS;
128 std::unique_ptr<Acts::BoundTrackParameters>
131 using namespace Acts::UnitLiterals;
132 std::shared_ptr<const Acts::Surface> actsSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
133 Acts::Vector3(0., 0., 0.));
141 truthParticle->momentum().phi(), truthParticle->momentum().theta(),
142 static_cast<float>(
::charge(truthParticle)) / (truthParticle->momentum().e()), 0.;
146 Acts::BoundSquareMatrix
cov = Acts::BoundSquareMatrix::Identity();
152 Acts::PdgParticle absPdg = Acts::makeAbsolutePdgParticle(Acts::ePionPlus);
154 absPdg,
mass, Acts::AnyCharge{
static_cast<float>(
::charge(truthParticle))}};
156 return std::make_unique<Acts::BoundTrackParameters>(actsSurface,
params,
157 cov, actsHypothesis);