27#include <CLHEP/Units/SystemOfUnits.h>
28#include <G4ApplicationState.hh>
29#include <G4ThreeVector.hh>
31#include <G4UIcommand.hh>
32#include <G4UImessenger.hh>
33#include <G4UIparameter.hh>
36#include "G4UIcmdWithADoubleAndUnit.hh"
37#include "G4UIcmdWithAnInteger.hh"
38#include "G4UIcmdWithoutParameter.hh"
39#include "G4UIdirectory.hh"
46 , fDetector(aDetector)
49 fExampleDir->SetGuidance(
"UI commands specific to this example");
52 fDetectorDir->SetGuidance(
"Detector construction UI commands");
55 fPrintCmd->SetGuidance(
"Print current settings.");
82 fAbsorCmd->SetGuidance(
"Set the absorber id, the material, the thickness.");
83 fAbsorCmd->SetGuidance(
" absorber number : from 0 to 1");
85 fAbsorCmd->SetGuidance(
" thickness (with unit) : t>0");
86 fAbsorCmd->SetGuidance(
" if sensitive : true/false.");
88 absNbPrm->SetGuidance(
"absor number : from 0 to 1");
89 absNbPrm->SetParameterRange(
"AbsorNb>-1&AbsoNb<2");
92 matPrm->SetGuidance(
"material name");
95 thickPrm->SetGuidance(
"thickness of absorber");
96 thickPrm->SetParameterRange(
"thickness>0.");
99 unitPrm->SetGuidance(
"unit of thickness");
100 G4String unitList = G4UIcommand::UnitsList(G4UIcommand::CategoryOf(
"mm"));
101 unitPrm->SetParameterCandidates(unitList);
103 auto sensitivePrm =
new G4UIparameter(
"sensitive",
'b',
false);
104 sensitivePrm->SetGuidance(
"if absorber is sensitive (registers energy deposits)");
107 fAbsorCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
111 fMeshDir->SetGuidance(
"Mesh UI commands");
114 fMeshNbRhoCellsCmd->SetGuidance(
"Set number of rho cells in the cylindrical mesh readout.");
121 fMeshNbPhiCellsCmd->SetGuidance(
"Set number of phi cells in the cylindrical mesh readout.");
128 fMeshNbZCellsCmd->SetGuidance(
"Set number of z cells in the cylindrical mesh readout.");
143 fMeshSizeZCellsCmd->SetGuidance(
"Set size of z cells in the cylindrical readout mesh");
196 std::istringstream is(aNewValue);
197 is >> num >> mat >> thick >> unt >> std::boolalpha >> sensitive;
199 thick *= G4UIcommand::ValueOf(unt);
void SetMeshSizeOfCells(G4ThreeVector aNb)
Set size of Mesh cells in cylindrical coordinates (r, phi, z)
G4double GetLength() const
Get length of the cylindrical detector (along z-axis)
void SetAbsorberSensitivity(const std::size_t aLayer, const G4bool aSensitivity)
Set sensitivity of the layer.
void SetLength(G4double aLength)
Set length radius of the cylindrical detector.
G4ThreeVector GetMeshSizeOfCells() const
Get size of Mesh cells in cylindrical coordinates (r, phi, z)
G4ThreeVector GetMeshNbOfCells() const
Get number of Mesh cells in cylindrical coordinates (r, phi, z)
void SetMeshNbOfCells(G4ThreeVector aNb)
Set number of Mesh cells in cylindrical coordinates (r, phi, z)
void SetAbsorberMaterial(const std::size_t aLayer, const G4String &aMaterial)
Set material of the layer (from NIST materials)
void Print() const
Print detector information.
void SetInnerRadius(G4double aInnerRadius)
Set inner radius of the cylindrical detector.
G4int GetNbOfLayers() const
Get number of layers.
void SetNbOfLayers(G4int aNumber)
Set number of layers.
G4double GetInnerRadius() const
Get inner radius of the cylindrical detector.
void SetAbsorberThickness(const std::size_t aLayer, const G4double aThickness)
Set thickness of the layer.
G4UIcmdWithAnInteger * fMeshNbPhiCellsCmd
Command to set the number of cells in the cylindrical readout mesh (along phi axis)
G4UIcmdWithADoubleAndUnit * fMeshSizeRhoCellsCmd
Command to the size of cells in the cylindrical readout mesh (along rho axis)
G4UIcmdWithoutParameter * fPrintCmd
Command printing current settings.
G4UIcommand * fAbsorCmd
Commanbd to set the absorbers within layers (material, thickness, sensitivity)
G4UIcmdWithADoubleAndUnit * fDetectorLengthCmd
Command to set the detector length.
G4UIcmdWithADoubleAndUnit * fDetectorInnerRadiusCmd
Command to set the detector inner radius.
Par04DetectorConstruction * fDetector
Detector construction to setup.
G4UIcmdWithAnInteger * fNbLayersCmd
Command to set the number of layers.
virtual G4String GetCurrentValue(G4UIcommand *) final
Retrieves the current settings.
virtual void SetNewValue(G4UIcommand *, G4String) final
Invokes appropriate methods based on the typed command.
G4UIdirectory * fExampleDir
Command to set the directory common to all messengers in this example /Par04.
Par04DetectorMessenger(Par04DetectorConstruction *)
G4UIcmdWithADoubleAndUnit * fMeshSizeZCellsCmd
Command to the size of cells in the cylindrical readout mesh (along z axis)
G4UIcmdWithAnInteger * fMeshNbZCellsCmd
Command to set the number of cells in the cylindrical readout mesh (along z axis)
G4UIdirectory * fDetectorDir
Command to set the directory for detector settings /Par04/detector.
G4UIdirectory * fMeshDir
Command to set the directory for sensitive detector settings /Par04/mesh.
~Par04DetectorMessenger()
G4UIcmdWithAnInteger * fMeshNbRhoCellsCmd
Command to set the number of cells in the cylindrical readout mesh (along rho axis)