herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
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 
10 namespace Herwig {
11 using namespace ThePEG;
12 
17  lightMeson=0,strangeMeson,lightBaryon,other
18 };
19 
24 
31  MultiplicityInfo(double mult=0.,double error=0.,
32  ParticleSpecies type=other)
33  : obsMultiplicity(mult), obsError(error), type(type) {};
34 
38  double obsMultiplicity;
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 :
70  (simMultiplicity() - obsMultiplicity)
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 }
double obsError
The error on the observed multiplicity.
The Statistic class is a simple class designed to store a variable for statistical analysis...
Definition: Statistic.h:23
double sqrt(int x)
double obsMultiplicity
The observed multiplicity.
ParticleSpecies
Enumeration for species of particle.
double simMultiplicity()
The average number per event.
constexpr auto sqr(const T &x) -> decltype(x *x)
double simError()
The error on the average number per event.
double nSigma()
Is the result more than from the experimental result.
MultiplicityInfo(double mult=0., double error=0., ParticleSpecies type=other)
Default constructor.
ParticleSpecies type
The type of particle.
double mean() const
Mean.
Definition: Statistic.h:63
-*- C++ -*-
double mean_stdDev() const
Error on the mean estimate.
Definition: Statistic.h:75
string bargraph()
Plot standard error in a simple barchart.
Statistic count
Simulation statistics for particles of this type.
Struct for the multiplcity data.