// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // // //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... #include "PhysicsListMessenger.hh" #include "PhysicsList.hh" #include "G4UIdirectory.hh" #include "G4UIcmdWithAnInteger.hh" #include "G4UIcmdWithADoubleAndUnit.hh" #include "G4UIcmdWithAString.hh" #include "G4UIcmdWithABool.hh" //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... PhysicsListMessenger::PhysicsListMessenger( PhysicsList* pPhys): G4UImessenger(), fPhysicsList(pPhys) { fPhysDir = new G4UIdirectory("/phys/"); fPhysDir->SetGuidance("PhysicsList control"); fVerboseCmd = new G4UIcmdWithAnInteger("/phys/OPverbose",this); fVerboseCmd->SetGuidance("set verbose for physics processes"); fVerboseCmd->SetParameterName("OPverbose",true); fVerboseCmd->SetDefaultValue(1); fVerboseCmd->SetRange("OPverbose>=0"); fVerboseCmd->AvailableForStates(G4State_PreInit, G4State_Idle); fCerenkovCmd = new G4UIcmdWithAnInteger("/phys/cerenkovMaxPhotons",this); fCerenkovCmd->SetGuidance("set max nb of photons per step"); fCerenkovCmd->SetParameterName("MaxNumber",false); fCerenkovCmd->SetRange("MaxNumber>=0"); fCerenkovCmd->AvailableForStates(G4State_PreInit, G4State_Idle); fCerenkovProcessCmd = new G4UIcmdWithAnInteger("/phys/setCerenkovProcess",this); fCerenkovProcessCmd->SetGuidance("activate/deactivate Cerenkov Process"); fCerenkovProcessCmd->SetParameterName("crkv",false); fCerenkovProcessCmd->SetRange("crkv==0 || crkv==1"); fCerenkovProcessCmd->AvailableForStates(G4State_PreInit, G4State_Idle); fOpPhotonPhysicsCmd = new G4UIcmdWithAnInteger("/phys/setOpPhotonPhysics",this); fOpPhotonPhysicsCmd->SetGuidance("activate/deactivate Optical Photon physics"); fOpPhotonPhysicsCmd->SetParameterName("OpPhys",false); fOpPhotonPhysicsCmd->SetRange("OpPhys==0 || OpPhys==1"); fOpPhotonPhysicsCmd->AvailableForStates(G4State_PreInit, G4State_Idle); fCutsCmd = new G4UIcmdWithADoubleAndUnit("/phys/setCuts",this); fCutsCmd->SetGuidance("set cuts"); fCutsCmd->SetParameterName("cuts",false); fCutsCmd->SetUnitCategory("Length"); fCutsCmd->SetRange("cuts>0."); fCutsCmd->AvailableForStates(G4State_PreInit, G4State_Idle); fListCmd = new G4UIcmdWithAString("/phys/SelectPhysicsList",this); fListCmd->SetGuidance("Select a modular EM physics list (standard, penelope, livermore)"); fListCmd->SetParameterName("PList",false); fListCmd->AvailableForStates(G4State_PreInit); fHadExtraPhysicsCmd = new G4UIcmdWithABool("/phys/setHadExtraPhysics", this); fHadExtraPhysicsCmd->SetGuidance("set Hadronic and Extra Physics: (1) true, (0) false"); fHadExtraPhysicsCmd->SetParameterName("IWantHadExtraPhysics", true); fHadExtraPhysicsCmd->SetDefaultValue(false); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... PhysicsListMessenger::~PhysicsListMessenger() { delete fPhysDir; delete fVerboseCmd; delete fCerenkovCmd; delete fCerenkovProcessCmd; delete fOpPhotonPhysicsCmd; delete fCutsCmd; delete fListCmd; delete fHadExtraPhysicsCmd; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... void PhysicsListMessenger::SetNewValue(G4UIcommand* command, G4String newValue) { if (command == fVerboseCmd) { fPhysicsList->SetVerbose(fVerboseCmd->GetNewIntValue(newValue)); } if (command == fCerenkovCmd) { fPhysicsList->SetNbOfPhotonsCerenkov(fCerenkovCmd->GetNewIntValue(newValue)); } if (command == fCerenkovProcessCmd) { fPhysicsList->SetCerenkovProcess(fCerenkovProcessCmd->GetNewIntValue(newValue)); } if (command == fOpPhotonPhysicsCmd) { fPhysicsList->SetOpPhotonPhysics(fOpPhotonPhysicsCmd->GetNewIntValue(newValue)); } if (command == fCutsCmd) { fPhysicsList->SetDefaultCutsValue(fCutsCmd->GetNewDoubleValue(newValue)); } if (command == fListCmd) { fPhysicsList->SelectPhysicsList(newValue); } if (command == fHadExtraPhysicsCmd) { fPhysicsList->SetHadExtraPhysics(fHadExtraPhysicsCmd->GetNewBoolValue(newValue)); } } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......