EF-style pattern recognition to create prototracks.
26 {
27
28
29 std::vector<const PRD_MultiTruthCollection*> prdMultiTruthCollections;
31
33 {
34
35 SG::ReadHandle<PRD_MultiTruthCollection> curColl (pmtCollNameIter, ctx);
36 if (!curColl.isValid())
37 {
38 ATH_MSG_WARNING(
"Could not retrieve " << pmtCollNameIter <<
". Ignoring ... ");
39 }
40 else
41 {
42 ATH_MSG_INFO(
"Added " << pmtCollNameIter <<
" to collection list for truth track creation.");
43 prdMultiTruthCollections.push_back(curColl.cptr());
44 }
45 }
46
47
48 std::map<Identifier, HepMC::ConstGenParticlePtr> identToHepMCMap;
49 for (auto & PRD_truthCollec: prdMultiTruthCollections )
50 {
51
52 PRD_MultiTruthCollection::const_iterator prdMtCIter = PRD_truthCollec->begin();
53 PRD_MultiTruthCollection::const_iterator prdMtCIterE = PRD_truthCollec->end();
54 for ( ; prdMtCIter != prdMtCIterE; ++ prdMtCIter ){
55
56
58 Identifier curIdentifier = (*prdMtCIter).first;
59
60
61 if ( curGenP->momentum().perp() < 500. ) continue;
62
63
64
65 identToHepMCMap[curIdentifier] = curGenP;
66 }
67 }
68
69
71 std::vector<const xAOD::UncalibratedMeasurement*>> trackCollections;
72
73 for(const auto cluster: pixelContainer)
74 {
75
76 auto identifierList = cluster->rdoList();
77
78
79 for(auto& id_value: identifierList)
80 {
81 Identifier
id(id_value);
82
83 if(identToHepMCMap.find(id) != identToHepMCMap.end())
84 {
85 auto truthParticle = identToHepMCMap.at(id);
86 trackCollections[truthParticle].emplace_back(cluster);
87 }
88 }
89 }
90
91 for(const auto cluster: stripContainer)
92 {
93
94 auto identifierList = cluster->rdoList();
95
96
97 for(auto& id_value: identifierList)
98 {
99 Identifier
id(id_value);
100
101 if(identToHepMCMap.find(id) != identToHepMCMap.end())
102 {
103 auto truthParticle = identToHepMCMap.at(id);
104 trackCollections[truthParticle].emplace_back(cluster);
105 }
106 }
107 }
108
109 for(const auto& var: trackCollections)
110 {
111
112 if(
var.second.size() < 3)
continue;
113
114
116 ATH_MSG_INFO(
"Found " <<
var.second.size() <<
" clusters for truth partcle "<<
var.first);
117 foundProtoTracks.push_back({
var.second,std::move(inputPerigee)});
118 }
119
120
121
122 return StatusCode::SUCCESS;
123}
#define ATH_MSG_WARNING(x)
HepMC3::ConstGenParticlePtr ConstGenParticlePtr