 |
Belle II Software
release-05-01-25
|
10 #include <tracking/mcMatcher/TrackMatchLookUp.h>
12 #include <mdst/dataobjects/Track.h>
14 #include <framework/datastore/DataStore.h>
15 #include <framework/logging/Logger.h>
20 TrackMatchLookUp::TrackMatchLookUp(
const std::string& mcRecoTrackStoreArrayName,
21 const std::string& prRecoTrackStoreArrayName)
26 B2WARNING(
"Pattern recognition and Monte Carlo track StoreArray are the same.");
44 std::pair<RecoTrack*, float> mcRecoTrackAndWeight =
46 const RecoTrack* mcRecoTrack = mcRecoTrackAndWeight.first;
48 purity = mcRecoTrackAndWeight.second;
59 std::pair<RecoTrack*, float> prRecoTrackAndWeight =
61 const RecoTrack* prRecoTrack = prRecoTrackAndWeight.first;
63 efficiency = prRecoTrackAndWeight.second;
73 const float& efficiency)
const
75 if (not prRecoTrack)
return MCToPRMatchInfo::c_Missing;
76 if (std::isnan(efficiency))
return MCToPRMatchInfo::c_Invalid;
83 if (roundTripMCRecoTrack == &mcRecoTrack) {
84 return MCToPRMatchInfo::c_Matched;
86 return MCToPRMatchInfo::c_Merged;
93 const float& purity __attribute__((unused)))
const
98 if (matchingStatus == RecoTrack::MatchingStatus::c_ghost) {
99 return PRToMCMatchInfo::c_Ghost;
100 }
else if (matchingStatus == RecoTrack::MatchingStatus::c_background) {
101 return PRToMCMatchInfo::c_Background;
102 }
else if (matchingStatus == RecoTrack::MatchingStatus::c_clone) {
103 if (not mcRecoTrack) B2WARNING(
"Clone with no related Monte Carlo RecoTrack");
104 return PRToMCMatchInfo::c_Clone;
105 }
else if (matchingStatus == RecoTrack::MatchingStatus::c_matched) {
106 if (not mcRecoTrack) B2WARNING(
"Match with no related Monte Carlo RecoTrack");
107 return PRToMCMatchInfo::c_Matched;
108 }
else if (matchingStatus == RecoTrack::MatchingStatus::c_undefined) {
109 return PRToMCMatchInfo::c_Invalid;
111 return PRToMCMatchInfo::c_Invalid;
149 return std::fabs(purity);
155 float efficiency = NAN;
157 return std::fabs(efficiency);
178 float efficiency = NAN;
191 const RecoTrack& mcRecoTrack = recoTrack;
200 const RecoTrack& prRecoTrack = recoTrack;
213 const RecoTrack& prRecoTrack = recoTrack;
222 const RecoTrack& mcRecoTrack = recoTrack;
PRToMCMatchInfo
Matching categories for the pattern recognition tracks.
float getRelatedEfficiency(const RecoTrack &mcRecoTrack) const
Getter for the absolute value of the efficiency that is stored in the efficiency relation from Monte ...
PRToMCMatchInfo extractPRToMCMatchInfo(const RecoTrack &prRecoTrack, const RecoTrack *mcRecoTrack, const float &purity) const
Helper function to assume the correct matching category for the pattern recognition tracks from the i...
MCToPRMatchInfo
Matching categories for the Monte Carlo tracks.
const TrackFitResult * getTrackFitResult(const Const::ChargedStable &chargedStable) const
Access to TrackFitResults.
const std::string & getPRTracksStoreArrayName() const
Getter for the name of the StoreArray of the pattern recognition tracks.
std::string getArrayName() const
Get name of array this object is stored in, or "" if not found.
TO * getRelatedTo(const std::string &name="", const std::string &namedRelation="") const
Get the object to which this object has a relation.
const RecoTrack * getMatchedMCRecoTrack(const RecoTrack &prRecoTrack) const
Looks up the matched Monte Carlo track for the given pattern recognition track.
MatchingStatus getMatchingStatus() const
Return the matching status set by the TrackMatcher module.
Values of the result of a track fit with a given particle hypothesis.
const RecoTrack * getRelatedPRRecoTrack(const RecoTrack &mcRecoTrack) const
Looks for a related pattern recognition track for the given Monte Carlo track and return it if found.
const std::string & getMCTracksStoreArrayName() const
Getter for the name of the StoreArray of the Monte Carlo tracks.
const RecoTrack * getMatchedPRRecoTrack(const RecoTrack &mcRecoTrack) const
Looks up the matched pattern recognition track for the given Monte Carlo track.
float getMatchedEfficiency(const RecoTrack &recoTrack) const
Get the hit efficiency of the matched track.
This is the Reconstruction Event-Data Model Track.
MCToPRMatchInfo extractMCToPRMatchInfo(const RecoTrack &mcRecoTrack, const RecoTrack *prRecoTrack, const float &efficiency) const
Helper function to assume the correct matching category for the Monte Carlo tracks from the informati...
std::string m_mcTracksStoreArrayName
Name of the StoreArray of Monte Carlo tracks.
std::pair< TO *, float > getRelatedToWithWeight(const std::string &name="", const std::string &namedRelation="") const
Get first related object & weight of relation pointing to an array.
float getMatchedPurity(const RecoTrack &recoTrack) const
Get the hit purity of the matched track.
Abstract base class for different kinds of events.
const RecoTrack * getRelatedMCRecoTrack(const RecoTrack &prRecoTrack) const
Looks for a related Monte Carlo track for the given pattern recognition track and return it if found.
const MCParticle * getRelatedMCParticle(const RecoTrack &recoTrack) const
Looks for a relation of the given track to a Monte Carlo particle.
std::string m_prTracksStoreArrayName
Name of the StoreArray of Pattern recognition tracks.
float getRelatedPurity(const RecoTrack &prRecoTrack) const
Getter for the absolute value of the purity that is stored in the purity relation from pattern recogn...
Provides a type-safe way to pass members of the chargedStableSet set.
Class that bundles various TrackFitResults.
A Class to store the Monte Carlo particle information.
const TrackFitResult * getRelatedTrackFitResult(const RecoTrack &prRecoTrack, Const::ChargedStable chargedStable=Const::pion) const
Looks up the TrackFitResult of a pattern recognition track.
bool isMCRecoTrack(const RecoTrack &recoTrack) const
Checks if the given track is in the Monte Carlo track StoreArray.
MatchingStatus
Enum for the matching status of this reco track (set by the matching modules in the tracking package)...
In the store you can park objects that have to be accessed by various modules.
FROM * getRelatedFrom(const std::string &name="", const std::string &namedRelation="") const
Get the object from which this object has a relation.
bool isPRRecoTrack(const RecoTrack &recoTrack) const
Checks if the given track is in the pattern recognition StoreArray.