Belle II Software development
|
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_undefined , c_matched , c_matchedWrongCharge , c_merged , c_mergedWrongCharge , c_missing } |
Matching categories for the Monte Carlo tracks. More... | |
enum class | PRToMCMatchInfo { c_undefined , c_matched , c_matchedWrongCharge , c_clone , c_cloneWrongCharge , c_background , c_ghost } |
Matching categories for the pattern recognition tracks. More... | |
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 respectively. | |
const RecoTrack * | getCorrectChargeMatchedMCRecoTrack (const RecoTrack &prRecoTrack) const |
Looks up the matched Monte Carlo track for the given pattern recognition track. | |
const RecoTrack * | getWrongChargeMatchedMCRecoTrack (const RecoTrack &prRecoTrack) const |
Looks up the matched Monte Carlo track for the given pattern recognition track with the wrong charge. | |
const RecoTrack * | getAnyChargeMatchedMCRecoTrack (const RecoTrack &prRecoTrack) const |
Check whether any matched MC RecoTracks for the given prRecoTrack, independent of whether both pattern and charge are matched correctly, or only the pattern is correct but the charge is wrong. | |
const RecoTrack * | getCorrectChargeMatchedPRRecoTrack (const RecoTrack &mcRecoTrack) const |
Looks up the matched pattern recognition track for the given Monte Carlo track. | |
const RecoTrack * | getWrongChargeMatchedPRRecoTrack (const RecoTrack &mcRecoTrack) const |
Looks up the matched pattern recognition track for the given Monte Carlo track. | |
const RecoTrack * | getAnyChargeMatchedPRRecoTrack (const RecoTrack &mcRecoTrack) const |
Check whether any matched PR RecoTracks for the given mcRecoTrack, independent of whether both pattern and charge are matched correctly, or only the pattern is correct but the charge is wrong. | |
float | getMatchedPurity (const RecoTrack &recoTrack) const |
Get the hit purity of the matched track. | |
float | getMatchedEfficiency (const RecoTrack &recoTrack) const |
Get the hit efficiency of the matched track. | |
bool | isChargeMatched (const RecoTrack &recoTrack) const |
Checks if the recoTrack charge is correctly assigned. | |
MCToPRMatchInfo | getMCToPRMatchInfo (const RecoTrack &mcRecoTrack) const |
Gets the matching category of Monte Carlo track. | |
bool | isCorrectChargeMatchedPRRecoTrack (const RecoTrack &prRecoTrack) const |
Checks, if the pattern recognition track was matched to a Monte Carlo track with both hit pattern and charge being matched. | |
bool | isWrongChargeMatchedPRRecoTrack (const RecoTrack &prRecoTrack) const |
Checks, if the pattern recognition track was matched to a Monte Carlo track but with the wrong charge. | |
bool | isAnyChargeMatchedPRRecoTrack (const RecoTrack &prRecoTrack) const |
Checks, if the pattern recognition track was matched to a Monte Carlo track, independent of whether the charge is matched. | |
bool | isCorrectChargeClonePRRecoTrack (const RecoTrack &prRecoTrack) const |
Checks, if the pattern recognition track is a clone of an other pattern recognition track. | |
bool | isWrongChargeClonePRRecoTrack (const RecoTrack &prRecoTrack) const |
Checks, if the pattern recognition track is a clone of an other pattern recognition track, but with the wrong charge. | |
bool | isAnyChargeClonePRRecoTrack (const RecoTrack &prRecoTrack) const |
Checks, if the pattern recognition track is a clone of an other pattern recognition track, independent of whether the charge is correct. | |
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 | isCorrectChargeMatchedMCRecoTrack (const RecoTrack &mcRecoTrack) const |
Checks, if the Monte Carlo Track was matched to a pattern recognition track based on the hit pattern and the correct charge. | |
bool | isWrongChargeMatchedMCRecoTrack (const RecoTrack &mcRecoTrack) const |
Checks, if the Monte Carlo Track was matched to a pattern recognition track based on the hit pattern, but was assigned the wrong charge. | |
bool | isAnyChargeMatchedMCRecoTrack (const RecoTrack &mcRecoTrack) const |
Checks, if the Monte Carlo Track was matched to a pattern recognition track independent of the charge. | |
bool | isCorrectChargeMergedMCRecoTrack (const RecoTrack &mcRecoTrack) const |
Checks, if the Monte Carlo Track has been merged into another pattern recognition track. | |
bool | isWrongChargeMergedMCRecoTrack (const RecoTrack &mcRecoTrack) const |
Checks, if the Monte Carlo Track has been merged into another pattern recognition track and with the wrong charge. | |
bool | isAnyChargeMergedMCRecoTrack (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. | |
const TrackFitResult * | getRelatedTrackFitResult (const RecoTrack &prRecoTrack, Const::ChargedStable chargedStable=Const::pion) const |
Looks up the TrackFitResult of a pattern recognition track. | |
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 RecoTrack * | getRelatedPRRecoTrack (const RecoTrack &mcRecoTrack) const |
Looks for a related pattern recognition track for the given Monte Carlo track and return it if found. | |
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. | |
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. | |
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. | |
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. | |
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. | |
const RecoTrack * | getMCRecoTrackWithStatus (const RecoTrack &prRecoTrack, const PRToMCMatchInfo matchingStatus=PRToMCMatchInfo::c_matched) const |
Looks up the matched Monte Carlo track with the PRToMCMatchInfo matchingStatus for the given pattern recognition track. | |
const RecoTrack * | getPRRecoTrackWithStatus (const RecoTrack &mcRecoTrack, const MCToPRMatchInfo matchingStatus=MCToPRMatchInfo::c_matched) const |
Looks up the matched pattern recognition track with the MCToPRMatchInfo matchingStatus for the given Monte Carlo track. | |
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.
|
strong |
Matching categories for the Monte Carlo tracks.
c_undefined, //until the matcher module sets it c_matched, // hit pattern and charge are both correct c_matchedWrongCharge, // hit pattern is correct, but the charge is wrong c_merged, //a clone with the correct charge c_mergedWrongCharge, //a clone with the wrong charge c_missing
Definition at line 45 of file TrackMatchLookUp.h.
|
strong |
Matching categories for the pattern recognition tracks.
c_undefined, //until the matcher module sets it c_matched, // hit pattern and charge are both correct c_matchedWrongCharge, // hit pattern is correct, but the charge is wrong c_clone, //a clone with the correct charge c_cloneWrongCharge, //a clone with the wrong charge c_background, c_ghost
Definition at line 57 of file TrackMatchLookUp.h.
|
explicit |
Constructor taking the names of the StoreArrays containing the Monte Carlo tracks and the pattern recognition tracks respectively.
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 17 of file TrackMatchLookUp.cc.
|
private |
Helper function to assume the correct matching category for the Monte Carlo tracks from the information efficiency relation.
Definition at line 68 of file TrackMatchLookUp.cc.
|
private |
Helper function to assume the correct matching category for the pattern recognition tracks from the information purity relation.
Definition at line 92 of file TrackMatchLookUp.cc.
Check whether any matched MC RecoTracks for the given prRecoTrack, independent of whether both pattern and charge are matched correctly, or only the pattern is correct but the charge is wrong.
If no match exists at all, a nullptr is returned.
Definition at line 131 of file TrackMatchLookUp.h.
Check whether any matched PR RecoTracks for the given mcRecoTrack, independent of whether both pattern and charge are matched correctly, or only the pattern is correct but the charge is wrong.
If no match exists at all, a nullptr is returned.
Definition at line 165 of file TrackMatchLookUp.h.
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, or the charge is wrong return nullptr.
Definition at line 110 of file TrackMatchLookUp.h.
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, or the charge is wrong return nullptr.
Definition at line 145 of file TrackMatchLookUp.h.
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 associated with the track return NAN.
Definition at line 220 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 associated with the track return NAN.
Definition at line 197 of file TrackMatchLookUp.cc.
|
private |
Looks up the matched Monte Carlo track with the PRToMCMatchInfo matchingStatus for the given pattern recognition track.
If there is no match or the pattern recognition track is a clone return nullptr.
Definition at line 167 of file TrackMatchLookUp.cc.
|
inline |
Gets the matching category of Monte Carlo track.
Definition at line 208 of file TrackMatchLookUp.h.
|
inline |
Getter for the name of the StoreArray of the Monte Carlo tracks.
Definition at line 455 of file TrackMatchLookUp.h.
|
private |
Looks up the matched pattern recognition track with the MCToPRMatchInfo matchingStatus for the given Monte Carlo track.
If there is no match or the Monte Carlo track return nullptr.
Definition at line 182 of file TrackMatchLookUp.cc.
|
inline |
Gets the matching category of pattern recognition track.
Definition at line 291 of file TrackMatchLookUp.h.
|
inline |
Getter for the name of the StoreArray of the pattern recognition tracks.
Definition at line 463 of file TrackMatchLookUp.h.
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 159 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 121 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 126 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 38 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 145 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 53 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 151 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 132 of file TrackMatchLookUp.cc.
Looks up the matched Monte Carlo track for the given pattern recognition track with the wrong charge.
If there is no match or the pattern recognition track is a clone, or the charge is correct return nullptr.
Definition at line 121 of file TrackMatchLookUp.h.
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 or the charge is correct return nullptr.
Definition at line 155 of file TrackMatchLookUp.h.
|
inline |
Checks, if the pattern recognition track is a clone of an other pattern recognition track, independent of whether the charge is correct.
Definition at line 264 of file TrackMatchLookUp.h.
|
inline |
Checks, if the Monte Carlo Track was matched to a pattern recognition track independent of the charge.
Definition at line 320 of file TrackMatchLookUp.h.
|
inline |
Checks, if the pattern recognition track was matched to a Monte Carlo track, independent of whether the charge is matched.
Definition at line 237 of file TrackMatchLookUp.h.
|
inline |
Checks, if the Monte Carlo Track has been merged into another pattern recognition track.
Definition at line 346 of file TrackMatchLookUp.h.
|
inline |
Checks, if the pattern recognition track is mostly made from background hits.
Definition at line 273 of file TrackMatchLookUp.h.
bool isChargeMatched | ( | const RecoTrack & | recoTrack | ) | const |
Checks if the recoTrack charge is correctly assigned.
Returns NAN if the recoTrack is not matched. The given track can be both Monte Carlo track or pattern recognition track.
Definition at line 243 of file TrackMatchLookUp.cc.
|
inline |
Checks, if the pattern recognition track is a clone of an other pattern recognition track.
Definition at line 246 of file TrackMatchLookUp.h.
|
inline |
Checks, if the Monte Carlo Track was matched to a pattern recognition track based on the hit pattern and the correct charge.
Definition at line 302 of file TrackMatchLookUp.h.
|
inline |
Checks, if the pattern recognition track was matched to a Monte Carlo track with both hit pattern and charge being matched.
Definition at line 219 of file TrackMatchLookUp.h.
|
inline |
Checks, if the Monte Carlo Track has been merged into another pattern recognition track.
Definition at line 329 of file TrackMatchLookUp.h.
|
inline |
Checks, if the pattern recognition track has contributions of different Monte Carlo tracks and/or background hits, such that a match is not possible.
Definition at line 282 of file TrackMatchLookUp.h.
bool isMCRecoTrack | ( | const RecoTrack & | recoTrack | ) | const |
Checks if the given track is in the Monte Carlo track StoreArray.
Definition at line 27 of file TrackMatchLookUp.cc.
|
inline |
Checks, if the Monte Carlo Track has no corresponding pattern recognition track.
Definition at line 355 of file TrackMatchLookUp.h.
bool isPRRecoTrack | ( | const RecoTrack & | recoTrack | ) | const |
Checks if the given track is in the pattern recognition StoreArray.
Definition at line 32 of file TrackMatchLookUp.cc.
|
inline |
Checks, if the pattern recognition track is a clone of an other pattern recognition track, but with the wrong charge.
Definition at line 255 of file TrackMatchLookUp.h.
|
inline |
Checks, if the Monte Carlo Track was matched to a pattern recognition track based on the hit pattern, but was assigned the wrong charge.
Definition at line 311 of file TrackMatchLookUp.h.
|
inline |
Checks, if the pattern recognition track was matched to a Monte Carlo track but with the wrong charge.
Definition at line 228 of file TrackMatchLookUp.h.
|
inline |
Checks, if the Monte Carlo Track has been merged into another pattern recognition track and with the wrong charge.
Definition at line 338 of file TrackMatchLookUp.h.
|
private |
Name of the StoreArray of Monte Carlo tracks.
Definition at line 470 of file TrackMatchLookUp.h.
|
private |
Name of the StoreArray of Pattern recognition tracks.
Definition at line 473 of file TrackMatchLookUp.h.