Public Member Functions | Private Member Functions | Private Attributes | List of all members
CaptWorldBuilder Class Reference

#include <CaptWorldBuilder.hh>

Inheritance diagram for CaptWorldBuilder:
EDepSim::Builder

Public Member Functions

 CaptWorldBuilder (G4String n, EDepSim::UserDetectorConstruction *c)
 
virtual ~CaptWorldBuilder ()
 
virtual G4LogicalVolume * GetPiece (void)
 
void SetLength (double v)
 Set the length of the world. More...
 
void SetWidth (double v)
 Set the width of the world. More...
 
void SetHeight (double v)
 Set the height of the world. More...
 
double GetLength ()
 Get the length of the world. More...
 
double GetWidth ()
 Get the width of the world. More...
 
double GetHeight ()
 Get the height of the world. More...
 
- Public Member Functions inherited from EDepSim::Builder
 Builder (G4String n, EDepSim::UserDetectorConstruction *c)
 
 Builder (G4String n, EDepSim::Builder *parent)
 
virtual ~Builder ()
 
G4String GetName (void)
 Return the base name of the object that this builds. More...
 
G4String GetLocalName (void)
 Return the base name of the object that this builds. More...
 
void SetLocalName (const G4String &name)
 Set the base name of the logical volume that this builds. More...
 
void SetOpacity (double v)
 Set the relative opacity of the constructed object. More...
 
double GetOpacity (void) const
 Get the relative opacity of the constructed object. More...
 
void SetDaughterOpacity (double v)
 Set the relative opacity of the object daughters. More...
 
EDepSim::UserDetectorConstructionGetConstruction (void)
 Return the detector construction that is building this piece. More...
 
virtual void SetSensitiveDetector (G4VSensitiveDetector *s)
 Set the sensitive detector for this component. More...
 
virtual G4VSensitiveDetector * GetSensitiveDetector (void)
 Get the sensitive detector for this component. More...
 
virtual void SetSensitiveDetector (G4String name, G4String type)
 Set the sensitive detector for this component by name. More...
 
virtual void SetMaximumHitSagitta (double sagitta)
 
virtual void SetMaximumHitLength (double length)
 Set the maximum length of a single hit segment. More...
 
G4UImessenger * GetMessenger (void)
 Return the messenger for this constructor. More...
 
void SetMessenger (G4UImessenger *m)
 Set the messenger for this constructor. More...
 
void AddBuilder (EDepSim::Builder *c)
 
template<class T >
T & Get (G4String n)
 
template<class T >
T * Find (G4String n)
 
bool Check ()
 
void SetCheck (bool v)
 Set the check value. More...
 

Private Member Functions

void Init (void)
 

Private Attributes

double fLength
 The distance along the X axis to simulate. More...
 
double fWidth
 The side to side (Y) dimension to be simulated. More...
 
double fHeight
 The height (Z) of the world coordinate system. More...
 

Additional Inherited Members

- Protected Member Functions inherited from EDepSim::Builder
G4Material * FindMaterial (G4String m)
 
G4VisAttributes GetColor (G4LogicalVolume *volume, double opacity=0.0)
 
G4VisAttributes GetColor (G4Material *volume, double opacity=0.0)
 

Detailed Description

Construct the world volume. The origin is located at the center of the detector coordinate system. The world is mostly filled with air.

Definition at line 10 of file CaptWorldBuilder.hh.

Constructor & Destructor Documentation

CaptWorldBuilder::CaptWorldBuilder ( G4String  n,
EDepSim::UserDetectorConstruction c 
)
inline

Definition at line 12 of file CaptWorldBuilder.hh.

13  : EDepSim::Builder(n,c) {Init();};
std::void_t< T > n
CaptWorldBuilder::~CaptWorldBuilder ( )
virtual

Definition at line 83 of file CaptWorldBuilder.cc.

83 {}

Member Function Documentation

double CaptWorldBuilder::GetHeight ( )
inline

Get the height of the world.

Definition at line 38 of file CaptWorldBuilder.hh.

38 {return fHeight;}
double fHeight
The height (Z) of the world coordinate system.
double CaptWorldBuilder::GetLength ( )
inline

Get the length of the world.

Definition at line 32 of file CaptWorldBuilder.hh.

32 {return fLength;}
double fLength
The distance along the X axis to simulate.
G4LogicalVolume * CaptWorldBuilder::GetPiece ( void  )
virtual

Construct and return a G4 volume for the object. This is a pure virtual function, which means it must be implemented by the inheriting classes. This returns an unplaced logical volume which faces along the Z axis.

Implements EDepSim::Builder.

Definition at line 85 of file CaptWorldBuilder.cc.

