[286] | 1 | #include "ELYSE/PhysicsMessenger.hh" |
---|
| 2 | |
---|
| 3 | //Geant4 |
---|
| 4 | #include "G4UIdirectory.hh" |
---|
| 5 | #include "G4ios.hh" |
---|
| 6 | #include "globals.hh" |
---|
| 7 | #include "G4UIcmdWithAString.hh" |
---|
| 8 | #include "G4UIcmdWithAnInteger.hh" |
---|
| 9 | |
---|
| 10 | //ELYSE |
---|
| 11 | #include "ELYSE/PhysicsList.hh" |
---|
| 12 | |
---|
| 13 | |
---|
| 14 | ELYSE::PhysicsMessenger::PhysicsMessenger(ELYSE::PhysicsList* ELYSEPhys) |
---|
| 15 | :ELYSEPhysics(ELYSEPhys) { |
---|
| 16 | |
---|
| 17 | ELYSEDir = new G4UIdirectory("/ELYSE/"); |
---|
| 18 | ELYSEDir->SetGuidance("UI commands of this example"); |
---|
| 19 | |
---|
| 20 | physDir = new G4UIdirectory("/ELYSE/phys/"); |
---|
| 21 | physDir->SetGuidance("PhysicsList control"); |
---|
| 22 | |
---|
| 23 | verboseCmd = new G4UIcmdWithAnInteger("/ELYSE/phys/verbose",this); |
---|
| 24 | verboseCmd->SetGuidance("set verbose for physics processes"); |
---|
| 25 | verboseCmd->SetParameterName("verbose",true); |
---|
| 26 | verboseCmd->SetDefaultValue(1); |
---|
| 27 | verboseCmd->SetRange("verbose>=0"); |
---|
| 28 | verboseCmd->AvailableForStates(G4State_PreInit,G4State_Idle); |
---|
| 29 | |
---|
| 30 | cerenkovCmd = new G4UIcmdWithAnInteger("/ELYSE/phys/cerenkovMaxPhotons",this); |
---|
| 31 | cerenkovCmd->SetGuidance("set max nb of photons per step"); |
---|
| 32 | cerenkovCmd->SetParameterName("MaxNumber",false); |
---|
| 33 | cerenkovCmd->SetRange("MaxNumber>=0"); |
---|
| 34 | cerenkovCmd->AvailableForStates(G4State_Idle); |
---|
| 35 | |
---|
| 36 | }//Ctor |
---|
| 37 | |
---|
| 38 | //--------------------------------------------------------------------------------- |
---|
| 39 | |
---|
| 40 | ELYSE::PhysicsMessenger::~PhysicsMessenger() { |
---|
| 41 | delete verboseCmd; |
---|
| 42 | delete cerenkovCmd; |
---|
| 43 | delete physDir; |
---|
| 44 | delete ELYSEDir; |
---|
| 45 | }//Dtor |
---|
| 46 | |
---|
| 47 | //--------------------------------------------------------------------------------- |
---|
| 48 | |
---|
| 49 | void ELYSE::PhysicsMessenger::SetNewValue(G4UIcommand* command, G4String newValue) { |
---|
| 50 | |
---|
| 51 | if( command == verboseCmd ) { |
---|
| 52 | ELYSEPhysics->SetVerbose(verboseCmd->GetNewIntValue(newValue)); |
---|
| 53 | } |
---|
| 54 | |
---|
| 55 | if( command == cerenkovCmd ) { |
---|
| 56 | ELYSEPhysics->SetNbOfPhotonsCerenkov(cerenkovCmd->GetNewIntValue(newValue)); |
---|
| 57 | } |
---|
| 58 | |
---|
| 59 | }//SetNewValue |
---|