Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
ML2PhysicsListMessenger.cc
이 파일의 문서화 페이지로 가기
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 // The code was written by :
27 // ^Claudio Andenna claudio.andenna@ispesl.it, claudio.andenna@iss.infn.it
28 // *Barbara Caccia barbara.caccia@iss.it
29 // with the support of Pablo Cirrone (LNS, INFN Catania Italy)
30 // with the contribute of Alessandro Occhigrossi*
31 //
32 // ^INAIL DIPIA - ex ISPESL and INFN Roma, gruppo collegato Sanità, Italy
33 // *Istituto Superiore di Sanità and INFN Roma, gruppo collegato Sanità, Italy
34 // Viale Regina Elena 299, 00161 Roma (Italy)
35 // tel (39) 06 49902246
36 // fax (39) 06 49387075
37 //
38 // more information:
39 // http://g4advancedexamples.lngs.infn.it/Examples/medical-linac
40 //
41 
42 
44 
45 #include "ML2PhysicsList.hh"
46 #include "G4UIdirectory.hh"
48 #include "G4UIcmdWithAString.hh"
49 
52 :pPhysicsList(pPhys)
53 {
54  physDir = new G4UIdirectory("/physic/");
55  physDir->SetGuidance("Commands to activate physics models and set cuts");
56 
57  gammaCutCmd = new G4UIcmdWithADoubleAndUnit("/physic/setGCut",this);
58  gammaCutCmd->SetGuidance("Set gamma cut.");
59  gammaCutCmd->SetParameterName("Gcut",false);
60  gammaCutCmd->SetUnitCategory("Length");
61  gammaCutCmd->SetRange("Gcut>0.0");
63 
64  electCutCmd = new G4UIcmdWithADoubleAndUnit("/physic/setECut",this);
65  electCutCmd->SetGuidance("Set electron cut.");
66  electCutCmd->SetParameterName("Ecut",false);
67  electCutCmd->SetUnitCategory("Length");
68  electCutCmd->SetRange("Ecut>0.0");
70 
71  protoCutCmd = new G4UIcmdWithADoubleAndUnit("/physic/setPCut",this);
72  protoCutCmd->SetGuidance("Set positron cut.");
73  protoCutCmd->SetParameterName("Pcut",false);
74  protoCutCmd->SetUnitCategory("Length");
75  protoCutCmd->SetRange("Pcut>0.0");
77 
78  allCutCmd = new G4UIcmdWithADoubleAndUnit("/physic/setCuts",this);
79  allCutCmd->SetGuidance("Set cut for all.");
80  allCutCmd->SetParameterName("cut",false);
81  allCutCmd->SetUnitCategory("Length");
82  allCutCmd->SetRange("cut>0.0");
84 
85  pListCmd = new G4UIcmdWithAString("/physic/addPhysics",this);
86  pListCmd->SetGuidance("Add physics list.");
87  pListCmd->SetParameterName("PList",false);
89 
90  packageListCmd = new G4UIcmdWithAString("/physic/addPackage",this);
91  packageListCmd->SetGuidance("Add physics package.");
92  packageListCmd->SetParameterName("package",false);
94 }
95 
98 {
99  delete gammaCutCmd;
100  delete electCutCmd;
101  delete protoCutCmd;
102  delete allCutCmd;
103  delete pListCmd;
104  delete physDir;
105  delete packageListCmd;
106 }
107 
108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
109 
111  G4String newValue)
112 {
113  if( command == gammaCutCmd )
115 
116  if( command == electCutCmd )
118 
119  if( command == protoCutCmd )
121 
122  if( command == allCutCmd )
123  {
124  G4double cut = allCutCmd->GetNewDoubleValue(newValue);
128  }
129 
130  if( command == pListCmd )
131  { pPhysicsList->AddPhysicsList(newValue);}
132 
133  if( command == packageListCmd )
134  { pPhysicsList->AddPackage(newValue);}
135 }
136 
137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetCutForElectron(G4double)
ML2PhysicsListMessenger(ML2PhysicsList *)
void AddPackage(const G4String &name)
G4UIcmdWithAString * packageListCmd
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
G4UIcmdWithADoubleAndUnit * protoCutCmd
static G4double GetNewDoubleValue(const char *paramString)
double G4double
Definition: G4Types.hh:76
void SetNewValue(G4UIcommand *, G4String)
void SetCutForPositron(G4double)
G4UIcmdWithADoubleAndUnit * allCutCmd
void SetUnitCategory(const char *unitCategory)
void SetCutForGamma(G4double)
void AddPhysicsList(const G4String &name)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:242
G4UIcmdWithADoubleAndUnit * electCutCmd
G4UIcmdWithADoubleAndUnit * gammaCutCmd