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< T >

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.
 
virtual std::string map (int index, T &t)
 Main function returning an attribute value for an object at the given index.
 

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< T >.

Definition at line 86 of file RecoTrackColorMapping.cc.

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

◆ map() [1/2]

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

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

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}
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:32
TO * getRelatedTo(const std::string &name="", const std::string &namedRelation="") const
Get the object to which this object has a relation.
Class to provide convenient methods to look up matching information between pattern recognition and M...
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:595

◆ map() [2/2]

virtual std::string map ( int  index,
T &  t 
)
inlinevirtualinherited

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