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) 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 BDSPARALLELWORLDUTILITIES_H
19#define BDSPARALLELWORLDUTILITIES_H
20
21#include "BDSParallelWorldInfo.hh"
22#include "BDSParallelWorldImportance.hh"
23#include "G4GeometrySampler.hh"
24#include "globals.hh"
25
26#include <vector>
27
28class G4ParallelWorldPhysics;
29class G4VModularPhysicsList;
30class G4VUserDetectorConstruction;
31class G4VUserParallelWorld;
32
33namespace BDS
34{
39 std::vector<BDSParallelWorldInfo> NumberOfExtraWorldsRequired();
40
44 std::vector<G4VUserParallelWorld*> ConstructAndRegisterParallelWorlds(G4VUserDetectorConstruction* massWorld,
45 G4bool buildSamplerWorld,
46 G4bool buildPlacementFieldsWorld);
47
49 std::vector<G4ParallelWorldPhysics*> ConstructParallelWorldPhysics(const std::vector<G4VUserParallelWorld*>& worlds);
50
52 void RegisterSamplerPhysics(const std::vector<G4ParallelWorldPhysics*>& processes,
53 G4VModularPhysicsList* physicsList);
54
56 void AddIStore(const std::vector<G4VUserParallelWorld*>& worlds);
57
59 void RegisterImportanceBiasing(const std::vector<G4VUserParallelWorld*>& worlds,
60 G4VModularPhysicsList* physicsList);
61
63 BDSParallelWorldImportance* GetImportanceSamplingWorld(const std::vector<G4VUserParallelWorld*>& worlds);
64
65}
66
67#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.