herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
MultiplicityInfo.h
1// -*- C++ -*-
2//
3// MultiplicityInfo.h is a part of Herwig - A multi-purpose Monte Carlo event generator
4// Copyright (C) 2002-2019 The Herwig Collaboration
5//
6// Herwig is licenced under version 3 of the GPL, see COPYING for details.
7// Please respe
8#include "Herwig/Utilities/Statistic.h"
9
10namespace Herwig {
11using namespace ThePEG;
12
17 lightMeson=0,strangeMeson,lightBaryon,other
18};
19
24
31 MultiplicityInfo(double mult=0.,double error=0.,
33 : obsMultiplicity(mult), obsError(error), type(type) {};
34
39
43 double obsError;
44
49
54
58 double simMultiplicity() { return count.mean();}
59
63 double simError() { return count.mean_stdDev();}
64
68 double nSigma() {
69 return obsMultiplicity == 0.0 ? 0.0 :
71 / sqrt(sqr(simError()) + sqr(obsError));
72 }
73
77 string bargraph() {
78 if (obsMultiplicity == 0.0) return " ? ";
79 else if (nSigma() >= 6.0) return "-----|---->";
80 else if (nSigma() >= 5.0) return "-----|----*";
81 else if (nSigma() >= 4.0) return "-----|---*-";
82 else if (nSigma() >= 3.0) return "-----|--*--";
83 else if (nSigma() >= 2.0) return "-----|-*---";
84 else if (nSigma() >= 1.0) return "-----|*----";
85 else if (nSigma() > -1.0) return "-----*-----";
86 else if (nSigma() > -2.0) return "----*|-----";
87 else if (nSigma() > -3.0) return "---*-|-----";
88 else if (nSigma() > -4.0) return "--*--|-----";
89 else if (nSigma() > -5.0) return "-*---|-----";
90 else if (nSigma() > -6.0) return "*----|-----";
91 else return "<----|-----";
92 }
93};
94}
The Statistic class is a simple class designed to store a variable for statistical analysis.
Definition: Statistic.h:23
double mean_stdDev() const
Error on the mean estimate.
Definition: Statistic.h:75
double mean() const
Mean.
Definition: Statistic.h:63
ParticleSpecies
Enumeration for species of particle.
-*- C++ -*-
double sqrt(int x)
constexpr auto sqr(const T &x) -> decltype(x *x)
Struct for the multiplcity data.
string bargraph()
Plot standard error in a simple barchart.
double simError()
The error on the average number per event.
double obsMultiplicity
The observed multiplicity.
Statistic count
Simulation statistics for particles of this type.
double nSigma()
Is the result more than from the experimental result.
double simMultiplicity()
The average number per event.
MultiplicityInfo(double mult=0., double error=0., ParticleSpecies type=other)
Default constructor.
double obsError
The error on the observed multiplicity.
ParticleSpecies type
The type of particle.