eic-smear  1.0.3
A collection of ROOT classes for Monte Carlo events and a fast-smearing code simulating detector effects for the Electron-Ion Collider task force
erhic::Pid Class Reference

Particle identity. More...

#include <Pid.h>

Public Member Functions

 Pid (Int_t pdg=Pid::InvalidCode())
 Constructor. More...
 
virtual ~Pid ()
 Destructor. More...
 
Int_t Code () const
 Returns the PDG code, an integer. More...
 
void Set (Int_t pdg)
 Sets the integer PDG code. More...
 
TParticlePDG * Info () const
 Returns the particle information object corresponding to this PDG code. More...
 
 operator Int_t () const
 Type conversion operator to integer PDG code. More...
 
bool operator== (Int_t i) const
 Comparison operator with integer. More...
 
bool operator< (Int_t i) const
 Comparison operator with integer. More...
 
bool operator> (Int_t i) const
 Comparison operator with integer. More...
 
bool operator!= (Int_t i) const
 Comparison operator with integer. More...
 
bool operator<= (Int_t i) const
 Comparison operator with integer. More...
 
bool operator>= (Int_t i) const
 Comparison operator with integer. More...
 

Static Public Member Functions

static Int_t InvalidCode ()
 Returns a code indicating 'not valid'. More...
 

Protected Attributes

Int_t mCode
 The integer PDG code. More...
 

Detailed Description

Particle identity.

Definition at line 22 of file Pid.h.

Constructor & Destructor Documentation

◆ Pid()

erhic::Pid::Pid ( Int_t  pdg = Pid::InvalidCode())

Constructor.

Parameters
[in]pdgThe particle's PDG code, an integer

Definition at line 20 of file Pid.cxx.

◆ ~Pid()

erhic::Pid::~Pid ( )
virtual

Destructor.

Definition at line 24 of file Pid.cxx.

Member Function Documentation

◆ Code()

Int_t erhic::Pid::Code ( ) const
inline

Returns the PDG code, an integer.

Definition at line 105 of file Pid.h.

◆ Info()

TParticlePDG * erhic::Pid::Info ( ) const

Returns the particle information object corresponding to this PDG code.

TODO May need to cache TParticlePDG* if performance proves too slow with database lookup upon each call.

From this, properties such as particle name, charge and mass can be accessed.

Definition at line 31 of file Pid.cxx.

◆ InvalidCode()

Int_t erhic::Pid::InvalidCode ( )
static

Returns a code indicating 'not valid'.

Use this value to consistently indicate particles without an ID number.

Definition at line 44 of file Pid.cxx.

◆ operator Int_t()

erhic::Pid::operator Int_t ( ) const
inline

Type conversion operator to integer PDG code.

int i = Pid(211) is equivalent to int i = Pid(211).Code();

Definition at line 103 of file Pid.h.

◆ operator!=()

bool erhic::Pid::operator!= ( Int_t  i) const
inline

Comparison operator with integer.

Compares the argument with this object's integer PDG code.

Definition at line 115 of file Pid.h.

◆ operator<()

bool erhic::Pid::operator< ( Int_t  i) const
inline

Comparison operator with integer.

Compares the argument with this object's integer PDG code.

Definition at line 111 of file Pid.h.

◆ operator<=()

bool erhic::Pid::operator<= ( Int_t  i) const
inline

Comparison operator with integer.

Compares the argument with this object's integer PDG code.

Definition at line 117 of file Pid.h.

◆ operator==()

bool erhic::Pid::operator== ( Int_t  i) const
inline

Comparison operator with integer.

Compares the argument with this object's integer PDG code.

Definition at line 109 of file Pid.h.

◆ operator>()

bool erhic::Pid::operator> ( Int_t  i) const
inline

Comparison operator with integer.

Compares the argument with this object's integer PDG code.

Definition at line 113 of file Pid.h.

◆ operator>=()

bool erhic::Pid::operator>= ( Int_t  i) const
inline

Comparison operator with integer.

Compares the argument with this object's integer PDG code.

Definition at line 119 of file Pid.h.

◆ Set()

void erhic::Pid::Set ( Int_t  pdg)
inline

Sets the integer PDG code.

Parameters
[in]pdgThe particle's PDG code, an integer

Definition at line 107 of file Pid.h.

Member Data Documentation

◆ mCode

Int_t erhic::Pid::mCode
protected

The integer PDG code.

Definition at line 98 of file Pid.h.


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