herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
CrossSections.h
1 // -*- C++ -*-
2 //
3 // CrossSections.hpp is a part of myStatistics
4 // Copyright (C) 2012-2019 Simon Platzer, The Herwig Collaboration
5 //
6 // myStatistics is licenced under version 3 of the GPL, see COPYING for details.
7 //
8 #ifndef MYSTATISTICS_CrossSections_hpp_included
9 #define MYSTATISTICS_CrossSections_hpp_included
10 
11 #include "Distribution.h"
12 
13 namespace Statistics {
14 
19  class CrossSections {
20 
21  public:
22 
26  CrossSections();
27 
31  explicit CrossSections(const std::string& newName);
32 
36  virtual ~CrossSections();
37 
38  public:
39 
44 
48  Distribution& distribution(const std::string& histoName);
49 
53  const Distribution& distribution(const std::string& histoName) const;
54 
58  const std::map<std::string,Distribution>& distributions() const { return theDistributions; }
59 
63  const std::string& name() const { return theName; }
64 
68  void name(const std::string& newName) { theName = newName; }
69 
73  double integral() const { return theIntegral; }
74 
78  double varianceOfIntegral() const { return theVarianceOfIntegral; }
79 
80  public:
81 
85  CrossSections& operator+=(const CrossSections& other);
86 
87  public:
88 
92  void fromXML(const XML::Element&);
93 
97  XML::Element toXML() const;
98 
99  private:
100 
104  std::string theName;
105 
109  double theIntegral;
110 
115 
119  std::map<std::string,Distribution> theDistributions;
120 
121 
122  };
123 
124 }
125 
126 #endif // MYSTATISTICS_CrossSections_hpp_included
A (one dimensional) distribution.
Definition: Distribution.h:21
double varianceOfIntegral() const
The variance of the integral.
Definition: CrossSections.h:78
std::string theName
The name of the run.
Distribution & addDistribution(const Distribution &)
Add a distribution.
void fromXML(const XML::Element &)
Fill run data from an XML element.
double theVarianceOfIntegral
The variance of the integral.
void name(const std::string &newName)
Set the name of the run.
Definition: CrossSections.h:68
double integral() const
The integral.
Definition: CrossSections.h:73
Definition: Bin.h:16
Distribution & distribution(const std::string &histoName)
Return a given distribution.
A simulation run.
Definition: CrossSections.h:19
virtual ~CrossSections()
Destructor.
const std::map< std::string, Distribution > & distributions() const
Return the distributions.
Definition: CrossSections.h:58
XML::Element toXML() const
Return an XML element for the data of this run.
std::map< std::string, Distribution > theDistributions
The distributions.
Element represents a (tree of) XML elements.
Definition: Element.h:56
CrossSections & operator+=(const CrossSections &other)
Add.
const std::string & name() const
Return the name of the run.
Definition: CrossSections.h:63
double theIntegral
The integral.
CrossSections()
Default constructor.