Geant4  10.03
G4IonPhysics.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: G4IonPhysics.cc 80671 2014-05-06 13:59:16Z gcosmo $
27 // GEANT4 tag $Name: $
28 //
29 //---------------------------------------------------------------------------
30 //
31 // Class: G4IonPhysics
32 //
33 // Author: A.Ivanchenko 02.03.2011
34 //
35 // Modified:
36 // 16.10.2012 A.Ribon: renamed G4IonFTFPBinaryCascadePhysics as G4IonPhysics
37 //
38 //---------------------------------------------------------------------------
39 
40 #include "G4IonPhysics.hh"
41 #include "G4SystemOfUnits.hh"
42 #include "G4ParticleDefinition.hh"
43 #include "G4ProcessManager.hh"
44 #include "G4Deuteron.hh"
45 #include "G4Triton.hh"
46 #include "G4He3.hh"
47 #include "G4Alpha.hh"
48 #include "G4GenericIon.hh"
49 #include "G4IonConstructor.hh"
50 
55 
56 #include "G4PreCompoundModel.hh"
57 #include "G4ExcitationHandler.hh"
58 #include "G4FTFBuilder.hh"
59 #include "G4HadronicInteraction.hh"
60 #include "G4BuilderType.hh"
62 
63 using namespace std;
64 
65 // factory
67 //
69 
76 
77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
78 
80  : G4VPhysicsConstructor("ionInelasticFTFP_BIC"),verbose(ver)
81 {
83  if(verbose > 1) { G4cout << "### G4IonPhysics" << G4endl; }
84 }
85 
86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
87 
89  : G4VPhysicsConstructor(nname),verbose(1)
90 {
92  if(verbose > 1) { G4cout << "### G4IonPhysics" << G4endl; }
93 }
94 
95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
96 
98 {
99  //Explictly setting pointers to zero is actually needed.
100  //These are static variables, in case we restart threads we need to re-create objects
101  delete theBuilder; theBuilder = 0;
102  delete theGGNuclNuclXS; theGGNuclNuclXS = 0;
103  delete theNuclNuclData; theNuclNuclData = 0;
104  delete theIonBC; theIonBC = 0;
105  delete theFTFP; theFTFP = 0;
106 }
107 
108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
109 
111 {
112  // Construct ions
113  G4IonConstructor pConstructor;
114  pConstructor.ConstructParticle();
115 }
116 
117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
118 
120 {
121  if(wasActivated) { return; }
122  wasActivated = true;
123 
124  G4double emax = 100.*TeV;
125 
128  G4PreCompoundModel* thePreCompound = static_cast<G4PreCompoundModel*>(p);
129  if(!thePreCompound) { thePreCompound = new G4PreCompoundModel; }
130 
131  // Binary Cascade
132  theIonBC = new G4BinaryLightIonReaction(thePreCompound);
133  theIonBC->SetMinEnergy(0.0);
135 
136  // FTFP
137  theBuilder = new G4FTFBuilder("FTFP",thePreCompound);
140  theFTFP->SetMaxEnergy(emax);
141 
142  theNuclNuclData =
144 
145  AddProcess("dInelastic", G4Deuteron::Deuteron(),false);
146  AddProcess("tInelastic",G4Triton::Triton(),false);
147  AddProcess("He3Inelastic",G4He3::He3(),true);
148  AddProcess("alphaInelastic", G4Alpha::Alpha(),true);
149  AddProcess("ionInelastic",G4GenericIon::GenericIon(),true);
150 
151  if(verbose > 1) {
152  G4cout << "G4IonPhysics::ConstructProcess done! "
153  << G4endl;
154  }
155 }
156 
157 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
158 
160  G4ParticleDefinition* part,
161  G4bool )//isIon)
162 {
163  G4HadronInelasticProcess* hadi = new G4HadronInelasticProcess(name, part);
164  G4ProcessManager* pManager = part->GetProcessManager();
165  pManager->AddDiscreteProcess(hadi);
166 
168 
169  hadi->RegisterMe(theIonBC);
170  hadi->RegisterMe(theFTFP);
171 }
172 
173 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static G4ThreadLocal G4VComponentCrossSection * theGGNuclNuclXS
Definition: G4IonPhysics.hh:72
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
G4IonPhysics(G4int ver=0)
Definition: G4IonPhysics.cc:79
static G4ThreadLocal G4BinaryLightIonReaction * theIonBC
Definition: G4IonPhysics.hh:74
const char * name(G4int ptype)
#define G4ThreadLocal
Definition: tls.hh:89
static G4ThreadLocal G4FTFBuilder * theBuilder
Definition: G4IonPhysics.hh:76
int G4int
Definition: G4Types.hh:78
virtual ~G4IonPhysics()
Definition: G4IonPhysics.cc:97
G4HadronicInteraction * GetModel()
static void ConstructParticle()
void RegisterMe(G4HadronicInteraction *a)
static constexpr double TeV
Definition: G4SIunits.hh:218
void SetMinEnergy(G4double anEnergy)
static G4ThreadLocal G4VCrossSectionDataSet * theNuclNuclData
Definition: G4IonPhysics.hh:71
void AddDataSet(G4VCrossSectionDataSet *aDataSet)
static G4ThreadLocal G4bool wasActivated
Definition: G4IonPhysics.hh:79
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
static G4ThreadLocal G4HadronicInteraction * theFTFP
Definition: G4IonPhysics.hh:75
static G4Triton * Triton()
Definition: G4Triton.cc:95
static G4Deuteron * Deuteron()
Definition: G4Deuteron.cc:94
void ConstructProcess()
static const G4double emax
G4HadronicInteraction * FindModel(const G4String &name)
static G4GenericIon * GenericIon()
Definition: G4GenericIon.cc:93
void AddProcess(const G4String &, G4ParticleDefinition *, G4bool isIon)
G4ProcessManager * GetProcessManager() const
static G4HadronicInteractionRegistry * Instance()
static constexpr double GeV
Definition: G4SIunits.hh:217
G4_DECLARE_PHYSCONSTR_FACTORY(G4IonPhysics)
void SetMaxEnergy(const G4double anEnergy)
#define G4endl
Definition: G4ios.hh:61
void ConstructParticle()
static G4Alpha * Alpha()
Definition: G4Alpha.cc:89
double G4double
Definition: G4Types.hh:76
static G4He3 * He3()
Definition: G4He3.cc:94