1 #ifndef EDepSim_ModuleBuilder_hh_seen 2 #define EDepSim_ModuleBuilder_hh_seen 6 #include <G4ThreeVector.hh> 15 namespace EDepSim {
class ModuleBuilder;}
33 virtual G4LogicalVolume *
GetPiece(
void);
66 double transX,
double transY);
128 typedef std::vector<EDepSim::ComponentBuilder*>
PartsList;
134 typedef std::vector<std::pair<double, double> >
TransList;
155 const char* guide=NULL)
158 fClearCMD =
new G4UIcmdWithoutParameter(CommandName(
"clear"),
this);
159 fClearCMD->SetGuidance(
"Clear the component list for the FG tracker.");
161 fAddCMD =
new G4UIcmdWithAString(CommandName(
"add"),
this);
162 fAddCMD->SetGuidance(
"Add the named component to the module." 163 " Components are added from upstream" 165 fAddCMD->SetParameterName(
"Component",
false);
167 fRepeatCMD =
new G4UIcommand(CommandName(
"repeat"),
this);
168 fRepeatCMD->SetGuidance(
"Times to repeat the last components.");
169 G4UIparameter* repParam =
new G4UIparameter(
'i');
170 repParam->SetParameterName(
"Repetitions");
171 fRepeatCMD->SetParameter(repParam);
172 G4UIparameter* cntParam =
new G4UIparameter(
'i');
173 cntParam->SetParameterName(
"Count");
174 fRepeatCMD->SetParameter(cntParam);
176 fWidthCMD =
new G4UIcmdWithADoubleAndUnit(CommandName(
"width"),
this);
177 fWidthCMD->SetGuidance(
"Set the width of the module.");
178 fWidthCMD->SetParameterName(
"Width",
false);
179 fWidthCMD->SetUnitCategory(
"Length");
181 fHeightCMD =
new G4UIcmdWithADoubleAndUnit(CommandName(
"height"),
this);
182 fHeightCMD->SetGuidance(
"Set the height of the module.");
183 fHeightCMD->SetParameterName(
"Height",
false);
184 fHeightCMD->SetUnitCategory(
"Length");
196 if (cmd==fClearCMD) {
199 else if (cmd==fAddCMD) {
202 else if (cmd==fRepeatCMD) {
205 std::istringstream
inputs((
char*)val.c_str());
209 else if (cmd==fWidthCMD) {
210 fBuilder->
SetWidth(fWidthCMD->GetNewDoubleValue(val));
212 else if (cmd==fHeightCMD) {
213 fBuilder->
SetHeight(fHeightCMD->GetNewDoubleValue(val));
ModuleBuilder(G4String n, EDepSim::UserDetectorConstruction *c)
std::pair< double, double > fPair
Default pair of translation constants.
void SetNewValue(G4UIcommand *cmd, G4String val)
std::vector< EDepSim::ComponentBuilder * > PartsList
A vector of ComponentBuilders that will be added to the module.
double GetYPosition()
Get y position at which components are positioned inside the module.
G4UIcmdWithADoubleAndUnit * fHeightCMD
double GetYminTranslation()
Get the minimum negative y translation parameter among the modules.
void AddComponent(G4String m)
double GetXPosition()
Get x position at which components are positioned inside the module.
void SetHeight(double w)
Set the height of the module. This is the Y dimension of the module.
double fLength
The length of the module.
double GetXminTranslation()
Get the minimum negative x translation parameter among the modules.
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.
bool GetFixLength(void)
Get flag to accept the TargetLength as the actual module length.
void ClearComponentList(void)
Clear the list of components to be added to the FG tracker.
void SetTargetLength(double w)
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)
Construct a module from components.
void SetNewValue(G4UIcommand *cmd, G4String val)
G4UIcmdWithADoubleAndUnit * fWidthCMD
ModuleBuilderMessenger(EDepSim::ModuleBuilder *c, const char *guide=NULL)
G4UIcmdWithoutParameter * fClearCMD
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 GetXmaxTranslation()
Get the maximum positive x translation parameter among the modules.
void SetYPosition(double y)
Set y position at which components are positioned inside the module.
double xPosition
The x position at which components are positioned inside the module.
EDepSim::ModuleBuilder * fBuilder
double fHeight
The height of the module.
void SetFixLength(bool f)
Set flag to accept the TargetLength as the actual module length.
G4double xmax
Collect the minimum and maximum of translations in x and y.
G4UIcmdWithAString * fAddCMD
ModuleBuilder(G4String n, EDepSim::Builder *p)
double GetYmaxTranslation()
Get the maximum positive y translation parameter among the modules.
double fWidth
The width of the module.
void SetWidth(double w)
Set the width of the module. This is the X dimension of the module.
void SetXPosition(double x)
Set x position at which components are positioned inside the module.
std::vector< std::pair< double, double > > TransList
double GetHeight(void)
Get the height of the module.
virtual ~ModuleBuilderMessenger()