|
ATLAS Offline Software
|
#include <DetailedTrackTruthBuilder.h>
Definition at line 25 of file DetailedTrackTruthBuilder.h.
◆ PRD_InverseTruth
◆ DetailedTrackTruthBuilder()
Trk::DetailedTrackTruthBuilder::DetailedTrackTruthBuilder |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ addTrack()
Definition at line 217 of file DetailedTrackTruthBuilder.cxx.
225 std::map<HepMcParticleLink,SubDetPRDs> pairStat;
250 if (orderedPRD_Truth[subdet]) {
254 using iprdt = PRD_MultiTruthCollection::const_iterator;
255 std::pair<iprdt, iprdt>
range = orderedPRD_Truth[subdet]->equal_range(
id);
261 if (!pa) {
continue; }
263 if (!
i->second.isValid()) {
264 ATH_MSG_WARNING(
"Unexpected invalid HepMcParticleLink in PRD_MultiTruthCollection");
267 pairStat[
i->second].subDetHits[subdet].insert(
id);
269 ATH_MSG_VERBOSE(
"PRD-ID:"<<
id<<
" subdet:"<<subdet<<
" number:"<<
n<<
" particle link:"<<
i->second);
273 ATH_MSG_VERBOSE(
"--> no link, noise ? PRD-ID:"<<
id<<
" subdet:"<<subdet);
290 for (std::map<HepMcParticleLink,SubDetPRDs>::const_iterator
i=pairStat.begin();
i!=pairStat.end(); ++
i) {
300 std::set<HepMcParticleLink> seeds;
301 for (std::map<HepMcParticleLink,SubDetPRDs>::const_iterator
i=pairStat.begin();
i!=pairStat.end(); ++
i) {
302 if (
i->first.isValid()) {
303 seeds.insert(
i->first);
309 traj.push_back(
i->first);
310 ATH_MSG_VERBOSE(
"addTrack(): add id 0 hits (noise ?) to DetailedTrackTruthCollection.");
327 using SproutMap = std::map<HepMcParticleLink, Sprout>;
329 while (!seeds.empty()) {
331 Sprout current_sprout;
332 std::queue<HepMC::ConstGenParticlePtr>
tmp;
340 seeds.erase(curlink);
344 if (p_old != sprouts.end()) {
346 current_sprout.splice(current_sprout.end(), p_old->second);
347 current_sprout.stat += p_old->second.stat;
349 sprouts.erase(p_old);
358 current_sprout.push_back(
current);
361 if (p_newstat != pairStat.end()) {
362 current_sprout.stat += p_newstat->second;
369 sprouts.insert(std::make_pair(link, current_sprout));
398 for (Sprout::const_iterator ppart=
s->second.begin(); ppart!=
s->second.end(); ++ppart) {
408 makeSubDetHitStatistics(
s->second.stat),
◆ buildDetailedTrackTruth()
See description for IDetailedTrackTruthBuilder::buildDetailedTrackTruth()
Definition at line 91 of file DetailedTrackTruthBuilder.cxx.
97 ATH_MSG_VERBOSE(
"DetailedTrackTruthBuilder::buildDetailedTrackTruth() ");
109 if (!(prdTruthColl)->
empty()) {
115 orderedPRD_Truth[subdet] = prdTruthColl;
131 for (
unsigned itrack=0; itrack<tracks.
size(); ++itrack) {
139 " Entries with TruthTrajectories of more then one particle shown at the DEBUG level.\n"
140 " Use VERBOSE level for complete dump.");
142 for (DetailedTrackTruthCollection::const_iterator
i=
output->begin();
i!=
output->end(); ++
i) {
143 bool interesting = (
i->second.trajectory().size() > 1);
146 <<
"out: trk="<<
i->first.index()<<
" => "<<
i->second<<
endmsg;
151 for (
unsigned k=0;
k<
t.size(); ++
k) {
◆ countPRDsOnTruth()
Definition at line 433 of file DetailedTrackTruthBuilder.cxx.
441 for (TruthTrajectory::const_iterator
p = traj.begin();
p != traj.end(); ++
p) {
447 ATH_MSG_WARNING(
"HepMcParticleLink " << *
p <<
" in truth trajectory does not point to a valid GenParticle.");
451 using iter = PRD_InverseTruth::const_iterator;
452 std::pair<iter,iter>
range = inverseTruth.equal_range(*
p);
460 return makeSubDetHitStatistics(prds);
◆ findSubDetType()
◆ initialize()
StatusCode Trk::DetailedTrackTruthBuilder::initialize |
( |
| ) |
|
|
virtual |
◆ makeTruthToRecMap()
Definition at line 417 of file DetailedTrackTruthBuilder.cxx.
422 for (
const auto&
i : rec2truth ) {
425 auto pa =
i.second.cptr();
426 if ( !pa ) {
continue; }
428 result.insert(std::make_pair(
i.second,
i.first));
◆ 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
static void makeTruthToRecMap(PRD_InverseTruth &result, const PRD_MultiTruthCollection &rec2truth)
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
bool is_trt(Identifier id) const
#define ATH_MSG_VERBOSE(x)
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
const GenParticle * ConstGenParticlePtr
const AtlasDetectorID * m_idHelper
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