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.
 

Detailed Description

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

Definition at line 108 of file HitColorMapping.h.

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

223{
224 RelationVector<MCParticle> relatedMCParticles =
225 hit.getRelationsWith<MCParticle>("MCParticles");
226 if (relatedMCParticles.size() == 0) {
227 return c_bkgHitColor;
228 } else {
229 double mcRelationWeight = relatedMCParticles.weight(0);
230 if (mcRelationWeight > 0) {
231 return "green";
232 } else {
233 return "red";
234 }
235 }
236}
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:32
Class for type safe access to objects that are referred to in relations.
size_t size() const
Get number of relations.
float weight(int index) const
Get weight with index.

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