8#include <tracking/trackFindingCDC/display/SegmentColorMapping.h>
10#include <tracking/trackFindingCDC/display/Colors.h>
11#include <tracking/trackingUtilities/eventdata/segments/CDCSegment2D.h>
12#include <tracking/trackFindingCDC/mclookup/CDCMCSegment2DLookUp.h>
14#include <framework/logging/Logger.h>
17using namespace TrackFindingCDC;
18using namespace TrackingUtilities;
20const std::string c_bkgSegmentColor =
"orange";
23 std::string inTrackIdToColor(
int inTrackId)
38 ITrackType mcTrackId = mcSegmentLookUp.
getMCTrackId(&segment);
41 return c_bkgSegmentColor;
43 int m_iColor = mcTrackId %
m_colors.size();
52 ITrackType mcTrackId = mcSegmentLookUp.
getMCTrackId(&segment);
54 if (mcTrackId < 0)
return c_bkgSegmentColor;
56 if (fbInfo == EForwardBackward::c_Forward) {
58 }
else if (fbInfo == EForwardBackward::c_Backward) {
61 B2INFO(
"Segment not orientable to match track");
62 return c_bkgSegmentColor;
72 if (firstInTrackId < 0)
return c_bkgSegmentColor;
73 return inTrackIdToColor(firstInTrackId);
82 if (lastInTrackId < 0)
return c_bkgSegmentColor;
83 return inTrackIdToColor(lastInTrackId);
92 if (firstNPassedSuperLayers < 0)
return c_bkgSegmentColor;
93 return inTrackIdToColor(firstNPassedSuperLayers);
102 if (lastNPassedSuperLayers < 0)
return c_bkgSegmentColor;
103 return inTrackIdToColor(lastNPassedSuperLayers);
TrackingUtilities::Index getFirstInTrackId(const ACDCHitCollection *ptrHits) const
Getter for in track id for the first hit in the collection of hits which has the Monte Carlo track id...
ITrackType getMCTrackId(const ACDCHitCollection *ptrHits) const
Getter for the Monte Carlo track id matched to this collection of hits.
TrackingUtilities::EForwardBackward isForwardOrBackwardToMCTrack(const ACDCHitCollection *ptrHits) const
Returns the orientation of the collection of hits relative to its matched track.
TrackingUtilities::Index getLastNPassedSuperLayers(const ACDCHitCollection *ptrHits) const
Getter for number of passed superlayer till the last hit the collection of hits which has the Monte C...
TrackingUtilities::Index getFirstNPassedSuperLayers(const ACDCHitCollection *ptrHits) const
Getter for number of passed superlayer till the first hit the collection of hits which has the Monte ...
TrackingUtilities::Index getLastInTrackId(const ACDCHitCollection *ptrHits) const
Getter for in track id for the last hit in the collection of hits which has the Monte Carlo track id ...
Specialisation of the lookup for the truth values of two dimensional segments.
static const CDCMCSegment2DLookUp & getInstance()
Getter for the singletone instance.
Utility functions related to colors.
static std::string getWheelColor(int degree)
Get a color from the wheel of colors.
std::string map(int index, const TrackingUtilities::CDCSegment2D &segment) override
Function call to map a segments object from the local finder to a color.
std::string map(int index, const TrackingUtilities::CDCSegment2D &segment) override
Function call to map a segments object from the local finder to a color.
std::string map(int index, const TrackingUtilities::CDCSegment2D &segment) override
Function call to map a segments object from the local finder to a color.
std::string map(int index, const TrackingUtilities::CDCSegment2D &segment) override
Function call to map a segments object from the local finder to a color.
std::string map(int index, const TrackingUtilities::CDCSegment2D &segment) override
Function call to map a segments object from the local finder to a color.
std::string map(int index, const TrackingUtilities::CDCSegment2D &segment) override
Function call to map a segments object from the local finder to a color.
SegmentMCTrackIdColorMap()
Constructor.
std::vector< std::string > m_colors
List of colors to be cycled through.
A reconstructed sequence of two dimensional hits in one super layer.
Abstract base class for different kinds of events.