23#include <G4AnalysisUtilities.hh>
24#include <G4UIcmdWithABool.hh>
25#include <G4UIcmdWithADoubleAndUnit.hh>
26#include <G4UIcmdWithAString.hh>
27#include <G4UIcmdWithoutParameter.hh>
28#include <G4UIdirectory.hh>
34 fGeometryManager(geometryManager),
37 fCreateFieldParametersCmd(0),
41 fPrintMaterialsCmd(0),
42 fPrintMaterialsPropertiesCmd(0),
45 fIsMaxStepInLowDensityMaterialsCmd(0),
46 fSetLimitDensityCmd(0),
47 fSetMaxStepInLowDensityMaterialsCmd(0),
48 fSetNewRadiatorCmd(0),
49 fSetRadiatorLayerCmd(0),
50 fSetRadiatorStrawTubeCmd(0),
52 fRadiatorDescription(0)
57 fDirectory->SetGuidance(
"Detector construction control commands.");
59 fUpdateFieldCmd =
new G4UIcmdWithoutParameter(
"/mcDet/updateMagField",
this);
60 G4String guidance =
"Update magnetic field.\n";
62 "This command must be called if the field parameters were changed \n";
63 guidance +=
"in the Idle state.";
68 new G4UIcmdWithAString(
"/mcDet/createMagFieldParameters",
this);
70 "Create parameters (and their commands) for a local magnetic field \n");
72 "associated with the volume with the given name.");
78 "Get local magnetic fields from Root geometry.");
82 fIsZeroFieldCmd =
new G4UIcmdWithABool(
"/mcDet/setIsZeroMagField",
this);
84 "(In)activate propagating 'ifield = 0' flag defined in tracking media.\n";
86 "When activated: a zero local magnetic field is set to the volumes "
88 guidance +=
" with tracking medium with 'ifield = 0'.";
93 fSeparatorCmd =
new G4UIcmdWithAString(
"/mcDet/volNameSeparator",
this);
95 "Override the default value of the volume name separator in g3tog4\n";
101 new G4UIcmdWithoutParameter(
"/mcDet/printMaterials",
this);
104 G4State_PreInit, G4State_Init, G4State_Idle);
107 new G4UIcmdWithoutParameter(
"/mcDet/printMaterialsProperties",
this);
109 "Prints all material properties for all materials.");
111 G4State_PreInit, G4State_Init, G4State_Idle);
113 fPrintMediaCmd =
new G4UIcmdWithoutParameter(
"/mcDet/printMedia",
this);
116 G4State_PreInit, G4State_Init, G4State_Idle);
118 fPrintVolumesCmd =
new G4UIcmdWithoutParameter(
"/mcDet/printVolumes",
this);
122 fPrintCutsCmd =
new G4UIcmdWithAString(
"/mcDet/printCuts",
this);
124 "Prints the cut value for given CutName for all tracking media");
130 "Prints the control value for given ControlName for all tracking media");
136 "Active user step limits defined in tracking media.");
141 new G4UIcmdWithABool(
"/mcDet/setIsMaxStepInLowDensityMaterials",
this);
143 "Active user step limits defined in tracking media.");
145 "IsMaxStepInLowDensityMaterials",
false);
149 new G4UIcmdWithADoubleAndUnit(
"/mcDet/setLimitDensity",
this);
151 "Set the material density limit for setting max allowed step");
153 "Note that setting step limits has to be activated first via:\n");
155 "/mcDet/setIsMaxStepInLowDensityMaterials true");
162 "/mcDet/setMaxStepInLowDensityMaterials",
this);
164 "Set max allowed step value in materials with density below the density "
167 "Note that setting step limits has to be activated first via:\n");
169 "/mcDet/setIsMaxStepInLowDensityMaterials true");
171 "MaxStepInLowDensityMaterials",
false);
219 G4UIparameter* volumeName =
new G4UIparameter(
"volumeName",
's',
false);
220 volumeName->SetGuidance(
"Radiator envelope.");
222 G4UIparameter* xtrModel =
new G4UIparameter(
"xtrModel",
's',
false);
223 xtrModel->SetGuidance(
"XTR model.");
226 G4UIparameter* foilNumber =
new G4UIparameter(
"foilNumber",
'i',
false);
227 foilNumber->SetGuidance(
"Number of foils");
229 G4UIparameter* strawTubeMaterial =
230 new G4UIparameter(
"strawTubeMaterial",
's',
true);
231 strawTubeMaterial->SetGuidance(
"Straw tube material name.");
232 strawTubeMaterial->SetDefaultValue(
"");
245 G4UIparameter* volumeName =
new G4UIparameter(
"materialName",
's',
false);
246 volumeName->SetGuidance(
"Layer material name.");
248 G4UIparameter* thickness =
new G4UIparameter(
"thickness",
'd',
false);
249 thickness->SetGuidance(
"The layer thickness (cm)");
251 G4UIparameter* fluctuation =
new G4UIparameter(
"fluctuation",
'd',
true);
253 "Parameter that refers to the layer Gamma-distributed thickness.\n";
254 guidance +=
"The relative thickness fluctuation is ~ 1/sqrt(param)";
255 fluctuation->SetGuidance(guidance);
259 "Define the radiator layer (foil/gass) properties.");
269 G4UIparameter* gasMaterialName =
270 new G4UIparameter(
"gasMaterialName",
's',
false);
271 gasMaterialName->SetGuidance(
"Straw tube gas material name.");
273 G4UIparameter* wallThickness =
new G4UIparameter(
"wallThickness",
'd',
false);
274 wallThickness->SetGuidance(
"The mean straw tube wall thickness (cm)");
276 G4UIparameter* gasThickness =
new G4UIparameter(
"gasThickness",
'd',
false);
277 wallThickness->SetGuidance(
"The mean straw tube gass thickness (cm)");
280 new G4UIcommand(
"/mcDet/setRadiatorStrawTube",
this);
282 "Define the radiator straw tube properties.");
292 G4UIparameter* volumeName =
new G4UIparameter(
"volumeName",
's',
false);
293 volumeName->SetGuidance(
"Radiator envelope.");
295 G4UIparameter* xtrModel =
new G4UIparameter(
"xtrModel",
's',
false);
296 xtrModel->SetGuidance(
"XTR model.");
299 G4UIparameter* foilMaterial =
new G4UIparameter(
"foilMaterial",
's',
false);
300 foilMaterial->SetGuidance(
"Foil material name.");
302 G4UIparameter* gasMaterial =
new G4UIparameter(
"gasMaterial",
's',
false);
303 gasMaterial->SetGuidance(
"Gas material name.");
305 G4UIparameter* foilThickness =
new G4UIparameter(
"foilThickness",
'd',
false);
306 foilThickness->SetGuidance(
"Foil thickness (cm).");
308 G4UIparameter* gasThickness =
new G4UIparameter(
"gasThickness",
'd',
false);
309 gasThickness->SetGuidance(
"Gas thickness (cm).");
311 G4UIparameter* foilNumber =
new G4UIparameter(
"foilNumber",
'i',
false);
312 foilNumber->SetGuidance(
"Number of foils");
314 G4UIparameter* strawTubeMaterial =
315 new G4UIparameter(
"strawTubeMaterial",
's',
true);
316 strawTubeMaterial->SetGuidance(
"Straw tube material name.");
317 strawTubeMaterial->SetDefaultValue(
"");
357 char separator = newValues[0];
396 std::vector<G4String> parameters;
397 G4Analysis::Tokenize(newValues, parameters);
400 G4String volumeName = parameters[counter++];
401 G4String xtrModel = parameters[counter++];
402 G4int foilNumber = G4UIcommand::ConvertToInt(parameters[counter++]);
414 TString(
"/mcDetector/setNewRadiator must be called first."));
419 std::vector<G4String> parameters;
420 G4Analysis::Tokenize(newValues, parameters);
423 G4String materialName = parameters[counter++];
424 G4double thickness = G4UIcommand::ConvertToDouble(parameters[counter++]);
425 G4double fluctuation = 0.;
426 if (G4int(parameters.size()) > counter) {
427 fluctuation = G4UIcommand::ConvertToDouble(parameters[counter++]);
440 TString(
"/mcDetector/setNewRadiator must be called first."));
445 std::vector<G4String> parameters;
446 G4Analysis::Tokenize(newValues, parameters);
449 G4String gasMaterialName = parameters[counter++];
450 G4double wallThickness =
451 G4UIcommand::ConvertToDouble(parameters[counter++]);
452 G4double gasThickness = G4UIcommand::ConvertToDouble(parameters[counter++]);
459 gasMaterialName, wallThickness, gasThickness);
465 std::vector<G4String> parameters;
466 G4Analysis::Tokenize(newValues, parameters);
469 G4String volumeName = parameters[counter++];
470 G4String xtrModel = parameters[counter++];
471 G4String foilMaterial = parameters[counter++];
472 G4String gasMaterial = parameters[counter++];
473 G4double foilThickness =
474 G4UIcommand::ConvertToDouble(parameters[counter++]);
475 G4double gasThickness = G4UIcommand::ConvertToDouble(parameters[counter++]);
476 G4int foilNumber = G4UIcommand::ConvertToInt(parameters[counter++]);
477 G4String strawTubeMaterial;
478 if (G4int(parameters.size()) > counter) {
479 strawTubeMaterial = parameters[counter++];
490 radiatorDescription->
SetLayer(foilMaterial, foilThickness, 100.);
491 radiatorDescription->
SetLayer(gasMaterial, gasThickness, 100.);
492 if (strawTubeMaterial.size()) {
494 strawTubeMaterial, 0.53 * CLHEP::mm, 3.14159 * CLHEP::mm);
Definition of the TG4DetConstructionMessenger class.
Definition of the TG4DetConstruction class.
Definition of the TG4G3Units class.
Definition of the TG4GeometryManager class.
Definition of the TG4GeometryServices class.
Definition of the TG4Globals class and basic container types.
Definition of the TG4RadiatorDescription class.
G4UIcmdWithAString * fPrintCutsCmd
command: printCuts
G4UIcmdWithABool * fIsUserMaxStepCmd
command: setIsUserMaxStep
G4UIcmdWithABool * fIsLocalFieldCmd
command: setIsLocalMagField
G4UIcommand * fSetRadiatorStrawTubeCmd
command: setRadiatorStrawTube
TG4DetConstructionMessenger()
Not implemented.
G4UIcmdWithoutParameter * fPrintMediaCmd
command: printMedia
G4UIdirectory * fDirectory
command directory
G4UIcmdWithAString * fCreateFieldParametersCmd
command: createMagFieldParameters
G4UIcommand * fSetNewRadiatorCmd
command: setNewRadiator
G4UIcmdWithAString * fPrintControlsCmd
command: printControls
G4UIcommand * fSetRadiatorCmd
G4UIcmdWithABool * fIsMaxStepInLowDensityMaterialsCmd
command: setIsMaxStepInLowDensityMaterials
G4UIcmdWithABool * fIsZeroFieldCmd
command: setIsZeroMagField
void CreateSetNewRadiatorCmd()
G4UIcmdWithoutParameter * fUpdateFieldCmd
command: updateMagField
virtual ~TG4DetConstructionMessenger()
G4UIcmdWithADoubleAndUnit * fSetMaxStepInLowDensityMaterialsCmd
command: setMaxStepInLowDensityMaterials
G4UIcmdWithADoubleAndUnit * fSetLimitDensityCmd
command: setLimitDensity
G4UIcmdWithoutParameter * fPrintMaterialsCmd
command: printMatrials
G4UIcmdWithAString * fSeparatorCmd
command: volumeNameSeparator
void CreateSetRadiatorCmd()
The following command is deprecated, will be removed in the next version.
virtual void SetNewValue(G4UIcommand *command, G4String newValues)
TG4RadiatorDescription * fRadiatorDescription
current radiator description
G4UIcmdWithoutParameter * fPrintMaterialsPropertiesCmd
command: printMaterialsProperties
void CreateSetRadiatorStrawTubeCmd()
G4UIcmdWithoutParameter * fPrintVolumesCmd
command: printVolumes
G4UIcommand * fSetRadiatorLayerCmd
command: setRadiatorLayer
void CreateSetRadiatorLayerCmd()
The manager class for building Geant4 geometry depending on a selected user input.
void SetIsLocalField(G4bool isLocalField)
void SetIsMaxStepInLowDensityMaterials(G4bool isMaxStep)
void SetIsZeroField(G4bool isZeroField)
void CreateFieldParameters(const G4String &fieldVolName)
TG4RadiatorDescription * CreateRadiator(const G4String &volName)
void SetMaxStepInLowDensityMaterials(G4double maxStep)
static TG4GeometryManager * Instance()
void SetIsUserMaxStep(G4bool isUserMaxStep)
void SetLimitDensity(G4double density)
void PrintControls(const G4String &controlName) const
void PrintLogicalVolumeStore() const
static TG4GeometryServices * Instance()
void PrintMaterials() const
void PrintMaterialsProperties() const
void SetG3toG4Separator(char separator)
void PrintCuts(const G4String &cutName) const
static void Warning(const TString &className, const TString &methodName, const TString &text)
The radiator description.
void SetStrawTube(const G4String &materialName, G4double wallThickness, G4double gasThickness)
void SetLayer(const G4String &materialName, G4double thickness, G4double fluctuation)
void SetXtrModel(const G4String &name)
Set the transition radiation process model.
void SetFoilNumber(G4int foilNumber)
Set the number of foils.