Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4StoppingPhysics.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 // $Id: G4StoppingPhysics.cc 99939 2016-10-12 08:08:23Z gcosmo $
27 //
28 //---------------------------------------------------------------------------
29 //
30 // ClassName: G4StoppingPhysics
31 //
32 // Author: Alberto Ribon
33 //
34 // Date: 27 July 2012
35 //
36 // Modified:
37 // 20120921 M. Kelsey -- Move MuonMinusCapture.hh here; replace G4MMCAtRest
38 // with new G4MuonMinusCapture.
39 // 16-Oct-2012 A. Ribon: renamed G4BertiniAndFritiofStoppingPhysics as
40 // G4StoppingPhysics.
41 // 17-Oct-2012 A. Ribon: added nuclear capture at rest of anti-nuclei with
42 // Fritof/Precompound.
43 //
44 //----------------------------------------------------------------------------
45 
46 #include "G4StoppingPhysics.hh"
47 #include "G4SystemOfUnits.hh"
50 #include "G4MuonMinusCapture.hh"
51 #include "G4ParticleDefinition.hh"
52 #include "G4ProcessManager.hh"
53 #include "G4LeptonConstructor.hh"
54 #include "G4MesonConstructor.hh"
55 #include "G4BaryonConstructor.hh"
56 #include "G4MuonMinus.hh"
57 #include "G4PionMinus.hh"
58 
59 // factory
61 //
63 
64 G4ThreadLocal G4bool G4StoppingPhysics::wasActivated = false;
65 
68  G4VPhysicsConstructor( "stopping" ),
69 //muProcess( 0 ), hBertiniProcess( 0 ), hFritiofProcess( 0 ),
70  verbose( ver ),
71  useMuonMinusCapture( true )
72 {
73  if ( verbose > 1 ) G4cout << "### G4StoppingPhysics" << G4endl;
74 }
75 
76 
79  G4bool UseMuonMinusCapture ) :
80  G4VPhysicsConstructor( name ),
81  // muProcess( 0 ), hBertiniProcess( 0 ), hFritiofProcess( 0 ),
82  verbose( ver ),
83  useMuonMinusCapture( UseMuonMinusCapture )
84 {
85  if ( verbose > 1 ) G4cout << "### G4StoppingPhysics" << G4endl;
86 }
87 
88 
90 
91 
93  // G4cout << "G4StoppingPhysics::ConstructParticle" << G4endl;
94  G4LeptonConstructor pLeptonConstructor;
95  pLeptonConstructor.ConstructParticle();
96 
97  G4MesonConstructor pMesonConstructor;
98  pMesonConstructor.ConstructParticle();
99 
100  G4BaryonConstructor pBaryonConstructor;
101  pBaryonConstructor.ConstructParticle();
102 }
103 
104 
106  if ( verbose > 1 ) G4cout << "### G4StoppingPhysics::ConstructProcess "
107  << wasActivated << G4endl;
108  if ( wasActivated ) return;
109  wasActivated = true;
110 
111  G4MuonMinusCapture* muProcess;
112  G4HadronicAbsorptionBertini* hBertiniProcess;
113  G4HadronicAbsorptionFritiof* hFritiofProcess;
114 
115  if ( useMuonMinusCapture ) {
116  muProcess = new G4MuonMinusCapture();
117  } else {
118  muProcess = 0;
119  }
120 
121  hBertiniProcess = new G4HadronicAbsorptionBertini();
122  hFritiofProcess = new G4HadronicAbsorptionFritiof();
123 
124  G4double mThreshold = 130.0*MeV;
125 
126  // Add Stopping Process
127  G4ParticleDefinition* particle = 0;
128  G4ProcessManager* pmanager = 0;
129 
130  auto myParticleIterator=GetParticleIterator();
131  myParticleIterator->reset();
132 
133  while ( (*myParticleIterator)() ) {
134 
135  particle = myParticleIterator->value();
136  pmanager = particle->GetProcessManager();
137 
138  if ( particle == G4MuonMinus::MuonMinus() ) {
139  if ( useMuonMinusCapture ) {
140  pmanager->AddRestProcess( muProcess );
141  if ( verbose > 1 ) {
142  G4cout << "### G4StoppingPhysics added G4MuonMinusCapture for "
143  << particle->GetParticleName() << G4endl;
144  }
145  }
146  }
147 
148  if ( particle->GetPDGCharge() < 0.0 &&
149  particle->GetPDGMass() > mThreshold &&
150  ! particle->IsShortLived() ) {
151 
152  // Use Fritiof/Precompound for: anti-protons, anti-sigma+, and
153  // anti-nuclei.
154  if ( particle == G4AntiProton::AntiProton() ||
155  particle == G4AntiSigmaPlus::AntiSigmaPlus() ||
156  particle->GetBaryonNumber() < -1 ) { // Anti-nuclei
157  if ( hFritiofProcess->IsApplicable( *particle ) ) {
158  pmanager->AddRestProcess( hFritiofProcess );
159  if ( verbose > 1 ) {
160  G4cout << "### G4HadronicAbsorptionFritiof added for "
161  << particle->GetParticleName() << G4endl;
162  }
163  }
164 
165  // Use Bertini/Precompound for pi-, K-, Sigma-, Xi-, and Omega-
166  } else if ( particle == G4PionMinus::PionMinus() ||
167  particle == G4KaonMinus::KaonMinus() ||
168  particle == G4SigmaMinus::SigmaMinus() ||
169  particle == G4XiMinus::XiMinus() ||
170  particle == G4OmegaMinus::OmegaMinus() ) {
171  if ( hBertiniProcess->IsApplicable( *particle ) ) {
172  pmanager->AddRestProcess( hBertiniProcess );
173  if ( verbose > 1 ) {
174  G4cout << "### G4HadronicAbsorptionBertini added for "
175  << particle->GetParticleName() << G4endl;
176  }
177  }
178 
179  } else {
180  if ( verbose > 1 ) {
181  G4cout << "WARNING in G4StoppingPhysics::ConstructProcess: \
182  not able to deal with nuclear stopping of "
183  << particle->GetParticleName() << G4endl;
184  }
185  }
186  }
187 
188  } // end of while loop
189 }
const XML_Char * name
Definition: expat.h:151
virtual void ConstructProcess()
G4bool IsApplicable(const G4ParticleDefinition &)
static G4OmegaMinus * OmegaMinus()
virtual void ConstructParticle()
static void ConstructParticle()
#define G4ThreadLocal
Definition: tls.hh:89
static G4AntiSigmaPlus * AntiSigmaPlus()
static void ConstructParticle()
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
static G4KaonMinus * KaonMinus()
Definition: G4KaonMinus.cc:113
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
G4GLOB_DLL std::ostream G4cout
static G4AntiProton * AntiProton()
Definition: G4AntiProton.cc:93
bool G4bool
Definition: G4Types.hh:79
static G4XiMinus * XiMinus()
Definition: G4XiMinus.cc:106
static void ConstructParticle()
static G4SigmaMinus * SigmaMinus()
G4double GetPDGMass() const
virtual ~G4StoppingPhysics()
G4ProcessManager * GetProcessManager() const
static G4PionMinus * PionMinus()
Definition: G4PionMinus.cc:98
static G4MuonMinus * MuonMinus()
Definition: G4MuonMinus.cc:100
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
G4int AddRestProcess(G4VProcess *aProcess, G4int ord=ordDefault)
G4bool IsApplicable(const G4ParticleDefinition &)
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const
#define G4_DECLARE_PHYSCONSTR_FACTORY(physics_constructor)
G4StoppingPhysics(G4int ver=1)