a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
SpectrumUpdater.hpp
Go to the documentation of this file.
1/*
2 * SpectrumUpdater.hpp
3 *
4 * Created on: Mar 15, 2012
5 * Author: Ben O'Leary (benjamin.oleary@gmail.com)
6 * Copyright 2012 Ben O'Leary
7 *
8 * This file is part of LesHouchesParserClasses, released under the
9 * GNU General Public License. Please see the accompanying
10 * README.LHPC_CPP.txt file for a full list of files, brief documentation
11 * on how to use these classes, and further details on the license.
12 */
13
14#ifndef SPECTRUMUPDATER_HPP_
15#define SPECTRUMUPDATER_HPP_
16
17#include <map>
18#include <vector>
20#include "MassEigenstate.hpp"
21#include "RunningConstant.hpp"
23
24namespace LHPC
25{
26 // this is a class that holds information to allow a MassSpectrum instance to
27 // update its masses and decays.
29 {
30 public:
33
34 void
35 setFmassMap( std::multimap< int, RunningConstant > const* fmassMap );
36 void
38 std::multimap< int, RunningConstantError > const* fmasserrMap );
39 void
40 setMassMap( std::map< int, double > const* massMap );
41 bool
42 isHoldingDecay() const;
43 void
44 clearDecay();
45 void
46 recordDecayHeader( std::string const& decayerCode,
47 std::string const& decayWidth );
48 void
50 void
52
53
54 protected:
55 std::multimap< int, RunningConstant > const* fmassMap;
56 std::multimap< int, RunningConstantError > const* fmasserrMap;
57 std::map< int, double > const* massMap;
60 double decayWidth;
61 std::vector< std::pair< double, std::vector< int > > >
63 std::pair< double, std::vector< int > > branchingRatioAndProducts;
64 };
65
66
67
68
69
70 inline void
72 std::multimap< int, RunningConstant > const* fmassMap )
73 {
74 this->fmassMap = fmassMap;
75 }
76
77 inline void
79 std::multimap< int, RunningConstantError > const* fmasserrMap )
80 {
81 this->fmasserrMap = fmasserrMap;
82 }
83
84 inline void
85 SpectrumUpdater::setMassMap( std::map< int, double > const* massMap )
86 {
87 this->massMap = massMap;
88 }
89
90 inline bool
92 {
93 return isHoldingDecayFlag;
94 }
95
96 inline void
98 {
99 decayChannels.clear();
100 isHoldingDecayFlag = false;
101 }
102
103 inline void
104 SpectrumUpdater::recordDecayHeader( std::string const& decayerCode,
105 std::string const& decayWidth )
106 {
107 this->decayerCode = BOL::StringParser::stringToInt( decayerCode );
108 this->decayWidth = BOL::StringParser::stringToDouble( decayWidth );
109 isHoldingDecayFlag = true;
110 }
111
112 inline void
114 BOL::VectorlikeArray< std::string > const& decayLine )
115 {
117 = BOL::StringParser::stringToDouble( decayLine[ 0 ] );
118 branchingRatioAndProducts.second.clear();
119 for( int whichWord( decayLine.getLastIndex() );
120 1 < whichWord;
121 --whichWord )
122 {
123 branchingRatioAndProducts.second.push_back(
124 BOL::StringParser::stringToInt( decayLine[ whichWord ] ) );
125 }
127 }
128
129}
130
131#endif /* SPECTRUMUPDATER_HPP_ */
static double stringToDouble(std::string const &stringToInterpret)
static int stringToInt(std::string const &stringToInterpret)
void recordDecayHeader(std::string const &decayerCode, std::string const &decayWidth)
void recordDecayLine(BOL::VectorlikeArray< std::string > const &decayLine)
std::map< int, double > const * massMap
void setFmasserrMap(std::multimap< int, RunningConstantError > const *fmasserrMap)
std::multimap< int, RunningConstantError > const * fmasserrMap
std::multimap< int, RunningConstant > const * fmassMap
std::pair< double, std::vector< int > > branchingRatioAndProducts
std::vector< std::pair< double, std::vector< int > > > decayChannels
void updateMassEigenstates(MassEigenstateCodeToPointerMap &codeMap) const
void setFmassMap(std::multimap< int, RunningConstant > const *fmassMap)
void setMassMap(std::map< int, double > const *massMap)
std::map< int, MassEigenstate * > MassEigenstateCodeToPointerMap