Thermal-FIST  1.3
Package for hadron resonance gas model applications
ThermalModelFitQuantities.h
Go to the documentation of this file.
1 /*
2  * Thermal-FIST package
3  *
4  * Copyright (c) 2019 Volodymyr Vovchenko
5  *
6  * GNU General Public License (GPLv3 or later)
7  */
8 #ifndef THERMALMODELFITQUANTITIES_H
9 #define THERMALMODELFITQUANTITIES_H
10 
11 #include <string>
12 
13 #include "HRGBase/ParticleDecay.h"
14 
21 namespace thermalfist {
22 
30  long long fPDGID;
31 
33  double fValue;
34 
36  double fError;
37 
40 
49  ExperimentMultiplicity(long long PDGID = -211, double value = 300., double error = 20., Feeddown::Type fd = Feeddown::StabilityFlag) :
50  fPDGID(PDGID), fValue(value), fError(error), fFeedDown(fd) { }
51 
53  void addSystematicError(double percent) {
54  fError = sqrt(fError*fError + percent * percent * fValue * fValue);
55  }
56  };
57 
63  struct ExperimentRatio {
65  long long fPDGID1;
66 
68  long long fPDGID2;
69 
71  double fValue;
72 
74  double fError;
75 
78 
81 
92  ExperimentRatio(long long PDGID1 = 211, long long PDGID2 = -211, double value = 1., double error = 0.1, Feeddown::Type fd1 = Feeddown::StabilityFlag, Feeddown::Type fd2 = Feeddown::StabilityFlag) :
93  fPDGID1(PDGID1), fPDGID2(PDGID2), fValue(value), fError(error), fFeedDown1(fd1), fFeedDown2(fd2) { }
94 
110  ExperimentRatio(long long PDGID1, long long PDGID2, double value1, double error1, double value2, double error2, Feeddown::Type fd1 = Feeddown::StabilityFlag, Feeddown::Type fd2 = Feeddown::StabilityFlag) :
111  fPDGID1(PDGID1), fPDGID2(PDGID2), fFeedDown1(fd1), fFeedDown2(fd2) {
112  fValue = value1 / value2;
113  fError = sqrt(error1*error1 / value2 / value2 + value1 * value1 / value2 / value2 / value2 / value2 * error2 * error2);
114  }
115  };
116 
122  struct FittedQuantity {
125  Multiplicity = 0,
126  Ratio = 1
127  };
128 
131 
133  bool toFit;
134 
137 
140 
143  toFit = true;
145  mult = ExperimentMultiplicity(-211, 10., 1.);
146  }
147 
151  toFit = true;
153  mult = op;
154  }
155 
159  toFit = true;
160  type = FittedQuantity::Ratio;
161  ratio = op;
162  }
163 
165  double Value() const {
166  if (type == Multiplicity)
167  return mult.fValue;
168  else
169  return ratio.fValue;
170  }
171 
173  double ValueError() const {
174  if (type == Multiplicity)
175  return mult.fError;
176  else
177  return ratio.fError;
178  }
179  };
180 
181 } // namespace thermalfist
182 
183 #endif
bool toFit
Whether this quantity contributes to the of a fit.
FittedQuantity(const ExperimentMultiplicity &op)
FittedQuantity(const ExperimentRatio &op)
ExperimentMultiplicity(long long PDGID=-211, double value=300., double error=20., Feeddown::Type fd=Feeddown::StabilityFlag)
Construct a new ExperimentMultiplicity object.
FittedQuantityType type
Whether it is a yield (multiplicity) or a ratio.
Feeddown::Type fFeedDown2
The feeddown contributions to be included for the yield in the denominator.
Structure describing the measurement to be fitted or compared to model.
ExperimentRatio(long long PDGID1, long long PDGID2, double value1, double error1, double value2, double error2, Feeddown::Type fd1=Feeddown::StabilityFlag, Feeddown::Type fd2=Feeddown::StabilityFlag)
Construct a new ExperimentRatio object two individual yields and their errors.
long long fPDGID
PDG code of the particle yield.
long long fPDGID1
PDG code of the particle yield in the numerator.
ExperimentMultiplicity mult
The yield data. Used if type is FittedQuantityType::Multiplicity.
void addSystematicError(double percent)
Adds a relative systematic error as a fraction of the total yield.
ExperimentRatio ratio
The ratio data. Used if type is FittedQuantityType::Ratio.
Structure containing the experimental ratio of yields to be fitted.
Feeddown::Type fFeedDown
The feeddown contributions to be included.
double fError
Experimental error of the yield ratio.
double fValue
Experimental value of the yield ratio.
FittedQuantityType
Yield (multiplicity) or ratio.
ExperimentRatio(long long PDGID1=211, long long PDGID2=-211, double value=1., double error=0.1, Feeddown::Type fd1=Feeddown::StabilityFlag, Feeddown::Type fd2=Feeddown::StabilityFlag)
Construct a new ExperimentRatio object.
double ValueError() const
Error of the measurement.
Contains structures related to particle decays.
Structure containing the experimental yield (multiplicity) to be fitted.
long long fPDGID2
PDG code of the particle yield in the denominator.
The main namespace where all classes and functions of the Thermal-FIST library reside.
double Value() const
Value of the measurement.
Feeddown::Type fFeedDown1
The feeddown contributions to be included for the yield in the numerator.
Feeddown from all particles marked as unstable.
Definition: ParticleDecay.h:37