BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
HistogramAccumulatorSum.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 HISTOGRAMACCUMULATORSUM_H
19#define HISTOGRAMACCUMULATORSUM_H
20
21#include "HistogramAccumulator.hh"
22
23#include <string>
24
25#include "Rtypes.h" // for classdef
26
27class TH1;
28
38{
39public:
42
44 HistogramAccumulatorSum(TH1* baseHistogram,
45 int nDimensionsIn,
46 const std::string& resultHistName,
47 const std::string& resultHistTitle);
48
49 virtual ~HistogramAccumulatorSum(){;}
50
52 virtual void Accumulate(TH1* newValue);
53
55 virtual TH1* Terminate();
56
57 ClassDef(HistogramAccumulatorSum, 1);
58};
59
60#endif
virtual void Accumulate(TH1 *newValue)
Use TH1::Add which works on 1,2 and 3D histograms.
virtual TH1 * Terminate()
Simply return the result as it's already the correct result.
HistogramAccumulatorSum()
Public constructor only for compatibility with ROOT - 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.