ROOTPWA
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
rpwa::amplitudeTreeLeaf Class Reference

#include <amplitudeTreeLeaf.h>

Public Member Functions

 amplitudeTreeLeaf ()
virtual ~amplitudeTreeLeaf ()
void clear ()
 clears all subamps and subamp labels
amplitudeTreeLeafoperator= (const amplitudeTreeLeaf &amp)
amplitudeTreeLeafoperator+= (const amplitudeTreeLeaf &amp)
 adds all subamps of two amplitudeTreeLeafs with same set of subamps
amplitudeTreeLeafoperator-= (const amplitudeTreeLeaf &amp)
 subtracts all subamps of two amplitudeTreeLeafs with same set of subamps
template<typename T >
amplitudeTreeLeafoperator*= (const T &factor)
 muliplies all subamps with factor
template<typename T >
amplitudeTreeLeafoperator/= (const T &factor)
 divides all subamps by factor
unsigned int nmbIncohSubAmps () const
 returns number of incoherent subamps
bool containsIncohSubAmp (const std::string &subAmpLabel) const
unsigned int incohSubAmpIndex (const std::string &subAmpLabel) const
const std::string & incohSubAmpName (const unsigned int subAmpIndex) const
const std::complex< double > & incohSubAmp (const unsigned int index=0) const
 returns incoherent subamp at index
const std::complex< double > & incohSubAmp (const std::string &subAmpLabel) const
 returns incoherent subamp at index
const std::complex< double > & amp () const
 returns first incoherent subamp (meant for cases where there is only one amplitude)
void defineIncohSubAmps (const std::vector< std::string > &subAmpLabels)
 defines number of subamps for this amplitude and their labels; vector has to be more than one entry
void setIncohSubAmp (const std::complex< double > &amp, const unsigned int index=0)
 sets incoherent subamp defined by index
void setAmp (const std::complex< double > &amp)
 returns first incoherent subamp (meant for cases where there is only one amplitude)
std::ostream & print (std::ostream &out) const
 prints amplitudes in human-readable form

Static Public Member Functions

static bool debug ()
 returns debug flag
static void setDebug (const bool debug=true)
 sets debug flag

Private Types

typedef std::map< std::string,
unsigned int >::const_iterator 
labelToIndexMapIterator

Private Member Functions

void rebuildSubAmpLabelMap ()
 rebuilds label-to-index map for subamps

Private Attributes

std::vector< std::complex
< double > > 
_incohSubAmps
 sub-amplitudes to be added incoherently in intensity formula
std::vector< std::string > _incohSubAmpLabels
 labels for subamps
std::map< std::string,
unsigned int
_labelToIndexMap

Static Private Attributes

static bool _debug = false
 if set to true, debug messages are printed

Friends

bool operator== (const amplitudeTreeLeaf &lhsAmp, const amplitudeTreeLeaf &rhsAmp)

Detailed Description

Definition at line 55 of file amplitudeTreeLeaf.h.

Member Typedef Documentation

typedef std::map<std::string, unsigned int>::const_iterator rpwa::amplitudeTreeLeaf::labelToIndexMapIterator
private

Definition at line 58 of file amplitudeTreeLeaf.h.

Constructor & Destructor Documentation

amplitudeTreeLeaf::amplitudeTreeLeaf ( )

Definition at line 59 of file amplitudeTreeLeaf.cc.

amplitudeTreeLeaf::~amplitudeTreeLeaf ( )
virtual

Definition at line 69 of file amplitudeTreeLeaf.cc.

Member Function Documentation

const std::complex<double>& rpwa::amplitudeTreeLeaf::amp ( ) const
inline

returns first incoherent subamp (meant for cases where there is only one amplitude)

Definition at line 94 of file amplitudeTreeLeaf.h.

References incohSubAmp().

Referenced by setIncohSubAmp(), and rpwa::writeAmpFromTree().

void amplitudeTreeLeaf::clear ( )

clears all subamps and subamp labels

Definition at line 73 of file amplitudeTreeLeaf.cc.

References _incohSubAmpLabels, _incohSubAmps, and _labelToIndexMap.

Referenced by main().

bool amplitudeTreeLeaf::containsIncohSubAmp ( const std::string &  subAmpLabel) const

Definition at line 128 of file amplitudeTreeLeaf.cc.

References _labelToIndexMap.

static bool rpwa::amplitudeTreeLeaf::debug ( )
inlinestatic

returns debug flag

Definition at line 105 of file amplitudeTreeLeaf.h.

References _debug.

Referenced by setDebug().

void amplitudeTreeLeaf::defineIncohSubAmps ( const std::vector< std::string > &  subAmpLabels)

defines number of subamps for this amplitude and their labels; vector has to be more than one entry

Definition at line 162 of file amplitudeTreeLeaf.cc.

References _incohSubAmpLabels, _incohSubAmps, and rebuildSubAmpLabelMap().

Referenced by main().

const std::complex<double>& rpwa::amplitudeTreeLeaf::incohSubAmp ( const unsigned int  index = 0) const
inline

returns incoherent subamp at index

Definition at line 89 of file amplitudeTreeLeaf.h.

References _incohSubAmps.

