Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
examples/extended/electromagnetic/TestEm8/src/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 //
26 /// \file electromagnetic/TestEm8/src/PhysicsListMessenger.cc
27 /// \brief Implementation of the PhysicsListMessenger class
28 //
29 // $Id: PhysicsListMessenger.cc 67268 2013-02-13 11:38:40Z ihrivnac $
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"
49 #include "G4UIcmdWithAString.hh"
50 #include "G4UIcmdWithAnInteger.hh"
51 #include "HistoManager.hh"
52 
53 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
54 
56 :G4UImessenger(),fPhysicsList(pPhys),
57  fECmd(0),
58  fEBCmd(0),
59  fCBCmd(0),
60  fListCmd(0),
61  fADCCmd(0)
62 {
63  fECmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setMaxE",this);
64  fECmd->SetGuidance("Set max energy deposit");
65  fECmd->SetParameterName("Emax",false);
66  fECmd->SetUnitCategory("Energy");
67  fECmd->SetRange("Emax>0.0");
69 
70  fEBCmd = new G4UIcmdWithAnInteger("/testem/phys/setNbinsE",this);
71  fEBCmd->SetGuidance("Set number of bins in energy.");
72  fEBCmd->SetParameterName("Ebins",false);
73  fEBCmd->SetRange("Ebins>0");
75 
76  fCBCmd = new G4UIcmdWithAnInteger("/testem/phys/setNbinsCl",this);
77  fCBCmd->SetGuidance("Set max number of clusters.");
78  fCBCmd->SetParameterName("Cbins",false);
79  fCBCmd->SetRange("Cbins>0");
81 
82  fListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics",this);
83  fListCmd->SetGuidance("Add modula physics list.");
84  fListCmd->SetParameterName("PList",false);
86 
87  fADCCmd = new G4UIcmdWithADoubleAndUnit("/testem/setEnergyPerChannel",this);
88  fADCCmd->SetGuidance("Set energy per ADC channel");
89  fADCCmd->SetParameterName("enadc",false,false);
90  fADCCmd->SetUnitCategory("Energy");
91  fADCCmd->SetDefaultUnit("keV");
92  fADCCmd->SetRange("enadc>0.");
94 }
95 
96 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
97 
99 {
100  delete fECmd;
101  delete fEBCmd;
102  delete fCBCmd;
103  delete fListCmd;
104  delete fADCCmd;
105 }
106 
107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
108 
110  G4String newValue)
111 {
113  if( command == fECmd )
114  { man->SetMaxEnergy(fECmd->GetNewDoubleValue(newValue)); }
115 
116  if( command == fEBCmd )
117  { man->SetNumberBins(fEBCmd->GetNewIntValue(newValue)); }
118 
119  if( command == fCBCmd )
120  { man->SetNumberBinsCluster(fCBCmd->GetNewIntValue(newValue)); }
121 
122  if( command == fListCmd )
123  { fPhysicsList->AddPhysicsList(newValue); }
124 
125  if( command == fADCCmd )
126  { man->SetEnergyPerChannel(fADCCmd->GetNewDoubleValue(newValue)); }
127 }
128 
129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
void SetUnitCategory(const char *unitCategory)
static G4double GetNewDoubleValue(const char *paramString)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:225
void SetDefaultUnit(const char *defUnit)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)