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) 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#include "BDSGeometryComponent.hh"
20#include "BDSSimpleComponent.hh"
21
22#include "globals.hh" // geant4 types / globals
23
25 BDSGeometryComponent* component,
26 G4double arcLengthIn,
27 G4double angleIn,
28 const G4ThreeVector& inputFaceNormalIn,
29 const G4ThreeVector& outputFaceNormalIn,
30 BDSBeamPipeInfo* beamPipeInfoIn):
31 BDSAcceleratorComponent(nameIn, arcLengthIn, angleIn, "simpleComponent", beamPipeInfoIn,
32 inputFaceNormalIn, outputFaceNormalIn)
33{
34 RegisterDaughter(component);
35 InheritExtents(component);
36 containerSolid = component->GetContainerSolid();
37 containerLogicalVolume = component->GetContainerLogicalVolume();
38 containerAssembly = component->GetContainerAssemblyVolume();
40}
41
43 G4double arcLengthIn,
44 G4double angleIn,
45 G4VSolid* containerSolidIn,
46 G4LogicalVolume* containerLogicalVolumeIn,
47 const BDSExtent& extentIn,
48 const G4ThreeVector& inputFaceNormalIn,
49 const G4ThreeVector& outputFaceNormalIn,
50 BDSBeamPipeInfo* beamPipeInfoIn):
51 BDSAcceleratorComponent(nameIn, arcLengthIn, angleIn, "simpleComponent", beamPipeInfoIn,
52 inputFaceNormalIn, outputFaceNormalIn)
53{
54 SetExtent(extentIn);
55 containerSolid = containerSolidIn;
56 containerLogicalVolume = containerLogicalVolumeIn;
57}
58
60{
62 // in each case this is used, user limits are attached already,
63 // so it is not needed to overwrite them here.
64}
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:39
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.