File indexing completed on 2025-01-18 09:16:36
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 #include "FADetectorConstructionMessenger.hh"
0031 #include "FADetectorConstruction.hh"
0032
0033 #include "G4UIcmdWithAnInteger.hh"
0034 #include "G4UIcmdWithADoubleAndUnit.hh"
0035 #include "G4UIcmdWithADouble.hh"
0036 #include "G4UIcmdWithABool.hh"
0037 #include "G4UIcmdWithAString.hh"
0038
0039 DetectorConstructionMessenger::DetectorConstructionMessenger(DetectorConstruction* detectorIn)
0040 : G4UImessenger()
0041 {
0042 fDetector = detectorIn;
0043
0044
0045
0046
0047 fGeometryDirectory = new G4UIdirectory("/geometry/");
0048 fGeometryDirectory->SetGuidance("Geometry setup.");
0049
0050
0051
0052
0053 fStepLimCmd = new G4UIcmdWithADoubleAndUnit("/geometry/stepLim",this);
0054 fStepLimCmd->SetGuidance("Maximum step length.");
0055 fStepLimCmd->SetParameterName("stepLim",false);
0056 fStepLimCmd->SetRange("stepLim>=0.");
0057 fStepLimCmd->SetDefaultValue(DBL_MAX);
0058 fStepLimCmd->SetDefaultUnit("mm");
0059 fStepLimCmd->AvailableForStates(G4State_PreInit);
0060
0061
0062
0063 fDropletRCmd = new G4UIcmdWithADoubleAndUnit("/geometry/dropletR",this);
0064 fDropletRCmd->SetGuidance("Minimal bounding radius of droplet.");
0065 fDropletRCmd->SetParameterName("dropletR",false);
0066 fDropletRCmd->SetRange("dropletR>0.");
0067 fDropletRCmd->SetDefaultValue(1.0);
0068 fDropletRCmd->SetDefaultUnit("mm");
0069 fDropletRCmd->AvailableForStates(G4State_PreInit);
0070
0071
0072 fDropletNumDensCmd = new G4UIcmdWithADouble("/geometry/dropletNumDens", this);
0073 fDropletNumDensCmd->SetGuidance("Number of droplets per mm^3.");
0074 fDropletNumDensCmd->SetParameterName("dropletCOunt",false);
0075 fDropletNumDensCmd->SetDefaultValue(0);
0076 fDropletNumDensCmd->AvailableForStates(G4State_PreInit);
0077
0078
0079
0080
0081 fFastAerosolCloudCmd = new G4UIcmdWithABool("/geometry/fastAerosolCloud",this);
0082 fFastAerosolCloudCmd->SetGuidance("Whether or not to build the fastAerosol cloud.");
0083 fFastAerosolCloudCmd->SetParameterName("fastAerosol",false);
0084 fFastAerosolCloudCmd->SetDefaultValue(false);
0085 fFastAerosolCloudCmd->AvailableForStates(G4State_PreInit);
0086
0087
0088 fParameterisedCloudCmd = new G4UIcmdWithABool("/geometry/parameterisedCloud",this);
0089 fParameterisedCloudCmd->SetGuidance("Whether or not to build the parameterised cloud.");
0090 fParameterisedCloudCmd->SetParameterName("parameterisedCloud",false);
0091 fParameterisedCloudCmd->SetDefaultValue(false);
0092 fParameterisedCloudCmd->AvailableForStates(G4State_PreInit);
0093
0094
0095 fSmoothCloudCmd = new G4UIcmdWithABool("/geometry/smoothCloud",this);
0096 fSmoothCloudCmd->SetGuidance("Whether or not to build the smooth cloud.");
0097 fSmoothCloudCmd->SetParameterName("smoothCloud",false);
0098 fSmoothCloudCmd->SetDefaultValue(false);
0099 fSmoothCloudCmd->AvailableForStates(G4State_PreInit);
0100
0101
0102
0103
0104 fCloudShapeCmd = new G4UIcmdWithAString("/geometry/cloudShape",this);
0105 fCloudShapeCmd->SetGuidance("Cloud bulk shape");
0106 fCloudShapeCmd->SetParameterName("cloudShapeStr",false);
0107 fCloudShapeCmd->AvailableForStates(G4State_PreInit);
0108
0109
0110 fDropletShapeCmd = new G4UIcmdWithAString("/geometry/dropletShape",this);
0111 fDropletShapeCmd->SetGuidance("Cloud droplet shape");
0112 fDropletShapeCmd->SetParameterName("dropletShapeStr",false);
0113 fDropletShapeCmd->AvailableForStates(G4State_PreInit);
0114
0115
0116 fPrePopulateCmd = new G4UIcmdWithABool("/geometry/prePopulate",this);
0117 fPrePopulateCmd->SetGuidance("Whether or not to populate the cloud at the beginning.");
0118 fPrePopulateCmd->SetParameterName("prePopulate",false);
0119 fPrePopulateCmd->SetDefaultValue(false);
0120 fPrePopulateCmd->AvailableForStates(G4State_PreInit);
0121
0122
0123 fMinSpacingCmd = new G4UIcmdWithADoubleAndUnit("/geometry/minSpacing",this);
0124 fMinSpacingCmd->SetGuidance("Minimum spacing between surfaces of spheres when generating random cloud of spheres.");
0125 fMinSpacingCmd->SetParameterName("minSpacing",false);
0126 fMinSpacingCmd->SetRange("minSpacing>0.");
0127 fMinSpacingCmd->SetDefaultValue(10.);
0128 fMinSpacingCmd->SetDefaultUnit("micrometer");
0129 fMinSpacingCmd->AvailableForStates(G4State_PreInit);
0130
0131
0132 fSmartlessCmd = new G4UIcmdWithADouble("/geometry/smartless", this);
0133 fSmartlessCmd->SetGuidance("Set the 'smartless' parameter for the parameterised cloud.");
0134 fSmartlessCmd->SetParameterName("smartless",false);
0135 fSmartlessCmd->SetRange("smartless>0.");
0136 fSmartlessCmd->SetDefaultValue(2.0);
0137 fSmartlessCmd->AvailableForStates(G4State_PreInit);
0138
0139
0140 fCloudSeedCmd = new G4UIcmdWithAnInteger("/geometry/cloudSeed", this);
0141 fCloudSeedCmd->SetGuidance("Base of the random seed for the cloud sphere positions.");
0142 fCloudSeedCmd->SetParameterName("cloudSeed",false);
0143 fCloudSeedCmd->SetDefaultValue(0);
0144 fCloudSeedCmd->AvailableForStates(G4State_PreInit);
0145 }
0146
0147 DetectorConstructionMessenger::~DetectorConstructionMessenger()
0148 {
0149 delete fGeometryDirectory;
0150
0151 delete fStepLimCmd;
0152
0153 delete fDropletRCmd;
0154 delete fDropletNumDensCmd;
0155
0156 delete fFastAerosolCloudCmd;
0157 delete fParameterisedCloudCmd;
0158 delete fSmoothCloudCmd;
0159
0160 delete fCloudShapeCmd;
0161 delete fDropletShapeCmd;
0162 delete fPrePopulateCmd;
0163 delete fMinSpacingCmd;
0164
0165
0166 delete fSmartlessCmd;
0167
0168 delete fCloudSeedCmd;
0169 }
0170
0171 void DetectorConstructionMessenger::SetNewValue( G4UIcommand* command, G4String newValue)
0172 {
0173
0174
0175 if( command == fFastAerosolCloudCmd ) {
0176 fDetector->fFastAerosolCloud = (fFastAerosolCloudCmd->GetNewBoolValue(newValue));
0177 }
0178
0179 if( command == fStepLimCmd ) {
0180 fDetector->fStepLim = (fStepLimCmd->GetNewDoubleValue(newValue));
0181 }
0182
0183 if( command == fDropletRCmd ) {
0184 fDetector->fDropletR = (fDropletRCmd->GetNewDoubleValue(newValue));
0185 }
0186 if( command == fDropletNumDensCmd ) {
0187 fDetector->fDropletNumDens = (fDropletNumDensCmd->GetNewDoubleValue(newValue));
0188 }
0189
0190 if( command == fParameterisedCloudCmd ) {
0191 fDetector->fParameterisedCloud = (fParameterisedCloudCmd->GetNewBoolValue(newValue));
0192 }
0193 if( command == fSmoothCloudCmd ) {
0194 fDetector->fSmoothCloud = (fSmoothCloudCmd->GetNewBoolValue(newValue));
0195 }
0196 if( command == fPrePopulateCmd ) {
0197 fDetector->fPrePopulate = (fPrePopulateCmd->GetNewBoolValue(newValue));
0198 }
0199
0200 if( command == fCloudShapeCmd ) {
0201 fDetector->fCloudShapeStr = newValue;
0202 }
0203 if( command == fDropletShapeCmd ) {
0204 fDetector->fDropletShapeStr = newValue;
0205 }
0206 if( command == fMinSpacingCmd ) {
0207 fDetector->fMinSpacing = (fMinSpacingCmd->GetNewDoubleValue(newValue));
0208 }
0209 if( command == fSmartlessCmd ) {
0210 fDetector->fSmartless = (fSmartlessCmd->GetNewDoubleValue(newValue));
0211 }
0212 if( command == fCloudSeedCmd ) {
0213 fDetector->fCloudSeed = (fCloudSeedCmd->GetNewIntValue(newValue));
0214 }
0215 }
0216