Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:24:27

0001 // -*- C++ -*-
0002 //
0003 // CrossSections.hpp is a part of myStatistics
0004 // Copyright (C) 2012-2019 Simon Platzer, The Herwig Collaboration
0005 //
0006 // myStatistics is licenced under version 3 of the GPL, see COPYING for details.
0007 //
0008 #ifndef MYSTATISTICS_CrossSections_hpp_included
0009 #define MYSTATISTICS_CrossSections_hpp_included
0010 
0011 #include "Distribution.h"
0012 
0013 namespace Statistics {
0014 
0015   /**
0016    * \brief A simulation run
0017    * \author Simon Platzer
0018    */
0019   class CrossSections {
0020 
0021   public:
0022 
0023     /**
0024      * Default constructor
0025      */
0026     CrossSections();
0027 
0028     /**
0029      * Construct giving a name and seed
0030      */
0031     explicit CrossSections(const std::string& newName);
0032 
0033     /**
0034      * Destructor
0035      */
0036     virtual ~CrossSections();
0037 
0038   public:
0039 
0040     /**
0041      * Add a distribution
0042      */
0043     Distribution& addDistribution(const Distribution&);
0044 
0045     /**
0046      * Return a given distribution
0047      */
0048     Distribution& distribution(const std::string& histoName);
0049 
0050     /**
0051      * Return a given distribution
0052      */
0053     const Distribution& distribution(const std::string& histoName) const;
0054 
0055     /**
0056      * Return the distributions
0057      */
0058     const std::map<std::string,Distribution>& distributions() const { return theDistributions; }
0059 
0060     /**
0061      * Return the name of the run
0062      */
0063     const std::string& name() const { return theName; }
0064 
0065     /**
0066      * Set the name of the run
0067      */
0068     void name(const std::string& newName) { theName = newName; }
0069 
0070     /**
0071      * The integral
0072      */
0073     double integral() const { return theIntegral; }
0074 
0075     /**
0076      * The variance of the integral
0077      */
0078     double varianceOfIntegral() const { return theVarianceOfIntegral; }
0079 
0080   public:
0081 
0082     /**
0083      * Add 
0084      */
0085     CrossSections& operator+=(const CrossSections& other);
0086 
0087   public:
0088 
0089     /**
0090      * Fill run data from an XML element
0091      */
0092     void fromXML(const XML::Element&);
0093 
0094     /**
0095      * Return an XML element for the data of this run
0096      */
0097     XML::Element toXML() const;
0098 
0099   private:
0100 
0101     /**
0102      * The name of the run
0103      */
0104     std::string theName;
0105 
0106     /**
0107      * The integral
0108      */
0109     double theIntegral;
0110 
0111     /**
0112      * The variance of the integral
0113      */
0114     double theVarianceOfIntegral;
0115 
0116     /**
0117      * The distributions
0118      */
0119     std::map<std::string,Distribution> theDistributions;
0120 
0121 
0122   };
0123 
0124 }
0125 
0126 #endif // MYSTATISTICS_CrossSections_hpp_included