Belle II Software development
TakenFlagColorMap Class Reference

CDCHit to color map highlighting the CDCHits that posses the do not use flag. More...

#include <HitColorMapping.h>

Inheritance diagram for TakenFlagColorMap:
Mapping< const CDCHit >

Public Member Functions

 TakenFlagColorMap ()
 Constructor checking if the CDCWireHits caring the taken flag are accessible.
 
std::string map (int index, const CDCHit &hit) override
 Function call to map the CDCHit id and object to a color.
 
virtual std::string info ()
 Informal string summarizing the translation from the object to the attribute value.
 

Private Attributes

StoreWrappedObjPtr< std::vector< CDCWireHit > > m_storedWireHits {"CDCWireHitVector"}
 Memory of the handle to the CDCWireHits on the DataStore.
 

Detailed Description

CDCHit to color map highlighting the CDCHits that posses the do not use flag.

Definition at line 47 of file HitColorMapping.h.

Constructor & Destructor Documentation

◆ TakenFlagColorMap()

Constructor checking if the CDCWireHits caring the taken flag are accessible.

Definition at line 69 of file HitColorMapping.cc.

70{
71 if (not m_storedWireHits) {
72 B2WARNING("CDCWireHitVector could not be found on the DataStore. Cannot plot the taken flags.");
73 }
74}
StoreWrappedObjPtr< std::vector< CDCWireHit > > m_storedWireHits
Memory of the handle to the CDCWireHits on the DataStore.

Member Function Documentation

◆ info()

virtual std::string info ( )
inlinevirtualinherited

Informal string summarizing the translation from the object to the attribute value.

Reimplemented in RLColorMap, PosFlagColorMap, BackgroundTagColorMap, MCParticleColorMap, MCPDGCodeColorMap, MCPrimaryColorMap, and SimHitPDGCodeColorMap.

Definition at line 37 of file Mapping.h.

38 {
39 return "(no info available)\n";
40 }

◆ 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 76 of file HitColorMapping.cc.

77{
78 if (m_storedWireHits) {
79 const std::vector<CDCWireHit>& wireHits = *m_storedWireHits;
80 ConstVectorRange<CDCWireHit> wireHitRange{std::equal_range(wireHits.begin(), wireHits.end(), hit)};
81
82 if (not wireHitRange.empty()) {
83 const CDCWireHit& wireHit = wireHitRange.front();
84 if (wireHit.getAutomatonCell().hasTakenFlag()) {
85 return "red";
86 }
87 }
88 }
89 return c_bkgHitColor;
90}
bool hasTakenFlag() const
Gets the current state of the taken marker flag.
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:55
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
Definition: CDCWireHit.h:286
A pair of iterators usable with the range base for loop.
Definition: Range.h:25

Member Data Documentation

◆ m_storedWireHits

StoreWrappedObjPtr<std::vector<CDCWireHit> > m_storedWireHits {"CDCWireHitVector"}
private

Memory of the handle to the CDCWireHits on the DataStore.

Definition at line 57 of file HitColorMapping.h.


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