File indexing completed on 2025-01-18 09:17:10
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 #include "XrayFluoMercuryDetectorMessenger.hh"
0039 #include "XrayFluoMercuryDetectorConstruction.hh"
0040 #include "G4UIdirectory.hh"
0041 #include "G4UIcmdWithAString.hh"
0042 #include "G4UIcmdWithADoubleAndUnit.hh"
0043 #include "G4UIcmdWithoutParameter.hh"
0044 #include "G4UIcmdWithABool.hh"
0045 #include "G4RunManager.hh"
0046
0047
0048
0049 XrayFluoMercuryDetectorMessenger::XrayFluoMercuryDetectorMessenger(XrayFluoMercuryDetectorConstruction * Det)
0050 :Detector(Det)
0051 {
0052 detDir = new G4UIdirectory("/apparate/");
0053 detDir->SetGuidance("detector control.");
0054
0055 UpdateCmd = new G4UIcmdWithoutParameter("/apparate/update",this);
0056 UpdateCmd->SetGuidance("Update apparate geometry.");
0057 UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
0058 UpdateCmd->SetGuidance("if you changed geometrical value(s): /apparate/GrainDiameter and /apparate/sampleGranularity");
0059
0060 UpdateCmd->AvailableForStates(G4State_Idle);
0061
0062 sampleCmd = new G4UIcmdWithAString("/apparate/mercuryMaterial",this);
0063 sampleCmd->SetGuidance("select a diferent material for the mercury");
0064 sampleCmd->SetParameterName("material",true);
0065 sampleCmd->SetDefaultValue("mars1");
0066 sampleCmd->SetCandidates("Dolorite Anorthosite Mars1 IceBasalt");
0067 sampleCmd->AvailableForStates(G4State_Idle);
0068
0069 detectorCmd = new G4UIcmdWithAString("/apparate/detector",this);
0070 detectorCmd->SetGuidance("select a diferent detectorType");
0071 detectorCmd->SetParameterName("detector",true);
0072 detectorCmd->SetDefaultValue("sili");
0073 detectorCmd->SetCandidates("sili hpge");
0074 detectorCmd->AvailableForStates(G4State_Idle);
0075
0076 latitudeAngleCmd = new G4UIcmdWithADoubleAndUnit( "/apparate/latitude",this );
0077 latitudeAngleCmd->SetGuidance( "Set latitude angle of the spacecraft" );
0078 latitudeAngleCmd->SetGuidance( "After this, /apparate/update must be executed before BeamOn" );
0079 latitudeAngleCmd->SetGuidance( "Default: 45 deg " );
0080 latitudeAngleCmd->SetParameterName( "Latitude Angle", true, true );
0081 latitudeAngleCmd->SetDefaultUnit( "deg" );
0082 latitudeAngleCmd->SetUnitCategory( "Angle" );
0083 latitudeAngleCmd->AvailableForStates(G4State_Idle);
0084
0085 orbitHeightCmd = new G4UIcmdWithADoubleAndUnit( "/apparate/orbitHeight",this );
0086 orbitHeightCmd->SetGuidance( "Set height of the spacecraft above Mercury Surface" );
0087 orbitHeightCmd->SetGuidance( "After this, /apparate/update must be executed before BeamOn" );
0088 orbitHeightCmd->SetGuidance( "Default: 400 km " );
0089 orbitHeightCmd->SetParameterName( "Spacecraft Altitude", true, true );
0090 orbitHeightCmd->SetDefaultUnit( "km" );
0091 orbitHeightCmd->SetUnitCategory( "Length" );
0092 orbitHeightCmd->AvailableForStates(G4State_Idle);
0093 }
0094
0095
0096
0097 XrayFluoMercuryDetectorMessenger::~XrayFluoMercuryDetectorMessenger()
0098 {
0099 delete UpdateCmd;
0100 delete detDir;
0101 }
0102
0103
0104
0105 void XrayFluoMercuryDetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
0106 {
0107 if( command == UpdateCmd )
0108 {
0109
0110
0111 Detector->UpdateGeometry();
0112 return;
0113 }
0114 else if ( command == sampleCmd )
0115 { Detector->SetMercuryMaterial(newValue);}
0116
0117 else if ( command == detectorCmd )
0118 { Detector->SetDetectorType(newValue);}
0119
0120 else if ( command == latitudeAngleCmd )
0121 {
0122 G4double newAngle = latitudeAngleCmd->GetNewDoubleValue(newValue);
0123 Detector->SetLatitude(newAngle);
0124 }
0125
0126 else if ( command == orbitHeightCmd )
0127 {
0128 G4double newAngle = orbitHeightCmd->GetNewDoubleValue(newValue);
0129 Detector->SetOribitHeight(newAngle);
0130 }
0131
0132 G4RunManager::GetRunManager()->GeometryHasBeenModified();
0133
0134 }
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146