Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExExChIonPhysics.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 //
28 //
29 
30 #include "ExExChIonPhysics.hh"
31 #include "G4SystemOfUnits.hh"
32 #include "G4ParticleDefinition.hh"
33 #include "G4ProcessManager.hh"
34 #include "G4Deuteron.hh"
35 #include "G4Triton.hh"
36 #include "G4He3.hh"
37 #include "G4Alpha.hh"
38 #include "G4GenericIon.hh"
39 #include "G4IonConstructor.hh"
40 
45 
46 #include "G4PreCompoundModel.hh"
47 #include "G4ExcitationHandler.hh"
48 #include "G4FTFBuilder.hh"
49 #include "G4HadronicInteraction.hh"
50 #include "G4BuilderType.hh"
51 
52 using namespace std;
53 
54 // factory
56 //
57 
58 // Wrapper
60 
62 
63 G4ThreadLocal G4bool ExExChIonPhysics::wasActivated = false;
64 G4ThreadLocal G4BinaryLightIonReaction* ExExChIonPhysics::theIonBC = 0;
65 G4ThreadLocal G4HadronicInteraction* ExExChIonPhysics::theFTFP = 0;
67  ExExChIonPhysics::theNuclNuclData = 0;
69  ExExChIonPhysics::theGGNuclNuclXS = 0;
70 G4ThreadLocal G4FTFBuilder* ExExChIonPhysics::theBuilder;
71 
72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
73 
75 : G4VPhysicsConstructor("ionInelasticFTFP_BIC"),verbose(ver)
76 {
78  if(verbose > 1) { G4cout << "### ExExChIonPhysics" << G4endl; }
79 }
80 
81 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
82 
84 : G4VPhysicsConstructor(nname),verbose(1)
85 {
87  if(verbose > 1) { G4cout << "### ExExChIonPhysics" << G4endl; }
88 }
89 
90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
91 
93 {
94  //Explictly setting pointers to zero is actually needed.
95  //These are static variables, in case we restart threads
96  //we need to re-create objects
97  delete theBuilder; theBuilder = 0;
98  delete theGGNuclNuclXS; theGGNuclNuclXS = 0;
99  delete theNuclNuclData; theNuclNuclData = 0;
100  delete theIonBC; theIonBC = 0;
101  delete theFTFP; theFTFP = 0;
102 }
103 
104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
105 
107 {
108  // Construct ions
109  G4IonConstructor pConstructor;
110  pConstructor.ConstructParticle();
111 }
112 
113 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
114 
116 {
117  if(wasActivated) { return; }
118  wasActivated = true;
119 
120  G4double emax = 100.*TeV;
121 
122  G4ExcitationHandler* handler = new G4ExcitationHandler();
123  G4PreCompoundModel* thePreCompound = new G4PreCompoundModel(handler);
124 
125  // Binary Cascade
126  theIonBC = new G4BinaryLightIonReaction(thePreCompound);
127  theIonBC->SetMinEnergy(0.0);
128  theIonBC->SetMaxEnergy(4*GeV);
129 
130  // FTFP
131  theBuilder = new G4FTFBuilder("FTFP",thePreCompound);
132  theFTFP = theBuilder->GetModel();
133  theFTFP->SetMinEnergy(2*GeV);
134  theFTFP->SetMaxEnergy(emax);
135 
136  theGGNuclNuclXS = new G4ComponentGGNuclNuclXsc();
137  theNuclNuclData = new G4CrossSectionInelastic(theGGNuclNuclXS);
138 
139  AddProcess("dInelastic", G4Deuteron::Deuteron(),false);
140  AddProcess("tInelastic",G4Triton::Triton(),false);
141  AddProcess("He3Inelastic",G4He3::He3(),true);
142  AddProcess("alphaInelastic", G4Alpha::Alpha(),true);
143  AddProcess("ionInelastic",G4GenericIon::GenericIon(),true);
144 
145  if(verbose > 1) {
146  G4cout << "ExExChIonPhysics::ConstructProcess done! "
147  << G4endl;
148  }
149 }
150 
151 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
152 
153 void ExExChIonPhysics::AddProcess(const G4String& name,
154  G4ParticleDefinition* part,
155  G4bool )//isIon)
156 {
157  G4HadronInelasticProcess* hadi = new G4HadronInelasticProcess(name, part);
158  G4ProcessManager* pManager = part->GetProcessManager();
159 
160 
161  hadi->AddDataSet(theNuclNuclData);
162 
163  hadi->RegisterMe(theIonBC);
164  hadi->RegisterMe(theFTFP);
165 
166  XWrapperDiscreteProcess* hadi_wrapper = new XWrapperDiscreteProcess();
167  hadi_wrapper->RegisterProcess(hadi,1);
168  pManager->AddDiscreteProcess(hadi_wrapper);
169 
170 }
171 
172 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const XML_Char * name
Definition: expat.h:151
virtual ~ExExChIonPhysics()
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
#define G4ThreadLocal
Definition: tls.hh:89
int G4int
Definition: G4Types.hh:78
G4HadronicInteraction * GetModel()
static void ConstructParticle()
void RegisterMe(G4HadronicInteraction *a)
static constexpr double TeV
Definition: G4SIunits.hh:218
void SetMinEnergy(G4double anEnergy)
void AddDataSet(G4VCrossSectionDataSet *aDataSet)
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
static G4Triton * Triton()
Definition: G4Triton.cc:95
static G4Deuteron * Deuteron()
Definition: G4Deuteron.cc:94
static const G4double emax
ExExChIonPhysics(G4int ver=0)
static G4GenericIon * GenericIon()
Definition: G4GenericIon.cc:93
Definition of the XWrapperDiscreteProcess class.
Definition of the ExExChIonPhysics class.
G4ProcessManager * GetProcessManager() const
static constexpr double GeV
Definition: G4SIunits.hh:217
void SetMaxEnergy(const G4double anEnergy)
#define G4endl
Definition: G4ios.hh:61
void RegisterProcess(G4VDiscreteProcess *)
static G4Alpha * Alpha()
Definition: G4Alpha.cc:89
double G4double
Definition: G4Types.hh:76
static G4He3 * He3()
Definition: G4He3.cc:94
#define G4_DECLARE_PHYSCONSTR_FACTORY(physics_constructor)