#include "ELYSE/PhysicsMessenger.hh" //Geant4 #include "G4UIdirectory.hh" #include "G4ios.hh" #include "globals.hh" #include "G4UIcmdWithAString.hh" #include "G4UIcmdWithAnInteger.hh" //ELYSE #include "ELYSE/PhysicsList.hh" ELYSE::PhysicsMessenger::PhysicsMessenger(ELYSE::PhysicsList* ELYSEPhys) :ELYSEPhysics(ELYSEPhys) { ELYSEDir = new G4UIdirectory("/ELYSE/"); ELYSEDir->SetGuidance("UI commands of this example"); physDir = new G4UIdirectory("/ELYSE/phys/"); physDir->SetGuidance("PhysicsList control"); verboseCmd = new G4UIcmdWithAnInteger("/ELYSE/phys/verbose",this); verboseCmd->SetGuidance("set verbose for physics processes"); verboseCmd->SetParameterName("verbose",true); verboseCmd->SetDefaultValue(1); verboseCmd->SetRange("verbose>=0"); verboseCmd->AvailableForStates(G4State_PreInit,G4State_Idle); cerenkovCmd = new G4UIcmdWithAnInteger("/ELYSE/phys/cerenkovMaxPhotons",this); cerenkovCmd->SetGuidance("set max nb of photons per step"); cerenkovCmd->SetParameterName("MaxNumber",false); cerenkovCmd->SetRange("MaxNumber>=0"); cerenkovCmd->AvailableForStates(G4State_Idle); }//Ctor //--------------------------------------------------------------------------------- ELYSE::PhysicsMessenger::~PhysicsMessenger() { delete verboseCmd; delete cerenkovCmd; delete physDir; delete ELYSEDir; }//Dtor //--------------------------------------------------------------------------------- void ELYSE::PhysicsMessenger::SetNewValue(G4UIcommand* command, G4String newValue) { if( command == verboseCmd ) { ELYSEPhysics->SetVerbose(verboseCmd->GetNewIntValue(newValue)); } if( command == cerenkovCmd ) { ELYSEPhysics->SetNbOfPhotonsCerenkov(cerenkovCmd->GetNewIntValue(newValue)); } }//SetNewValue