Belle II Software development
PosFlagColorMap Class Reference

CDCHit to color map by their associated CDCSimHit::getPosFlag property. More...

#include <HitColorMapping.h>

Inheritance diagram for PosFlagColorMap:
Mapping< const CDCHit >

Public Member Functions

std::string map (int index, const CDCHit &hit) override
 Function call to map the CDCHit id and object to a color.
 
std::string info () override
 Informal string summarizing the translation from CDCSimHit::getPosFlag variable to colors.
 

Detailed Description

CDCHit to color map by their associated CDCSimHit::getPosFlag property.

Definition at line 73 of file HitColorMapping.h.

Member Function Documentation

◆ info()

std::string info ( )
overridevirtual

Informal string summarizing the translation from CDCSimHit::getPosFlag variable to colors.

Reimplemented from Mapping< const CDCHit >.

Definition at line 124 of file HitColorMapping.cc.

125{
126 return "PosFlag variable of the related CDCSimHit: green <-> 0 (Right), red <-> 1 (Left), orange <-> determinable.\n";
127}

◆ map()

std::string map ( int index,
const CDCHit & hit )
overridevirtual

Function call to map the CDCHit id and object to a color.

Reimplemented from Mapping< const CDCHit >.

Definition at line 111 of file HitColorMapping.cc.

112{
113 CDCSimHit* simHit = hit.getRelated<CDCSimHit>("CDCSimHits");
114 int posFlag = simHit->getPosFlag();
115 if (posFlag == 0) {
116 return ("green"); // right
117 } else if (posFlag == 1) {
118 return ("red"); // left
119 } else {
120 return (c_bkgHitColor);
121 }
122}
int getPosFlag() const
The method to get old left/right info.
Definition CDCSimHit.h:222
T * getRelated(const std::string &name="", const std::string &namedRelation="") const
Get the object to or from which this object has a relation.

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