Belle II Software development
UserInfo< Info, Payload > Class Template Reference

UserInfo class which is used to attach additional information to Geant4 particles and tracks. More...

#include <UserInfo.h>

Inheritance diagram for UserInfo< Info, Payload >:

Public Member Functions

 UserInfo (Payload data)
 The constructor of the user info class.
 
Payload getData ()
 Returns the payloaded data.
 
int getStatus ()
 Get status of optical photon (used for performance speed-ups) 0 initial 1 prescaled in StackingAction 2 quantum efficiency has been applied.
 
double getFraction ()
 Get optical photon propagation fraction (used for performance speed-ups) status=0: fraction=1 status=1: fraction=PhotonFraction as set in FullSim status=2: fraction=quantum efficiency.
 
MCParticleTrajectorygetTrajectory ()
 Get optional particle trajectory.
 
void setStatus (int status)
 Set status of optical photon (used for performance speed-ups)
 
void setFraction (double fraction)
 Store optical photon propagation fraction (used for performance speed-ups)
 
void setTrajectory (MCParticleTrajectory *trajectory)
 Set the optional particle trajectory.
 
virtual void Print () const
 Prints information, not implemented in this class.
 

Static Public Member Functions

template<class Carrier >
static Payload getInfo (Carrier &obj)
 Static function to just return UserInformation attached to the obj of type Carrier.
 

Protected Attributes

Payload m_data
 The data which is payloaded to the specified class.
 
int m_status
 optical photon: status
 
double m_fraction
 optical photon: propagation fraction
 
MCParticleTrajectorym_trajectory
 Particle trajectory, if any.
 

Detailed Description

template<class Info, class Payload>
class Belle2::Simulation::UserInfo< Info, Payload >

UserInfo class which is used to attach additional information to Geant4 particles and tracks.

This class is designed as a template based payload class.

Definition at line 36 of file UserInfo.h.

Constructor & Destructor Documentation

◆ UserInfo()

UserInfo ( Payload  data)
inlineexplicit

The constructor of the user info class.

Parameters
dataThe data which should be payloaded to the class.

Definition at line 44 of file UserInfo.h.

44: Info(), m_data(data), m_status(0), m_fraction(1.0), m_trajectory(nullptr) {}
MCParticleTrajectory * m_trajectory
Particle trajectory, if any.
Definition: UserInfo.h:113
int m_status
optical photon: status
Definition: UserInfo.h:111
double m_fraction
optical photon: propagation fraction
Definition: UserInfo.h:112
Payload m_data
The data which is payloaded to the specified class.
Definition: UserInfo.h:109

Member Function Documentation

◆ getData()

Payload getData ( )
inline

Returns the payloaded data.

Returns
The data added to the class.

Definition at line 50 of file UserInfo.h.

50{ return m_data; }

◆ getFraction()

double getFraction ( )
inline

Get optical photon propagation fraction (used for performance speed-ups) status=0: fraction=1 status=1: fraction=PhotonFraction as set in FullSim status=2: fraction=quantum efficiency.

Returns
fraction

Definition at line 68 of file UserInfo.h.

68{return m_fraction;}

◆ getInfo()

static Payload getInfo ( Carrier &  obj)
inlinestatic

Static function to just return UserInformation attached to the obj of type Carrier.

Throws an exception of type CouldNotFindUserInfo if no information was found.

Parameters
objReference to the carrier.
Returns
The data attached to the carrier.

Definition at line 100 of file UserInfo.h.

101 {
102 UserInfo<Info, Payload>* userinfo = dynamic_cast<UserInfo<Info, Payload>*>(obj.GetUserInformation());
103 if (!userinfo) throw(CouldNotFindUserInfo());
104 return userinfo->getData();
105 }

◆ getStatus()

int getStatus ( )
inline

Get status of optical photon (used for performance speed-ups) 0 initial 1 prescaled in StackingAction 2 quantum efficiency has been applied.

Returns
status

Definition at line 59 of file UserInfo.h.

59{return m_status;}

◆ getTrajectory()

MCParticleTrajectory * getTrajectory ( )
inline

Get optional particle trajectory.

Definition at line 71 of file UserInfo.h.

71{ return m_trajectory; }

◆ Print()

virtual void Print ( ) const
inlinevirtual

Prints information, not implemented in this class.

Definition at line 91 of file UserInfo.h.

91{;}

◆ setFraction()

void setFraction ( double  fraction)
inline

Store optical photon propagation fraction (used for performance speed-ups)

Parameters
fractionfraction

Definition at line 83 of file UserInfo.h.

83{ m_fraction = fraction;}

◆ setStatus()

void setStatus ( int  status)
inline

Set status of optical photon (used for performance speed-ups)

Parameters
statusstatus

Definition at line 77 of file UserInfo.h.

77{ m_status = status;}

◆ setTrajectory()

void setTrajectory ( MCParticleTrajectory trajectory)
inline

Set the optional particle trajectory.

Definition at line 86 of file UserInfo.h.

86{ m_trajectory = trajectory; }

Member Data Documentation

◆ m_data

Payload m_data
protected

The data which is payloaded to the specified class.

Definition at line 109 of file UserInfo.h.

◆ m_fraction

double m_fraction
protected

optical photon: propagation fraction

Definition at line 112 of file UserInfo.h.

◆ m_status

int m_status
protected

optical photon: status

Definition at line 111 of file UserInfo.h.

◆ m_trajectory

MCParticleTrajectory* m_trajectory
protected

Particle trajectory, if any.

Definition at line 113 of file UserInfo.h.


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