8 #include <G4Material.hh> 9 #include <G4LogicalVolume.hh> 10 #include <G4VPhysicalVolume.hh> 11 #include <G4PVPlacement.hh> 12 #include <G4VisAttributes.hh> 14 #include <G4SystemOfUnits.hh> 15 #include <G4PhysicalConstants.hh> 65 double componentLength = (*e)->GetLength();
66 if (componentLength < 0.0) {
80 EDepSimThrow(
"EDepSim::ModuleBuilder::GetPiece(): Volume too long");
89 G4VSolid *solid =
new G4Box(
GetName(),
95 G4LogicalVolume *logVolume
96 =
new G4LogicalVolume(solid,
103 zPosition += (*e)->GetLength()/2;
125 zPosition += (*e)->GetLength()/2;
138 = &Get<EDepSim::ComponentBuilder>(
name);
147 EDepSimError(
"*** Repetition count must be greater than " 152 EDepSimError(
"*** Component count must be greater than " 159 <<
" Parts required: " <<
c);
167 for (
int i=1; i<
r; ++i) {
169 fPartsList->insert(e,additions.begin(),additions.end());
171 for (
int i = 0; i < r*
c; i++)
184 double transX,
double transY) {
185 for (
int i = 0; i <
c; i++) {
186 fTransList->at(module*cPerM+i).first = transX;
187 fTransList->at(module*cPerM+i).second = transY;
static constexpr double cm
G4String GetName(void)
Return the base name of the object that this builds.
std::pair< double, double > fPair
Default pair of translation constants.
std::vector< EDepSim::ComponentBuilder * > PartsList
A vector of ComponentBuilders that will be added to the module.
void AddComponent(G4String m)
void SetMessenger(G4UImessenger *m)
Set the messenger for this constructor.
double fLength
The length of the module.
G4Material * FindMaterial(G4String m)
#define EDepSimThrow(message)
Print an error message, and then throw an exception.
double yPosition
The y position at which components are positioned inside the module.
double GetTargetLength(void)
Get the target length of the module bounding box.
void ClearComponentList(void)
Clear the list of components to be added to the FG tracker.
void SetModuleCompTrans(int m, int cPerM, int c, double transX, double transY)
bool fFixLength
Logical flag to accept the target length as the module length.
virtual G4LogicalVolume * GetPiece(void)
double GetLength(void)
Get the length of the module.
void SetRepetitions(int r, int c)
double GetWidth(void)
Get the width of the module.
double xPosition
The x position at which components are positioned inside the module.
double fHeight
The height of the module.
#define EDepSimError(outStream)
G4double xmax
Collect the minimum and maximum of translations in x and y.
#define EDepSimWarn(outStream)
double fWidth
The width of the module.
static constexpr double mm
std::vector< std::pair< double, double > > TransList
double GetHeight(void)
Get the height of the module.