8#include <tracking/trackFindingCDC/display/SegmentColorMapping.h>
10#include <tracking/trackFindingCDC/display/Colors.h>
11#include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
12#include <tracking/trackFindingCDC/mclookup/CDCMCSegment2DLookUp.h>
14#include <framework/logging/Logger.h>
17using namespace TrackFindingCDC;
19const std::string c_bkgSegmentColor =
"orange";
22 std::string inTrackIdToColor(
int inTrackId)
29 : m_colors(
Colors::getList())
37 ITrackType mcTrackId = mcSegmentLookUp.
getMCTrackId(&segment);
40 return c_bkgSegmentColor;
42 int m_iColor = mcTrackId %
m_colors.size();
51 ITrackType mcTrackId = mcSegmentLookUp.
getMCTrackId(&segment);
53 if (mcTrackId < 0)
return c_bkgSegmentColor;
55 if (fbInfo == EForwardBackward::c_Forward) {
57 }
else if (fbInfo == EForwardBackward::c_Backward) {
60 B2INFO(
"Segment not orientable to match track");
61 return c_bkgSegmentColor;
71 if (firstInTrackId < 0)
return c_bkgSegmentColor;
72 return inTrackIdToColor(firstInTrackId);
81 if (lastInTrackId < 0)
return c_bkgSegmentColor;
82 return inTrackIdToColor(lastInTrackId);
91 if (firstNPassedSuperLayers < 0)
return c_bkgSegmentColor;
92 return inTrackIdToColor(firstNPassedSuperLayers);
101 if (lastNPassedSuperLayers < 0)
return c_bkgSegmentColor;
102 return inTrackIdToColor(lastNPassedSuperLayers);
EForwardBackward isForwardOrBackwardToMCTrack(const ACDCHitCollection *ptrHits) const
Returns the orientation of the collection of hits relative to its matched track.
ITrackType getMCTrackId(const ACDCHitCollection *ptrHits) const
Getter for the Monte Carlo track id matched to this collection of hits.
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...
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 ...
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...
Index getFirstNPassedSuperLayers(const ACDCHitCollection *ptrHits) const
Getter for number of passed superlayer till the first hit the collection of hits which has the Monte ...
Specialisation of the lookup for the truth values of two dimensional segments.
static const CDCMCSegment2DLookUp & getInstance()
Getter for the singletone instance.
A reconstructed sequence of two dimensional hits in one super layer.
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 CDCSegment2D &segment) override
Function call to map a segments object from the local finder to a color.
std::string map(int index, const CDCSegment2D &segment) override
Function call to map a segments object from the local finder to a color.
std::string map(int index, const CDCSegment2D &segment) override
Function call to map a segments object from the local finder to a color.
std::string map(int index, const CDCSegment2D &segment) override
Function call to map a segments object from the local finder to a color.
std::string map(int index, const CDCSegment2D &segment) override
Function call to map a segments object from the local finder to a color.
SegmentMCTrackIdColorMap()
Constructor.
std::string map(int index, const CDCSegment2D &segment) override
Function call to map a segments object from the local finder to a color.
std::vector< std::string > m_colors
List of colors to be cycled through.
EForwardBackward
Enumeration to represent the distinct possibilities of the right left passage information.
Abstract base class for different kinds of events.