 |
ATLAS Offline Software
|
#include <DetailedTrackTruthBuilder.h>
Definition at line 25 of file DetailedTrackTruthBuilder.h.
◆ PRD_InverseTruth
◆ addTrack()
Definition at line 207 of file DetailedTrackTruthBuilder.cxx.
215 std::map<HepMcParticleLink,SubDetPRDs> pairStat;
247 if (!orderedPRD_Truth[subdet]) {
254 using iprdt = PRD_MultiTruthCollection::const_iterator;
255 std::pair<iprdt, iprdt>
range = orderedPRD_Truth[subdet]->equal_range(
id);
265 if (!
i->second.isValid()) {
266 ATH_MSG_WARNING(
"Unexpected invalid HepMcParticleLink in PRD_MultiTruthCollection");
269 pairStat[
i->second].subDetHits[subdet].insert(
id);
271 ATH_MSG_VERBOSE(
"PRD-ID:"<<
id<<
" subdet:"<<subdet<<
" number:"<<
n<<
" particle link:"<<
i->second);
274 ATH_MSG_VERBOSE(
"--> no link, noise ? PRD-ID:"<<
id<<
" subdet:"<<subdet);
285 for (std::map<HepMcParticleLink,SubDetPRDs>::const_iterator
i=pairStat.begin();
i!=pairStat.end(); ++
i) {
296 std::set<HepMcParticleLink> seeds;
297 for (std::map<HepMcParticleLink,SubDetPRDs>::const_iterator
i=pairStat.begin();
i!=pairStat.end(); ++
i) {
298 if (
i->first.isValid()) {
299 seeds.insert(
i->first);
305 traj.push_back(
i->first);
306 ATH_MSG_VERBOSE(
"addTrack(): add id 0 hits (noise ?) to DetailedTrackTruthCollection.");
314 output->insert(std::make_pair(trackLink,
323 using SproutMap = std::map<HepMcParticleLink, Sprout>;
325 while (!seeds.empty() ) {
328 Sprout current_sprout;
329 std::queue<HepMC::ConstGenParticlePtr>
tmp;
335 unsigned nAncestor{0};
338 curlink.setTruthSuppressionType(truthSuppressionStatus);
340 if (!nAncestor && !seeds.count(curlink)) {
341 ATH_MSG_WARNING(
"The first link should always point to the object itself.\nHowever "<<
342 link<<
"=="<<curlink<<
"\n evaluates to " <<(curlink==link)<<
", getTruthSuppressionType: "
344 <<
", id:"<<(curlink.id() == link.
id())
345 <<
", eventIndex: "<<(curlink.eventIndex() == link.
eventIndex()));
351 seeds.erase(curlink);
355 if (p_old != sprouts.end()) {
357 current_sprout.splice(current_sprout.end(), p_old->second);
358 current_sprout.stat += p_old->second.stat;
360 sprouts.erase(p_old);
369 current_sprout.push_back(
current);
372 if (p_newstat != pairStat.end()) {
373 current_sprout.stat += p_newstat->second;
380 sprouts.insert(std::make_pair(link, current_sprout));
409 for (Sprout::const_iterator ppart=
s->second.begin(); ppart!=
s->second.end(); ++ppart) {
417 output->insert(std::make_pair(trackLink,
419 makeSubDetHitStatistics(
s->second.stat),
◆ buildDetailedTrackTruth()
See description for IDetailedTrackTruthBuilder::buildDetailedTrackTruth()
Definition at line 86 of file DetailedTrackTruthBuilder.cxx.
92 ATH_MSG_VERBOSE(
"DetailedTrackTruthBuilder::buildDetailedTrackTruth() ");
103 if (prdTruthColl->empty()) {
110 orderedPRD_Truth[subdet] = prdTruthColl;
121 for (
unsigned itrack=0; itrack<tracks.
size(); ++itrack) {
129 " Entries with TruthTrajectories of more then one particle shown at the DEBUG level.\n"
130 " Use VERBOSE level for complete dump.");
132 for (DetailedTrackTruthCollection::const_iterator
i=
output->begin();
i!=
output->end(); ++
i) {
133 bool interesting = (
i->second.trajectory().size() > 1);
136 <<
"out: trk="<<
i->first.index()<<
" => "<<
i->second<<
endmsg;
141 for (
unsigned k=0;
k<
t.size(); ++
k) {
◆ countPRDsOnTruth()
Definition at line 451 of file DetailedTrackTruthBuilder.cxx.
459 for (TruthTrajectory::const_iterator
p = traj.begin();
p != traj.end(); ++
p) {
465 ATH_MSG_WARNING(
"HepMcParticleLink " << *
p <<
" in truth trajectory does not point to a valid GenParticle.");
469 using iter = PRD_InverseTruth::const_iterator;
470 std::pair<iter,iter>
range = inverseTruth.equal_range(*
p);
478 return makeSubDetHitStatistics(prds);
◆ findSubDetType()
◆ initialize()
StatusCode Trk::DetailedTrackTruthBuilder::initialize |
( |
| ) |
|
|
overridevirtual |
◆ makeTruthToRecMap()
◆ m_idHelper
◆ m_truthTrajBuilder
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
bool is_pixel(Identifier id) const
bool is_rpc(Identifier id) const
bool is_csc(Identifier id) const
bool is_sct(Identifier id) const
A PRD is mapped onto all contributing particles.
bool is_mm(Identifier id) const
SubDetHitStatistics::SubDetType findSubDetType(const Identifier &id) const
void makeTruthToRecMap(PRD_InverseTruth &result, const PRD_MultiTruthCollection &rec2truth) const
bool is_trt(Identifier id) const
#define ATH_MSG_VERBOSE(x)
int id() const
Return the id of the target particle.
HepMC::ConstGenParticlePtr cptr() const
Dereference.
virtual const RIO_OnTrack & rioOnTrack(unsigned int) const =0
returns the RIO_OnTrack (also known as ROT) objects depending on the integer.
a link optimized in size for a GenParticle in a McEventCollection
PublicToolHandle< Trk::ITruthTrajectoryBuilder > m_truthTrajBuilder
bool is_tgc(Identifier id) const
Base class for all CompetingRIOsOnTack implementations, extends the common MeasurementBase.
void addTrack(DetailedTrackTruthCollection *output, const ElementLink< DataVector< Trk::Track > > &track, const std::vector< const PRD_MultiTruthCollection * > &orderedPRD_Truth, const PRD_InverseTruth &inverseTruth, const EventContext &ctx) const
constexpr int UNDEFINED_ID
ElementLink implementation for ROOT usage.
Identifier identify() const
return the identifier
index_type eventIndex() const
Return the event number of the referenced GenEvent.
const GenParticle * ConstGenParticlePtr
const AtlasDetectorID * m_idHelper
EBC_SUPPRESSED_TRUTH getTruthSuppressionType() const
Return whether the truth particle has been suppressed, as an enum.
bool isGeantino(const T &p)
virtual const Trk::PrepRawData * prepRawData() const =0
returns the PrepRawData (also known as RIO) object to which this RIO_OnTrack is associated.
SubDetHitStatistics countPRDsOnTruth(const TruthTrajectory &traj, const PRD_InverseTruth &inverseTruth) const
#define ATH_MSG_WARNING(x)
bool is_stgc(Identifier id) const
unsigned int indexOfMaxAssignProb() const
Index of the ROT with the highest assignment probability.
InverseMultiMap< PRD_MultiTruthCollection > PRD_InverseTruth
size_type size() const noexcept
Returns the number of elements in the collection.
bool is_truth_suppressed_pileup(const T &p)
Method to establish if a particle (or barcode) corresponds to truth-suppressed pile-up (TODO update t...
bool is_mdt(Identifier id) const
thread_local event_number_t eventIndex