Referenced by amp(), operator+=(), operator-=(), rpwa::operator==(), and TPWALikelihood< complexT >::readDecayAmplitudes().

const std::complex<double>& rpwa::amplitudeTreeLeaf::incohSubAmp ( const std::string &  subAmpLabel) const
inline

returns incoherent subamp at index

Definition at line 91 of file amplitudeTreeLeaf.h.

References _incohSubAmps, and incohSubAmpIndex().

unsigned int amplitudeTreeLeaf::incohSubAmpIndex ( const std::string &  subAmpLabel) const

Definition at line 138 of file amplitudeTreeLeaf.cc.

References _labelToIndexMap.

Referenced by incohSubAmp(), and main().

const string & amplitudeTreeLeaf::incohSubAmpName ( const unsigned int  subAmpIndex) const

Definition at line 150 of file amplitudeTreeLeaf.cc.

References _incohSubAmpLabels.

unsigned int rpwa::amplitudeTreeLeaf::nmbIncohSubAmps ( ) const
inline
template<typename T >
amplitudeTreeLeaf & rpwa::amplitudeTreeLeaf::operator*= ( const T &  factor)
inline

muliplies all subamps with factor

Definition at line 155 of file amplitudeTreeLeaf.h.

References _incohSubAmps, i, and nmbIncohSubAmps().

amplitudeTreeLeaf & amplitudeTreeLeaf::operator+= ( const amplitudeTreeLeaf amp)

adds all subamps of two amplitudeTreeLeafs with same set of subamps

Definition at line 96 of file amplitudeTreeLeaf.cc.

References _incohSubAmpLabels, _incohSubAmps, i, incohSubAmp(), and nmbIncohSubAmps().

amplitudeTreeLeaf & amplitudeTreeLeaf::operator-= ( const amplitudeTreeLeaf amp)

subtracts all subamps of two amplitudeTreeLeafs with same set of subamps

Definition at line 112 of file amplitudeTreeLeaf.cc.

References _incohSubAmpLabels, _incohSubAmps, i, incohSubAmp(), and nmbIncohSubAmps().

template<typename T >
amplitudeTreeLeaf & rpwa::amplitudeTreeLeaf::operator/= ( const T &  factor)
inline

divides all subamps by factor

Definition at line 166 of file amplitudeTreeLeaf.h.

References _incohSubAmps, i, and nmbIncohSubAmps().

amplitudeTreeLeaf & amplitudeTreeLeaf::operator= ( const amplitudeTreeLeaf amp)

Definition at line 83 of file amplitudeTreeLeaf.cc.

References _incohSubAmpLabels, _incohSubAmps, and _labelToIndexMap.

ostream & amplitudeTreeLeaf::print ( std::ostream &  out) const

prints amplitudes in human-readable form

Definition at line 184 of file amplitudeTreeLeaf.cc.

References _incohSubAmpLabels, _incohSubAmps, i, and nmbIncohSubAmps().

Referenced by rpwa::operator<<().

void amplitudeTreeLeaf::rebuildSubAmpLabelMap ( )
private

rebuilds label-to-index map for subamps

Definition at line 203 of file amplitudeTreeLeaf.cc.

References _incohSubAmpLabels, _labelToIndexMap, and i.

Referenced by defineIncohSubAmps().

void rpwa::amplitudeTreeLeaf::setAmp ( const std::complex< double > &  amp)
inline

returns first incoherent subamp (meant for cases where there is only one amplitude)

Definition at line 101 of file amplitudeTreeLeaf.h.

References setIncohSubAmp().

Referenced by rpwa::fillTreeFromAmp(), and main().

static void rpwa::amplitudeTreeLeaf::setDebug ( const bool  debug = true)
inlinestatic

sets debug flag

Definition at line 106 of file amplitudeTreeLeaf.h.

References _debug, and debug().

void rpwa::amplitudeTreeLeaf::setIncohSubAmp ( const std::complex< double > &  amp,
const unsigned int  index = 0 
)
inline

sets incoherent subamp defined by index

Definition at line 98 of file amplitudeTreeLeaf.h.

References _incohSubAmps, and amp().

Referenced by main(), and setAmp().

Friends And Related Function Documentation

bool operator== ( const amplitudeTreeLeaf lhsAmp,
const amplitudeTreeLeaf rhsAmp 
)
friend

Definition at line 130 of file amplitudeTreeLeaf.h.

Member Data Documentation

bool amplitudeTreeLeaf::_debug = false
staticprivate

if set to true, debug messages are printed

Definition at line 113 of file amplitudeTreeLeaf.h.

Referenced by debug(), and setDebug().

std::vector<std::string> rpwa::amplitudeTreeLeaf::_incohSubAmpLabels
private
std::vector<std::complex<double> > rpwa::amplitudeTreeLeaf::_incohSubAmps
private

sub-amplitudes to be added incoherently in intensity formula

Definition at line 115 of file amplitudeTreeLeaf.h.

Referenced by clear(), defineIncohSubAmps(), incohSubAmp(), nmbIncohSubAmps(), operator*=(), operator+=(), operator-=(), operator/=(), operator=(), print(), and setIncohSubAmp().

std::map<std::string, unsigned int> rpwa::amplitudeTreeLeaf::_labelToIndexMap
private

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