BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSBH4D.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 BDSBH4D_H
19#define BDSBH4D_H
20#include "BDSBH4DBase.hh"
21
22#ifdef USE_BOOST
23#include <boost/histogram.hpp>
24#include "BDSBH4DTypeDefs.hh"
25#endif
26
27#include "Rtypes.h"
28#include "TH1D.h"
29#include "TTree.h"
30
31#include <vector>
32
38template<class T>
39class BDSBH4D: public BDSBH4DBase
40{
41#ifdef USE_BOOST
42public:
43 BDSBH4D();
44 BDSBH4D(std::string& name, std::string& title, const std::string& eScale,
45 unsigned int nxbins, double xmin, double xmax,
46 unsigned int nybins, double ymin, double ymax,
47 unsigned int nzbins, double zmin, double zmax,
48 unsigned int nebins, double emin, double emax);
49 BDSBH4D(std::string& name, std::string& title, const std::string& eScale,
50 const std::vector<double>& eBinsEdges,
51 unsigned int nxbins, double xmin, double xmax,
52 unsigned int nybins, double ymin, double ymax,
53 unsigned int nzbins, double zmin, double zmax);
54 virtual ~BDSBH4D();
55 T h;
56 T h_err;
57
58 BDSBH4DBase& operator+=(const BDSBH4DBase& other) override
59 {
60 h += dynamic_cast<const BDSBH4D<T>&>(other).h;
61 return *this;
62 }
63
64 void Reset_BDSBH4D() override;
65 BDSBH4D* Clone(const char*) const override;
66 void Fill_BDSBH4D(double, double, double, double) override;
67 void Set_BDSBH4D(int, int, int, int, double) override;
68 void SetError_BDSBH4D(int, int, int, int, double) override;
69 void Add_BDSBH4D(BDSBH4DBase*) override;
70 double At(int, int, int, int) override;
71 double AtError(int, int, int, int) override;
72 double LowBinEdgeAt(int, int, int, int) override;
73 double HighBinEdgeAt(int, int, int, int) override;
74 void Print_BDSBH4D(bool with_zero_values=true) override;
75 void Print_BDSBH4D(int, int, int, int) override;
76#endif
77
78 ClassDef(BDSBH4D,1);
79};
80
81#endif
Base class for the 4D histogram classes.
4D histogram classes with linear, logarithmic and user-defined energy binning.
Definition BDSBH4D.hh:40