![]() |
Precalibrated Ion Beam Identification Detector Simulation 1.0
A pilot study detector simulation, written in C++ with Geant4.
|
Creates commands that the user can invoke via the command line. More...
#include <DetectorMessenger.hh>
Public Member Functions | |
DetectorMessenger (DetectorConstruction *) | |
Constructor, constructs the object. | |
~DetectorMessenger () | |
Destructor, destroys the object. | |
void | SetNewValue (G4UIcommand *, G4String) |
This method is invoked when the user (or a script, etc.) enters a command. | |
Private Attributes | |
DetectorConstruction * | Detector |
The detector associated with this messenger. | |
G4UIdirectory * | PIBIDSDir |
Directory containing some commands wich can be invoked. | |
G4UIdirectory * | detDir |
Directory containing some commands wich can be invoked. | |
G4UIcmdWithAString * | ScintillatorMaterialCmd |
A command which can be invoked. | |
G4UIcmdWithAString * | GapMaterCmd |
A command which can be invoked. | |
G4UIcmdWithADoubleAndUnit * | ScintillatorDiameterCmd |
A command which can be invoked. | |
G4UIcmdWithADoubleAndUnit * | ScintillatorShieldingGapThicknessCmd |
A command which can be invoked. | |
G4UIcmdWithAnInteger * | NumberOfScintillatorsPerBoxCmd |
A command which can be invoked. | |
G4UIcmdWithAnInteger * | NumberOfScintillatorBoxesCmd |
Number of scintillator boxes. | |
G4UIcmdWithoutParameter * | UpdateCmd |
A command which can be invoked. | |
G4UIcmdWithADoubleAndUnit * | EffectiveSlowdownThicknessCmd |
Set the effective slowdown thickness. | |
G4UIcmdWithADoubleAndUnit * | SlowdownLengthCmd |
Set the slowdown length. | |
G4UIcmdWithADoubleAndUnit * | SlowdownThicknessCmd |
Set the slowdown thickness. | |
G4UIcmdWithADoubleAndUnit * | BeamBlockerThicknessCmd |
Sets the beam blocker thickness. | |
G4UIcmdWithADoubleAndUnit * | ShieldingBeamBlockerThicknessCmd |
Sets the beam blocker thickness. | |
G4UIcmdWithADoubleAndUnit * | ShieldingThicknessCmd |
Sets the shielding thickness. | |
G4UIcmdWithADoubleAndUnit * | TopShieldingThicknessCmd |
Sets the shielding thickness. | |
G4UIcmdWithADoubleAndUnit * | GeDetectorRadiusCmd |
G4UIcmdWithADoubleAndUnit * | GeDetectorShellLengthCmd |
G4UIcmdWithADoubleAndUnit * | GeDetectorLengthCmd |
G4UIcmdWithADoubleAndUnit * | GeDetectorShellInnerRadiusCmd |
G4UIcmdWithADoubleAndUnit * | GeDetectorShellOuterRadiusCmd |
G4UIcmdWithAString * | ShieldingMaterialCmd |
A command which can be invoked. | |
G4UIcmdWithAString * | GeDetectorShellMaterialCmd |
G4UIcmdWithAString * | GermaniumDetectorMaterialCmd |
G4UIcmdWithAString * | BeamBlockerMaterialCmd |
G4UIcmdWithAString * | ShieldingBeamBlockerMaterialCmd |
G4UIcmdWithAString * | SlowdownMaterialCmd |
G4UIcmdWithABool * | FlipBetaCmd |
Creates commands that the user can invoke via the command line.
Definition at line 35 of file DetectorMessenger.hh.
DetectorMessenger::DetectorMessenger | ( | DetectorConstruction * | Det | ) |
Constructor, constructs the object.
Det | The detector for which we are constructing the messenger. |
Definition at line 3 of file DetectorMessenger.cc.
References BeamBlockerThicknessCmd, detDir, EffectiveSlowdownThicknessCmd, GapMaterCmd, NumberOfScintillatorBoxesCmd, NumberOfScintillatorsPerBoxCmd, PIBIDSDir, ScintillatorDiameterCmd, ScintillatorMaterialCmd, ScintillatorShieldingGapThicknessCmd, ShieldingBeamBlockerThicknessCmd, ShieldingMaterialCmd, ShieldingThicknessCmd, SlowdownLengthCmd, SlowdownThicknessCmd, TopShieldingThicknessCmd, and UpdateCmd.
:Detector(Det) { PIBIDSDir = new G4UIdirectory("/PIBIDS/"); PIBIDSDir->SetGuidance("UI commands for the PIBIDS simulation."); detDir = new G4UIdirectory("/PIBIDS/det/"); detDir->SetGuidance("Detector properties control."); ScintillatorMaterialCmd = new G4UIcmdWithAString("/PIBIDS/det/setAbsMat",this); ScintillatorMaterialCmd->SetGuidance("Set material in the scintillators."); ScintillatorMaterialCmd->SetParameterName("choice",false); ScintillatorMaterialCmd->AvailableForStates(G4State_PreInit,G4State_Idle); GapMaterCmd = new G4UIcmdWithAString("/PIBIDS/det/setGapMat",this); GapMaterCmd->SetGuidance("Select material of the gap between the scintillators."); GapMaterCmd->SetParameterName("choice",false); GapMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle); ScintillatorDiameterCmd = new G4UIcmdWithADoubleAndUnit("/PIBIDS/det/setScintillatorDiameter",this); ScintillatorDiameterCmd->SetGuidance("Set the scintillator diameter."); ScintillatorDiameterCmd->SetParameterName("Size",false); ScintillatorDiameterCmd->SetRange("Size>=0."); ScintillatorDiameterCmd->SetUnitCategory("Length"); ScintillatorDiameterCmd->AvailableForStates(G4State_PreInit,G4State_Idle); ScintillatorShieldingGapThicknessCmd = new G4UIcmdWithADoubleAndUnit("/PIBIDS/det/setScintillatorShieldingGapThickness",this); ScintillatorShieldingGapThicknessCmd->SetGuidance("Set thickness of the gap between scintillators."); ScintillatorShieldingGapThicknessCmd->SetParameterName("Size",false); ScintillatorShieldingGapThicknessCmd->SetRange("Size>=0."); ScintillatorShieldingGapThicknessCmd->SetUnitCategory("Length"); ScintillatorShieldingGapThicknessCmd->AvailableForStates(G4State_PreInit,G4State_Idle); NumberOfScintillatorsPerBoxCmd = new G4UIcmdWithAnInteger("/PIBIDS/det/setNumberOfScintillatorsPerBox",this); NumberOfScintillatorsPerBoxCmd->SetGuidance("Set number of layers of scintillators."); NumberOfScintillatorsPerBoxCmd->SetParameterName("NbLayers",false); NumberOfScintillatorsPerBoxCmd->SetRange("NbLayers>0 && NbLayers<500"); NumberOfScintillatorsPerBoxCmd->AvailableForStates(G4State_PreInit,G4State_Idle); NumberOfScintillatorBoxesCmd = new G4UIcmdWithAnInteger("/PIBIDS/det/setNumberOfScintillatorBoxes",this); NumberOfScintillatorBoxesCmd->SetGuidance("Set number of scintillator boxes."); NumberOfScintillatorBoxesCmd->SetParameterName("NbLayers",false); NumberOfScintillatorBoxesCmd->SetRange("NbLayers>0 && NbLayers<20"); NumberOfScintillatorBoxesCmd->AvailableForStates(G4State_PreInit,G4State_Idle); EffectiveSlowdownThicknessCmd = new G4UIcmdWithADoubleAndUnit("/PIBIDS/det/setEffectiveSlowdownThickness",this); EffectiveSlowdownThicknessCmd->SetGuidance("Set effective slowdown thickness of wedges."); EffectiveSlowdownThicknessCmd->SetParameterName("Thickness",false); EffectiveSlowdownThicknessCmd->SetRange("Thickness>0."); EffectiveSlowdownThicknessCmd->SetUnitCategory("Length"); EffectiveSlowdownThicknessCmd->AvailableForStates(G4State_PreInit,G4State_Idle); SlowdownLengthCmd = new G4UIcmdWithADoubleAndUnit("/PIBIDS/det/setSlowdownLength",this); SlowdownLengthCmd->SetGuidance("Set slowdown (wedges) length."); SlowdownLengthCmd->SetParameterName("Length",false); SlowdownLengthCmd->SetRange("Length>0."); SlowdownLengthCmd->SetUnitCategory("Length"); SlowdownLengthCmd->AvailableForStates(G4State_PreInit,G4State_Idle); GeDetectorRadiusCmd = new G4UIcmdWithADoubleAndUnit("/PIBIDS/det/setGeDetectorRadius",this); GeDetectorRadiusCmd->SetGuidance("Set Ge detector radius."); GeDetectorRadiusCmd->SetParameterName("Radius",false); GeDetectorRadiusCmd->SetRange("Radius>0."); GeDetectorRadiusCmd->SetUnitCategory("Length"); GeDetectorRadiusCmd->AvailableForStates(G4State_PreInit,G4State_Idle); GeDetectorShellLengthCmd = new G4UIcmdWithADoubleAndUnit("/PIBIDS/det/setGeDetectorShellLength",this); GeDetectorShellLengthCmd->SetGuidance("Set Ge detector shell length."); GeDetectorShellLengthCmd->SetParameterName("Length",false); GeDetectorShellLengthCmd->SetRange("Length>0."); GeDetectorShellLengthCmd->SetUnitCategory("Length"); GeDetectorShellLengthCmd->AvailableForStates(G4State_PreInit,G4State_Idle); GeDetectorLengthCmd = new G4UIcmdWithADoubleAndUnit("/PIBIDS/det/setGeDetectorLength",this); GeDetectorLengthCmd->SetGuidance("Set Ge detector length."); GeDetectorLengthCmd->SetParameterName("Length",false); GeDetectorLengthCmd->SetRange("Length>0."); GeDetectorLengthCmd->SetUnitCategory("Length"); GeDetectorLengthCmd->AvailableForStates(G4State_PreInit,G4State_Idle); GeDetectorShellInnerRadiusCmd = new G4UIcmdWithADoubleAndUnit("/PIBIDS/det/setGeDetectorShellInnerRadius",this); GeDetectorShellInnerRadiusCmd->SetGuidance("Set Ge detector shell inner radius"); GeDetectorShellInnerRadiusCmd->SetParameterName("Radius",false); GeDetectorShellInnerRadiusCmd->SetRange("Radius>0."); GeDetectorShellInnerRadiusCmd->SetUnitCategory("Length"); GeDetectorShellInnerRadiusCmd->AvailableForStates(G4State_PreInit,G4State_Idle); GeDetectorShellOuterRadiusCmd = new G4UIcmdWithADoubleAndUnit("/PIBIDS/det/setGeDetectorShellOuterRadius",this); GeDetectorShellOuterRadiusCmd->SetGuidance("Set Ge detector shell outer radius."); GeDetectorShellOuterRadiusCmd->SetParameterName("Radius",false); GeDetectorShellOuterRadiusCmd->SetRange("Radius>0."); GeDetectorShellOuterRadiusCmd->SetUnitCategory("Length"); GeDetectorShellOuterRadiusCmd->AvailableForStates(G4State_PreInit,G4State_Idle); SlowdownThicknessCmd = new G4UIcmdWithADoubleAndUnit("/PIBIDS/det/setSlowdownThickness",this); SlowdownThicknessCmd->SetGuidance("Set slowdown (wedges) length."); SlowdownThicknessCmd->SetParameterName("Thickness",false); SlowdownThicknessCmd->SetRange("Thickness>0."); SlowdownThicknessCmd->SetUnitCategory("Length"); SlowdownThicknessCmd->AvailableForStates(G4State_PreInit,G4State_Idle); BeamBlockerThicknessCmd = new G4UIcmdWithADoubleAndUnit("/PIBIDS/det/setBeamBlockerThickness",this); BeamBlockerThicknessCmd->SetGuidance("Set beam blocker thickness."); BeamBlockerThicknessCmd->SetParameterName("Thickness",false); BeamBlockerThicknessCmd->SetRange("Thickness>0."); BeamBlockerThicknessCmd->SetUnitCategory("Length"); BeamBlockerThicknessCmd->AvailableForStates(G4State_PreInit,G4State_Idle); ShieldingBeamBlockerThicknessCmd = new G4UIcmdWithADoubleAndUnit("/PIBIDS/det/setShieldingBeamBlockerThickness",this); ShieldingBeamBlockerThicknessCmd->SetGuidance("Set beam blocker thickness."); ShieldingBeamBlockerThicknessCmd->SetParameterName("Thickness",false); ShieldingBeamBlockerThicknessCmd->SetRange("Thickness>0."); ShieldingBeamBlockerThicknessCmd->SetUnitCategory("Length"); ShieldingBeamBlockerThicknessCmd->AvailableForStates(G4State_PreInit,G4State_Idle); ShieldingThicknessCmd = new G4UIcmdWithADoubleAndUnit("/PIBIDS/det/setShieldingThickness",this); ShieldingThicknessCmd->SetGuidance("Set shielding thickness."); ShieldingThicknessCmd->SetParameterName("Thickness",false); ShieldingThicknessCmd->SetRange("Thickness>0."); ShieldingThicknessCmd->SetUnitCategory("Length"); ShieldingThicknessCmd->AvailableForStates(G4State_PreInit,G4State_Idle); TopShieldingThicknessCmd = new G4UIcmdWithADoubleAndUnit("/PIBIDS/det/setTopShieldingThickness",this); TopShieldingThicknessCmd->SetGuidance("Set shielding thickness."); TopShieldingThicknessCmd->SetParameterName("Thickness",false); TopShieldingThicknessCmd->SetRange("Thickness>0."); TopShieldingThicknessCmd->SetUnitCategory("Length"); TopShieldingThicknessCmd->AvailableForStates(G4State_PreInit,G4State_Idle); ShieldingMaterialCmd = new G4UIcmdWithAString("/PIBIDS/det/setShieldingMaterial",this); ShieldingMaterialCmd->SetGuidance("Set the shielding material."); ShieldingMaterialCmd->SetParameterName("choice",false); ShieldingMaterialCmd->AvailableForStates(G4State_PreInit,G4State_Idle); GeDetectorShellMaterialCmd = new G4UIcmdWithAString("/PIBIDS/det/setGeDetectorShellMaterial",this); GeDetectorShellMaterialCmd->SetGuidance("Set the germanium detector shell material."); GeDetectorShellMaterialCmd->SetParameterName("choice",false); GeDetectorShellMaterialCmd->AvailableForStates(G4State_PreInit,G4State_Idle); GermaniumDetectorMaterialCmd = new G4UIcmdWithAString("/PIBIDS/det/setGermaniumDetectorMaterial",this); GermaniumDetectorMaterialCmd->SetGuidance("Set the germanium detector material."); GermaniumDetectorMaterialCmd->SetParameterName("choice",false); GermaniumDetectorMaterialCmd->AvailableForStates(G4State_PreInit,G4State_Idle); BeamBlockerMaterialCmd = new G4UIcmdWithAString("/PIBIDS/det/setBeamBlockerMaterial",this); BeamBlockerMaterialCmd->SetGuidance("Set the beam blocker material."); BeamBlockerMaterialCmd->SetParameterName("choice",false); BeamBlockerMaterialCmd->AvailableForStates(G4State_PreInit,G4State_Idle); ShieldingBeamBlockerMaterialCmd = new G4UIcmdWithAString("/PIBIDS/det/setShieldingBeamBlockerMaterial",this); ShieldingBeamBlockerMaterialCmd->SetGuidance("Set the beam blocker material."); ShieldingBeamBlockerMaterialCmd->SetParameterName("choice",false); ShieldingBeamBlockerMaterialCmd->AvailableForStates(G4State_PreInit,G4State_Idle); SlowdownMaterialCmd = new G4UIcmdWithAString("/PIBIDS/det/setSlowdownMaterial",this); SlowdownMaterialCmd->SetGuidance("Set the slowdown material."); SlowdownMaterialCmd->SetParameterName("choice",false); SlowdownMaterialCmd->AvailableForStates(G4State_PreInit,G4State_Idle); FlipBetaCmd = new G4UIcmdWithABool("/PIBIDS/det/flipBeta",this); FlipBetaCmd->SetGuidance("Use this to switch beta detector flipping on or off."); FlipBetaCmd->SetParameterName("Flip",false); UpdateCmd = new G4UIcmdWithoutParameter("/PIBIDS/det/update",this); UpdateCmd->SetGuidance("Update detector geometry."); UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" "); UpdateCmd->SetGuidance("if you changed geometrical value(s)."); UpdateCmd->AvailableForStates(G4State_Idle); }
void DetectorMessenger::SetNewValue | ( | G4UIcommand * | command, |
G4String | newValue | ||
) |
This method is invoked when the user (or a script, etc.) enters a command.
command | The command invoked. |
newValue | The value which was sent as a parameter to the command. |
Definition at line 219 of file DetectorMessenger.cc.
References BeamBlockerThicknessCmd, Detector, EffectiveSlowdownThicknessCmd, GapMaterCmd, NumberOfScintillatorBoxesCmd, NumberOfScintillatorsPerBoxCmd, ScintillatorDiameterCmd, ScintillatorMaterialCmd, ScintillatorShieldingGapThicknessCmd, DetectorConstruction::SetBeamBlockerMaterial(), DetectorConstruction::SetBeamBlockerThickness(), DetectorConstruction::SetBetaFlipping(), DetectorConstruction::SetEffectiveSlowdownThickness(), DetectorConstruction::SetGapMaterial(), DetectorConstruction::SetGeDetectorLength(), DetectorConstruction::SetGeDetectorRadius(), DetectorConstruction::SetGeDetectorShellInnerRadius(), DetectorConstruction::SetGeDetectorShellLength(), DetectorConstruction::SetGeDetectorShellMaterial(), DetectorConstruction::SetGeDetectorShellOuterRadius(), DetectorConstruction::SetGermaniumDetectorMaterial(), DetectorConstruction::SetNumberOfScintillatorBoxes(), DetectorConstruction::SetNumberOfScintillatorsPerBox(), DetectorConstruction::SetScintillatorDiameter(), DetectorConstruction::SetScintillatorMaterial(), DetectorConstruction::SetScintillatorShieldingGapThickness(), DetectorConstruction::SetShieldingBeamBlockerMaterial(), DetectorConstruction::SetShieldingBeamBlockerThickness(), DetectorConstruction::SetShieldingMaterial(), DetectorConstruction::SetShieldingThickness(), DetectorConstruction::SetSlowdownLength(), DetectorConstruction::SetSlowdownMaterial(), DetectorConstruction::SetSlowdownThickness(), DetectorConstruction::SetTopShieldingThickness(), ShieldingBeamBlockerThicknessCmd, ShieldingMaterialCmd, ShieldingThicknessCmd, SlowdownLengthCmd, SlowdownThicknessCmd, TopShieldingThicknessCmd, UpdateCmd, and DetectorConstruction::UpdateGeometry().
{ if( command == ScintillatorMaterialCmd ) { Detector->SetScintillatorMaterial(newValue);} if( command == GapMaterCmd ) { Detector->SetGapMaterial(newValue);} if( command == ShieldingMaterialCmd) { Detector->SetShieldingMaterial(newValue);} if( command == GeDetectorShellMaterialCmd) {Detector->SetGeDetectorShellMaterial(newValue);} if( command == GermaniumDetectorMaterialCmd) {Detector->SetGermaniumDetectorMaterial(newValue);} if( command == BeamBlockerMaterialCmd) {Detector->SetBeamBlockerMaterial(newValue);} if( command == ShieldingBeamBlockerMaterialCmd) {Detector->SetShieldingBeamBlockerMaterial(newValue);} if( command == SlowdownMaterialCmd) {Detector->SetSlowdownMaterial(newValue);} if( command == ScintillatorDiameterCmd ) { Detector->SetScintillatorDiameter(ScintillatorDiameterCmd ->GetNewDoubleValue(newValue));} if( command == ScintillatorShieldingGapThicknessCmd ) { Detector->SetScintillatorShieldingGapThickness(ScintillatorShieldingGapThicknessCmd->GetNewDoubleValue(newValue));} if( command == NumberOfScintillatorsPerBoxCmd ) { Detector->SetNumberOfScintillatorsPerBox(NumberOfScintillatorsPerBoxCmd->GetNewIntValue(newValue));} if(command == NumberOfScintillatorBoxesCmd) { Detector->SetNumberOfScintillatorBoxes(NumberOfScintillatorBoxesCmd->GetNewIntValue(newValue)); } if( command == EffectiveSlowdownThicknessCmd) { Detector->SetEffectiveSlowdownThickness(EffectiveSlowdownThicknessCmd->GetNewDoubleValue(newValue));} if( command == SlowdownLengthCmd) { Detector->SetSlowdownLength(SlowdownLengthCmd->GetNewDoubleValue(newValue));} if( command == GeDetectorRadiusCmd) { Detector->SetGeDetectorRadius(GeDetectorRadiusCmd->GetNewDoubleValue(newValue));} if( command == GeDetectorShellLengthCmd) { Detector->SetGeDetectorShellLength(GeDetectorShellLengthCmd->GetNewDoubleValue(newValue));} if( command == GeDetectorLengthCmd) { Detector->SetGeDetectorLength(GeDetectorLengthCmd->GetNewDoubleValue(newValue));} if( command == GeDetectorShellInnerRadiusCmd) { Detector->SetGeDetectorShellInnerRadius(GeDetectorShellInnerRadiusCmd->GetNewDoubleValue(newValue));} if( command == GeDetectorShellOuterRadiusCmd) { Detector->SetGeDetectorShellOuterRadius(GeDetectorShellOuterRadiusCmd->GetNewDoubleValue(newValue));} if( command == SlowdownThicknessCmd) { Detector->SetSlowdownThickness(SlowdownThicknessCmd->GetNewDoubleValue(newValue));} if( command == BeamBlockerThicknessCmd) { Detector->SetBeamBlockerThickness(BeamBlockerThicknessCmd->GetNewDoubleValue(newValue));} if( command == ShieldingBeamBlockerThicknessCmd) { Detector->SetShieldingBeamBlockerThickness(ShieldingBeamBlockerThicknessCmd->GetNewDoubleValue(newValue));} if( command == ShieldingThicknessCmd) { Detector->SetShieldingThickness(ShieldingThicknessCmd->GetNewDoubleValue(newValue));} if( command == TopShieldingThicknessCmd) { Detector->SetTopShieldingThickness(TopShieldingThicknessCmd->GetNewDoubleValue(newValue));} if (command == FlipBetaCmd) {Detector->SetBetaFlipping(FlipBetaCmd->GetNewBoolValue(newValue));} if( command == UpdateCmd ) { Detector->UpdateGeometry(); } }