BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSParallelWorldCurvilinear.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 "BDSParallelWorldCurvilinear.hh"
24
25#include "G4String.hh"
26#include "G4LogicalVolume.hh"
27#include "G4VisAttributes.hh"
28#include "G4VPhysicalVolume.hh"
29
30class BDSBeamline;
31
33 G4VUserParallelWorld("CurvilinearWorld_" + name),
34 suffix(name),
35 clWorldVis(nullptr)
36{;}
37
38BDSParallelWorldCurvilinear::~BDSParallelWorldCurvilinear()
39{
40 delete clWorldVis;
41}
42
44{// general abbreviation: 'cl' == curvilinear
45#ifdef BDSDEBUG
46 G4cout << __METHOD_NAME__ << G4endl;
47#endif
48
49 G4VPhysicalVolume* clWorld = GetWorld();
50
51 // TODO - only register main one for now
52 // register read out world PV with our auxiliary navigator.
53 if (suffix == "main")
55
56 G4LogicalVolume* clWorldLV = clWorld->GetLogicalVolume();
57
58 // visualisation
60 clWorldVis = new G4VisAttributes(*(globals->VisibleDebugVisAttr()));
61 clWorldVis->SetForceWireframe(true);//just wireframe so we can see inside it
62 clWorldLV->SetVisAttributes(clWorldVis);
63
64 BDSBeamlineSet blSet = BDSAcceleratorModel::Instance()->BeamlineSet(suffix);
65
66 BDSDetectorConstruction::PlaceBeamlineInWorld(blSet.curvilinearWorld, clWorld,
67 globals->CheckOverlaps(), false, true, true);
68}
const BDSBeamlineSet & BeamlineSet(const G4String &name) const
Accessor.
static void AttachWorldVolumeToNavigatorCL(G4VPhysicalVolume *curvilinearWorldPVIn)
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.
BDSParallelWorldCurvilinear()=delete
No default constructor.
G4String suffix
Just the input part of the name.
G4VisAttributes * clWorldVis
Visualisation attributes for the world volume.