Geant4  10.01.p03
PhysicsListMessenger.cc
Go to the documentation of this file.
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 //
28 //
29 // $Id: PhysicsListMessenger.cc 85243 2014-10-27 08:22:42Z gcosmo $
30 //
31 //---------------------------------------------------------------------------
32 //
33 // ClassName: PhysicsListMessenger
34 //
35 // Description: EM physics with a possibility to add PAI model
36 //
37 // Author: V.Ivanchenko 01.09.2010
38 //
39 //----------------------------------------------------------------------------
40 //
41 
42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44 
45 #include "PhysicsListMessenger.hh"
46 
47 #include "PhysicsList.hh"
48 #include "G4UIdirectory.hh"
50 #include "G4UIcmdWithAString.hh"
51 #include "G4UIcmdWithAnInteger.hh"
52 #include "TestParameters.hh"
53 
54 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
55 
57 :G4UImessenger(),fPhysicsList(pPhys),
58  fECmd(0),
59  fEBCmd(0),
60  fCBCmd(0),
61  fListCmd(0),
62  fADCCmd(0)
63 {
64  fPhysDir = new G4UIdirectory("/testem/phys/");
65  fPhysDir->SetGuidance("physics list commands");
66 
67  fECmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setMaxE",this);
68  fECmd->SetGuidance("Set max energy deposit");
69  fECmd->SetParameterName("Emax",false);
70  fECmd->SetUnitCategory("Energy");
71  fECmd->SetRange("Emax>0.0");
73 
74  fEBCmd = new G4UIcmdWithAnInteger("/testem/phys/setNbinsE",this);
75  fEBCmd->SetGuidance("Set number of bins in energy.");
76  fEBCmd->SetParameterName("Ebins",false);
77  fEBCmd->SetRange("Ebins>0");
79 
80  fCBCmd = new G4UIcmdWithAnInteger("/testem/phys/setNbinsCl",this);
81  fCBCmd->SetGuidance("Set max number of clusters.");
82  fCBCmd->SetParameterName("Cbins",false);
83  fCBCmd->SetRange("Cbins>0");
85 
86  fListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics",this);
87  fListCmd->SetGuidance("Add modula physics list.");
88  fListCmd->SetParameterName("PList",false);
90 
91  fADCCmd = new G4UIcmdWithADoubleAndUnit("/testem/setEnergyPerChannel",this);
92  fADCCmd->SetGuidance("Set energy per ADC channel");
93  fADCCmd->SetParameterName("enadc",false,false);
94  fADCCmd->SetUnitCategory("Energy");
95  fADCCmd->SetDefaultUnit("keV");
96  fADCCmd->SetRange("enadc>0.");
98 }
99 
100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
101 
103 {
104  delete fECmd;
105  delete fEBCmd;
106  delete fCBCmd;
107  delete fListCmd;
108  delete fADCCmd;
109  delete fPhysDir;
110 }
111 
112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
113 
115  G4String newValue)
116 {
118 
119  if( command == fECmd )
120  { man->SetMaxEnergy(fECmd->GetNewDoubleValue(newValue)); }
121  if( command == fEBCmd )
122  { man->SetNumberBins(fEBCmd->GetNewIntValue(newValue)); }
123  if( command == fCBCmd )
124  { man->SetNumberBinsCluster(fCBCmd->GetNewIntValue(newValue)); }
125  if( command == fListCmd )
126  { fPhysicsList->AddPhysicsList(newValue); }
127  if( command == fADCCmd )
128  { man->SetEnergyPerChannel(fADCCmd->GetNewDoubleValue(newValue)); }
129 }
130 
131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithADoubleAndUnit * fADCCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
void SetNumberBinsCluster(G4int value)
G4UIcmdWithADoubleAndUnit * fECmd
void SetEnergyPerChannel(G4double value)
void SetUnitCategory(const char *unitCategory)
static G4double GetNewDoubleValue(const char *paramString)
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void SetNumberBins(G4int value)
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
void SetNewValue(G4UIcommand *, G4String)
G4UIcmdWithAnInteger * fCBCmd
void SetMaxEnergy(G4double value)
void SetDefaultUnit(const char *defUnit)
static TestParameters * GetPointer()
PhysicsListMessenger(PhysicsList *)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithAnInteger * fEBCmd
G4UIcmdWithAString * fListCmd