85  {
86 
87  EDepSimLog("##############################################");
88  EDepSimLog("# CONSTRUCT THE WORLD GEOMETRY ");
89  EDepSimLog("##############################################");
90 
91  G4LogicalVolume *logVolume
92  = new G4LogicalVolume(new G4Box(GetName(),
93  fLength/2,
94  fWidth/2,
95  fHeight/2),
96  FindMaterial("Air"),
97  GetName());
98  logVolume->SetVisAttributes(G4VisAttributes::Invisible);
99 
100  double floorThickness = 10*CLHEP::cm;
101  G4LogicalVolume *logFloor
102  = new G4LogicalVolume(new G4Box(GetName()+"/Floor",
103  fLength/2,
104  fWidth/2,
105  floorThickness/2),
106  FindMaterial("Cement"),
107  GetName()+"/Floor");
108  logFloor->SetVisAttributes(G4VisAttributes::Invisible);
109 
110  CaptCryostatBuilder& cryo
111  = Get<CaptCryostatBuilder>("Cryostat");
112  G4LogicalVolume* logCryostat = cryo.GetPiece();
113 
114  G4ThreeVector cryoCenter = G4ThreeVector(0,0,0)
115  - cryo.GetOffset() - cryo.GetTPCOffset();
116 
117  new G4PVPlacement(NULL, // rotation.
118  cryoCenter, // position
119  logCryostat, // logical volume
120  logCryostat->GetName(), // name
121  logVolume, // mother volume
122  false, // overlapping volume (not used)
123  0, // Copy number (zero)
124  Check()); // Check overlaps.
125 
126 #ifdef SHOW_FLOOR
127  G4VisExtent cryoExtent = logCryostat->GetSolid()->GetExtent();
128  G4ThreeVector centerFloor(0.0, 0.0,
129  cryoCenter.z() + cryoExtent.GetZmin()
130  - floorThickness/2 - 50*CLHEP::cm);
131 
132  new G4PVPlacement(NULL, // rotation.
133  centerFloor, // position
134  logFloor, // logical volume
135  GetName()+"/Floor", // name
136  logVolume, // mother volume
137  false, // overlapping volume (not used)
138  0, // Copy number (zero)
139  Check()); // Check overlaps.
140 
141  if (GetVisible()) {
142  logFloor->SetVisAttributes(GetColor(logFloor));
143  }
144 #endif
145 
146  return logVolume;
147 }
static constexpr double cm
Definition: Units.h:68
#define EDepSimLog(outStream)
Definition: EDepSimLog.hh:717
G4String GetName(void)
Return the base name of the object that this builds.
G4Material * FindMaterial(G4String m)
double fLength
The distance along the X axis to simulate.
G4ThreeVector GetTPCOffset()
double fWidth
The side to side (Y) dimension to be simulated.
G4VisAttributes GetColor(G4LogicalVolume *volume, double opacity=0.0)
G4ThreeVector GetOffset()
virtual G4LogicalVolume * GetPiece(void)
double fHeight
The height (Z) of the world coordinate system.
double CaptWorldBuilder::GetWidth ( )
inline

Get the width of the world.

Definition at line 35 of file CaptWorldBuilder.hh.

35 {return fWidth;}
double fWidth
The side to side (Y) dimension to be simulated.
void CaptWorldBuilder::Init ( void  )
private

Definition at line 73 of file CaptWorldBuilder.cc.

73  {
75  fLength = 10*CLHEP::m;
76  fWidth = fLength;
77  fHeight = fLength;
78 
79  AddBuilder(new CaptCryostatBuilder("Cryostat",this));
80 
81 }
void SetMessenger(G4UImessenger *m)
Set the messenger for this constructor.
double fLength
The distance along the X axis to simulate.
void AddBuilder(EDepSim::Builder *c)
double fWidth
The side to side (Y) dimension to be simulated.
double fHeight
The height (Z) of the world coordinate system.
void CaptWorldBuilder::SetHeight ( double  v)
inline

Set the height of the world.

Definition at line 29 of file CaptWorldBuilder.hh.

29 {fHeight = v;}
double fHeight
The height (Z) of the world coordinate system.
void CaptWorldBuilder::SetLength ( double  v)
inline

Set the length of the world.

Definition at line 23 of file CaptWorldBuilder.hh.

23 {fLength = v;}
double fLength
The distance along the X axis to simulate.
void CaptWorldBuilder::SetWidth ( double  v)
inline

Set the width of the world.

Definition at line 26 of file CaptWorldBuilder.hh.

26 {fWidth = v;}
double fWidth
The side to side (Y) dimension to be simulated.

Member Data Documentation

double CaptWorldBuilder::fHeight
private

The height (Z) of the world coordinate system.

Definition at line 51 of file CaptWorldBuilder.hh.

double CaptWorldBuilder::fLength
private

The distance along the X axis to simulate.

Definition at line 45 of file CaptWorldBuilder.hh.

double CaptWorldBuilder::fWidth
private

The side to side (Y) dimension to be simulated.

Definition at line 48 of file CaptWorldBuilder.hh.


The documentation for this class was generated from the following files: