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

#include <MassSpectrum.hpp>

+ Inheritance diagram for LHPC::MassSpectrum:

Detailed Description

Definition at line 28 of file MassSpectrum.hpp.

Public Types

enum  defaultFlags { escapesDetector = 0 , isJet = 1 , isLightLepton = 2 , sizeOfEnum = 3 }
 

Public Member Functions

MassSpectrumclearMassesAndDecays ()
 
MassEigenstateensureMassEigenstateExists (int const pdgCode)
 
MassEigenstategetMassEigenstate (int const pdgCode)
 
MassEigenstate const * getMassEigenstate (int const pdgCode) const
 
std::vector< MassEigenstate * > & getMassEigenstateSet ()
 
std::vector< MassEigenstate * > const & getMassEigenstateSet () const
 
bool getVerbosity () const
 
 MassSpectrum (bool const isVerbose=false, std::vector< bool > const *defaultFlags=NULL)
 
MassEigenstateoperator[] (int const pdgCode)
 
MassEigenstate const & operator[] (int const pdgCode) const
 
virtual void respondToObservedSignal ()
 
virtual void respondToPush (SpectrumUpdater const &pushedValue)
 
virtual ~MassSpectrum ()
 
- Public Member Functions inherited from BOL::PushedToObserver< SpectrumUpdater >
 PushedToObserver ()
 
virtual void respondToPush (SpectrumUpdater const &pushedValue)=0
 
virtual ~PushedToObserver ()
 
- Public Member Functions inherited from BOL::BasicObserver
void acceptFlagFromObserved (bool *const flagFromObserved)
 
 BasicObserver ()
 
void clearObservingFlags ()
 
void discardFlagFromObserved (bool *const flagFromObserved)
 
virtual ~BasicObserver ()
 

Static Protected Member Functions

static MassEigenstatefindMassEigenstateReference (int const pdgCode, MassEigenstateCodeToPointerMap const &codeMap)
 
static void warnThatMassEigenstateWasNotFound (int const pdgCode)
 

Protected Attributes

std::vector< MassEigenstate * > allMassEigenstates
 
bool const isVerbose
 
MassEigenstateMapAndVectorAndBools mapAndVectorAndBools
 
MassEigenstateCodeToPointerMap pdgCodeMap
 
std::vector< MassEigenstate * > unknownMassEigenstates
 
- Protected Attributes inherited from BOL::BasicObserver
std::list< bool * > stillObservingFlags
 

Static Protected Attributes

static std::vector< bool > const defaultBoolVector
 
static std::vector< bool > const defaultEscapesDetectorBoolVector
 
static std::vector< bool > const defaultIsJetBoolVector
 
static std::vector< bool > const defaultIsLightLeptonBoolVector
 

Member Enumeration Documentation

◆ defaultFlags

Enumerator
escapesDetector 
isJet 
isLightLepton 
sizeOfEnum 

Definition at line 31 of file MassSpectrum.hpp.

Constructor & Destructor Documentation

◆ MassSpectrum()

LHPC::MassSpectrum::MassSpectrum ( bool const  isVerbose = false,
std::vector< bool > const *  defaultFlags = NULL 
)

Definition at line 32 of file MassSpectrum.cpp.

33 :
36 pdgCodeMap(),
40 isVerbose )
41 {
42 if( NULL == defaultFlags )
43 {
45 }
47 }
MapAndVectorAndBools< PointerClass > & withBools(std::vector< bool > const *const boolVector)
std::vector< MassEigenstate * > unknownMassEigenstates
std::vector< MassEigenstate * > allMassEigenstates
MassEigenstateMapAndVectorAndBools mapAndVectorAndBools
MassEigenstateCodeToPointerMap pdgCodeMap
bool const isVerbose
static std::vector< bool > const defaultBoolVector

◆ ~MassSpectrum()

LHPC::MassSpectrum::~MassSpectrum ( )
virtual

Definition at line 49 of file MassSpectrum.cpp.

50 {
51 for( int deletionIndex( unknownMassEigenstates.size() - 1 );
52 0 <= deletionIndex;
53 --deletionIndex )
54 {
55 delete unknownMassEigenstates[ deletionIndex ];
56 }
57 }

Member Function Documentation

◆ clearMassesAndDecays()

MassSpectrum & LHPC::MassSpectrum::clearMassesAndDecays ( )
inline

Definition at line 130 of file MassSpectrum.hpp.

131 {
132 for( int clearingIndex( allMassEigenstates.size() - 1 );
133 0 <= clearingIndex;
134 --clearingIndex )
135 {
136 allMassEigenstates[ clearingIndex ]->clearMassesAndDecays();
137 }
138 return *this;
139 }

◆ ensureMassEigenstateExists()

MassEigenstate & LHPC::MassSpectrum::ensureMassEigenstateExists ( int const  pdgCode)

Definition at line 61 of file MassSpectrum.cpp.

68 {
69 MassEigenstate*
70 massEigenstatePointer( MassEigenstate::findPointerWithCode( pdgCode,
71 pdgCodeMap ) );
72 if( NULL == massEigenstatePointer )
73 // if the requested MassEigenstate could not be found...
74 {
75 std::string codeAsName( BOL::StringParser::intToString( pdgCode,
76 1 ) );
77 // the code is turned into a name.
78 massEigenstatePointer = new MassEigenstate( pdgCode,
80 false,
81 codeAsName,
82 codeAsName );
83 // the MassEigenstate is constructed with default flags.
84 unknownMassEigenstates.push_back( massEigenstatePointer );
85 // the pointer is noted so that it can be deleted when appropriate.
86 codeAsName.assign( BOL::StringParser::intToString( -pdgCode,
87 1 ) );
88 // the charge conjugate's name is made, & then used for the creation of
89 // the charge conjugate itself, while storing its pointer for deletion:
90 unknownMassEigenstates.push_back( new MassEigenstate(
91 *massEigenstatePointer,
92 codeAsName,
93 codeAsName ) );
94 }
95 return *massEigenstatePointer;
96 }
static std::string intToString(int inputInt, int const minimumNumberOfDigits, std::string const prefixForPositiveNumbers="+", std::string const prefixForNegativeNumbers="-", char const paddingChar='0')
static MassEigenstate * findPointerWithCode(int pdgCode, MassEigenstateCodeMap const &codeMap)

◆ findMassEigenstateReference()

MassEigenstate & LHPC::MassSpectrum::findMassEigenstateReference ( int const  pdgCode,
MassEigenstateCodeToPointerMap const &  codeMap 
)
inlinestaticprotected

Definition at line 161 of file MassSpectrum.hpp.

163 {
164 MassEigenstate*
165 massEigenstatePointer( MassEigenstate::findPointerWithCode( pdgCode,
166 codeMap ) );
167 if( NULL != massEigenstatePointer )
168 {
169 return *massEigenstatePointer;
170 }
171 else
172 {
173 std::string
174 errorMessage( "MassSpectrum::findMassEigenstateReference( " );
175 errorMessage.append( BOL::StringParser::intToString( pdgCode,
176 1 ) );
177 errorMessage.append( ") out of range." );
179 throw std::out_of_range( errorMessage );
180 }
181 }
static void warnThatMassEigenstateWasNotFound(int const pdgCode)

◆ getMassEigenstate() [1/2]

MassEigenstate * LHPC::MassSpectrum::getMassEigenstate ( int const  pdgCode)
inline

Definition at line 104 of file MassSpectrum.hpp.

105 {
107 pdgCodeMap );
108 }

◆ getMassEigenstate() [2/2]

MassEigenstate const * LHPC::MassSpectrum::getMassEigenstate ( int const  pdgCode) const
inline

Definition at line 111 of file MassSpectrum.hpp.

112 {
114 pdgCodeMap );
115 }

◆ getMassEigenstateSet() [1/2]

std::vector< MassEigenstate * > & LHPC::MassSpectrum::getMassEigenstateSet ( )
inline

Definition at line 118 of file MassSpectrum.hpp.

119 {
120 return allMassEigenstates;
121 }

◆ getMassEigenstateSet() [2/2]

std::vector< MassEigenstate * > const & LHPC::MassSpectrum::getMassEigenstateSet ( ) const
inline

