Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 27 // (adapted from B2aDetectorMessenger) 28 // Author: A.Knaian (ara@nklabs.com), N.MacFad 29 30 #include "FADetectorConstructionMessenger.hh" 31 #include "FADetectorConstruction.hh" 32 33 #include "G4UIcmdWithAnInteger.hh" 34 #include "G4UIcmdWithADoubleAndUnit.hh" 35 #include "G4UIcmdWithADouble.hh" 36 #include "G4UIcmdWithABool.hh" 37 #include "G4UIcmdWithAString.hh" 38 39 DetectorConstructionMessenger::DetectorConstru 40 : G4UImessenger() 41 { 42 fDetector = detectorIn; 43 44 // Directory 45 // 46 // /geometry 47 fGeometryDirectory = new G4UIdirectory("/geo 48 fGeometryDirectory->SetGuidance("Geometry se 49 50 // Physics 51 // 52 // /geometry/stepLim 53 fStepLimCmd = new G4UIcmdWithADoubleAndUnit( 54 fStepLimCmd->SetGuidance("Maximum step lengt 55 fStepLimCmd->SetParameterName("stepLim",fals 56 fStepLimCmd->SetRange("stepLim>=0."); 57 fStepLimCmd->SetDefaultValue(DBL_MAX); 58 fStepLimCmd->SetDefaultUnit("mm"); 59 fStepLimCmd->AvailableForStates(G4State_PreI 60 61 // Cloud droplet settings 62 // /geometry/dropletR 63 fDropletRCmd = new G4UIcmdWithADoubleAndUnit 64 fDropletRCmd->SetGuidance("Minimal bounding 65 fDropletRCmd->SetParameterName("dropletR",fa 66 fDropletRCmd->SetRange("dropletR>0."); 67 fDropletRCmd->SetDefaultValue(1.0); 68 fDropletRCmd->SetDefaultUnit("mm"); 69 fDropletRCmd->AvailableForStates(G4State_Pre 70 71 // /geometry/dropletNumDens 72 fDropletNumDensCmd = new G4UIcmdWithADouble( 73 fDropletNumDensCmd->SetGuidance("Number of d 74 fDropletNumDensCmd->SetParameterName("drople 75 fDropletNumDensCmd->SetDefaultValue(0); 76 fDropletNumDensCmd->AvailableForStates(G4Sta 77 78 // Cloud build type 79 // 80 // /geometry/fastAerosol 81 fFastAerosolCloudCmd = new G4UIcmdWithABool( 82 fFastAerosolCloudCmd->SetGuidance("Whether o 83 fFastAerosolCloudCmd->SetParameterName("fast 84 fFastAerosolCloudCmd->SetDefaultValue(false) 85 fFastAerosolCloudCmd->AvailableForStates(G4S 86 87 // /geometry/parameterisedCloud 88 fParameterisedCloudCmd = new G4UIcmdWithABoo 89 fParameterisedCloudCmd->SetGuidance("Whether 90 fParameterisedCloudCmd->SetParameterName("pa 91 fParameterisedCloudCmd->SetDefaultValue(fals 92 fParameterisedCloudCmd->AvailableForStates(G 93 94 // /geometry/smoothCloud 95 fSmoothCloudCmd = new G4UIcmdWithABool("/geo 96 fSmoothCloudCmd->SetGuidance("Whether or not 97 fSmoothCloudCmd->SetParameterName("smoothClo 98 fSmoothCloudCmd->SetDefaultValue(false); 99 fSmoothCloudCmd->AvailableForStates(G4State_ 100 101 // fastAerosol cloud details 102 // 103 // /geometry/cloudShape 104 fCloudShapeCmd = new G4UIcmdWithAString("/ge 105 fCloudShapeCmd->SetGuidance("Cloud bulk shap 106 fCloudShapeCmd->SetParameterName("cloudShape 107 fCloudShapeCmd->AvailableForStates(G4State_P 108 109 // /geometry/dropletShape 110 fDropletShapeCmd = new G4UIcmdWithAString("/ 111 fDropletShapeCmd->SetGuidance("Cloud droplet 112 fDropletShapeCmd->SetParameterName("dropletS 113 fDropletShapeCmd->AvailableForStates(G4State 114 115 // /geometry/prePopulate 116 fPrePopulateCmd = new G4UIcmdWithABool("/geo 117 fPrePopulateCmd->SetGuidance("Whether or not 118 fPrePopulateCmd->SetParameterName("prePopula 119 fPrePopulateCmd->SetDefaultValue(false); 120 fPrePopulateCmd->AvailableForStates(G4State_ 121 122 // /geometry/minSpacing 123 fMinSpacingCmd = new G4UIcmdWithADoubleAndUn 124 fMinSpacingCmd->SetGuidance("Minimum spacing 125 fMinSpacingCmd->SetParameterName("minSpacing 126 fMinSpacingCmd->SetRange("minSpacing>0."); 127 fMinSpacingCmd->SetDefaultValue(10.); 128 fMinSpacingCmd->SetDefaultUnit("micrometer") 129 fMinSpacingCmd->AvailableForStates(G4State_P 130 131 // /geometry/setSmartless 132 fSmartlessCmd = new G4UIcmdWithADouble("/geo 133 fSmartlessCmd->SetGuidance("Set the 'smartle 134 fSmartlessCmd->SetParameterName("smartless", 135 fSmartlessCmd->SetRange("smartless>0."); 136 fSmartlessCmd->SetDefaultValue(2.0); 137 fSmartlessCmd->AvailableForStates(G4State_Pr 138 139 // /geometry/cloudSeed 140 fCloudSeedCmd = new G4UIcmdWithAnInteger("/g 141 fCloudSeedCmd->SetGuidance("Base of the rand 142 fCloudSeedCmd->SetParameterName("cloudSeed", 143 fCloudSeedCmd->SetDefaultValue(0); 144 fCloudSeedCmd->AvailableForStates(G4State_Pr 145 } 146 147 DetectorConstructionMessenger::~DetectorConstr 148 { 149 delete fGeometryDirectory; 150 151 delete fStepLimCmd; 152 153 delete fDropletRCmd; 154 delete fDropletNumDensCmd; 155 156 delete fFastAerosolCloudCmd; 157 delete fParameterisedCloudCmd; 158 delete fSmoothCloudCmd; 159 160 delete fCloudShapeCmd; 161 delete fDropletShapeCmd; 162 delete fPrePopulateCmd; 163 delete fMinSpacingCmd; 164 //delete fGridPitchCmd; 165 166 delete fSmartlessCmd; 167 168 delete fCloudSeedCmd; 169 } 170 171 void DetectorConstructionMessenger::SetNewValu 172 { 173 // Geometry Commands 174 175 if( command == fFastAerosolCloudCmd ) { 176 fDetector->fFastAerosolCloud = (fFastAeros 177 } 178 179 if( command == fStepLimCmd ) { 180 fDetector->fStepLim = (fStepLimCmd->GetNew 181 } 182 183 if( command == fDropletRCmd ) { 184 fDetector->fDropletR = (fDropletRCmd->GetN 185 } 186 if( command == fDropletNumDensCmd ) { 187 fDetector->fDropletNumDens = (fDropletNumD 188 } 189 190 if( command == fParameterisedCloudCmd ) { 191 fDetector->fParameterisedCloud = (fParamet 192 } 193 if( command == fSmoothCloudCmd ) { 194 fDetector->fSmoothCloud = (fSmoothCloudCmd 195 } 196 if( command == fPrePopulateCmd ) { 197 fDetector->fPrePopulate = (fPrePopulateCmd 198 } 199 200 if( command == fCloudShapeCmd ) { 201 fDetector->fCloudShapeStr = newValue; 202 } 203 if( command == fDropletShapeCmd ) { 204 fDetector->fDropletShapeStr = newValue; 205 } 206 if( command == fMinSpacingCmd ) { 207 fDetector->fMinSpacing = (fMinSpacingCmd-> 208 } 209 if( command == fSmartlessCmd ) { 210 fDetector->fSmartless = (fSmartlessCmd->Ge 211 } 212 if( command == fCloudSeedCmd ) { 213 fDetector->fCloudSeed = (fCloudSeedCmd->Ge 214 } 215 } 216 217