a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
LHPC::FlavorObservable Class Reference

#include <FlavorObservable.hpp>

Detailed Description

Definition at line 24 of file FlavorObservable.hpp.

Public Member Functions

 FlavorObservable ()
 
 FlavorObservable (FlavorObservable const &copySource)
 
std::string getAsString () const
 
std::list< int > & getDaughterParticleList ()
 
std::list< int > const & getDaughterParticleList () const
 
int getNumberOfDaughterParticles () const
 
double getScale () const
 
double getValue () const
 
void setFromString (std::string const &valuesString)
 
void setValues (double const valueDouble, double const evaluationScale, std::list< int > const &daughterParticleCodes)
 
 ~FlavorObservable ()
 

Static Public Attributes

static int const minimumDigitsForCodes
 
static int const spacesBetweenCodes
 

Protected Attributes

std::list< int > daughterParticleCodes
 
double evaluationScale
 
double valueDouble
 

Constructor & Destructor Documentation

◆ FlavorObservable() [1/2]

LHPC::FlavorObservable::FlavorObservable ( )

Definition at line 21 of file FlavorObservable.cpp.

21 :
25 {
26 // just an initialization list.
27 }
static double const notANumber
Definition: UsefulStuff.hpp:28
std::list< int > daughterParticleCodes

◆ FlavorObservable() [2/2]

LHPC::FlavorObservable::FlavorObservable ( FlavorObservable const &  copySource)

Definition at line 29 of file FlavorObservable.cpp.

29 :
30 valueDouble( copySource.valueDouble ),
31 evaluationScale( copySource.evaluationScale ),
32 daughterParticleCodes( copySource.daughterParticleCodes )
33 {
34 // just an initialization list.
35 }

◆ ~FlavorObservable()

LHPC::FlavorObservable::~FlavorObservable ( )

Definition at line 37 of file FlavorObservable.cpp.

38 {
39 // does nothing.
40 }

Member Function Documentation

◆ getAsString()

std::string LHPC::FlavorObservable::getAsString ( ) const

Definition at line 97 of file FlavorObservable.cpp.

98 {
99 std::string returnString( BOL::StringParser::doubleToString( valueDouble,
100 9,
101 3 ) );
102 returnString.append( spacesBetweenCodes,
103 ' ' );
105 9,
106 3 ) );
107 for( std::list< int >::const_iterator
108 daughterIterator( daughterParticleCodes.begin() );
109 daughterParticleCodes.end() != daughterIterator;
110 ++daughterIterator )
111 {
112 returnString.append( spacesBetweenCodes,
113 ' ' );
115 *daughterIterator,
117 "" ) );
118 }
119 return returnString;
120 }
static std::string doubleToString(double inputDouble, int const numberOfMantissaDigits, int const numberOfExponentDigits, std::string const prefixForPositiveNumbers="+", std::string const prefixForNegativeNumbers="-", std::string const positiveExponentPrefix="+", std::string const negativeExponentPrefix="-", std::string const exponentCharacter="E")
static std::string intToSpacePaddedString(int inputInt, int const minimumNumberOfChars, std::string const prefixForPositiveNumbers="+", std::string const prefixForNegativeNumbers="-")
static int const spacesBetweenCodes
static int const minimumDigitsForCodes

◆ getDaughterParticleList() [1/2]

std::list< int > & LHPC::FlavorObservable::getDaughterParticleList ( )
inline

Definition at line 83 of file FlavorObservable.hpp.

84 {
86 }

◆ getDaughterParticleList() [2/2]

std::list< int > const & LHPC::FlavorObservable::getDaughterParticleList ( ) const
inline

Definition at line 89 of file FlavorObservable.hpp.

90 {
92 }

◆ getNumberOfDaughterParticles()

int LHPC::FlavorObservable::getNumberOfDaughterParticles ( ) const
inline

Definition at line 77 of file FlavorObservable.hpp.

78 {
79 return (int)(daughterParticleCodes.size());
80 }

◆ getScale()

double LHPC::FlavorObservable::getScale ( ) const
inline

Definition at line 71 of file FlavorObservable.hpp.

72 {
73 return evaluationScale;
74 }

◆ getValue()

double LHPC::FlavorObservable::getValue ( ) const
inline

Definition at line 65 of file FlavorObservable.hpp.

66 {
67 return valueDouble;
68 }

◆ setFromString()

void LHPC::FlavorObservable::setFromString ( std::string const &  valuesString)

Definition at line 43 of file FlavorObservable.cpp.

44 {
45 std::string firstRemainder;
46 std::string secondRemainder;
49 valuesString,
50 &firstRemainder,
54 firstRemainder,
55 &secondRemainder,
57 int numberOfDaughterParticles( BOL::StringParser::stringToInt(
59 secondRemainder,
60 &firstRemainder,
62 secondRemainder.assign( BOL::StringParser::trimFromFrontAndBack(
63 firstRemainder,
66 while( !(secondRemainder.empty()) )
67 {
70 secondRemainder,
71 &firstRemainder,
73 secondRemainder.assign( BOL::StringParser::trimFromFrontAndBack(
74 firstRemainder,
76 }
77 if( ( 0 < numberOfDaughterParticles )
78 &&
79 ( (size_t)numberOfDaughterParticles != daughterParticleCodes.size() ) )
80 {
81 std::cout
82 << std::endl
83 << "LHPC::warning! An FOBS line declared a different number of daughter"
84 << " particles ( " << numberOfDaughterParticles << " ) to the actual"
85 << " number of daughter particle codes it had ( "
86 << daughterParticleCodes.size()
87 << " )! The declared number is being ignored in favor of the number of"
88 << " codes read in.";
89 std::cout
90 << std::endl
91 << "input string: \"" << valuesString << "\"";
92 std::cout << std::endl;
93 }
94 }
static std::string firstWordOf(std::string const &stringToParse, std::string *const remainderString=NULL, std::string const &separatorChars=whitespaceChars)
static std::string const whitespaceAndNewlineChars
static std::string trimFromFrontAndBack(std::string const &stringToTrim, std::string const &charsToTrim=whitespaceAndNewlineChars)
static double stringToDouble(std::string const &stringToInterpret)
static int stringToInt(std::string const &stringToInterpret)

◆ setValues()

void LHPC::FlavorObservable::setValues ( double const  valueDouble,
double const  evaluationScale,
std::list< int > const &  daughterParticleCodes 
)
inline

Definition at line 95 of file FlavorObservable.hpp.

Member Data Documentation

◆ daughterParticleCodes

std::list< int > LHPC::FlavorObservable::daughterParticleCodes
protected

Definition at line 57 of file FlavorObservable.hpp.

◆ evaluationScale

double LHPC::FlavorObservable::evaluationScale
protected

Definition at line 56 of file FlavorObservable.hpp.

◆ minimumDigitsForCodes

int const LHPC::FlavorObservable::minimumDigitsForCodes
static

Definition at line 28 of file FlavorObservable.hpp.

◆ spacesBetweenCodes

int const LHPC::FlavorObservable::spacesBetweenCodes
static

Definition at line 27 of file FlavorObservable.hpp.

◆ valueDouble

double LHPC::FlavorObservable::valueDouble
protected

Definition at line 55 of file FlavorObservable.hpp.


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