[807] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
[1342] | 26 | // $Id: PhysicsListMessenger.cc,v 1.3 2010/09/08 09:12:10 vnivanch Exp $ |
---|
| 27 | // GEANT4 tag $Name: examples-V09-03-09 $ |
---|
[807] | 28 | // |
---|
[1342] | 29 | //--------------------------------------------------------------------------- |
---|
[807] | 30 | // |
---|
[1342] | 31 | // ClassName: PhysicsListMessenger |
---|
| 32 | // |
---|
| 33 | // Description: EM physics with a possibility to add PAI model |
---|
| 34 | // |
---|
| 35 | // Author: V.Ivanchenko 01.09.2010 |
---|
| 36 | // |
---|
| 37 | //---------------------------------------------------------------------------- |
---|
[807] | 38 | // |
---|
| 39 | |
---|
| 40 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 41 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 42 | |
---|
| 43 | #include "PhysicsListMessenger.hh" |
---|
| 44 | |
---|
| 45 | #include "PhysicsList.hh" |
---|
| 46 | #include "G4UIcmdWithADoubleAndUnit.hh" |
---|
| 47 | #include "G4UIcmdWithAString.hh" |
---|
[1342] | 48 | #include "G4UIcmdWithAnInteger.hh" |
---|
| 49 | #include "HistoManager.hh" |
---|
[807] | 50 | |
---|
| 51 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 52 | |
---|
| 53 | PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys) |
---|
| 54 | :pPhysicsList(pPhys) |
---|
| 55 | { |
---|
[1342] | 56 | eCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setMaxE",this); |
---|
| 57 | eCmd->SetGuidance("Set max energy deposit"); |
---|
| 58 | eCmd->SetParameterName("Emax",false); |
---|
| 59 | eCmd->SetUnitCategory("Energy"); |
---|
| 60 | eCmd->SetRange("Emax>0.0"); |
---|
| 61 | eCmd->AvailableForStates(G4State_PreInit,G4State_Idle); |
---|
[807] | 62 | |
---|
[1342] | 63 | ebCmd = new G4UIcmdWithAnInteger("/testem/phys/setNbinsE",this); |
---|
| 64 | ebCmd->SetGuidance("Set number of bins in energy."); |
---|
| 65 | ebCmd->SetParameterName("Ebins",false); |
---|
| 66 | ebCmd->SetRange("Ebins>0"); |
---|
| 67 | ebCmd->AvailableForStates(G4State_PreInit,G4State_Idle); |
---|
[807] | 68 | |
---|
[1342] | 69 | cbCmd = new G4UIcmdWithAnInteger("/testem/phys/setNbinsCl",this); |
---|
| 70 | cbCmd->SetGuidance("Set max number of clusters."); |
---|
| 71 | cbCmd->SetParameterName("Cbins",false); |
---|
| 72 | cbCmd->SetRange("Cbins>0"); |
---|
| 73 | cbCmd->AvailableForStates(G4State_PreInit,G4State_Idle); |
---|
[807] | 74 | |
---|
| 75 | pListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics",this); |
---|
| 76 | pListCmd->SetGuidance("Add modula physics list."); |
---|
| 77 | pListCmd->SetParameterName("PList",false); |
---|
| 78 | pListCmd->AvailableForStates(G4State_PreInit); |
---|
| 79 | } |
---|
| 80 | |
---|
| 81 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 82 | |
---|
| 83 | PhysicsListMessenger::~PhysicsListMessenger() |
---|
| 84 | { |
---|
[1342] | 85 | delete eCmd; |
---|
| 86 | delete ebCmd; |
---|
| 87 | delete cbCmd; |
---|
[807] | 88 | delete pListCmd; |
---|
| 89 | } |
---|
| 90 | |
---|
| 91 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 92 | |
---|
| 93 | void PhysicsListMessenger::SetNewValue(G4UIcommand* command, |
---|
| 94 | G4String newValue) |
---|
| 95 | { |
---|
[1342] | 96 | HistoManager* man = HistoManager::GetPointer(); |
---|
| 97 | if( command == eCmd ) |
---|
| 98 | { man->SetMaxEnergy(eCmd->GetNewDoubleValue(newValue));} |
---|
[807] | 99 | |
---|
[1342] | 100 | if( command == ebCmd ) |
---|
| 101 | { man->SetNumberBins(ebCmd->GetNewIntValue(newValue));} |
---|
[807] | 102 | |
---|
[1342] | 103 | if( command == cbCmd ) |
---|
| 104 | { man->SetNumberBinsCluster(cbCmd->GetNewIntValue(newValue));} |
---|
[807] | 105 | |
---|
| 106 | if( command == pListCmd ) |
---|
| 107 | { pPhysicsList->AddPhysicsList(newValue);} |
---|
| 108 | } |
---|
| 109 | |
---|
| 110 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|