Belle II Software development
ReassignedSecondaryMap Class Reference

CDCHit to color map indicating the reassignment to a different MCParticle. More...

#include <HitColorMapping.h>

Inheritance diagram for ReassignedSecondaryMap:
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.
 
virtual std::string info ()
 Informal string summarizing the translation from the object to the attribute value.
 
virtual std::string info ()
 Informal string summarizing the translation from the object to the attribute value.
 

Detailed Description

CDCHit to color map indicating the reassignment to a different MCParticle.

Definition at line 110 of file HitColorMapping.h.

Member Function Documentation

◆ info() [1/2]

virtual std::string info ( )
inlinevirtualinherited

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

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

Definition at line 37 of file Mapping.h.

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

◆ info() [2/2]

virtual std::string info ( )
inlinevirtualinherited

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

Reimplemented in BackgroundTagColorMap, MCParticleColorMap, MCPDGCodeColorMap, MCPrimaryColorMap, PosFlagColorMap, RLColorMap, 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 223 of file HitColorMapping.cc.

224{
225 RelationVector<MCParticle> relatedMCParticles =
226 hit.getRelationsWith<MCParticle>("MCParticles");
227 if (relatedMCParticles.size() == 0) {
228 return c_bkgHitColor;
229 } else {
230 double mcRelationWeight = relatedMCParticles.weight(0);
231 if (mcRelationWeight > 0) {
232 return "green";
233 } else {
234 return "red";
235 }
236 }
237}
size_t size() const
Get number of relations.
float weight(int index) const
Get weight with index.
RelationVector< T > getRelationsWith(const std::string &name="", const std::string &namedRelation="") const
Get the relations between this object and another store array.

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