The Gaudi Framework  master (37c0b60a)
Gaudi::Decays::Decay Class Referencefinal

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

Collaboration diagram for Gaudi::Decays::Decay:

Classes

class  Item
 

Public Types

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

Public Member Functions

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

Public Attributes

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

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

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 }

◆ 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.

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 }

◆ 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 ); }

◆ 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 ) ); }

◆ 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  {
129  fillStream( s );
130  return s.str();
131 }

◆ 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 }

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:
Gaudi::Decays::Decay::setDaughters
void setDaughters(const Items &daugs)
set the daughters
Definition: Decay.cpp:148
Gaudi::Decays::Decay::setMother
void setMother(const Item &mom)
set the mother
Definition: Decay.cpp:171
gaudirun.s
string s
Definition: gaudirun.py:346
std::vector::size
T size(T... args)
Gaudi::Decays::Decay::daughters
const Items & daughters() const
get all daughters
Definition: Decay.h:106
Gaudi::Decays::Decay::Item::validate
StatusCode validate(const Gaudi::Interfaces::IParticlePropertySvc *svc) const
validate the item using the service
Definition: Decay.cpp:35
std::vector::clear
T clear(T... args)
std::vector::push_back
T push_back(T... args)
Gaudi::Decays::Decay::m_daughters
Items m_daughters
the daughter particles
Definition: Decay.h:171
Gaudi::Decays::Decay::fillStream
std::ostream & fillStream(std::ostream &s) const
the default printout
Definition: Decay.cpp:105
StatusCode
Definition: StatusCode.h:65
Gaudi::Decays::Decay::Item::fillStream
std::ostream & fillStream(std::ostream &s) const
the default printout
Definition: Decay.cpp:114
std::ostringstream
STL class.
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:129
std::vector::begin
T begin(T... args)
GaudiPartProp.decorators.Item
Item
Definition: decorators.py:306
std::vector::empty
T empty(T... args)
Gaudi::Decays::Decay::m_mother
Item m_mother
the head of the decay
Definition: Decay.h:169
std::vector::end
T end(T... args)
Gaudi::Decays::Decay::mother
const Item & mother() const
get the mother(head) of the decay
Definition: Decay.h:104
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
compareOutputFiles.pp
pp
Definition: compareOutputFiles.py:507
Gaudi::ParticleProperties::index
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...
Definition: IParticlePropertySvc.cpp:39