BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSHistBinMapper.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 BDSHISTBINMAPPER_H
19#define BDSHISTBINMAPPER_H
20
21#include "BDSBH4DTypeDefs.hh"
22#include "G4ThreeVector.hh"
23
31{
32public:
33 BDSHistBinMapper(G4int nBinsIIn,
34 G4int nBinsJIn,
35 G4int nBinsKIn,
36 G4int nBinsLIn);
37#ifdef USE_BOOST
38 BDSHistBinMapper(G4int nBinsIIn,
39 G4int nBinsJIn,
40 G4int nBinsKIn,
41 G4int nBinsLIn,
42 boost_histogram_axes_variant energyAxisIn);
43#endif
44
45 virtual ~BDSHistBinMapper(){;}
46
47 virtual G4int GlobalFromIJKLIndex(G4int iIndex,
48 G4int jIndex,
49 G4int kIndex,
50 G4int lIndex = 0) const;
51
52 virtual void IJKLFromGlobal(G4int globalBin,
53 G4int& iIndex,
54 G4int& jIndex,
55 G4int& kIndex,
56 G4int& lIndex) const;
57
58 inline G4double NBinsI() const {return nBinsI;}
59 inline G4double NBinsJ() const {return nBinsJ;}
60 inline G4double NBinsK() const {return nBinsK;}
61 inline G4double NBinsL() const {return nBinsL;}
62
63#ifdef USE_BOOST
64 inline boost_histogram_axes_variant GetEnergyAxis() const {return energyAxis;}
65#endif
66
67protected:
68 G4int nBinsI;
69 G4int nBinsJ;
70 G4int nBinsK;
71 G4int nBinsL;
72#ifdef USE_BOOST
73 boost_histogram_axes_variant energyAxis;
74#endif
75};
76
77#endif
Mapping from axis indices to 1D index.