The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
Gaudi::Decays::Decay Class Referencefinal

The simple representation of "simple 1-step" decay (there are no trees! More...

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

Collaboration diagram for Gaudi::Decays::Decay:

Classes

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

Public Types

typedef std::vector< ItemItems
 the vector of items (the obvious representation of daughter particles)
 

Public Member Functions

 Decay ()=default
 
 Decay (const Gaudi::ParticleProperty *mother, const std::vector< const Gaudi::ParticleProperty * > &daughters)
 the constructor from mother and daughters
 
 Decay (const std::string &mother, const std::vector< std::string > &daughters)
 the constructor from mother and daughters
 
 Decay (const Gaudi::ParticleID &mother, const std::vector< Gaudi::ParticleID > &daughters)
 the constructor from mother and daughters
 
 Decay (const Item &mother, const std::vector< Item > &daughters)
 the constructor from mother and daughters
 
const Itemmother () const
 get the mother(head) of the decay
 
const Itemsdaughters () const
 get all daughters
 
const Itemschildren () const
 get all daughters
 
size_t nDaughters () const
 get the number of daughters
 
size_t nChildren () const
 get the number of daughters
 
const Itemoperator() (const unsigned int index) const
 get the component by the number
 
const Itemoperator[] (const unsigned int index) const
 get the component by the number
 
void setMother (const Item &mom)
 set the mother
 
void setMother (const Gaudi::ParticleProperty *mom)
 set the mother
 
void setMother (const std::string &mom)
 set the mother
 
void setMother (const Gaudi::ParticleID &mom)
 set the mother
 
void setDaughters (const Items &daugs)
 set the daughters
 
void setDaughters (const std::vector< const Gaudi::ParticleProperty * > &daugs)
 set the daughters
 
void setDaughters (const std::vector< std::string > &daugs)
 set the daughters
 
void setDaughters (const std::vector< Gaudi::ParticleID > &daugs)
 set the daughters
 
void setChildren (const Items &daugs)
 set the daughters
 
void setChildren (const std::vector< const Gaudi::ParticleProperty * > &daugs)
 set the daughters
 
void setChildren (const std::vector< std::string > &daugs)
 set the daughters
 
void setChidlren (const std::vector< Gaudi::ParticleID > &daugs)
 set the daughters
 
Decayoperator+= (const std::string &child)
 add the child
 
Decayoperator+= (const Gaudi::ParticleID &child)
 add the child
 
Decayoperator+= (const Gaudi::ParticleProperty *child)
 add the child
 
Decayoperator+= (const Item &child)
 add the child
 
StatusCode validate (const Gaudi::Interfaces::IParticlePropertySvc *svc) const
 validate the decay using the service
 
std::ostream & fillStream (std::ostream &s) const
 the default printout
 
std::string toString () const
 the conversion to the string
 

Public Attributes

Item m_mother
 the head of the decay
 
Items m_daughters
 the daughter particles
 

Detailed Description

The simple representation of "simple 1-step" decay (there are no trees!

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 32 of file Decay.h.

Member Typedef Documentation

◆ Items

typedef std::vector<Item> Gaudi::Decays::Decay::Items

the vector of items (the obvious representation of daughter particles)

Definition at line 73 of file Decay.h.

Constructor & Destructor Documentation

◆ Decay() [1/5]

Gaudi::Decays::Decay::Decay ( )
default

◆ Decay() [2/5]

Gaudi::Decays::Decay::Decay ( const Gaudi::ParticleProperty * mother,
const std::vector< const Gaudi::ParticleProperty * > & daughters )

the constructor from mother and daughters

Parameters
motherthe mother
daughtersthe daughters

Definition at line 74 of file Decay.cpp.

76 : m_mother( mother ) {
78}
void setDaughters(const Items &daugs)
set the daughters
Definition Decay.cpp:148
const Item & mother() const
get the mother(head) of the decay
Definition Decay.h:104
const Items & daughters() const
get all daughters
Definition Decay.h:106
Item m_mother
the head of the decay
Definition Decay.h:169

◆ Decay() [3/5]

Gaudi::Decays::Decay::Decay ( const std::string & mother,
const std::vector< std::string > & daughters )

the constructor from mother and daughters

Parameters
motherthe mother
daughtersthe daughters

Definition at line 80 of file Decay.cpp.

80 : m_mother( mother ) {
82}

◆ Decay() [4/5]

Gaudi::Decays::Decay::Decay ( const Gaudi::ParticleID & mother,
const std::vector< Gaudi::ParticleID > & daughters )

the constructor from mother and daughters

Parameters
motherthe mother
daughtersthe daughters

Definition at line 84 of file Decay.cpp.

85 : m_mother( mother ) {
87}

◆ Decay() [5/5]

Gaudi::Decays::Decay::Decay ( const Item & mother,
const std::vector< Item > & daughters )

the constructor from mother and daughters

Parameters
motherthe mother
daughtersthe daughters

Definition at line 89 of file Decay.cpp.

Items m_daughters
the daughter particles
Definition Decay.h:171

Member Function Documentation

◆ children()

const Items & Gaudi::Decays::Decay::children ( ) const
inline

get all daughters

Definition at line 108 of file Decay.h.

108{ return daughters(); }

◆ daughters()

const Items & Gaudi::Decays::Decay::daughters ( ) const
inline

get all daughters

Definition at line 106 of file Decay.h.

106{ return m_daughters; }

◆ fillStream()

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

the default printout

Definition at line 105 of file Decay.cpp.

105 {
106 m_mother.fillStream( s );
107 if ( m_daughters.empty() ) { return s; }
108 s << "->";
109 // loop over daughters
110 for ( const auto& dau : m_daughters ) { dau.fillStream( s ); }
111 return s;
112}

◆ mother()

const Item & Gaudi::Decays::Decay::mother ( ) const
inline

get the mother(head) of the decay

Definition at line 104 of file Decay.h.

104{ return m_mother; }

◆ nChildren()

size_t Gaudi::Decays::Decay::nChildren ( ) const
inline

get the number of daughters

Definition at line 112 of file Decay.h.

112{ return m_daughters.size(); }

◆ nDaughters()

size_t Gaudi::Decays::Decay::nDaughters ( ) const
inline

get the number of daughters

Definition at line 110 of file Decay.h.

110{ return m_daughters.size(); }

◆ operator()()

const Decays::Decay::Item & Gaudi::Decays::Decay::operator() ( const unsigned int index) const

get the component by the number

Attention
index 0 corresponds to the mother particle
Parameters
indexthe index (0 corresponds to the mother particle)
Returns
the component

Definition at line 166 of file Decay.cpp.

166 {
167 if ( 0 == index ) { return m_mother; }
168 return m_daughters[index - 1];
169}
size_t index(const Gaudi::ParticleProperty *property, const Gaudi::Interfaces::IParticlePropertySvc *service)
helper utility for mapping of Gaudi::ParticleProperty object into non-negative integral sequential id...

◆ operator+=() [1/4]

Decays::Decay & Gaudi::Decays::Decay::operator+= ( const Gaudi::ParticleID & child)

add the child

Definition at line 152 of file Decay.cpp.

152{ return ( *this ) += Item( child ); }
the helper representation of the item in the decay chain
Definition Decay.h:39

◆ operator+=() [2/4]

Decays::Decay & Gaudi::Decays::Decay::operator+= ( const Gaudi::ParticleProperty * child)

add the child

Definition at line 154 of file Decay.cpp.

154{ return ( *this ) += Item( child ); }

◆ operator+=() [3/4]

Decays::Decay & Gaudi::Decays::Decay::operator+= ( const Item & child)

add the child

Definition at line 156 of file Decay.cpp.

156 {
157 m_daughters.push_back( child );
158 return *this;
159}

◆ operator+=() [4/4]

Decays::Decay & Gaudi::Decays::Decay::operator+= ( const std::string & child)

add the child

Definition at line 150 of file Decay.cpp.

150{ return ( *this ) += Item( child ); }

◆ operator[]()

const Item & Gaudi::Decays::Decay::operator[] ( const unsigned int index) const
inline

get the component by the number

Attention
index 0 corresponds to th emother particle
Parameters
indexthe index (0 corresponds to the mother particle)
Returns
the component

Definition at line 124 of file Decay.h.

124{ return ( *this )( index ); }

◆ setChidlren()

void Gaudi::Decays::Decay::setChidlren ( const std::vector< Gaudi::ParticleID > & daugs)
inline

set the daughters

Definition at line 149 of file Decay.h.

149{ setDaughters( daugs ); }

◆ setChildren() [1/3]

void Gaudi::Decays::Decay::setChildren ( const Items & daugs)
inline

set the daughters

Definition at line 143 of file Decay.h.

143{ setDaughters( daugs ); }

◆ setChildren() [2/3]

void Gaudi::Decays::Decay::setChildren ( const std::vector< const Gaudi::ParticleProperty * > & daugs)
inline

set the daughters

Definition at line 145 of file Decay.h.

145{ setDaughters( daugs ); }

◆ setChildren() [3/3]

void Gaudi::Decays::Decay::setChildren ( const std::vector< std::string > & daugs)
inline

set the daughters

Definition at line 147 of file Decay.h.

147{ setDaughters( daugs ); }

◆ setDaughters() [1/4]

void Gaudi::Decays::Decay::setDaughters ( const Items & daugs)

set the daughters

Definition at line 148 of file Decay.cpp.

148{ m_daughters = daugs; }

◆ setDaughters() [2/4]

void Gaudi::Decays::Decay::setDaughters ( const std::vector< const Gaudi::ParticleProperty * > & daugs)

set the daughters

Definition at line 133 of file Decay.cpp.

133 {
134 m_daughters.clear();
135 for ( const auto& pp : daugs ) *this += pp;
136}

◆ setDaughters() [3/4]

void Gaudi::Decays::Decay::setDaughters ( const std::vector< Gaudi::ParticleID > & daugs)

set the daughters

Definition at line 143 of file Decay.cpp.

143 {
144 m_daughters.clear();
145 for ( const auto& pp : daugs ) *this += pp;
146}

◆ setDaughters() [4/4]

void Gaudi::Decays::Decay::setDaughters ( const std::vector< std::string > & daugs)

set the daughters

Definition at line 138 of file Decay.cpp.

138 {
139 m_daughters.clear();
140 for ( const auto& pp : daugs ) *this += pp;
141}

◆ setMother() [1/4]

void Gaudi::Decays::Decay::setMother ( const Gaudi::ParticleID & mom)

set the mother

Definition at line 175 of file Decay.cpp.

175{ setMother( Item( mom ) ); }
void setMother(const Item &mom)
set the mother
Definition Decay.cpp:171

◆ setMother() [2/4]

void Gaudi::Decays::Decay::setMother ( const Gaudi::ParticleProperty * mom)

set the mother

Definition at line 173 of file Decay.cpp.

173{ setMother( Item( mom ) ); }

◆ setMother() [3/4]

void Gaudi::Decays::Decay::setMother ( const Item & mom)

set the mother

Definition at line 171 of file Decay.cpp.

171{ m_mother = mom; }

◆ setMother() [4/4]

void Gaudi::Decays::Decay::setMother ( const std::string & mom)

set the mother

Definition at line 177 of file Decay.cpp.

177{ setMother( Item( mom ) ); }

◆ toString()

std::string Gaudi::Decays::Decay::toString ( ) const

the conversion to the string

Definition at line 127 of file Decay.cpp.

127 {
128 std::ostringstream s;
129 fillStream( s );
130 return s.str();
131}
std::ostream & fillStream(std::ostream &s) const
the default printout
Definition Decay.cpp:105

◆ validate()

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

validate the decay using the service

Definition at line 92 of file Decay.cpp.

92 {
93 // validate the mother
94 StatusCode sc = m_mother.validate( svc );
95 if ( sc.isFailure() ) { return sc; }
96 if ( m_daughters.empty() ) { return StatusCode::FAILURE; }
97 // loop over daughters
98 for ( auto idau = m_daughters.begin(); m_daughters.end() != idau; ++idau ) {
99 sc = idau->validate( svc );
100 if ( sc.isFailure() ) { return sc; }
101 }
102 return sc;
103}
bool isFailure() const
Definition StatusCode.h:129
constexpr static const auto FAILURE
Definition StatusCode.h:100

Member Data Documentation

◆ m_daughters

Items Gaudi::Decays::Decay::m_daughters
mutable

the daughter particles

Definition at line 171 of file Decay.h.

◆ m_mother

Item Gaudi::Decays::Decay::m_mother
mutable

the head of the decay

Definition at line 169 of file Decay.h.


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