Obtains truth matching by using hit <–> MCParticle associations. More...
#include <MCTruthAssociations.h>
Classes | |
struct | HitPartAssnsStruct |
Public Member Functions | |
MCTruthAssociations (fhicl::ParameterSet const &config) | |
void | setup (const HitParticleAssociationsVec &, const MCParticleVec &, const MCTruthAssns &, const geo::GeometryCore &) |
const MCTruthParticleList & | getParticleList () const |
const simb::MCParticle * | TrackIDToParticle (int const &id) const |
const simb::MCParticle * | TrackIDToMotherParticle (int const &id) const |
const art::Ptr< simb::MCTruth > & | TrackIDToMCTruth (int const &id) const |
const art::Ptr< simb::MCTruth > & | ParticleToMCTruth (const simb::MCParticle *p) const |
std::vector< const simb::MCParticle * > | MCTruthToParticles (art::Ptr< simb::MCTruth > const &mct) const |
const MCTruthTruthVec & | MCTruthVector () const |
std::vector< TrackIDE > | HitToTrackID (const recob::Hit *) const |
std::vector< TrackIDE > | HitToTrackID (art::Ptr< recob::Hit > const &) const |
const std::vector< std::vector < art::Ptr< recob::Hit > > > | TrackIDsToHits (std::vector< art::Ptr< recob::Hit >> const &, std::vector< int > const &) const |
std::vector< TrackIDE > | HitToEveID (art::Ptr< recob::Hit > const &hit) const |
std::vector< double > | HitToXYZ (art::Ptr< recob::Hit > const &hit) const |
std::vector< double > | SpacePointHitsToXYZ (art::PtrVector< recob::Hit > const &hits) const |
double | HitCollectionPurity (std::set< int >, std::vector< art::Ptr< recob::Hit > > const &) const |
double | HitCollectionEfficiency (std::set< int >, std::vector< art::Ptr< recob::Hit > > const &, std::vector< art::Ptr< recob::Hit > > const &, geo::View_t const &) const |
double | HitChargeCollectionPurity (std::set< int >, std::vector< art::Ptr< recob::Hit > > const &) const |
double | HitChargeCollectionEfficiency (std::set< int >, std::vector< art::Ptr< recob::Hit > > const &, std::vector< art::Ptr< recob::Hit > > const &, geo::View_t const &) const |
std::set< int > | GetSetOfEveIDs () const |
std::set< int > | GetSetOfTrackIDs () const |
std::set< int > | GetSetOfEveIDs (std::vector< art::Ptr< recob::Hit > > const &) const |
std::set< int > | GetSetOfTrackIDs (std::vector< art::Ptr< recob::Hit > > const &) const |
Private Types | |
using | HitMatchDataPair = std::pair< const recob::Hit *, const anab::BackTrackerHitMatchingData * > |
using | PartMatchDataPair = std::pair< const simb::MCParticle *, const anab::BackTrackerHitMatchingData * > |
using | HitToPartVecMap = std::map< const recob::Hit *, std::set< PartMatchDataPair >> |
using | PartToHitVecMap = std::map< const simb::MCParticle *, std::set< HitMatchDataPair >> |
using | MCTruthTrackIDMap = std::unordered_map< int, art::Ptr< simb::MCTruth >> |
using | HitPartAssnsList = std::list< HitPartAssnsStruct > |
Private Member Functions | |
int | calculateEvdID (int) const |
double | length (const recob::Track *) const |
double | length (const detinfo::DetectorPropertiesData &detProp, const simb::MCParticle &part, double dx, TVector3 &start, TVector3 &end, TVector3 &startmom, TVector3 &endmom, unsigned int tpc=0, unsigned int cstat=0) const |
Private Attributes | |
HitPartAssnsList | fHitPartAssnsVec |
Container for the (multiple) associations. More... | |
MCTruthParticleList | fParticleList |
ParticleList to map track ID to. More... | |
MCTruthTruthVec | fMCTruthVec |
all the MCTruths for the event More... | |
MCTruthTrackIDMap | fTrackIDToMCTruthIndex |
map of track ids to MCTruthList entry More... | |
float | fMinHitEnergyFraction |
geo::GeometryCore const * | fGeometry = nullptr |
Obtains truth matching by using hit <–> MCParticle associations.
Definition at line 64 of file MCTruthAssociations.h.
|
private |
Definition at line 144 of file MCTruthAssociations.h.
|
private |
Definition at line 160 of file MCTruthAssociations.h.
|
private |
Definition at line 146 of file MCTruthAssociations.h.
|
private |
Definition at line 148 of file MCTruthAssociations.h.
|
private |
Definition at line 145 of file MCTruthAssociations.h.
|
private |
Definition at line 147 of file MCTruthAssociations.h.
truth::MCTruthAssociations::MCTruthAssociations | ( | fhicl::ParameterSet const & | config | ) |
Definition at line 33 of file MCTruthAssociations.cpp.
|
private |
const MCTruthParticleList & truth::MCTruthAssociations::getParticleList | ( | ) | const |
Definition at line 107 of file MCTruthAssociations.cpp.
std::set< int > truth::MCTruthAssociations::GetSetOfEveIDs | ( | ) | const |
Definition at line 494 of file MCTruthAssociations.cpp.
std::set< int > truth::MCTruthAssociations::GetSetOfEveIDs | ( | std::vector< art::Ptr< recob::Hit > > const & | hitVec | ) | const |
Definition at line 517 of file MCTruthAssociations.cpp.
std::set< int > truth::MCTruthAssociations::GetSetOfTrackIDs | ( | ) | const |
Definition at line 505 of file MCTruthAssociations.cpp.
std::set< int > truth::MCTruthAssociations::GetSetOfTrackIDs | ( | std::vector< art::Ptr< recob::Hit > > const & | hitVec | ) | const |
Definition at line 533 of file MCTruthAssociations.cpp.
double truth::MCTruthAssociations::HitChargeCollectionEfficiency | ( | std::set< int > | trackIDs, |
std::vector< art::Ptr< recob::Hit > > const & | hitVec, | ||
std::vector< art::Ptr< recob::Hit > > const & | allHitVec, | ||
geo::View_t const & | view | ||
) | const |
Definition at line 434 of file MCTruthAssociations.cpp.
double truth::MCTruthAssociations::HitChargeCollectionPurity | ( | std::set< int > | trackIDs, |
std::vector< art::Ptr< recob::Hit > > const & | hitVec | ||
) | const |
Definition at line 398 of file MCTruthAssociations.cpp.
double truth::MCTruthAssociations::HitCollectionEfficiency | ( | std::set< int > | trackIDs, |
std::vector< art::Ptr< recob::Hit > > const & | hitVec, | ||
std::vector< art::Ptr< recob::Hit > > const & | allHitVec, | ||
geo::View_t const & | view | ||
) | const |
Definition at line 338 of file MCTruthAssociations.cpp.
double truth::MCTruthAssociations::HitCollectionPurity | ( | std::set< int > | trackIDs, |
std::vector< art::Ptr< recob::Hit > > const & | hitVec | ||
) | const |
Definition at line 305 of file MCTruthAssociations.cpp.
std::vector< TrackIDE > truth::MCTruthAssociations::HitToEveID | ( | art::Ptr< recob::Hit > const & | hit | ) | const |
Definition at line 261 of file MCTruthAssociations.cpp.
std::vector< TrackIDE > truth::MCTruthAssociations::HitToTrackID | ( | const recob::Hit * | hit | ) | const |
Definition at line 180 of file MCTruthAssociations.cpp.
std::vector< TrackIDE > truth::MCTruthAssociations::HitToTrackID | ( | art::Ptr< recob::Hit > const & | hit | ) | const |
Definition at line 217 of file MCTruthAssociations.cpp.
std::vector< double > truth::MCTruthAssociations::HitToXYZ | ( | art::Ptr< recob::Hit > const & | hit | ) | const |
Definition at line 291 of file MCTruthAssociations.cpp.
|
private |
Definition at line 549 of file MCTruthAssociations.cpp.
|
private |
Definition at line 556 of file MCTruthAssociations.cpp.
std::vector< const simb::MCParticle * > truth::MCTruthAssociations::MCTruthToParticles | ( | art::Ptr< simb::MCTruth > const & | mct | ) | const |
Definition at line 158 of file MCTruthAssociations.cpp.
const MCTruthTruthVec & truth::MCTruthAssociations::MCTruthVector | ( | ) | const |
Definition at line 173 of file MCTruthAssociations.cpp.
const art::Ptr< simb::MCTruth > & truth::MCTruthAssociations::ParticleToMCTruth | ( | const simb::MCParticle * | p | ) | const |
Definition at line 153 of file MCTruthAssociations.cpp.
void truth::MCTruthAssociations::setup | ( | const HitParticleAssociationsVec & | partToHitAssnsVec, |
const MCParticleVec & | mcPartVec, | ||
const MCTruthAssns & | truthToPartAssns, | ||
const geo::GeometryCore & | geometry | ||
) |
Definition at line 38 of file MCTruthAssociations.cpp.
std::vector< double > truth::MCTruthAssociations::SpacePointHitsToXYZ | ( | art::PtrVector< recob::Hit > const & | hits | ) | const |
Definition at line 298 of file MCTruthAssociations.cpp.
const std::vector< std::vector< art::Ptr< recob::Hit > > > truth::MCTruthAssociations::TrackIDsToHits | ( | std::vector< art::Ptr< recob::Hit >> const & | allHits, |
std::vector< int > const & | tkIDs | ||
) | const |
Definition at line 223 of file MCTruthAssociations.cpp.
const art::Ptr< simb::MCTruth > & truth::MCTruthAssociations::TrackIDToMCTruth | ( | int const & | id | ) | const |
Definition at line 140 of file MCTruthAssociations.cpp.
const simb::MCParticle * truth::MCTruthAssociations::TrackIDToMotherParticle | ( | int const & | id | ) | const |
Definition at line 132 of file MCTruthAssociations.cpp.
const simb::MCParticle * truth::MCTruthAssociations::TrackIDToParticle | ( | int const & | id | ) | const |
Definition at line 113 of file MCTruthAssociations.cpp.
|
private |
Definition at line 179 of file MCTruthAssociations.h.
|
private |
Container for the (multiple) associations.
Definition at line 169 of file MCTruthAssociations.h.
|
private |
all the MCTruths for the event
Definition at line 171 of file MCTruthAssociations.h.
|
private |
minimum fraction of energy a track id has to contribute to a hit to be counted in purity and efficiency calculations based on hit collections
Definition at line 174 of file MCTruthAssociations.h.
|
private |
ParticleList to map track ID to.
Definition at line 170 of file MCTruthAssociations.h.
|
private |
map of track ids to MCTruthList entry
Definition at line 172 of file MCTruthAssociations.h.