The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
Gaudi::Decays::Decay::Item Class Referencefinal

the helper representation of the item in the decay chain More...

#include </builds/gaudi/Gaudi/GaudiPartProp/include/Gaudi/Decays/Decay.h>

Collaboration diagram for Gaudi::Decays::Decay::Item:

Public Member Functions

 Item (const Gaudi::ParticleProperty *pp=0)
 the constructor from the particle property
 Item (const std::string &name)
 the constructor from the particle name
 Item (const Gaudi::ParticleID &pid)
 the constructor from the particle PID
const std::string & name () const
 get the particle name
const Gaudi::ParticleID & pid () const
 get the particle PID
const Gaudi::ParticleProperty * pp () const
 get the particle property
std::ostream & fillStream (std::ostream &s) const
 the default printout
StatusCode validate (const Gaudi::Interfaces::IParticlePropertySvc *svc) const
 validate the item using the service
StatusCode validate (const Gaudi::ParticleProperty *prop) const
 validate the item using the particle property object

Private Attributes

std::string m_name
 the particle name
Gaudi::ParticleID m_pid
 the particle PID
const Gaudi::ParticleProperty * m_pp = nullptr
 the source of properties

Detailed Description

the helper representation of the item in the decay chain

Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@n.nosp@m.ikhe.nosp@m.f.nl
Date
2008-03-31

Definition at line 39 of file Decay.h.

Constructor & Destructor Documentation

◆ Item() [1/3]

Gaudi::Decays::Decay::Item::Item ( const Gaudi::ParticleProperty * pp = 0)

the constructor from the particle property

Definition at line 24 of file Decay.cpp.

24 : m_pp( pp ) {
25 if ( m_pp ) {
26 m_name = m_pp->particle();
27 m_pid = m_pp->particleID();
28 }
29}
std::string m_name
the particle name
Definition Decay.h:65
const Gaudi::ParticleProperty * pp() const
get the particle property
Definition Decay.h:53
Gaudi::ParticleID m_pid
the particle PID
Definition Decay.h:67
const Gaudi::ParticleProperty * m_pp
the source of properties
Definition Decay.h:69

◆ Item() [2/3]

Gaudi::Decays::Decay::Item::Item ( const std::string & name)

the constructor from the particle name

Definition at line 31 of file Decay.cpp.

31: m_name( name ) {}
const std::string & name() const
get the particle name
Definition Decay.h:49

◆ Item() [3/3]

Gaudi::Decays::Decay::Item::Item ( const Gaudi::ParticleID & pid)

the constructor from the particle PID

Definition at line 33 of file Decay.cpp.

33: m_pid( pid ) {}
const Gaudi::ParticleID & pid() const
get the particle PID
Definition Decay.h:51

Member Function Documentation

◆ fillStream()

std::ostream & Gaudi::Decays::Decay::Item::fillStream ( std::ostream & s) const

the default printout

Definition at line 114 of file Decay.cpp.

114 {
115 if ( m_name.empty() ) {
116 if ( m_pp ) {
117 m_name = m_pp->particle();
118 } else if ( Gaudi::ParticleID() != m_pid ) {
119 return s << ' ' << m_pid.pid() << ' ';
120 } else {
121 return s << " ? ";
122 }
123 }
124 return s << ' ' << m_name << ' ';
125}

◆ name()

const std::string & Gaudi::Decays::Decay::Item::name ( ) const
inline

get the particle name

Definition at line 49 of file Decay.h.

49{ return m_name; }

◆ pid()

const Gaudi::ParticleID & Gaudi::Decays::Decay::Item::pid ( ) const
inline

get the particle PID

Definition at line 51 of file Decay.h.

51{ return m_pid; }

◆ pp()

const Gaudi::ParticleProperty * Gaudi::Decays::Decay::Item::pp ( ) const
inline

get the particle property

Definition at line 53 of file Decay.h.

53{ return m_pp; }

◆ validate() [1/2]

StatusCode Gaudi::Decays::Decay::Item::validate ( const Gaudi::Interfaces::IParticlePropertySvc * svc) const

validate the item using the service

Definition at line 35 of file Decay.cpp.

35 {
36 if ( m_pp ) {
37 m_name = m_pp->particle();
38 m_pid = m_pp->particleID();
40 }
41 // it not possible to validate it!
42 if ( 0 == svc ) { return StatusCode::FAILURE; }
43 // check by name
44 if ( !m_name.empty() ) {
45 m_pp = svc->find( m_name );
46 if ( !m_pp ) { return StatusCode::FAILURE; }
47 m_pid = m_pp->particleID();
49 }
50 // check by PID
51 if ( Gaudi::ParticleID() != m_pid ) {
52 m_pp = svc->find( m_pid );
53 if ( !m_pp ) { return StatusCode::FAILURE; }
54 m_name = m_pp->particle();
56 }
58}
virtual const ParticleProperty * find(const std::string &name) const =0
Retrieve an object by name:
constexpr static const auto SUCCESS
Definition StatusCode.h:99
constexpr static const auto FAILURE
Definition StatusCode.h:100

◆ validate() [2/2]

StatusCode Gaudi::Decays::Decay::Item::validate ( const Gaudi::ParticleProperty * prop) const

validate the item using the particle property object

Definition at line 60 of file Decay.cpp.

60 {
61 if ( m_pp && !pp ) {
62 m_name = m_pp->particle();
63 m_pid = m_pp->particleID();
65 } else if ( pp ) {
66 m_pp = pp;
67 m_name = m_pp->particle();
68 m_pid = m_pp->particleID();
70 }
72}

Member Data Documentation

◆ m_name

std::string Gaudi::Decays::Decay::Item::m_name
mutableprivate

the particle name

Definition at line 65 of file Decay.h.

◆ m_pid

Gaudi::ParticleID Gaudi::Decays::Decay::Item::m_pid
mutableprivate

the particle PID

Definition at line 67 of file Decay.h.

◆ m_pp

const Gaudi::ParticleProperty* Gaudi::Decays::Decay::Item::m_pp = nullptr
mutableprivate

the source of properties

Definition at line 69 of file Decay.h.


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