Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 /// \file biasing/ReverseMC01/src/RMC01Detecto 26 /// \file biasing/ReverseMC01/src/RMC01DetectorMessenger.cc 27 /// \brief Implementation of the RMC01Detector 27 /// \brief Implementation of the RMC01DetectorMessenger class 28 // 28 // 29 // 29 // 30 ////////////////////////////////////////////// 30 ////////////////////////////////////////////////////////////// 31 // Class Name: RMC01DetectorMessen 31 // Class Name: RMC01DetectorMessenger 32 // Author: L. Desorgher 32 // Author: L. Desorgher 33 // Organisation: SpaceIT GmbH 33 // Organisation: SpaceIT GmbH 34 // Contract: ESA contract 21435/ 34 // Contract: ESA contract 21435/08/NL/AT 35 // Customer: ESA/ESTEC 35 // Customer: ESA/ESTEC 36 ////////////////////////////////////////////// 36 ////////////////////////////////////////////////////////////// 37 37 38 //....oooOO0OOooo........oooOO0OOooo........oo 38 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 39 //....oooOO0OOooo........oooOO0OOooo........oo 39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 40 40 41 #include "RMC01DetectorMessenger.hh" 41 #include "RMC01DetectorMessenger.hh" 42 42 43 #include "RMC01DetectorConstruction.hh" 43 #include "RMC01DetectorConstruction.hh" 44 << 44 #include "G4UIdirectory.hh" 45 #include "G4UIcmdWith3VectorAndUnit.hh" 45 #include "G4UIcmdWith3VectorAndUnit.hh" 46 #include "G4UIcmdWithADoubleAndUnit.hh" 46 #include "G4UIcmdWithADoubleAndUnit.hh" 47 #include "G4UIdirectory.hh" << 48 47 49 //....oooOO0OOooo........oooOO0OOooo........oo 48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 50 49 51 RMC01DetectorMessenger::RMC01DetectorMessenger << 50 RMC01DetectorMessenger::RMC01DetectorMessenger( 52 : G4UImessenger(), << 51 RMC01DetectorConstruction* GeneralDet) 53 fTheDetector(GeneralDet), << 52 : G4UImessenger(), 54 fGeneralDir(0), << 53 fTheDetector(GeneralDet), 55 fDetDir(0), << 54 fGeneralDir(0), 56 fSetSensitiveVolumeHeightCmd(0), << 55 fDetDir(0), 57 fSetSensitiveVolumeRadiusCmd(0), << 56 fSetSensitiveVolumeHeightCmd(0), 58 fSetShieldingThicknessCmd(0) << 57 fSetSensitiveVolumeRadiusCmd(0), 59 { << 58 fSetShieldingThicknessCmd(0) 60 fGeneralDir = new G4UIdirectory("/RMC01/"); << 59 { 61 fGeneralDir->SetGuidance("Control of the Gea << 60 >> 61 fGeneralDir= new G4UIdirectory("/RMC01/"); >> 62 fGeneralDir->SetGuidance( >> 63 "Control of the Geant4 Reverse Monte Carlo example1"); >> 64 >> 65 62 66 63 fDetDir = new G4UIdirectory("/RMC01/geometry 67 fDetDir = new G4UIdirectory("/RMC01/geometry/"); 64 fDetDir->SetGuidance("Geometry control"); 68 fDetDir->SetGuidance("Geometry control"); 65 << 69 66 fSetSensitiveVolumeHeightCmd = << 70 67 new G4UIcmdWithADoubleAndUnit("/RMC01/geom << 71 fSetSensitiveVolumeHeightCmd = new G4UIcmdWithADoubleAndUnit( 68 fSetSensitiveVolumeHeightCmd->SetGuidance("S << 72 "/RMC01/geometry/SetSensitiveVolumeHeight",this); >> 73 fSetSensitiveVolumeHeightCmd->SetGuidance( >> 74 "Set the height of the sensitive cylinder"); 69 fSetSensitiveVolumeHeightCmd->AvailableForSt 75 fSetSensitiveVolumeHeightCmd->AvailableForStates(G4State_PreInit); 70 << 76 71 fSetSensitiveVolumeRadiusCmd = << 77 fSetSensitiveVolumeRadiusCmd = new G4UIcmdWithADoubleAndUnit( 72 new G4UIcmdWithADoubleAndUnit("/RMC01/geom << 78 "/RMC01/geometry/SetSensitiveVolumeRadius",this); 73 fSetSensitiveVolumeRadiusCmd->SetGuidance("S << 79 fSetSensitiveVolumeRadiusCmd->SetGuidance( >> 80 "Set the radius of the sensitive cylinder"); 74 fSetSensitiveVolumeRadiusCmd->AvailableForSt 81 fSetSensitiveVolumeRadiusCmd->AvailableForStates(G4State_PreInit); 75 << 82 76 fSetShieldingThicknessCmd = << 83 fSetShieldingThicknessCmd = new G4UIcmdWithADoubleAndUnit( 77 new G4UIcmdWithADoubleAndUnit("/RMC01/geom << 84 "/RMC01/geometry/SetShieldingThickness",this); 78 fSetShieldingThicknessCmd->SetGuidance("Set << 85 fSetShieldingThicknessCmd->SetGuidance( >> 86 "Set the thickness of the Aluminum Shielding sphere"); 79 fSetShieldingThicknessCmd->AvailableForState 87 fSetShieldingThicknessCmd->AvailableForStates(G4State_PreInit); >> 88 80 } 89 } 81 90 82 //....oooOO0OOooo........oooOO0OOooo........oo 91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 83 92 84 RMC01DetectorMessenger::~RMC01DetectorMessenge 93 RMC01DetectorMessenger::~RMC01DetectorMessenger() 85 { 94 { 86 if (fGeneralDir) delete fGeneralDir; << 95 if (fGeneralDir ) delete fGeneralDir; 87 if (fDetDir) delete fDetDir; 96 if (fDetDir) delete fDetDir; 88 if (fSetSensitiveVolumeHeightCmd) delete fSe << 97 if (fSetSensitiveVolumeHeightCmd) delete fSetSensitiveVolumeHeightCmd; 89 if (fSetSensitiveVolumeRadiusCmd) delete fSe << 98 if (fSetSensitiveVolumeRadiusCmd) delete fSetSensitiveVolumeRadiusCmd; 90 if (fSetShieldingThicknessCmd) delete fSetSh << 99 if (fSetShieldingThicknessCmd) delete fSetShieldingThicknessCmd; >> 100 91 } 101 } 92 102 93 //....oooOO0OOooo........oooOO0OOooo........oo 103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 94 104 95 void RMC01DetectorMessenger::SetNewValue(G4UIc << 105 void RMC01DetectorMessenger::SetNewValue(G4UIcommand* command, 96 { << 106 G4String newValue) 97 if (command == fSetSensitiveVolumeHeightCmd) << 107 { if( command == fSetSensitiveVolumeHeightCmd ){ 98 fTheDetector->SetSensitiveVolumeHeight( << 108 fTheDetector->SetSensitiveVolumeHeight( 99 fSetSensitiveVolumeHeightCmd->GetNewDoub << 109 fSetSensitiveVolumeHeightCmd->GetNewDoubleValue(newValue)); 100 } 110 } 101 << 111 102 else if (command == fSetSensitiveVolumeRadiu << 112 else if( command == fSetSensitiveVolumeRadiusCmd ){ 103 fTheDetector->SetSensitiveVolumeRadius( << 113 fTheDetector->SetSensitiveVolumeRadius( 104 fSetSensitiveVolumeRadiusCmd->GetNewDoub << 114 fSetSensitiveVolumeRadiusCmd->GetNewDoubleValue(newValue)); 105 } 115 } 106 << 116 107 else if (command == fSetShieldingThicknessCm << 117 else if( command == fSetShieldingThicknessCmd ){ 108 fTheDetector->SetShieldingThickness(fSetSh << 118 fTheDetector->SetShieldingThickness( >> 119 fSetShieldingThicknessCmd->GetNewDoubleValue(newValue)); 109 } 120 } 110 } 121 } 111 122 112 //....oooOO0OOooo........oooOO0OOooo........oo 123 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 113 124