BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSSimpleComponent.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 "BDSGeometryComponent.hh"
19#include "BDSSimpleComponent.hh"
20
21#include "globals.hh" // geant4 types / globals
22
24 BDSGeometryComponent* component,
25 G4double arcLengthIn,
26 G4double angleIn,
27 const G4ThreeVector& inputFaceNormalIn,
28 const G4ThreeVector& outputFaceNormalIn,
29 BDSBeamPipeInfo* beamPipeInfoIn):
30 BDSAcceleratorComponent(nameIn, arcLengthIn, angleIn, "simpleComponent", beamPipeInfoIn,
31 inputFaceNormalIn, outputFaceNormalIn)
32{
33 RegisterDaughter(component);
34 InheritExtents(component);
35 containerSolid = component->GetContainerSolid();
36 containerLogicalVolume = component->GetContainerLogicalVolume();
37 containerAssembly = component->GetContainerAssemblyVolume();
39}
40
42 G4double arcLengthIn,
43 G4double angleIn,
44 G4VSolid* containerSolidIn,
45 G4LogicalVolume* containerLogicalVolumeIn,
46 const BDSExtent& extentIn,
47 const G4ThreeVector& inputFaceNormalIn,
48 const G4ThreeVector& outputFaceNormalIn,
49 BDSBeamPipeInfo* beamPipeInfoIn):
50 BDSAcceleratorComponent(nameIn, arcLengthIn, angleIn, "simpleComponent", beamPipeInfoIn,
51 inputFaceNormalIn, outputFaceNormalIn)
52{
53 SetExtent(extentIn);
54 containerSolid = containerSolidIn;
55 containerLogicalVolume = containerLogicalVolumeIn;
56}
57
59{
61 // in each case this is used, user limits are attached already,
62 // so it is not needed to overwrite them here.
63}
Abstract class that represents a component of an accelerator.
Holder class for all information required to describe a beam pipe model.
Holder for +- extents in 3 dimensions.
Definition BDSExtent.hh:38
A generic geometry component for a bdsim model.
G4LogicalVolume * GetContainerLogicalVolume() const
Accessor - see member for more info.
G4bool ContainerIsAssembly() const
Whether the container is an assembly. If not, it's a logical volume.
void InheritExtents(BDSGeometryComponent const *const anotherComponent)
Update the extents of this object with those of another object.
G4AssemblyVolume * GetContainerAssemblyVolume() const
Accessor - see member for more info.
void RegisterDaughter(BDSGeometryComponent *anotherComponent)
G4VSolid * GetContainerSolid() const
Accessor - see member for more info.
void SetExtent(const BDSExtent &extIn)
Set extent.
G4bool containerIsAssembly
True if the 'container' is really an assembly; false if an LV.
BDSSimpleComponent(const G4String &name, BDSGeometryComponent *componentIn, G4double arcLength, G4double angle=0, const G4ThreeVector &inputFaceNormal=G4ThreeVector(0, 0,-1), const G4ThreeVector &outputFaceNormal=G4ThreeVector(0, 0, 1), BDSBeamPipeInfo *beamPipeInfo=nullptr)
virtual void BuildContainerLogicalVolume()
Required implementation from base class.