BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSParallelWorldCurvilinearBridge.cc
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#include "BDSAcceleratorModel.hh"
19#include "BDSAuxiliaryNavigator.hh"
20#include "BDSDebug.hh"
21#include "BDSDetectorConstruction.hh"
22#include "BDSGlobalConstants.hh"
23#include "BDSParallelWorldCurvilinearBridge.hh"
24
25#include "G4String.hh"
26#include "G4LogicalVolume.hh"
27#include "G4VisAttributes.hh"
28#include "G4VPhysicalVolume.hh"
29
30class BDSBeamline;
31
33 G4VUserParallelWorld("CurvilinearBridgeWorld_" + name),
34 suffix(name),
35 clbWorldVis(nullptr)
36{;}
37
38BDSParallelWorldCurvilinearBridge::~BDSParallelWorldCurvilinearBridge()
39{
40 delete clbWorldVis;
41}
42
44{// general abbreviation: 'clb' == curvilinear bridge
45#ifdef BDSDEBUG
46 G4cout << __METHOD_NAME__ << G4endl;
47#endif
48
49 G4VPhysicalVolume* clbWorld = GetWorld();
50
51 // TODO - only register main one for now
52 // Register read out world PV with our auxiliary navigator.
53 if (suffix == "main")
54 {BDSAuxiliaryNavigator::RegisterCurvilinearBridgeWorld(clbWorld);}
55
56 // Visualisation
57 G4LogicalVolume* clbWorldLV = clbWorld->GetLogicalVolume();
59 clbWorldVis = new G4VisAttributes(*(globals->VisibleDebugVisAttr()));
60 clbWorldVis->SetForceWireframe(true);//just wireframe so we can see inside it
61 clbWorldLV->SetVisAttributes(clbWorldVis);
62
63 BDSBeamlineSet blSet = BDSAcceleratorModel::Instance()->BeamlineSet(suffix);
64
65 BDSDetectorConstruction::PlaceBeamlineInWorld(blSet.curvilinearBridgeWorld, clbWorld,
66 globals->CheckOverlaps(), false, true, true);
67}
const BDSBeamlineSet & BeamlineSet(const G4String &name) const
Accessor.
Simple struct to return a beamline plus associated beam lines.
A vector of BDSBeamlineElement instances - a beamline.
static void PlaceBeamlineInWorld(BDSBeamline *beamline, G4VPhysicalVolume *containerPV, G4bool checkOverlaps=false, G4bool setRegions=false, G4bool registerInfo=false, G4bool useCLPlacementTransform=false, G4bool useIncrementalCopyNumbers=false, G4bool registerPlacementNamesForOutput=false)
A class that holds global options and constants.
static BDSGlobalConstants * Instance()
Access method.
BDSParallelWorldCurvilinearBridge()=delete
No default constructor.
G4String suffix
Just the input part of the name.
G4VisAttributes * clbWorldVis
Visualisation attributes for the world volume.