Belle II Software development
MCRecoTrackMatchingStatusColorMap Class Reference

Color mapping showing the match status of the monte carlo track. More...

#include <RecoTrackColorMapping.h>

Inheritance diagram for MCRecoTrackMatchingStatusColorMap:
Mapping< const RecoTrack >

Public Member Functions

std::string map (int index, const RecoTrack &recoTrack) override
 Function call to map a reco tracks object to a color.
 
std::string info () override
 Short description of the coloring scheme.
 

Detailed Description

Color mapping showing the match status of the monte carlo track.

Definition at line 39 of file RecoTrackColorMapping.h.

Member Function Documentation

◆ info()

std::string info ( )
overridevirtual

Short description of the coloring scheme.

Reimplemented from Mapping< const RecoTrack >.

Definition at line 86 of file RecoTrackColorMapping.cc.

87{
88 return "Matching status:\n green <-> match\n blue <-> merged\n red <-> missing.";
89}

◆ map()

std::string map ( int index,
const RecoTrack & recoTrack )
overridevirtual

Function call to map a reco tracks object to a color.

Reimplemented from Mapping< const RecoTrack >.

Definition at line 57 of file RecoTrackColorMapping.cc.

59{
60 const std::string mcRecoTrackStoreArrayName = "MCRecoTracks";
61 TrackMatchLookUp trackMatchLookUp(mcRecoTrackStoreArrayName);
62 using MCToPRMatchInfo = TrackMatchLookUp::MCToPRMatchInfo;
63 MCToPRMatchInfo mcMatchInfo = trackMatchLookUp.getMCToPRMatchInfo(recoTrack);
64 MCParticle* mcParticle = recoTrack.getRelatedTo<MCParticle>();
65 bool isPrimary = mcParticle->isPrimaryParticle();
66 switch (mcMatchInfo) {
67 case MCToPRMatchInfo::c_matched:
68 return isPrimary ? "green" : "limegreen";
69 break;
70
71 case MCToPRMatchInfo::c_merged:
72 return isPrimary ? "blue" : "cornflowerblue";
73 break;
74
75 case MCToPRMatchInfo::c_missing:
76 return isPrimary ? "darkred" : "crimson";
77 break;
78
79 default:
80 B2WARNING("Undefined matching status");
81 return c_bkgRecoTrackColor;
82 break;
83 }
84}
TO * getRelatedTo(const std::string &name="", const std::string &namedRelation="") const
Get the object to which this object has a relation.
MCToPRMatchInfo
Matching categories for the Monte Carlo tracks.
bool isPrimaryParticle() const
Check if particle is a primary particle which was created by the generator (and not,...
Definition MCParticle.h:585

The documentation for this class was generated from the following files: