BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
ResultHistogram.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) BDSIM Collaboration, 2001 - 2026.
3
4This file is part of BDSIM.
5
6BDSIM is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published
8by the Free Software Foundation version 3 of the License.
9
10BDSIM is distributed in the hope that it will be useful, but
11WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef COMPRESULTHISTOGRAM_H
19#define COMPRESULTHISTOGRAM_H
20
21#include "Result.hh"
22
23#include <iomanip>
24#include <sstream>
25#include <string>
26
34{
35public:
36 double h1Entries;
37 double h2Entries;
38 int h1NXBins;
39 int h2NXBins;
40 double h1XMean;
41 double h2XMean;
42 double h1XRms;
43 double h2XRms;
44 double h1Integral;
45 double h2Integral;
46 double chi2;
47 double tolerance;
48
49 virtual std::string print() const
50 {
51 const int nw = 15;
52 std::stringstream ss;
53 ss << Result::print();
54 ss << "Parameter" << std::setw(nw) << std::right << "file1" << " / "
55 << std::left << std::setw(nw) << "file2" << "\n";
56 ss << "Entries " << std::setw(nw) << std::right << h1Entries << " / "
57 << std::left << std::setw(nw) << h2Entries << "\n";
58 ss << "Bins " << std::setw(nw) << std::right << h1NXBins << " / "
59 << std::left << std::setw(nw) << h2NXBins << "\n";
60 ss << "X Mean " << std::setw(nw) << std::right << h1XMean << " / "
61 << std::left << std::setw(nw) << h2XMean << "\n";
62 ss << "X RMS " << std::setw(nw) << std::right << h1XRms << " / "
63 << std::left << std::setw(nw) << h2XRms << "\n";
64 ss << "Integral " << std::setw(nw) << std::right << h1Integral << " / "
65 << std::left << std::setw(nw) << h2Integral << "\n";
66 ss << "Chi^2 " << chi2 << " vs tolerance of " << tolerance;
67 return ss.str();
68 }
69
70 virtual ~ResultHistogram() {}
71};
72
73#endif
Result of comparing 2 histograms.
virtual std::string print() const
Print the result of the test - ie information store in the class.
Base class of a result.
Definition Result.hh:36
virtual std::string print() const
Print the result of the test - ie information store in the class.
Definition Result.hh:57