18#include "BDSAcceleratorModel.hh"
19#include "BDSBeamPipe.hh"
20#include "BDSBeamPipeFactory.hh"
21#include "BDSBeamPipeInfo.hh"
22#include "BDSGasCapillary.hh"
23#include "BDSColours.hh"
25#include "BDSException.hh"
26#include "BDSGlobalConstants.hh"
27#include "BDSMaterials.hh"
28#include "BDSSDType.hh"
29#include "BDSUtilities.hh"
30#include "BDSWarning.hh"
34#include "G4LogicalVolume.hh"
35#include "G4PVPlacement.hh"
36#include "G4SubtractionSolid.hh"
37#include "G4IntersectionSolid.hh"
39#include "G4UserLimits.hh"
40#include "G4VisAttributes.hh"
47 G4double horizontalWidthIn,
48 G4Material* capillaryOuterMaterialIn,
49 G4Material* capillaryGasMaterialIn,
50 G4Material* electrodesMaterialIn,
51 G4double capillaryGasDiameterIn,
52 G4double electrodeThicknessIn,
53 G4bool circularOuterIn):
55 horizontalWidth(horizontalWidthIn),
56 capillaryGasDiameter(capillaryGasDiameterIn),
57 electrodeThickness(electrodeThicknessIn),
58 circularOuter(circularOuterIn),
60 capillaryOuterSolid(nullptr),
61 capillaryGasSolid(nullptr),
62 electrodeSolid(nullptr),
64 capillaryOuterUncutSolid(nullptr),
65 electrodeUncutSolid(nullptr),
67 capillaryHoleSolid(nullptr),
68 electrodeHoleSolid(nullptr),
70 capillaryOuterMaterial(capillaryOuterMaterialIn),
71 capillaryGasMaterial(capillaryGasMaterialIn),
72 electrodeMaterial(electrodesMaterialIn)
75BDSGasCapillary::~BDSGasCapillary()
82 G4cerr << __METHOD_NAME__ <<
"aperture bigger than width!" << G4endl;
83 G4cerr <<
"Full horizontal width is " <<
horizontalWidth <<
" mm for component named: \""
84 <<
name <<
"\"" << G4endl;
86 throw BDSException(__METHOD_NAME__,
"Error in gas capillary");
90 G4cerr << __METHOD_NAME__ <<
"element need a non null aperture!" << G4endl;
91 throw BDSException(__METHOD_NAME__,
"Error in gas capillary");
143void BDSGasCapillary::BuildUncutSolid() {
173void BDSGasCapillary::BuildHolesSolid() {
189void BDSGasCapillary::BuildCutSolid()
193 G4RotationMatrix* Rot =
new G4RotationMatrix;
195 G4VSolid* capillaryOuterCut1Solid =
new G4SubtractionSolid(
name +
"_capillaryOuterCut1_solid",
198 G4VSolid* capillaryOuterCut2Solid =
new G4SubtractionSolid(
name +
"_capillaryOuterCut2_solid",
220 G4RotationMatrix* Rotate=
new G4RotationMatrix;
227 name +
"_capillaryOuter_lv");
229 name +
"_capillaryGas_lv");
231 name +
"_electrode_lv");
240 G4PVPlacement* capillaryOuterPV =
new G4PVPlacement(Rotate,
241 G4ThreeVector(0, 0, 0),
243 name +
"_capillaryOuter_pv",
249 G4PVPlacement* capillaryGasPV =
new G4PVPlacement(Rotate,
250 G4ThreeVector(0,0,0),
252 name +
"_capillaryGas_pv",
258 G4PVPlacement* electrodeFrontPV =
new G4PVPlacement(Rotate,
261 name +
"_electrodeFront_pv",
267 G4PVPlacement* electrodeBackPV =
new G4PVPlacement(Rotate,
270 name +
"_electrodeBack_pv",
282void BDSGasCapillary::SetupLV(G4LogicalVolume* lv, G4Colour* colour)
285 G4VisAttributes* gasVisAttr =
new G4VisAttributes(*colour);
286 lv->SetVisAttributes(gasVisAttr);
Abstract class that represents a component of an accelerator.
G4UserLimits * userLimits
Cache of user limits.
void SetAcceleratorVacuumLogicalVolume(G4LogicalVolume *accVacLVIn)
const G4String name
Const protected member variable that may not be changed by derived classes.
virtual void SetOutputFaceNormal(const G4ThreeVector &output)
Allow updating of face normals. Virtual so derived class may apply it to daughters.
static G4double lengthSafety
Useful variable often used in construction.
static G4bool checkOverlaps
Useful variable often used in construction.
virtual std::set< G4LogicalVolume * > GetAcceleratorVacuumLogicalVolumes() const
Access the 'vacuum' volume(s) in this component if any. Default is empty set.
static G4double lengthSafetyLarge
virtual void SetInputFaceNormal(const G4ThreeVector &input)
Allow updating of face normals. Virtual so derived class may apply it to daughters.
G4double chordLength
Protected member variable that can be modified by derived classes.
BDSBeamPipeInfo * beamPipeInfo
Optional beam pipe recipe that is written out to the survey if it exists.
The main interface for using the beam pipe factories.
static BDSBeamPipeFactory * Instance()
Singleton accessor.
Holder class for all information required to describe a beam pipe model.
A holder class for a piece of beam pipe geometry.
G4LogicalVolume * GetVacuumLogicalVolume() const
Access the vacuum volume to set fields and limits.
G4ThreeVector InputFaceNormal() const
Accessor.
G4ThreeVector OutputFaceNormal() const
Accessor.
static BDSColours * Instance()
singleton pattern
General exception with possible name of object and message.
G4double horizontalWidth
Horizontal width.
G4Material * capillaryOuterMaterial
Materials:
virtual G4String ElectrodeMaterial() const
Accessor.
G4VSolid * electrodeHoleSolid
Solids:
G4Material * electrodeMaterial
Materials:
BDSGasCapillary()=delete
Private default constructor to force the use of the supplied one.
G4Material * capillaryGasMaterial
Materials:
G4VSolid * capillaryGasSolid
Solids:
virtual void CheckParameters()
G4bool circularOuter
Aperture type of the outer wall.
virtual void BuildContainerLogicalVolume()
G4VSolid * capillaryOuterSolid
Solids:
virtual G4String CapillaryOuterMaterial() const
Accessor.
G4VSolid * electrodeSolid
Solids:
G4VSolid * electrodeUncutSolid
Solids:
G4double capillaryGasDiameter
Aperture diameter of the gas.
G4VSolid * capillaryOuterUncutSolid
Solids:
virtual G4String CapillaryGasMaterial() const
Accessor.
G4VSolid * capillaryHoleSolid
Solids:
G4double electrodeThickness
Thickness of the two electrodes.
G4LogicalVolume * GetContainerLogicalVolume() const
Accessor - see member for more info.
void InheritExtents(BDSGeometryComponent const *const anotherComponent)
Update the extents of this object with those of another object.
void RegisterDaughter(BDSGeometryComponent *anotherComponent)
void RegisterLogicalVolume(G4LogicalVolume *logicalVolume)
void RegisterPhysicalVolume(G4VPhysicalVolume *physicalVolume)
G4VSolid * GetContainerSolid() const
Accessor - see member for more info.
void RegisterVisAttributes(G4VisAttributes *visAttribute)
void RegisterSolid(G4VSolid *solid)
G4bool IsFinite(G4double value, G4double tolerance=std::numeric_limits< double >::epsilon())