Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
ExUCNExtraPhysics.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: ExUCNExtraPhysics.cc 69762 2013-05-14 08:08:54Z gcosmo $
27 //
30 //
31 //
32 #include "G4ParticleDefinition.hh"
33 #include "G4ProcessManager.hh"
34 
35 #include "G4Transportation.hh"
36 
37 #include "G4Decay.hh"
38 #include "G4DecayTable.hh"
40 
41 #include "G4UserSpecialCuts.hh"
42 #include "G4StepLimiter.hh"
43 #include "G4SystemOfUnits.hh"
44 
45 #include "G4UCNLoss.hh"
46 #include "G4UCNAbsorption.hh"
47 #include "G4UCNMultiScattering.hh"
48 #include "G4UCNBoundaryProcess.hh"
49 
50 #include "ExUCNExtraPhysics.hh"
51 
52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53 
55  : G4VPhysicsConstructor("Extra") {;}
56 
57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58 
60 
61 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
62 
64 
65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
66 
68 {
70  particleIterator->reset();
71 
72  while ((*particleIterator)()) {
73  G4ParticleDefinition* particle = particleIterator->value();
74  G4ProcessManager* pmanager = particle->GetProcessManager();
75  G4String particleName = particle->GetParticleName();
76 
77  if (!pmanager) {
78  std::ostringstream o;
79  o << "Particle " << particleName << "without a Process Manager";
80  G4Exception("ExUCNExtraPhysics::ConstructProcess()","",
81  FatalException,o.str().c_str());
82  }
83 
84  pmanager->AddDiscreteProcess(new G4StepLimiter());
85  pmanager->AddDiscreteProcess(new G4UserSpecialCuts());
86  }
87 
88  ConstructUCN();
89 
90 // G4Transportation::EnableUseMagneticMoment();
91 
92 }
93 
94 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
95 
97 {
99  particleIterator->reset();
100  G4ProcessManager* pmanager = NULL;
101 
102  while ((*particleIterator)()) {
103  G4ParticleDefinition* particle = particleIterator->value();
104  pmanager = particle->GetProcessManager();
105  G4String particleName = particle->GetParticleName();
106 
107  if (!pmanager) {
108  std::ostringstream o;
109  o << "Particle " << particleName << "without a Process Manager";
110  G4Exception("ExUCNExtraPhysics::ConstructProcess()","",
111  FatalException,o.str().c_str());
112  }
113 
114  if (particleName == "neutron") {
115  pmanager->AddDiscreteProcess(new G4UCNLoss());
116  pmanager->AddDiscreteProcess(new G4UCNAbsorption());
117  pmanager->AddDiscreteProcess(new G4UCNMultiScattering());
118 
119  G4UCNBoundaryProcess* ucnBoundaryProcess =
120  new G4UCNBoundaryProcess();
121  ucnBoundaryProcess->SetMicroRoughness(true);
122  ucnBoundaryProcess->SetVerboseLevel(0);
123 
124  pmanager->AddDiscreteProcess(ucnBoundaryProcess);
125  }
126  }
127 }
128 
129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Definition of the ExUCNExtraPhysics class.
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
virtual void ConstructProcess()
const G4String & GetParticleName() const
void SetVerboseLevel(G4int value)
Definition: G4VProcess.hh:440
virtual ~ExUCNExtraPhysics()
virtual void ConstructParticle()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.hh:65
G4ProcessManager * GetProcessManager() const
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const