BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSPSCellFluxScaled3D.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 BDSPSCELLFLUXSCALED3D_H
19#define BDSPSCELLFLUXSCALED3D_H
20
21#include "globals.hh"
22#include "G4THitsMap.hh"
23#include "G4VPrimitiveScorer.hh"
24
26class G4PhysicsVector;
27
41class BDSPSCellFluxScaled3D: public G4VPrimitiveScorer
42{
43public:
46 BDSPSCellFluxScaled3D(const G4String& scorerName,
47 const BDSHistBinMapper* mapperIn,
48 const G4String& unitIn = "percm2",
49 G4int ni=1, G4int nj=1, G4int nk=1,
50 G4int depi=2, G4int depj=1, G4int depk=0);
51
54 BDSPSCellFluxScaled3D(const G4String& scorerName,
55 const BDSHistBinMapper* mapperIn,
56 const G4String& filename,
57 const G4String& unitIn = "percm2",
58 G4int ni=1, G4int nj=1, G4int nk=1,
59 G4int depi=2, G4int depj=1, G4int depk=0);
60
61 virtual ~BDSPSCellFluxScaled3D() override;
62
63public:
64 void Initialize(G4HCofThisEvent* HCE) override;
65 void EndOfEvent(G4HCofThisEvent* HCE) override;
66 void clear() override;
67 G4bool ProcessHits(G4Step* aStep, G4TouchableHistory*) override;
68 G4int GetIndex(G4Step* aStep) override;
69
70 virtual G4double GetConversionFactor(G4int particleID,
71 G4double kineticEnergy) const;
72
73private:
75 void DefineUnitAndCategory() const;
76
77 G4int HCID3D;
79
81 G4int fDepthi;
82 G4int fDepthj;
83 G4int fDepthk;
85
87 G4PhysicsVector* conversionFactor;
88
91
92 std::map<G4VSolid*, G4double> volumeCache;
93};
94
95#endif
Mapping from axis indices to 1D index.
Primitive scorer for cell flux in a 3D mesh with a conversion factor.
G4THitsMap< G4double > * evtMap3D
Hits map.
const BDSHistBinMapper * mapper
Mapping from coordinate systems in mesh to global replica number.
G4int fDepthk
Depth in replica to look for each dimension.
G4PhysicsVector * conversionFactor
Conversion factor interpolator object.
G4int fDepthi
Depth in replica to look for each dimension.
G4int fDepthj
Depth in replica to look for each dimension.
void DefineUnitAndCategory() const
Define units -> taken from G4PSCellFlux.