![]() |
Belle II Software
release-06-01-15
|
Class to provide convenient methods to look up matching information between pattern recognition and Monte Carlo tracks. More...
#include <TrackMatchLookUp.h>
Public Types | |
enum class | MCToPRMatchInfo { c_Invalid , c_Matched , c_Merged , c_Missing } |
Matching categories for the Monte Carlo tracks. | |
enum class | PRToMCMatchInfo { c_Invalid , c_Matched , c_Clone , c_Background , c_Ghost } |
Matching categories for the pattern recognition tracks. | |
Public Member Functions | |
TrackMatchLookUp (const std::string &mcRecoTrackStoreArrayName, const std::string &prRecoTrackStoreArrayName="") | |
Constructor taking the names of the StoreArrays containing the Monte Carlo tracks and the pattern recognition tracks respectivelly. More... | |
const RecoTrack * | getMatchedMCRecoTrack (const RecoTrack &prRecoTrack) const |
Looks up the matched Monte Carlo track for the given pattern recognition track. More... | |
const RecoTrack * | getMatchedPRRecoTrack (const RecoTrack &mcRecoTrack) const |
Looks up the matched pattern recognition track for the given Monte Carlo track. More... | |
float | getMatchedPurity (const RecoTrack &recoTrack) const |
Get the hit purity of the matched track. More... | |
float | getMatchedEfficiency (const RecoTrack &recoTrack) const |
Get the hit efficiency of the matched track. More... | |
MCToPRMatchInfo | getMCToPRMatchInfo (const RecoTrack &mcRecoTrack) const |
Gets the matching category of Monte Carlo track. | |
bool | isMatchedPRRecoTrack (const RecoTrack &prRecoTrack) const |
Checks, if the pattern recognition track was matched to a Monte Carlo track. | |
bool | isClonePRRecoTrack (const RecoTrack &prRecoTrack) const |
Checks, if the pattern recognition track is a clone of an other pattern recognition track. | |
bool | isBackgroundPRRecoTrack (const RecoTrack &prRecoTrack) const |
Checks, if the pattern recognition track is mostly made from background hits. | |
bool | isGhostPRRecoTrack (const RecoTrack &prRecoTrack) const |
Checks, if the pattern recognition track has contributions of different Monte Carlo tracks and/or background hits, such that a match is not possible. | |
PRToMCMatchInfo | getPRToMCMatchInfo (const RecoTrack &prRecoTrack) const |
Gets the matching category of pattern recognition track. | |
bool | isMatchedMCRecoTrack (const RecoTrack &mcRecoTrack) const |
Checks, if the Monte Carlo Track was matched to a pattern recognition track. | |
bool | isMergedMCRecoTrack (const RecoTrack &mcRecoTrack) const |
Checks, if the Monte Carlo Track has been merged into another pattern recognition track. | |
bool | isMissingMCRecoTrack (const RecoTrack &mcRecoTrack) const |
Checks, if the Monte Carlo Track has no corresponding pattern recognition track. | |
const MCParticle * | getRelatedMCParticle (const RecoTrack &recoTrack) const |
Looks for a relation of the given track to a Monte Carlo particle. More... | |
const TrackFitResult * | getRelatedTrackFitResult (const RecoTrack &prRecoTrack, Const::ChargedStable chargedStable=Const::pion) const |
Looks up the TrackFitResult of a pattern recognition track. More... | |
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. More... | |
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. More... | |
float | getRelatedPurity (const RecoTrack &prRecoTrack) const |
Getter for the absolute value of the purity that is stored in the purity relation from pattern recognition tracks to Monte Carlo tracks. More... | |
float | getRelatedEfficiency (const RecoTrack &mcRecoTrack) const |
Getter for the absolute value of the efficiency that is stored in the efficiency relation from Monte Carlo tracks to pattern recognition tracks. More... | |
const RecoTrack * | getRelatedMCRecoTrack (const RecoTrack &prRecoTrack, float &purity) const |
Helper function looking for a related Monte Carlo track to the given pattern recognition track in the purity relation. More... | |
const RecoTrack * | getRelatedPRRecoTrack (const RecoTrack &mcRecoTrack, float &efficiency) const |
Helper function looking for a related Monte Carlo track to the given pattern recognition track in the efficiency relation. More... | |
bool | isMCRecoTrack (const RecoTrack &recoTrack) const |
Checks if the given track is in the Monte Carlo track StoreArray. | |
bool | isPRRecoTrack (const RecoTrack &recoTrack) const |
Checks if the given track is in the pattern recognition StoreArray. | |
const std::string & | getMCTracksStoreArrayName () const |
Getter for the name of the StoreArray of the Monte Carlo tracks. | |
const std::string & | getPRTracksStoreArrayName () const |
Getter for the name of the StoreArray of the pattern recognition tracks. | |
Private Member Functions | |
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 information efficiency relation. | |
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 information purity relation. | |
Private Attributes | |
std::string | m_mcTracksStoreArrayName |
Name of the StoreArray of Monte Carlo tracks. | |
std::string | m_prTracksStoreArrayName |
Name of the StoreArray of Pattern recognition tracks. | |
Class to provide convenient methods to look up matching information between pattern recognition and Monte Carlo tracks.
It provides a more user friendly look up interface into the relations that were generated by the MCTrackMatcherModule.
Instead of looking through the relations directly to find the matching information on your own the methods of this class exhibit a conceptual view on them.
This class is also accessible in python steering files.
Definition at line 33 of file TrackMatchLookUp.h.
|
explicit |
Constructor taking the names of the StoreArrays containing the Monte Carlo tracks and the pattern recognition tracks respectivelly.
Only the name of StoreArray of the Monte Carlo reference tracks has to be given. The name of the StoreArray of the pattern recognition tracks to defaults to the standard name.
Definition at line 18 of file TrackMatchLookUp.cc.
float getMatchedEfficiency | ( | const RecoTrack & | recoTrack | ) | const |
Get the hit efficiency of the matched track.
The given track can be both Monte Carlo track or pattern recognition track since the match is one to one relation. The returned efficiency is positive, hence the absolute value of the relation weight. If no exact match is assoziated with the track return NAN.
Definition at line 208 of file TrackMatchLookUp.cc.
Looks up the matched Monte Carlo track for the given pattern recognition track.
If there is no match or the pattern recognition track is a clone return nullptr.
Definition at line 158 of file TrackMatchLookUp.cc.
Looks up the matched pattern recognition track for the given Monte Carlo track.
If there is no match or the Monte Carlo track is a over-merged return nullptr.
Definition at line 172 of file TrackMatchLookUp.cc.
float getMatchedPurity | ( | const RecoTrack & | recoTrack | ) | const |
Get the hit purity of the matched track.
The given track can be both Monte Carlo track or pattern recognition track since the match is one to one relation. The returned purity is positive, hence the absolute value of the relation weight. If no exact match is assoziated with the track return NAN.
Definition at line 186 of file TrackMatchLookUp.cc.
float getRelatedEfficiency | ( | const RecoTrack & | mcRecoTrack | ) | const |
Getter for the absolute value of the efficiency that is stored in the efficiency relation from Monte Carlo tracks to pattern recognition tracks.
The efficiency relation on the DataStore encodes some information about the match category in the sign of the efficiency. However user code is always interested in the absolute value of the efficiency but may forget apply an absolute value. Since the matching category can be found by other methods of this class, we only provide the absolute value here.
Definition at line 150 of file TrackMatchLookUp.cc.
const MCParticle * getRelatedMCParticle | ( | const RecoTrack & | recoTrack | ) | const |
Looks for a relation of the given track to a Monte Carlo particle.
Returns nullptr if not found.
Works for both pattern recognition and Monte Carlo tracks.
Whether clones have a related MCParticle depends on the settings of the MCTrackMatcher module that filled the relations.
Definition at line 112 of file TrackMatchLookUp.cc.
Looks for a related Monte Carlo track for the given pattern recognition track and return it if found.
Return nullptr if not found.
Definition at line 117 of file TrackMatchLookUp.cc.
Helper function looking for a related Monte Carlo track to the given pattern recognition track in the purity relation.
Also returns to found purity as output parameter.
Definition at line 39 of file TrackMatchLookUp.cc.
Looks for a related pattern recognition track for the given Monte Carlo track and return it if found.
Return nullptr if not found.
Definition at line 136 of file TrackMatchLookUp.cc.
Helper function looking for a related Monte Carlo track to the given pattern recognition track in the efficiency relation.
Also returns to found efficiency as output parameter.
Definition at line 54 of file TrackMatchLookUp.cc.
float getRelatedPurity | ( | const RecoTrack & | prRecoTrack | ) | const |
Getter for the absolute value of the purity that is stored in the purity relation from pattern recognition tracks to Monte Carlo tracks.
The purity relation on the DataStore encodes some information about the match category in the sign of the purity. However user code is always interested in the absolute value of the purity but may forget apply an absolute value. Since the matching category can be found by other methods of this class, we only provide the absolute value here.
Definition at line 142 of file TrackMatchLookUp.cc.
const TrackFitResult * getRelatedTrackFitResult | ( | const RecoTrack & | prRecoTrack, |
Const::ChargedStable | chargedStable = Const::pion |
||
) | const |
Looks up the TrackFitResult of a pattern recognition track.
Return nullptr if there is no related track fit result.
The relations are setup to be from the Belle2::Track to the RecoTrack.
Then the TrackFitResults stored within the Belle2::Tracks are retrieved and the one selected particle hypothesises given via chargedStable is returned.
The default is the Pion fit.
Definition at line 123 of file TrackMatchLookUp.cc.