 |
Belle II Software
release-05-02-19
|
10 #include <tracking/trackFindingCDC/display/SegmentColorMapping.h>
12 #include <tracking/trackFindingCDC/display/Colors.h>
13 #include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
14 #include <tracking/trackFindingCDC/mclookup/CDCMCSegment2DLookUp.h>
16 #include <framework/logging/Logger.h>
19 using namespace TrackFindingCDC;
21 const std::string c_bkgSegmentColor =
"orange";
24 std::string inTrackIdToColor(
int inTrackId)
31 : m_colors(
Colors::getList())
39 ITrackType mcTrackId = mcSegmentLookUp.
getMCTrackId(&segment);
42 return c_bkgSegmentColor;
44 int m_iColor = mcTrackId %
m_colors.size();
53 ITrackType mcTrackId = mcSegmentLookUp.
getMCTrackId(&segment);
55 if (mcTrackId < 0)
return c_bkgSegmentColor;
57 if (fbInfo == EForwardBackward::c_Forward) {
59 }
else if (fbInfo == EForwardBackward::c_Backward) {
62 B2INFO(
"Segment not orientable to match track");
63 return c_bkgSegmentColor;
73 if (firstInTrackId < 0)
return c_bkgSegmentColor;
74 return inTrackIdToColor(firstInTrackId);
83 if (lastInTrackId < 0)
return c_bkgSegmentColor;
84 return inTrackIdToColor(lastInTrackId);
93 if (firstNPassedSuperLayers < 0)
return c_bkgSegmentColor;
94 return inTrackIdToColor(firstNPassedSuperLayers);
103 if (lastNPassedSuperLayers < 0)
return c_bkgSegmentColor;
104 return inTrackIdToColor(lastNPassedSuperLayers);
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 getFirstNPassedSuperLayers(const ACDCHitCollection *ptrHits) const
Getter for number of passed superlayer till the first hit the collection of hits which has the Monte ...
std::vector< std::string > m_colors
List of colors to be cycled through.
Specialisation of the lookup for the truth values of two dimensional segments.
EForwardBackward
Enumeration to represent the distinct possibilities of the right left passage information.
ITrackType getMCTrackId(const ACDCHitCollection *ptrHits) const
Getter for the Monte Carlo track id matched to this collection of hits.
static const CDCMCSegment2DLookUp & getInstance()
Getter for the singletone instance.
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::string map(int index, const CDCSegment2D &segment) override
Function call to map a segments object from the local finder to a color.
Abstract base class for different kinds of events.
EForwardBackward isForwardOrBackwardToMCTrack(const ACDCHitCollection *ptrHits) const
Returns the orientation of the collection of hits relative to its matched track.
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...
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.
A reconstructed sequence of two dimensional hits in one super layer.
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.
static std::string getWheelColor(int degree)
Get a color from the wheel of colors.
Utility functions related to colors.
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...