Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
WLSPhysicsList.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: WLSPhysicsList.cc 101181 2016-11-08 15:08:33Z gcosmo $
27 //
30 //
31 //
32 #include "WLSPhysicsList.hh"
34 
35 #include "WLSExtraPhysics.hh"
36 #include "WLSOpticalPhysics.hh"
37 
38 #include "G4LossTableManager.hh"
39 
40 #include "G4ProcessManager.hh"
41 #include "G4ParticleTypes.hh"
42 #include "G4ParticleTable.hh"
43 
44 //#include "G4PhysListFactory.hh"
45 #include "FTFP_BERT.hh"
46 #include "QGSP_BERT_HP.hh"
47 
48 #include "G4Gamma.hh"
49 #include "G4Electron.hh"
50 #include "G4Positron.hh"
51 
52 #include "WLSStepMax.hh"
53 
54 #include "G4ProcessTable.hh"
55 
56 #include "G4PionDecayMakeSpin.hh"
57 #include "G4DecayWithSpin.hh"
58 
59 #include "G4DecayTable.hh"
62 
64 
65 #include "G4SystemOfUnits.hh"
66 
67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
68 
70 {
72 
73  defaultCutValue = 1.*mm;
77 
78 // G4PhysListFactory factory;
79  G4VModularPhysicsList* phys = NULL;
80  if (physName == "QGSP_BERT_HP") {
81  phys = new QGSP_BERT_HP;
82  } else {
83  phys = new FTFP_BERT;
84  }
85 // if (factory.IsReferencePhysList(physName)) {
86 // phys = factory.GetReferencePhysList(physName);
87 // if(!phys)G4Exception("WLSPhysicsList::WLSPhysicsList","InvalidSetup",
88 // FatalException,"PhysicsList does not exist");
90 // }
91 
92  for (G4int i = 0; ; ++i) {
93  G4VPhysicsConstructor* elem =
94  const_cast<G4VPhysicsConstructor*> (phys->GetPhysics(i));
95  if (elem == NULL) break;
96  G4cout << "RegisterPhysics: " << elem->GetPhysicsName() << G4endl;
97  RegisterPhysics(elem);
98  }
99 
100  fAbsorptionOn = true;
101 
104 
106 
107  fStepMaxProcess = new WLSStepMax();
108 }
109 
110 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
111 
113 {
114  delete fMessenger;
115 
116  delete fStepMaxProcess;
117 }
118 
119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
120 
122 {
123  for (G4PhysConstVector::iterator p = fPhysicsVector->begin();
124  p != fPhysicsVector->end(); ++p) {
125  delete (*p);
126  }
127  fPhysicsVector->clear();
128 }
129 
130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
131 
133 {
135 
136  G4DecayTable* MuonPlusDecayTable = new G4DecayTable();
137  MuonPlusDecayTable -> Insert(new
138  G4MuonDecayChannelWithSpin("mu+",0.986));
139  MuonPlusDecayTable -> Insert(new
141  G4MuonPlus::MuonPlusDefinition() -> SetDecayTable(MuonPlusDecayTable);
142 
143  G4DecayTable* MuonMinusDecayTable = new G4DecayTable();
144  MuonMinusDecayTable -> Insert(new
145  G4MuonDecayChannelWithSpin("mu-",0.986));
146  MuonMinusDecayTable -> Insert(new
148  G4MuonMinus::MuonMinusDefinition() -> SetDecayTable(MuonMinusDecayTable);
149 
150 }
151 
152 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
153 
155 {
157 
158  SetVerbose(0);
159 
160  G4DecayWithSpin* decayWithSpin = new G4DecayWithSpin();
161 
163 
164  G4VProcess* decay;
165  decay = processTable->FindProcess("Decay",G4MuonPlus::MuonPlus());
166 
167  G4ProcessManager* pManager;
168  pManager = G4MuonPlus::MuonPlus()->GetProcessManager();
169 
170  if (pManager) {
171  if (decay) pManager->RemoveProcess(decay);
172  pManager->AddProcess(decayWithSpin);
173  // set ordering for PostStepDoIt and AtRestDoIt
174  pManager ->SetProcessOrdering(decayWithSpin, idxPostStep);
175  pManager ->SetProcessOrdering(decayWithSpin, idxAtRest);
176  }
177 
178  decay = processTable->FindProcess("Decay",G4MuonMinus::MuonMinus());
179 
181 
182  if (pManager) {
183  if (decay) pManager->RemoveProcess(decay);
184  pManager->AddProcess(decayWithSpin);
185  // set ordering for PostStepDoIt and AtRestDoIt
186  pManager ->SetProcessOrdering(decayWithSpin, idxPostStep);
187  pManager ->SetProcessOrdering(decayWithSpin, idxAtRest);
188  }
189 
190  G4PionDecayMakeSpin* poldecay = new G4PionDecayMakeSpin();
191 
192  decay = processTable->FindProcess("Decay",G4PionPlus::PionPlus());
193 
194  pManager = G4PionPlus::PionPlus()->GetProcessManager();
195 
196  if (pManager) {
197  if (decay) pManager->RemoveProcess(decay);
198  pManager->AddProcess(poldecay);
199  // set ordering for PostStepDoIt and AtRestDoIt
200  pManager ->SetProcessOrdering(poldecay, idxPostStep);
201  pManager ->SetProcessOrdering(poldecay, idxAtRest);
202  }
203 
204  decay = processTable->FindProcess("Decay",G4PionMinus::PionMinus());
205 
207 
208  if (pManager) {
209  if (decay) pManager->RemoveProcess(decay);
210  pManager->AddProcess(poldecay);
211  // set ordering for PostStepDoIt and AtRestDoIt
212  pManager ->SetProcessOrdering(poldecay, idxPostStep);
213  pManager ->SetProcessOrdering(poldecay, idxAtRest);
214  }
215 
216  AddStepMax();
217 
218 }
219 
220 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
221 
223 {
224  G4bool success = false;
225  for (G4PhysConstVector::iterator p = fPhysicsVector->begin();
226  p != fPhysicsVector->end(); ++p) {
227  G4VPhysicsConstructor* e = (*p);
228  if (e->GetPhysicsName() == name) {
229  fPhysicsVector->erase(p);
230  success = true;
231  break;
232  }
233  }
234  if (!success) {
236  message << "PhysicsList::RemoveFromEMPhysicsList "<< name << "not found";
237  G4Exception("example WLSPhysicsList::RemoveFromPhysicsList()",
238  "ExamWLSPhysicsList01",FatalException,message);
239  }
240 }
241 
242 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
243 
245 {
246  fAbsorptionOn = toggle;
247  RemoveFromPhysicsList("Optical");
249  push_back(fOpticalPhysics = new WLSOpticalPhysics(toggle));
251 }
252 
253 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
254 
256 {
257  if (verboseLevel >0) {
258  G4cout << "WLSPhysicsList::SetCuts:";
259  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length")
260  << G4endl;
261  }
262 
263  // set cut values for gamma at first and for e- second and next for e+,
264  // because some processes for e+/e- need cut values for gamma
265  SetCutValue(fCutForGamma, "gamma");
268 
270 }
271 
272 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
273 
275 {
276  fCutForGamma = cut;
278 }
279 
280 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
281 
283 {
284  fCutForElectron = cut;
286 }
287 
288 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
289 
291 {
292  fCutForPositron = cut;
294 }
295 
296 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
297 
299 {
301 }
302 
303 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
304 
306 {
307  return fStepMaxProcess;
308 }
309 
310 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
311 
313 {
314  // Step limitation seen as a process
315 
317  particleIterator->reset();
318  while ((*particleIterator)()){
319  G4ParticleDefinition* particle = particleIterator->value();
320  G4ProcessManager* pmanager = particle->GetProcessManager();
321 
322  if (fStepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived())
323  {
324  if (pmanager) pmanager ->AddDiscreteProcess(fStepMaxProcess);
325  }
326  }
327 }
328 
329 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
330 
332 {
334 }
335 
336 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
337 
339 {
346 }
static G4PionMinus * PionMinus()
Definition: G4PionMinus.cc:98
ParticleList decay(Cluster *const c)
Carries out a cluster decay.
const XML_Char * name
Definition: expat.h:151
Definition of the WLSPhysicsListMessenger class.
void SetNbOfPhotonsCerenkov(G4int)
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:45
virtual void ConstructParticle() override
Definition of the WLSStepMax class.
void RemoveFromPhysicsList(const G4String &)
Remove specific physics from physics list.
G4Scintillation * GetScintillationProcess()
void ClearPhysics()
Make sure that the physics list is empty.
virtual void ConstructProcess()
Provide control of the physics list and cut parameters.
G4OpRayleigh * GetRayleighScatteringProcess()
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
static constexpr double mm
Definition: G4SIunits.hh:115
G4VMPLData::G4PhysConstVectorData * fPhysicsVector
#define G4endl
Definition: G4ios.hh:61
const char * p
Definition: xmltok.h:285
Definition of the WLSExtraPhysics class.
void message(RunManager *runmanager)
Definition: ts_scorers.cc:72
static G4PionPlus * PionPlus()
Definition: G4PionPlus.cc:98
static G4MuonMinus * MuonMinus()
Definition: G4MuonMinus.cc:100
static G4ProcessTable * GetProcessTable()
G4OpAbsorption * GetAbsorptionProcess()
WLSStepMax * GetStepMaxProcess()
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:95
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: WLSStepMax.cc:57
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
void SetStepMax(G4double)
Definition: WLSStepMax.cc:64
virtual ~WLSPhysicsList()
G4OpBoundaryProcess * GetBoundaryProcess()
void SetVerboseLevel(G4int value)
Definition: G4VProcess.hh:440
WLSOpticalPhysics * fOpticalPhysics
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
const G4VPhysicsConstructor * GetPhysics(G4int index) const
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
WLSStepMax * fStepMaxProcess
G4double fCutForGamma
const G4String & GetPhysicsName() const
void RegisterPhysics(G4VPhysicsConstructor *)
void SetCutForElectron(G4double)
void SetCutForPositron(G4double)
static G4Positron * Positron()
Definition: G4Positron.cc:94
void SetStepMax(G4double)
void SetNbOfPhotonsCerenkov(G4int)
static G4Electron * Electron()
Definition: G4Electron.cc:94
G4OpMieHG * GetMieHGScatteringProcess()
TFTFP_BERT< G4VModularPhysicsList > FTFP_BERT
Definition: FTFP_BERT.hh:63
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
void SetVerbose(G4int)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.hh:65
WLSPhysicsListMessenger * fMessenger
int G4int
Definition: G4Types.hh:78
WLSPhysicsList(G4String)
G4ProcessManager * GetProcessManager() const
TQGSP_BERT_HP< G4VModularPhysicsList > QGSP_BERT_HP
Definition: QGSP_BERT_HP.hh:62
Definition of the WLSOpticalPhysics class.
static G4MuonPlus * MuonPlus()
Definition: G4MuonPlus.cc:99
G4VProcess * RemoveProcess(G4VProcess *aProcess)
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
G4GLOB_DLL std::ostream G4cout
G4VProcess * FindProcess(const G4String &processName, const G4String &particleName) const
static G4LossTableManager * Instance()
void SetCutValue(G4double aCut, const G4String &pname)
void SetAbsorption(G4bool)
Definition of the WLSPhysicsList class.
static G4MuonPlus * MuonPlusDefinition()
Definition: G4MuonPlus.cc:94
void SetCutForGamma(G4double)
virtual void ConstructParticle()
void DumpCutValuesTable(G4int flag=1)
virtual void ConstructProcess()
void Insert(const PVNodeID *pvPath, size_t pathLength, G4int index, Node *node)
G4double fCutForPositron
virtual void ConstructProcess() override
G4Cerenkov * GetCerenkovProcess()
G4double fCutForElectron