ROOTPWA
|
#include <ampIntegralMatrix.h>
Public Types | |
typedef boost::multi_array < std::complex< double >, 2 > | integralMatrixType |
Public Member Functions | |
ampIntegralMatrix () | |
ampIntegralMatrix (const ampIntegralMatrix &integral) | |
virtual | ~ampIntegralMatrix () |
void | clear () |
ampIntegralMatrix & | operator= (const ampIntegralMatrix &integral) |
ampIntegralMatrix & | operator+= (const ampIntegralMatrix &integral) |
ampIntegralMatrix & | operator-= (const ampIntegralMatrix &integral) |
ampIntegralMatrix & | operator*= (const double factor) |
ampIntegralMatrix & | operator/= (const double factor) |
unsigned int | nmbWaves () const |
returns number of waves in integral | |
unsigned long | nmbEvents () const |
returns number of events in integral | |
void | setNmbEvents (const unsigned long nmbEvents) |
sets number of events in integral | |
bool | containsWave (const std::string &waveName) const |
returns whether wave is in integral matrix | |
unsigned int | waveIndex (const std::string &waveName) const |
returns wave index for a wave name | |
const std::string & | waveName (const unsigned int waveIndex) const |
returns wave name for a wave index | |
const std::vector < rpwa::waveDescription > & | waveDescriptions () const |
returns array of wave descriptions | |
const waveDescription * | waveDesc (const unsigned int waveIndex) const |
returns wave descriptuion for wave index, if existent | |
const waveDescription * | waveDesc (const std::string &waveName) const |
returns wave descriptuion for wave name, if existent | |
bool | allWavesHaveDesc () const |
returns whether all waves in integral have description object | |
integralMatrixType & | matrix () |
returns integral matrix | |
const integralMatrixType & | matrix () const |
returns integral matrix | |
std::complex< double > | element (const unsigned int waveIndexI, const unsigned int waveIndexJ) const |
returns integral matrix element devided by number of events defined by index pair | |
std::complex< double > | element (const std::string &waveNameI, const std::string &waveNameJ) const |
< returns integral matrix element devided by number of events defined by pair of wave names | |
bool | integrate (const std::vector< std::string > &binAmpFileNames, const std::vector< std::string > &rootAmpFileNames, const unsigned long maxNmbEvents=0, const std::string &weightFileName="") |
void | renormalize (const unsigned long nmbEventsRenorm) |
bool | writeAscii (std::ostream &out=std::cout) const |
bool | readAscii (std::istream &in=std::cin) |
bool | writeAscii (const std::string &outFileName) const |
bool | readAscii (const std::string &inFileName) |
std::ostream & | print (std::ostream &out, const bool printIntegralValues=false) const |
prints integral 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 | waveNameToIndexMapIterator |
typedef integralMatrixType::size_type | sizeType |
Private Member Functions | |
unsigned long | openBinAmpFiles (std::vector< std::ifstream * > &Files, const std::vector< std::string > &FileNames, const unsigned int waveIndexOffset=0) |
opens array of .amp files, performs some scrunity checks and adds waves to name <-> index maps | |
unsigned long | openRootAmpFiles (std::vector< TTree * > &Trees, std::vector< rpwa::amplitudeTreeLeaf * > &TreeLeafs, const std::vector< std::string > &FileNames, const unsigned int waveIndexOffset=0, const std::string &LeafName="amplitude") |
opens array of .root files, performs some scrunity checks and adds waves to name <-> index maps | |
void | rebuildWaveNameToIndexMap () |
rebuilds the wave name -> index map from _waveNames | |
bool | hasIdenticalWaveSet (const ampIntegralMatrix &integral) const |
checks whether other integral matrix has exactly the same set of waves | |
void | storeMultiArray () |
copies multiarray into storage variables written to ROOT file | |
void | readMultiArray () |
rebuilds multiarray from storage variables read from ROOT file |
Private Attributes | |
unsigned int | _nmbWaves |
number of waves in integral | |
std::map< std::string, unsigned int > | _waveNameToIndexMap |
std::vector< std::string > | _waveNames |
///< maps wave names to wave indices | |
unsigned long | _nmbEvents |
number of events in integral matrix | |
integralMatrixType | _integrals |
std::vector< unsigned int > | _intStorageShape |
///< integral matrix | |
unsigned int | _intStorageNmbElements |
number of elements in array | |
std::complex< double > * | _intStorageData |
std::vector < rpwa::waveDescription > | _waveDescriptions |
wave descriptions of all waves |
Static Private Attributes | |
static bool | _debug = false |
if set to true, debug messages are printed |
Friends | |
bool | operator== (const ampIntegralMatrix &lhsInt, const ampIntegralMatrix &rhsInt) |
Definition at line 69 of file ampIntegralMatrix.h.
typedef boost::multi_array<std::complex<double>, 2> rpwa::ampIntegralMatrix::integralMatrixType |
Definition at line 79 of file ampIntegralMatrix.h.
|
private |
Definition at line 81 of file ampIntegralMatrix.h.
|
private |
Definition at line 72 of file ampIntegralMatrix.h.
ampIntegralMatrix::ampIntegralMatrix | ( | ) |
Definition at line 69 of file ampIntegralMatrix.cc.
ampIntegralMatrix::ampIntegralMatrix | ( | const ampIntegralMatrix & | integral | ) |
Definition at line 85 of file ampIntegralMatrix.cc.
|
virtual |
Definition at line 91 of file ampIntegralMatrix.cc.
bool ampIntegralMatrix::allWavesHaveDesc | ( | ) | const |
returns whether all waves in integral have description object
Definition at line 236 of file ampIntegralMatrix.cc.
References _waveDescriptions, and i.
Referenced by integrate().
void ampIntegralMatrix::clear | ( | ) |
Definition at line 96 of file ampIntegralMatrix.cc.
References _integrals, _intStorageData, _intStorageNmbElements, _intStorageShape, _nmbEvents, _nmbWaves, _waveDescriptions, _waveNames, and _waveNameToIndexMap.
bool ampIntegralMatrix::containsWave | ( | const std::string & | waveName | ) | const |
returns whether wave is in integral matrix
Definition at line 193 of file ampIntegralMatrix.cc.
References _waveNameToIndexMap.
Referenced by hasIdenticalWaveSet(), openBinAmpFiles(), openRootAmpFiles(), and rebuildWaveNameToIndexMap().
|
inlinestatic |
returns debug flag
Definition at line 145 of file ampIntegralMatrix.h.
References _debug.
Referenced by setDebug().
complex< double > ampIntegralMatrix::element | ( | const unsigned int | waveIndexI, |
const unsigned int | waveIndexJ | ||
) | const |
returns integral matrix element devided by number of events defined by index pair
Definition at line 246 of file ampIntegralMatrix.cc.
References _integrals, _nmbEvents, and _nmbWaves.
Referenced by TPWALikelihood< complexT >::reorderIntegralMatrix().
|
inline |
< returns integral matrix element devided by number of events defined by pair of wave names
Definition at line 125 of file ampIntegralMatrix.h.
References element(), and waveIndex().
Referenced by element().
|
private |
checks whether other integral matrix has exactly the same set of waves
Definition at line 746 of file ampIntegralMatrix.cc.
References _nmbWaves, containsWave(), i, nmbWaves(), and waveName().
Referenced by operator+=(), operator-=(), and rpwa::operator==().
bool ampIntegralMatrix::integrate | ( | const std::vector< std::string > & | binAmpFileNames, |
const std::vector< std::string > & | rootAmpFileNames, | ||
const unsigned long | maxNmbEvents = 0 , |
||
const std::string & | weightFileName = "" |
||
) |
!! this should be provided as a friend tree for the amlitudes
Definition at line 264 of file ampIntegralMatrix.cc.
References _debug, _integrals, _nmbEvents, _nmbWaves, _waveDescriptions, _waveNames, allWavesHaveDesc(), conj(), i, openBinAmpFiles(), openRootAmpFiles(), progressIndicator(), and waveIndex().
Referenced by main().
|
inline |
returns integral matrix
Definition at line 119 of file ampIntegralMatrix.h.
References _integrals.
Referenced by operator+=(), operator-=(), and rpwa::operator==().
|
inline |
|
inline |
returns number of events in integral
Definition at line 105 of file ampIntegralMatrix.h.
References _nmbEvents.
Referenced by main(), operator+=(), operator-=(), rpwa::operator==(), and setNmbEvents().
|
inline |
returns number of waves in integral
Definition at line 104 of file ampIntegralMatrix.h.
References _nmbWaves.
Referenced by hasIdenticalWaveSet(), and rpwa::operator==().
|
private |
opens array of .amp files, performs some scrunity checks and adds waves to name <-> index maps
Definition at line 566 of file ampIntegralMatrix.cc.
References _debug, _waveNames, _waveNameToIndexMap, containsWave(), i, waveIndex(), and waveName().
Referenced by integrate().
|
private |
opens array of .root files, performs some scrunity checks and adds waves to name <-> index maps
Definition at line 621 of file ampIntegralMatrix.cc.
References _debug, _waveDescriptions, _waveNames, _waveNameToIndexMap, containsWave(), i, waveDesc(), waveIndex(), and waveName().
Referenced by integrate().
ampIntegralMatrix & ampIntegralMatrix::operator*= | ( | const double | factor | ) |
Definition at line 171 of file ampIntegralMatrix.cc.
References _integrals, _nmbEvents, _nmbWaves, and i.
ampIntegralMatrix & ampIntegralMatrix::operator+= | ( | const ampIntegralMatrix & | integral | ) |
Definition at line 131 of file ampIntegralMatrix.cc.
References _integrals, _nmbEvents, _nmbWaves, _waveDescriptions, hasIdenticalWaveSet(), i, matrix(), nmbEvents(), waveIndex(), and waveName().
ampIntegralMatrix & ampIntegralMatrix::operator-= | ( | const ampIntegralMatrix & | integral | ) |
Definition at line 151 of file ampIntegralMatrix.cc.
References _integrals, _nmbEvents, _nmbWaves, _waveDescriptions, hasIdenticalWaveSet(), i, matrix(), nmbEvents(), waveIndex(), and waveName().
ampIntegralMatrix & ampIntegralMatrix::operator/= | ( | const double | factor | ) |
Definition at line 182 of file ampIntegralMatrix.cc.
References _integrals, _nmbEvents, _nmbWaves, and i.
ampIntegralMatrix & ampIntegralMatrix::operator= | ( | const ampIntegralMatrix & | integral | ) |
Definition at line 111 of file ampIntegralMatrix.cc.
References _integrals, _nmbEvents, _nmbWaves, _waveDescriptions, _waveNames, and _waveNameToIndexMap.
ostream & ampIntegralMatrix::print | ( | std::ostream & | out, |
const bool | printIntegralValues = false |
||
) | const |
prints integral in human-readable form
Definition at line 544 of file ampIntegralMatrix.cc.
References _integrals, _nmbEvents, _nmbWaves, _waveNames, _waveNameToIndexMap, i, and if.
Referenced by rpwa::operator<<().
bool ampIntegralMatrix::readAscii | ( | std::istream & | in = std::cin | ) |
Definition at line 462 of file ampIntegralMatrix.cc.
References _integrals, _nmbEvents, _nmbWaves, _waveNames, _waveNameToIndexMap, i, waveIndex(), and waveName().
Referenced by main(), and readAscii().
bool ampIntegralMatrix::readAscii | ( | const std::string & | inFileName | ) |
Definition at line 525 of file ampIntegralMatrix.cc.
References _debug, and readAscii().
|
private |
rebuilds multiarray from storage variables read from ROOT file
Definition at line 775 of file ampIntegralMatrix.cc.
References _integrals, _intStorageData, _intStorageNmbElements, _intStorageShape, and i.
|
private |
rebuilds the wave name -> index map from _waveNames
Definition at line 733 of file ampIntegralMatrix.cc.
References _waveNames, _waveNameToIndexMap, containsWave(), and i.
void ampIntegralMatrix::renormalize | ( | const unsigned long | nmbEventsRenorm | ) |
Definition at line 426 of file ampIntegralMatrix.cc.
References _debug, and _nmbEvents.
Referenced by main().
|
inlinestatic |
|
inline |
sets number of events in integral
Definition at line 107 of file ampIntegralMatrix.h.
References _nmbEvents, and nmbEvents().
|
private |
copies multiarray into storage variables written to ROOT file
Definition at line 763 of file ampIntegralMatrix.cc.
References _integrals, _intStorageData, _intStorageNmbElements, _intStorageShape, and i.
const waveDescription * ampIntegralMatrix::waveDesc | ( | const unsigned int | waveIndex | ) | const |
returns wave descriptuion for wave index, if existent
Definition at line 227 of file ampIntegralMatrix.cc.
References _waveDescriptions.
Referenced by openRootAmpFiles().
|
inline |
returns wave descriptuion for wave name, if existent
Definition at line 115 of file ampIntegralMatrix.h.
References waveDesc(), and waveIndex().
Referenced by waveDesc().
|
inline |
returns array of wave descriptions
Definition at line 113 of file ampIntegralMatrix.h.
References _waveDescriptions.
unsigned int ampIntegralMatrix::waveIndex | ( | const std::string & | waveName | ) | const |
returns wave index for a wave name
Definition at line 203 of file ampIntegralMatrix.cc.
References _waveNameToIndexMap.
Referenced by element(), integrate(), openBinAmpFiles(), openRootAmpFiles(), operator+=(), operator-=(), rpwa::operator==(), readAscii(), and waveDesc().
const string & ampIntegralMatrix::waveName | ( | const unsigned int | waveIndex | ) | const |
returns wave name for a wave index
Definition at line 215 of file ampIntegralMatrix.cc.
References _waveNames.
Referenced by hasIdenticalWaveSet(), openBinAmpFiles(), openRootAmpFiles(), operator+=(), operator-=(), rpwa::operator==(), and readAscii().
bool ampIntegralMatrix::writeAscii | ( | std::ostream & | out = std::cout | ) | const |
Definition at line 437 of file ampIntegralMatrix.cc.
References _integrals, _nmbEvents, _nmbWaves, _waveNameToIndexMap, and i.
Referenced by main(), and writeAscii().
bool ampIntegralMatrix::writeAscii | ( | const std::string & | outFileName | ) | const |
Definition at line 506 of file ampIntegralMatrix.cc.
References _debug, and writeAscii().
|
friend |
Definition at line 195 of file ampIntegralMatrix.h.
|
staticprivate |
if set to true, debug messages are printed
Definition at line 166 of file ampIntegralMatrix.h.
Referenced by debug(), integrate(), openBinAmpFiles(), openRootAmpFiles(), readAscii(), renormalize(), setDebug(), and writeAscii().
|
private |
Definition at line 176 of file ampIntegralMatrix.h.
Referenced by clear(), element(), integrate(), matrix(), operator*=(), operator+=(), operator-=(), operator/=(), operator=(), print(), readAscii(), readMultiArray(), storeMultiArray(), and writeAscii().
|
private |
Definition at line 180 of file ampIntegralMatrix.h.
Referenced by clear(), readMultiArray(), and storeMultiArray().
|
private |
number of elements in array
Definition at line 179 of file ampIntegralMatrix.h.
Referenced by clear(), readMultiArray(), and storeMultiArray().
|
private |
///< integral matrix
array shape
Definition at line 178 of file ampIntegralMatrix.h.
Referenced by clear(), readMultiArray(), and storeMultiArray().
|
private |
number of events in integral matrix
Definition at line 171 of file ampIntegralMatrix.h.
Referenced by clear(), element(), integrate(), nmbEvents(), operator*=(), operator+=(), operator-=(), operator/=(), operator=(), print(), readAscii(), renormalize(), setNmbEvents(), and writeAscii().
|
private |
number of waves in integral
Definition at line 168 of file ampIntegralMatrix.h.
Referenced by clear(), element(), hasIdenticalWaveSet(), integrate(), nmbWaves(), operator*=(), operator+=(), operator-=(), operator/=(), operator=(), print(), readAscii(), and writeAscii().
|
private |
wave descriptions of all waves
Definition at line 182 of file ampIntegralMatrix.h.
Referenced by allWavesHaveDesc(), clear(), integrate(), openRootAmpFiles(), operator+=(), operator-=(), operator=(), waveDesc(), and waveDescriptions().
|
private |
///< maps wave names to wave indices
maps wave indices to wave names
Definition at line 170 of file ampIntegralMatrix.h.
Referenced by clear(), integrate(), openBinAmpFiles(), openRootAmpFiles(), operator=(), print(), readAscii(), rebuildWaveNameToIndexMap(), and waveName().
|
private |
Definition at line 169 of file ampIntegralMatrix.h.
Referenced by clear(), containsWave(), openBinAmpFiles(), openRootAmpFiles(), operator=(), print(), readAscii(), rebuildWaveNameToIndexMap(), waveIndex(), and writeAscii().