19#include "BDSAcceleratorModel.hh"
20#include "BDSBeamPipe.hh"
21#include "BDSBeamPipeFactory.hh"
22#include "BDSBeamPipeInfo.hh"
23#include "BDSGasCapillary.hh"
24#include "BDSColours.hh"
26#include "BDSException.hh"
27#include "BDSGlobalConstants.hh"
28#include "BDSMaterials.hh"
29#include "BDSSDType.hh"
30#include "BDSUtilities.hh"
31#include "BDSWarning.hh"
35#include "G4LogicalVolume.hh"
36#include "G4PVPlacement.hh"
37#include "G4SubtractionSolid.hh"
38#include "G4IntersectionSolid.hh"
40#include "G4UserLimits.hh"
41#include "G4VisAttributes.hh"
48 G4double horizontalWidthIn,
49 G4Material* capillaryOuterMaterialIn,
50 G4Material* capillaryGasMaterialIn,
51 G4Material* electrodesMaterialIn,
52 G4double capillaryGasDiameterIn,
53 G4double electrodeThicknessIn,
54 G4bool circularOuterIn):
56 horizontalWidth(horizontalWidthIn),
57 capillaryGasDiameter(capillaryGasDiameterIn),
58 electrodeThickness(electrodeThicknessIn),
59 circularOuter(circularOuterIn),
61 capillaryOuterSolid(nullptr),
62 capillaryGasSolid(nullptr),
63 electrodeSolid(nullptr),
65 capillaryOuterUncutSolid(nullptr),
66 electrodeUncutSolid(nullptr),
68 capillaryHoleSolid(nullptr),
69 electrodeHoleSolid(nullptr),
71 capillaryOuterMaterial(capillaryOuterMaterialIn),
72 capillaryGasMaterial(capillaryGasMaterialIn),
73 electrodeMaterial(electrodesMaterialIn)
76BDSGasCapillary::~BDSGasCapillary()
83 G4cerr << __METHOD_NAME__ <<
"aperture bigger than width!" << G4endl;
84 G4cerr <<
"Full horizontal width is " <<
horizontalWidth <<
" mm for component named: \""
85 <<
name <<
"\"" << G4endl;
87 throw BDSException(__METHOD_NAME__,
"Error in gas capillary");
91 G4cerr << __METHOD_NAME__ <<
"element need a non null aperture!" << G4endl;
92 throw BDSException(__METHOD_NAME__,
"Error in gas capillary");
144void BDSGasCapillary::BuildUncutSolid() {
174void BDSGasCapillary::BuildHolesSolid() {
190void BDSGasCapillary::BuildCutSolid()
194 G4RotationMatrix* Rot =
new G4RotationMatrix;
196 G4VSolid* capillaryOuterCut1Solid =
new G4SubtractionSolid(
name +
"_capillaryOuterCut1_solid",
199 G4VSolid* capillaryOuterCut2Solid =
new G4SubtractionSolid(
name +
"_capillaryOuterCut2_solid",
221 G4RotationMatrix* Rotate=
new G4RotationMatrix;
228 name +
"_capillaryOuter_lv");
230 name +
"_capillaryGas_lv");
232 name +
"_electrode_lv");
241 G4PVPlacement* capillaryOuterPV =
new G4PVPlacement(Rotate,
242 G4ThreeVector(0, 0, 0),
244 name +
"_capillaryOuter_pv",
250 G4PVPlacement* capillaryGasPV =
new G4PVPlacement(Rotate,
251 G4ThreeVector(0,0,0),
253 name +
"_capillaryGas_pv",
259 G4PVPlacement* electrodeFrontPV =
new G4PVPlacement(Rotate,
262 name +
"_electrodeFront_pv",
268 G4PVPlacement* electrodeBackPV =
new G4PVPlacement(Rotate,
271 name +
"_electrodeBack_pv",
283void BDSGasCapillary::SetupLV(G4LogicalVolume* lv, G4Colour* colour)
286 G4VisAttributes* gasVisAttr =
new G4VisAttributes(*colour);
287 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())