6 #include "Acts/Surfaces/PerigeeSurface.hpp"
11 const std::string&
name,
18 ATH_CHECK( m_prdMultiTruthCollectionNames.initialize() );
19 return StatusCode::SUCCESS;
24 std::vector<ActsTrk::ProtoTrack> & foundProtoTracks )
const {
27 std::vector<const PRD_MultiTruthCollection*> prdMultiTruthCollections;
28 prdMultiTruthCollections.reserve(m_prdMultiTruthCollectionNames.size());
30 for(
const auto& pmtCollNameIter:m_prdMultiTruthCollectionNames)
36 ATH_MSG_WARNING(
"Could not retrieve " << pmtCollNameIter <<
". Ignoring ... ");
40 ATH_MSG_INFO(
"Added " << pmtCollNameIter <<
" to collection list for truth track creation.");
41 prdMultiTruthCollections.push_back(curColl.
cptr());
46 std::map<Identifier, HepMC::ConstGenParticlePtr> identToHepMCMap;
47 for (
auto & PRD_truthCollec: prdMultiTruthCollections )
50 PRD_MultiTruthCollection::const_iterator prdMtCIter = PRD_truthCollec->begin();
51 PRD_MultiTruthCollection::const_iterator prdMtCIterE = PRD_truthCollec->end();
52 for ( ; prdMtCIter != prdMtCIterE; ++ prdMtCIter ){
61 Identifier curIdentifier = (*prdMtCIter).first;
64 if ( curGenP->momentum().perp() < 500. )
continue;
68 identToHepMCMap[curIdentifier] = curGenP;
73 std::map<HepMC::ConstGenParticlePtr, std::vector<ActsTrk::ATLASUncalibSourceLink>> trackCollections;
75 for(
const auto cluster: pixelContainer)
78 auto identifierList = cluster->rdoList();
81 for(
auto&
id: identifierList)
84 if(identToHepMCMap.find(
id) != identToHepMCMap.end())
86 auto truthParticle = identToHepMCMap.at(
id);
92 for(
const auto cluster: stripContainer)
95 auto identifierList = cluster->rdoList();
98 for(
auto&
id: identifierList)
101 if(identToHepMCMap.find(
id) != identToHepMCMap.end())
103 auto truthParticle = identToHepMCMap.at(
id);
109 for(
const auto&
var: trackCollections)
112 if(
var.second.size() < 3)
continue;
115 auto inputPerigee = makeDummyParams(
var.first);
116 ATH_MSG_INFO(
"Found " <<
var.second.size() <<
" clusters for truth partcle "<<
var.first);
117 foundProtoTracks.push_back({
var.second,std::move(inputPerigee)});
122 return StatusCode::SUCCESS;
128 using namespace Acts::UnitLiterals;
129 std::shared_ptr<const Acts::Surface> actsSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
130 Acts::Vector3(0., 0., 0.));
138 truthParticle->momentum().phi(), truthParticle->momentum().theta(),
139 static_cast<float>(
::charge(truthParticle)) / (truthParticle->momentum().e()), 0.;
143 Acts::BoundSquareMatrix
cov = Acts::BoundSquareMatrix::Identity();
149 Acts::PdgParticle absPdg = Acts::makeAbsolutePdgParticle(Acts::ePionPlus);
151 absPdg,
mass, Acts::AnyCharge{
static_cast<float>(
::charge(truthParticle))}};
153 return std::make_unique<Acts::BoundTrackParameters>(actsSurface,
params,
154 cov, actsHypothesis);