Belle II Software development
DecayDescriptorParticle Class Reference

Represents a particle in the DecayDescriptor. More...

#include <DecayDescriptorParticle.h>

Public Member Functions

 DecayDescriptorParticle ()
 Default ctor.
 
 DecayDescriptorParticle (const DecayDescriptorParticle &)=default
 Want the default copy ctor.
 
DecayDescriptorParticleoperator= (const DecayDescriptorParticle &)=default
 Want the default assignment operator.
 
bool init (const DecayStringParticle &p)
 initialise member variables from std::string member variables contained in a DecayStringParticle struct.
 
std::string getName () const
 evt.pdl name of the particle.
 
std::string getFullName () const
 returns the full name of the particle full_name = name:label
 
std::string getNameSimple () const
 Return the name from getName() without + - * or anti-.
 
bool isSelected () const
 Is the particle selected in the decay string?
 
std::string getLabel () const
 The label of this particle, "default" returned, when no label set.
 
int getPDGCode () const
 Return PDG code.
 
int getProperty () const
 return property of the particle.
 
bool isUnspecified () const
 Is the particle unspecified?
 
bool isIgnoreMisID () const
 Check if misID shall be ignored.
 
bool isIgnoreDecayInFlight () const
 Check if decayInFlight shall be ignored.
 

Private Attributes

std::string m_strName
 evt.pdl name of the particle.
 
bool m_isSelected
 Is particle selected?
 
int m_properties
 Particle property.
 
std::string m_strLabel
 Label of this particle to distinguish e.g.
 
int m_iPDGCode
 PDG code of the decaying particle.
 

Detailed Description

Represents a particle in the DecayDescriptor.

It is used for mother and daughter particles.

User documentation is located at analysis/doc/DecayDescriptor.rst Please modify in accordingly to introduced changes.

Definition at line 27 of file DecayDescriptorParticle.h.

Constructor & Destructor Documentation

◆ DecayDescriptorParticle()

Default ctor.

Definition at line 20 of file DecayDescriptorParticle.cc.

20 :
21 m_strName(""),
22 m_isSelected(false),
23 m_properties(0),
24 m_strLabel(""),
25 m_iPDGCode(0)
26{}
std::string m_strLabel
Label of this particle to distinguish e.g.
bool m_isSelected
Is particle selected?
std::string m_strName
evt.pdl name of the particle.
int m_iPDGCode
PDG code of the decaying particle.

Member Function Documentation

◆ getFullName()

std::string getFullName ( ) const
inline

returns the full name of the particle full_name = name:label

Definition at line 59 of file DecayDescriptorParticle.h.

60 {
61 if (m_strLabel.empty())
62 return m_strName;
63 else
64 return m_strName + ":" + m_strLabel;
65 }

◆ getLabel()

std::string getLabel ( ) const
inline

The label of this particle, "default" returned, when no label set.

Definition at line 74 of file DecayDescriptorParticle.h.

75 {
76 return m_strLabel;
77 }

◆ getName()

std::string getName ( ) const
inline

evt.pdl name of the particle.

Definition at line 52 of file DecayDescriptorParticle.h.

53 {
54 return m_strName;
55 }

◆ getNameSimple()

string getNameSimple ( ) const

Return the name from getName() without + - * or anti-.

Definition at line 53 of file DecayDescriptorParticle.cc.

54{
55 string strNameSimple(m_strName);
56 erase_all(strNameSimple, "anti-");
57 erase_all(strNameSimple, "+");
58 erase_all(strNameSimple, "-");
59 erase_all(strNameSimple, "/");
60 erase_all(strNameSimple, "(");
61 erase_all(strNameSimple, ")");
62 replace_all(strNameSimple, "*", "ST");
63 replace_all(strNameSimple, "'", "p");
64 return strNameSimple;
65}

◆ getPDGCode()

int getPDGCode ( ) const
inline

Return PDG code.

Definition at line 79 of file DecayDescriptorParticle.h.

80 {
81 return m_iPDGCode;
82 }

◆ getProperty()

int getProperty ( ) const
inline

return property of the particle.

Definition at line 84 of file DecayDescriptorParticle.h.

85 {
86 return m_properties;
87 }

◆ init()

bool init ( const DecayStringParticle p)

initialise member variables from std::string member variables contained in a DecayStringParticle struct.

Definition at line 28 of file DecayDescriptorParticle.cc.

29{
30 // Set member variables from the information in the DecayStringParticle p
31 m_strName = p.m_strName;
32 if (!p.m_strSelector.empty()) {
33 m_isSelected = (p.m_strSelector.find('^') != std::string::npos);
34
35 if (p.m_strSelector.find('@') != std::string::npos)
37 if (p.m_strSelector.find("(misID)") != std::string::npos)
39 if (p.m_strSelector.find("(decay)") != std::string::npos)
41 }
42 if (!p.m_strLabel.empty()) m_strLabel = p.m_strLabel;
43 // Determine PDG code using the particle names defined in evt.pdl
44 TParticlePDG* particle = TDatabasePDG::Instance()->GetParticle(m_strName.c_str());
45 if (!particle) {
46 B2WARNING("Particle not in evt.pdl file! " << m_strName);
47 return false;
48 }
49 m_iPDGCode = particle->PdgCode();
50 return true;
51}
@ c_IsUnspecified
Ordinary particles.
Definition: Particle.h:118
@ c_IsIgnoreDecayInFlight
Is the particle MC matched with the ignore DecayInFlight flag set?
Definition: Particle.h:126
@ c_IsIgnoreMisID
Is the particle MC matched with the ignore MisID flag set?
Definition: Particle.h:125

◆ isIgnoreDecayInFlight()

bool isIgnoreDecayInFlight ( ) const
inline

Check if decayInFlight shall be ignored.

Definition at line 99 of file DecayDescriptorParticle.h.

◆ isIgnoreMisID()

bool isIgnoreMisID ( ) const
inline

Check if misID shall be ignored.

Definition at line 94 of file DecayDescriptorParticle.h.

◆ isSelected()

bool isSelected ( ) const
inline

Is the particle selected in the decay string?

Definition at line 69 of file DecayDescriptorParticle.h.

70 {
71 return m_isSelected;
72 }

◆ isUnspecified()

bool isUnspecified ( ) const
inline

Is the particle unspecified?

Definition at line 89 of file DecayDescriptorParticle.h.

Member Data Documentation

◆ m_iPDGCode

int m_iPDGCode
private

PDG code of the decaying particle.

Definition at line 38 of file DecayDescriptorParticle.h.

◆ m_isSelected

bool m_isSelected
private

Is particle selected?

Definition at line 32 of file DecayDescriptorParticle.h.

◆ m_properties

int m_properties
private

Particle property.

Flags are defined in Particle::PropertyFlags

Definition at line 34 of file DecayDescriptorParticle.h.

◆ m_strLabel

std::string m_strLabel
private

Label of this particle to distinguish e.g.

different decay channels or selection criteria.

Definition at line 36 of file DecayDescriptorParticle.h.

◆ m_strName

std::string m_strName
private

evt.pdl name of the particle.

Definition at line 30 of file DecayDescriptorParticle.h.


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