Belle II Software development
MCPrimaryColorMap Class Reference

CDCHit to color map by the isPrimary information as well as the secondary process type in case the particle is not primary. More...

#include <HitColorMapping.h>

Inheritance diagram for MCPrimaryColorMap:
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 secondary process codes to colors.
 

Detailed Description

CDCHit to color map by the isPrimary information as well as the secondary process type in case the particle is not primary.

Definition at line 150 of file HitColorMapping.h.

Member Function Documentation

◆ info()

std::string info ( )
overridevirtual

Informal string summarizing the translation from secondary process codes to colors.

Reimplemented from Mapping< const CDCHit >.

Definition at line 326 of file HitColorMapping.cc.

327{
328 return "Legend:\n"
329 "blue->primary\n"
330 "green->secondary decay in flight\n"
331 "orange->beam background\n";
332}

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

307{
308 MCParticle* mcParticle = hit.getRelated<MCParticle>("MCParticles");
309 if (mcParticle != nullptr) {
310 unsigned short int primaryFlag = 1;
311 bool isPrimary = mcParticle->hasStatus(primaryFlag);
312 int secondaryProcess = mcParticle->getSecondaryPhysicsProcess();
313
314 if (isPrimary) {
315 return "blue";
316 } else if (secondaryProcess > 200) {
317 return "green"; // decay in flight
318 } else {
319 return "red";
320 }
321 } else {
322 return c_bkgHitColor;
323 }
324}
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:32
bool hasStatus(unsigned short int bitmask) const
Return if specific status bit is set.
Definition: MCParticle.h:129
int getSecondaryPhysicsProcess() const
Returns the physics process type of a secondary particle.
Definition: MCParticle.h:297

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