BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
HistogramAccumulatorMerge.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 HISTOGRAMACCUMULATORMERGE_H
19#define HISTOGRAMACCUMULATORMERGE_H
20
21#include "HistogramAccumulator.hh"
22
23#include <string>
24
25#include "Rtypes.h" // for classdef
26
27class TH1;
28
44{
45public:
48
50 HistogramAccumulatorMerge(TH1* baseHistogram,
51 int nDimensionsIn,
52 const std::string& resultHistName,
53 const std::string& resultHistTitle);
54
56
59 virtual void Accumulate(TH1* newValue);
60
61protected:
62
66 virtual void AccumulateSingleValue(double oldMean,
67 double oldVari,
68 double x,
69 double xVari,
70 unsigned long nEntriesAccumulated,
71 unsigned long nEntriesToAccumulate,
72 double& newMean,
73 double& newVari) const;
74
75 ClassDef(HistogramAccumulatorMerge,1);
76};
77
78#endif
Class to combine histograms of mean with error on mean.
virtual void AccumulateSingleValue(double oldMean, double oldVari, double x, double xVari, unsigned long nEntriesAccumulated, unsigned long nEntriesToAccumulate, double &newMean, double &newVari) const
virtual void Accumulate(TH1 *newValue)
HistogramAccumulatorMerge()
Default constructor only for ROOT reflexivity - not intended for use.
Class to accumulate and merge histograms in different ways.
const std::string resultHistName
Name for resultant histogram.
const std::string resultHistTitle
Title for resultant histogram.