a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
SpectrumUpdater.cpp
Go to the documentation of this file.
1/*
2 * SpectrumUpdater.cpp
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#include "MEC.hpp"
15
16namespace LHPC
17{
19 fmassMap( NULL ),
20 fmasserrMap( NULL ),
21 massMap( NULL ),
22 isHoldingDecayFlag( false ),
23 decayerCode( 0 ),
24 decayWidth( BOL::UsefulStuff::notANumber ),
25 decayChannels(),
26 branchingRatioAndProducts()
27 {
28 // just an initialization list.
29 }
30
32 {
33 // does nothing.
34 }
35
36
37 void
39 MassEigenstateCodeToPointerMap& codeMap ) const
40 {
41 MassEigenstate* massEigenstateFiller( NULL );
42 // 1st the masses from the MASS block are recorded:
43
44 if( NULL != massMap )
45 {
46 std::map< int, double >::const_iterator
47 massMapIterator( massMap->begin() );
48 while( massMap->end() != massMapIterator )
49 {
50 massEigenstateFiller
51 = MassEigenstate::findPointerWithCode( massMapIterator->first,
52 codeMap );
53 if( NULL != massEigenstateFiller )
54 {
55 massEigenstateFiller->recordMass( massMapIterator->second );
56 // now the charge-conjugate is considered:
57 if( !(massEigenstateFiller->getChargeConjugate(
59 {
60 massEigenstateFiller->getChargeConjugate().recordMass(
61 massMapIterator->second );
62 }
63 }
64 ++massMapIterator;
65 }
66 }
67
68 // then the masses from the FMASS block are recorded:
69 if( NULL != fmassMap )
70 {
71 std::multimap< int, RunningConstant >::const_iterator
72 fmassMapIterator( fmassMap->begin() );
73 while( fmassMap->end() != fmassMapIterator )
74 {
75 massEigenstateFiller
76 = MassEigenstate::findPointerWithCode( fmassMapIterator->first,
77 codeMap );
78 if( NULL != massEigenstateFiller )
79 {
80 massEigenstateFiller->recordMass(
81 fmassMapIterator->second.getValue(),
82 0.0,
83 0.0,
84 fmassMapIterator->second.getScheme(),
85 fmassMapIterator->second.getScale() );
86 // now the charge-conjugate is considered:
87 if( massEigenstateFiller->getChargeConjugate(
88 ).getAllRecordedMasses().size()
89 < massEigenstateFiller->getAllRecordedMasses().size() )
90 {
91 massEigenstateFiller->getChargeConjugate().recordMass(
92 fmassMapIterator->second.getValue(),
93 0.0,
94 0.0,
95 fmassMapIterator->second.getScheme(),
96 fmassMapIterator->second.getScale() );
97 }
98 }
99 ++fmassMapIterator;
100 }
101 }
102
103 // then the mass errors from the FMASSERR block are recorded:
104 if( NULL != fmasserrMap )
105 {
106 std::multimap< int, RunningConstantError >::const_iterator
107 fmasserrMapIterator( fmasserrMap->begin() );
108 while( fmasserrMap->end() != fmasserrMapIterator )
109 {
110 massEigenstateFiller
111 = MassEigenstate::findPointerWithCode( fmasserrMapIterator->first,
112 codeMap );
113 if( NULL != massEigenstateFiller )
114 {
115 massEigenstateFiller->recordMassError(
116 fmasserrMapIterator->second.getMinusUncertainty(),
117 fmasserrMapIterator->second.getPlusUncertainty(),
118 fmasserrMapIterator->second.getScheme(),
119 fmasserrMapIterator->second.getScale() );
120 // now the charge-conjugate is considered:
121 if( !(massEigenstateFiller->isSelfConjugate()) )
122 {
123 massEigenstateFiller->getChargeConjugate().recordMassError(
124 fmasserrMapIterator->second.getMinusUncertainty(),
125 fmasserrMapIterator->second.getPlusUncertainty(),
126 fmasserrMapIterator->second.getScheme(),
127 fmasserrMapIterator->second.getScale() );
128 // recordMassError does nothing if it doesn't find a matching
129 // running mass.
130 }
131 }
132 ++fmasserrMapIterator;
133 }
134 }
135
136 // finally the given decay is recorded:
138 {
140 massEigenstateFiller
142 codeMap );
143 massEigenstateFiller->setDecayWidth( decayWidth );
144 size_t numberOfChannels( decayChannels.size() );
145 for( size_t whichChannel( 0 );
146 numberOfChannels > whichChannel;
147 ++whichChannel )
148 {
149 decayRecorder.clearPointers();
150 for( int whichProduct( decayChannels[ whichChannel ].second.size()
151 - 1 );
152 0 <= whichProduct;
153 --whichProduct )
154 {
156 decayChannels[ whichChannel ].second[ whichProduct ],
157 codeMap ) );
158 }
159 decayRecorder.setPairedValueAndSortPointers(
160 decayChannels[ whichChannel ].first );
161 massEigenstateFiller->recordDecay( decayRecorder );
162 }
163
164 /* next, the mass eigenstate is checked for whether it has a charge
165 * conjugate & whether it has already recorded a decay (so that
166 * charge-conjugate pairs do not necessarily have the same decay widths
167 * & branching ratios: they are initially set to be so when the 1st of a
168 * pair is recorded, but if its charge conjugate is found, only the
169 * charge conjugate gets its decays overwritten.
170 */
171 if( !(massEigenstateFiller->isSelfConjugate())
172 &&
173 !(massEigenstateFiller->getChargeConjugate(
175 {
176 numberOfChannels = massEigenstateFiller->getDecaySet().size();
177 for( size_t whichDecay( 0 );
178 numberOfChannels > whichDecay;
179 ++whichDecay )
180 {
181 massEigenstateFiller->getChargeConjugate(
183 *(massEigenstateFiller->getDecaySet()[ whichDecay ]) );
184 }
185 massEigenstateFiller->getChargeConjugate().setDecayWidth( decayWidth );
186 }
187 }
188 }
189
190}
std::vector< MassEigenstatesPairedWithBr * > & getDecaySet()
bool hasMassBeenRecorded() const
void recordMass(double const massValue, double const minusUncertainty=0.0, double const plusUncertainty=0.0, int const schemeType=0, double const evaluationScale=0.0)
void recordDecay(MassEigenstatesPairedWithBr const &decayToRecord)
void recordChargeConjugateOfDecay(MassEigenstatesPairedWithBr const &decayToRecord)
std::vector< ExtendedMass * > const & getAllRecordedMasses() const
void setDecayWidth(double const decayWidth)
void recordMassError(double const minusUncertainty, double const plusUncertainty, int const schemeType, double const evaluationScale)
MassEigenstate & getChargeConjugate()
static MassEigenstate * findPointerWithCode(int pdgCode, MassEigenstateCodeMap const &codeMap)
bool isSelfConjugate() const
bool haveDecaysBeenRecorded() const
void addPointer(PointerClass const pointerToAdd)
void setPairedValueAndSortPointers(ValueClass const pairedValue)
std::map< int, double > const * massMap
std::multimap< int, RunningConstantError > const * fmasserrMap
std::multimap< int, RunningConstant > const * fmassMap
std::vector< std::pair< double, std::vector< int > > > decayChannels
void updateMassEigenstates(MassEigenstateCodeToPointerMap &codeMap) const
std::map< int, MassEigenstate * > MassEigenstateCodeToPointerMap