Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
WLSPhysicsListMessenger.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 // $Id: WLSPhysicsListMessenger.cc 69561 2013-05-08 12:25:56Z gcosmo $
27 //
30 //
31 //
32 #include "globals.hh"
33 
35 #include "WLSPhysicsList.hh"
36 
37 #include "G4UIdirectory.hh"
38 #include "G4UIcmdWithABool.hh"
39 #include "G4UIcmdWithAString.hh"
40 #include "G4UIcmdWithAnInteger.hh"
43 
46 
47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
48 
50  : fPhysicsList(pPhys)
51 {
52 
53  fDirectory = new G4UIdirectory("/WLS/phys/");
54  fDirectory->SetGuidance("WLSPhysicsList control");
55 
56  fSetAbsorptionCMD = new G4UIcmdWithABool("/WLS/setAbsorption", this);
57  fSetAbsorptionCMD->SetGuidance("Turn on or off absorption process");
59 
60  fVerboseCmd = new G4UIcmdWithAnInteger("/WLS/phys/verbose",this);
61  fVerboseCmd->SetGuidance("set verbose for physics processes");
62  fVerboseCmd->SetParameterName("verbose",true);
64  fVerboseCmd->SetRange("verbose>=0");
66 
67  fCerenkovCmd =
68  new G4UIcmdWithAnInteger("/WLS/phys/cerenkovMaxPhotons",this);
69  fCerenkovCmd->SetGuidance("set max nb of photons per step");
70  fCerenkovCmd->SetParameterName("MaxNumber",false);
71  fCerenkovCmd->SetRange("MaxNumber>=0");
73 
74  fGammaCutCMD = new G4UIcmdWithADoubleAndUnit("/WLS/phys/gammaCut",this);
75  fGammaCutCMD->SetGuidance("Set gamma cut");
76  fGammaCutCMD->SetParameterName("Gcut",false);
77  fGammaCutCMD->SetUnitCategory("Length");
78  fGammaCutCMD->SetRange("Gcut>0.0");
81 
82  fElectCutCMD = new G4UIcmdWithADoubleAndUnit("/WLS/phys/electronCut",this);
83  fElectCutCMD->SetGuidance("Set electron cut");
84  fElectCutCMD->SetParameterName("Ecut",false);
85  fElectCutCMD->SetUnitCategory("Length");
86  fElectCutCMD->SetRange("Ecut>0.0");
89 
90  fPosCutCMD = new G4UIcmdWithADoubleAndUnit("/WLS/phys/positronCut",this);
91  fPosCutCMD->SetGuidance("Set positron cut");
92  fPosCutCMD->SetParameterName("Pcut",false);
93  fPosCutCMD->SetUnitCategory("Length");
94  fPosCutCMD->SetRange("Pcut>0.0");
97 
98  fAllCutCMD = new G4UIcmdWithADoubleAndUnit("/WLS/phys/allCuts",this);
99  fAllCutCMD->SetGuidance("Set cut for all");
100  fAllCutCMD->SetParameterName("cut",false);
101  fAllCutCMD->SetUnitCategory("Length");
102  fAllCutCMD->SetRange("cut>0.0");
103  fAllCutCMD->SetDefaultUnit("mm");
105 
106  fStepMaxCMD = new G4UIcmdWithADoubleAndUnit("/WLS/phys/stepMax",this);
107  fStepMaxCMD->SetGuidance("Set max. step length in the detector");
108  fStepMaxCMD->SetParameterName("mxStep",false);
109  fStepMaxCMD->SetUnitCategory("Length");
110  fStepMaxCMD->SetRange("mxStep>0.0");
113 
115  new G4UIcmdWithoutParameter("/WLS/phys/clearPhysics",this);
116  fClearPhysicsCMD->SetGuidance("Clear the physics list");
118 
119  fRemovePhysicsCMD = new G4UIcmdWithAString("/WLS/phys/removePhysics",this);
121  SetGuidance("Remove a physics process from Physics List");
122  fRemovePhysicsCMD->SetParameterName("PList",false);
124 
125  fListCMD = new G4UIcmdWithoutParameter("/WLS/phys/list",this);
126  fListCMD->SetGuidance("Available Physics Lists");
128 
129  fDecayDirectory = new G4UIdirectory("/decay/");
130  fDecayDirectory->SetGuidance("Decay chain control commands.");
131 
132  fPienuCMD = new G4UIcmdWithoutParameter("/decay/pienu", this);
133  fPienuCMD->SetGuidance("Sets the pi+ to decay into e+, nu");
134 
135  fPimunuCMD = new G4UIcmdWithoutParameter("/decay/pimunu", this);
136  fPimunuCMD->SetGuidance("Sets the pi+ to decay into mu+, nu");
137 
138 }
139 
140 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
141 
143 {
144  delete fVerboseCmd;
145  delete fCerenkovCmd;
146 
147  delete fSetAbsorptionCMD;
148 
149  delete fGammaCutCMD;
150  delete fElectCutCMD;
151  delete fPosCutCMD;
152  delete fAllCutCMD;
153 
154  delete fClearPhysicsCMD;
155  delete fRemovePhysicsCMD;
156 
157  delete fListCMD;
158 
159  delete fPienuCMD;
160  delete fPimunuCMD;
161 
162  delete fDirectory;
163 }
164 
165 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
166 
168  G4String newValue)
169 {
170  if( command == fSetAbsorptionCMD ) {
172  }
173 
174  else if( command == fVerboseCmd ) {
176  }
177 
178  else if( command == fCerenkovCmd ) {
179  fPhysicsList->
180  SetNbOfPhotonsCerenkov(fCerenkovCmd->GetNewIntValue(newValue));
181  }
182 
183  else if (command == fPienuCMD) {
185  G4ParticleDefinition* particleDef = particleTable->FindParticle("pi+");
186  G4VDecayChannel* mode =
187  new G4PhaseSpaceDecayChannel("pi+",1.0,2,"e+","nu_e");
188  G4DecayTable* table = new G4DecayTable();
189  table->Insert(mode);
190  // mode = new G4PionRadiativeDecayChannel("pi+",0.000017);
191  // table->Insert(mode);
192  particleDef->SetDecayTable(table);
193  }
194 
195  else if (command == fPimunuCMD) {
197  G4ParticleDefinition* particleDef = particleTable->FindParticle("pi+");
198  G4VDecayChannel* mode =
199  new G4PhaseSpaceDecayChannel("pi+",1.000,2,"mu+","nu_mu");
200  G4DecayTable* table = new G4DecayTable();
201  table->Insert(mode);
202  particleDef->SetDecayTable(table);
203  }
204 
205  else if (command == fGammaCutCMD) {
207  ->GetNewDoubleValue(newValue));
208  }
209  else if (command == fElectCutCMD) {
211  ->GetNewDoubleValue(newValue));
212  }
213  else if (command == fPosCutCMD) {
215  ->GetNewDoubleValue(newValue));
216  }
217  else if (command == fAllCutCMD) {
218  G4double cut = fAllCutCMD->GetNewDoubleValue(newValue);
222  }
223  else if (command == fStepMaxCMD) {
225  ->GetNewDoubleValue(newValue));
226  }
227  else if (command == fClearPhysicsCMD) {
229  }
230  else if (command == fRemovePhysicsCMD) {
231  G4String name = newValue;
233  }
234 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
const XML_Char * name
Definition: expat.h:151
Definition of the WLSPhysicsListMessenger class.
G4UIcmdWithADoubleAndUnit * fPosCutCMD
G4UIcmdWithABool * fSetAbsorptionCMD
G4UIcmdWithAnInteger * fVerboseCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4ParticleTable * GetParticleTable()
void RemoveFromPhysicsList(const G4String &)
Remove specific physics from physics list.
void SetDecayTable(G4DecayTable *aDecayTable)
void ClearPhysics()
Make sure that the physics list is empty.
void SetDefaultValue(G4int defVal)
WLSPhysicsListMessenger(WLSPhysicsList *)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void Insert(G4VDecayChannel *aChannel)
Definition: G4DecayTable.cc:62
G4UIcmdWithADoubleAndUnit * fAllCutCMD
static G4bool GetNewBoolValue(const char *paramString)
virtual void SetNewValue(G4UIcommand *, G4String)
static G4double GetNewDoubleValue(const char *paramString)
double G4double
Definition: G4Types.hh:76
void SetUnitCategory(const char *unitCategory)
void SetCutForElectron(G4double)
void SetCutForPositron(G4double)
G4UIcmdWithAnInteger * fCerenkovCmd
G4UIcmdWithoutParameter * fListCMD
void SetStepMax(G4double)
void SetVerbose(G4int)
G4UIcmdWithoutParameter * fClearPhysicsCMD
G4UIcmdWithoutParameter * fPimunuCMD
G4UIcmdWithADoubleAndUnit * fStepMaxCMD
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)
G4UIcmdWithADoubleAndUnit * fElectCutCMD
G4UIcmdWithADoubleAndUnit * fGammaCutCMD
void SetAbsorption(G4bool)
Definition of the WLSPhysicsList class.
void SetCutForGamma(G4double)
G4UIcmdWithoutParameter * fPienuCMD
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:242
G4UIcmdWithAString * fRemovePhysicsCMD
void SetDefaultUnit(const char *defUnit)