BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSParallelWorldUtilities.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2023.
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 BDSPARALLELWORLDUTILITIES_H
20#define BDSPARALLELWORLDUTILITIES_H
21
22#include "BDSParallelWorldInfo.hh"
23#include "BDSParallelWorldImportance.hh"
24#include "G4GeometrySampler.hh"
25#include "globals.hh"
26
27#include <vector>
28
29class G4ParallelWorldPhysics;
30class G4VModularPhysicsList;
31class G4VUserDetectorConstruction;
32class G4VUserParallelWorld;
33
34namespace BDS
35{
40 std::vector<BDSParallelWorldInfo> NumberOfExtraWorldsRequired();
41
45 std::vector<G4VUserParallelWorld*> ConstructAndRegisterParallelWorlds(G4VUserDetectorConstruction* massWorld,
46 G4bool buildSamplerWorld,
47 G4bool buildPlacementFieldsWorld);
48
50 std::vector<G4ParallelWorldPhysics*> ConstructParallelWorldPhysics(const std::vector<G4VUserParallelWorld*>& worlds);
51
53 void RegisterSamplerPhysics(const std::vector<G4ParallelWorldPhysics*>& processes,
54 G4VModularPhysicsList* physicsList);
55
57 void AddIStore(const std::vector<G4VUserParallelWorld*>& worlds);
58
60 void RegisterImportanceBiasing(const std::vector<G4VUserParallelWorld*>& worlds,
61 G4VModularPhysicsList* physicsList);
62
64 BDSParallelWorldImportance* GetImportanceSamplingWorld(const std::vector<G4VUserParallelWorld*>& worlds);
65
66}
67
68#endif
Class that constructs a parallel importance world.
Return either G4Tubs or G4CutTubs depending on flat face.
std::vector< G4ParallelWorldPhysics * > ConstructParallelWorldPhysics(const std::vector< G4VUserParallelWorld * > &worlds)
Construct the parallel physics process for each sampler world.
void RegisterSamplerPhysics(const std::vector< G4ParallelWorldPhysics * > &processes, G4VModularPhysicsList *physicsList)
Register each parallel physics process to the main physics list.
std::vector< BDSParallelWorldInfo > NumberOfExtraWorldsRequired()
void RegisterImportanceBiasing(const std::vector< G4VUserParallelWorld * > &worlds, G4VModularPhysicsList *physicsList)
Create importance geometry sampler and register importance biasing with physics list.
std::vector< G4VUserParallelWorld * > ConstructAndRegisterParallelWorlds(G4VUserDetectorConstruction *massWorld, G4bool buildSamplerWorld, G4bool buildPlacementFieldsWorld)
BDSParallelWorldImportance * GetImportanceSamplingWorld(const std::vector< G4VUserParallelWorld * > &worlds)
Get importance sampling world from list of all parallel worlds.
void AddIStore(const std::vector< G4VUserParallelWorld * > &worlds)
Get store, and prepare importance sampling for importance geometry sampler.