Definition at line 124 of file MassSpectrum.hpp.

125 {
126 return allMassEigenstates;
127 }

◆ getVerbosity()

bool LHPC::MassSpectrum::getVerbosity ( ) const
inline

Definition at line 142 of file MassSpectrum.hpp.

143 {
144 return isVerbose;
145 }

◆ operator[]() [1/2]

MassEigenstate & LHPC::MassSpectrum::operator[] ( int const  pdgCode)
inline

Definition at line 90 of file MassSpectrum.hpp.

91 {
92 return findMassEigenstateReference( pdgCode,
93 pdgCodeMap );
94 }
static MassEigenstate & findMassEigenstateReference(int const pdgCode, MassEigenstateCodeToPointerMap const &codeMap)

◆ operator[]() [2/2]

MassEigenstate const & LHPC::MassSpectrum::operator[] ( int const  pdgCode) const
inline

Definition at line 97 of file MassSpectrum.hpp.

98 {
99 return findMassEigenstateReference( pdgCode,
100 pdgCodeMap );
101 }

◆ respondToObservedSignal()

void LHPC::MassSpectrum::respondToObservedSignal ( )
inlinevirtual

Reimplemented from BOL::PushedToObserver< SpectrumUpdater >.

Definition at line 148 of file MassSpectrum.hpp.

150 {
152 }
MassSpectrum & clearMassesAndDecays()

◆ respondToPush()

void LHPC::MassSpectrum::respondToPush ( SpectrumUpdater const &  pushedValue)
inlinevirtual

Definition at line 155 of file MassSpectrum.hpp.

156 {
157 pushedValue.updateMassEigenstates( pdgCodeMap );
158 }

◆ warnThatMassEigenstateWasNotFound()

void LHPC::MassSpectrum::warnThatMassEigenstateWasNotFound ( int const  pdgCode)
inlinestaticprotected

Definition at line 184 of file MassSpectrum.hpp.

185 {
186 std::cout
187 << std::endl
188 << "LhaParsing::error! MassEigenstate::findPointerWithCode could not"
189 << " find the MassEigenstate with particle code " << pdgCode
190 << ", so it is returning a NULL pointer. MassSpectrum is throwing an"
191 << " out-of-range exception because of this.";
192 std::cout << std::endl;
193 }

Member Data Documentation

◆ allMassEigenstates

std::vector< MassEigenstate* > LHPC::MassSpectrum::allMassEigenstates
protected

Definition at line 80 of file MassSpectrum.hpp.

◆ defaultBoolVector

std::vector< bool > const LHPC::MassSpectrum::defaultBoolVector
staticprotected

Definition at line 69 of file MassSpectrum.hpp.

◆ defaultEscapesDetectorBoolVector

std::vector< bool > const LHPC::MassSpectrum::defaultEscapesDetectorBoolVector
staticprotected

Definition at line 70 of file MassSpectrum.hpp.

◆ defaultIsJetBoolVector

std::vector< bool > const LHPC::MassSpectrum::defaultIsJetBoolVector
staticprotected

Definition at line 71 of file MassSpectrum.hpp.

◆ defaultIsLightLeptonBoolVector

std::vector< bool > const LHPC::MassSpectrum::defaultIsLightLeptonBoolVector
staticprotected

Definition at line 72 of file MassSpectrum.hpp.

◆ isVerbose

bool const LHPC::MassSpectrum::isVerbose
protected

Definition at line 83 of file MassSpectrum.hpp.

◆ mapAndVectorAndBools

MassEigenstateMapAndVectorAndBools LHPC::MassSpectrum::mapAndVectorAndBools
protected

Definition at line 84 of file MassSpectrum.hpp.

◆ pdgCodeMap

MassEigenstateCodeToPointerMap LHPC::MassSpectrum::pdgCodeMap
protected

Definition at line 82 of file MassSpectrum.hpp.

◆ unknownMassEigenstates

std::vector< MassEigenstate* > LHPC::MassSpectrum::unknownMassEigenstates
protected

Definition at line 81 of file MassSpectrum.hpp.


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