BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSBH4D.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2022.
4
5This file is part of BDSIM.
6
7BDSIM is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published
9by the Free Software Foundation version 3 of the License.
10
11BDSIM is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef BDSBH4D_H
20#define BDSBH4D_H
21#include "BDSBH4DBase.hh"
22
23#ifdef USE_BOOST
24#include <boost/histogram.hpp>
25#include "BDSBH4DTypeDefs.hh"
26#endif
27
28#include "Rtypes.h"
29#include "TH1D.h"
30#include "TTree.h"
31
32#include <vector>
33
39template<class T>
40class BDSBH4D: public BDSBH4DBase
41{
42#ifdef USE_BOOST
43public:
44 BDSBH4D();
45 BDSBH4D(std::string& name, std::string& title, const std::string& eScale,
46 unsigned int nxbins, double xmin, double xmax,
47 unsigned int nybins, double ymin, double ymax,
48 unsigned int nzbins, double zmin, double zmax,
49 unsigned int nebins, double emin, double emax);
50 BDSBH4D(std::string& name, std::string& title, const std::string& eScale,
51 const std::vector<double>& eBinsEdges,
52 unsigned int nxbins, double xmin, double xmax,
53 unsigned int nybins, double ymin, double ymax,
54 unsigned int nzbins, double zmin, double zmax);
55 virtual ~BDSBH4D();
56 T h;
57 T h_err;
58
59 BDSBH4DBase& operator+=(const BDSBH4DBase& other) override
60 {
61 h += dynamic_cast<const BDSBH4D<T>&>(other).h;
62 return *this;
63 }
64
65 void Reset_BDSBH4D() override;
66 BDSBH4D* Clone(const char*) const override;
67 void Fill_BDSBH4D(double, double, double, double) override;
68 void Set_BDSBH4D(int, int, int, int, double) override;
69 void SetError_BDSBH4D(int, int, int, int, double) override;
70 void Add_BDSBH4D(BDSBH4DBase*) override;
71 double At(int, int, int, int) override;
72 double AtError(int, int, int, int) override;
73 double LowBinEdgeAt(int, int, int, int) override;
74 double HighBinEdgeAt(int, int, int, int) override;
75 void Print_BDSBH4D(bool with_zero_values=true) override;
76 void Print_BDSBH4D(int, int, int, int) override;
77#endif
78
79 ClassDef(BDSBH4D,1);
80};
81
82#endif
Base class for the 4D histogram classes.
Definition: BDSBH4DBase.hh:37
4D histogram classes with linear, logarithmic and user-defined energy binning.
Definition: BDSBH4D.hh:41