Geant4  10.02.p01
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 //
26 
27 #include "ExExChIonPhysics.hh"
28 #include "G4SystemOfUnits.hh"
29 #include "G4ParticleDefinition.hh"
30 #include "G4ProcessManager.hh"
31 #include "G4Deuteron.hh"
32 #include "G4Triton.hh"
33 #include "G4He3.hh"
34 #include "G4Alpha.hh"
35 #include "G4GenericIon.hh"
36 #include "G4IonConstructor.hh"
37 
42 
43 #include "G4PreCompoundModel.hh"
44 #include "G4ExcitationHandler.hh"
45 #include "G4FTFBuilder.hh"
46 #include "G4HadronicInteraction.hh"
47 #include "G4BuilderType.hh"
48 
49 using namespace std;
50 
51 // factory
53 //
54 
55 // Wrapper
57 
59 
68 
69 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
70 
72 : G4VPhysicsConstructor("ionInelasticFTFP_BIC"),verbose(ver)
73 {
75  if(verbose > 1) { G4cout << "### ExExChIonPhysics" << G4endl; }
76 }
77 
78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
79 
81 : G4VPhysicsConstructor(nname),verbose(1)
82 {
84  if(verbose > 1) { G4cout << "### ExExChIonPhysics" << G4endl; }
85 }
86 
87 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
88 
90 {
91  //Explictly setting pointers to zero is actually needed.
92  //These are static variables, in case we restart threads
93  //we need to re-create objects
94  delete theBuilder; theBuilder = 0;
95  delete theGGNuclNuclXS; theGGNuclNuclXS = 0;
96  delete theNuclNuclData; theNuclNuclData = 0;
97  delete theIonBC; theIonBC = 0;
98  delete theFTFP; theFTFP = 0;
99 }
100 
101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
102 
104 {
105  // Construct ions
106  G4IonConstructor pConstructor;
107  pConstructor.ConstructParticle();
108 }
109 
110 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
111 
113 {
114  if(wasActivated) { return; }
115  wasActivated = true;
116 
117  G4double emax = 100.*TeV;
118 
119  G4ExcitationHandler* handler = new G4ExcitationHandler();
120  G4PreCompoundModel* thePreCompound = new G4PreCompoundModel(handler);
121 
122  // Binary Cascade
123  theIonBC = new G4BinaryLightIonReaction(thePreCompound);
124  theIonBC->SetMinEnergy(0.0);
126 
127  // FTFP
128  theBuilder = new G4FTFBuilder("FTFP",thePreCompound);
131  theFTFP->SetMaxEnergy(emax);
132 
135 
136  AddProcess("dInelastic", G4Deuteron::Deuteron(),false);
137  AddProcess("tInelastic",G4Triton::Triton(),false);
138  AddProcess("He3Inelastic",G4He3::He3(),true);
139  AddProcess("alphaInelastic", G4Alpha::Alpha(),true);
140  AddProcess("ionInelastic",G4GenericIon::GenericIon(),true);
141 
142  if(verbose > 1) {
143  G4cout << "ExExChIonPhysics::ConstructProcess done! "
144  << G4endl;
145  }
146 }
147 
148 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
149 
151  G4ParticleDefinition* part,
152  G4bool )//isIon)
153 {
154  G4HadronInelasticProcess* hadi = new G4HadronInelasticProcess(name, part);
155  G4ProcessManager* pManager = part->GetProcessManager();
156 
157 
159 
160  hadi->RegisterMe(theIonBC);
161  hadi->RegisterMe(theFTFP);
162 
163  XWrapperDiscreteProcess* hadi_wrapper = new XWrapperDiscreteProcess();
164  hadi_wrapper->RegisterProcess(hadi,1);
165  pManager->AddDiscreteProcess(hadi_wrapper);
166 
167 }
168 
169 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
virtual ~ExExChIonPhysics()
static G4ThreadLocal G4FTFBuilder * theBuilder
G4String name
Definition: TRTMaterials.hh:40
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
#define G4ThreadLocal
Definition: tls.hh:89
G4ProcessManager * GetProcessManager() const
int G4int
Definition: G4Types.hh:78
G4_DECLARE_PHYSCONSTR_FACTORY(ExExChIonPhysics)
G4HadronicInteraction * GetModel()
static void ConstructParticle()
void RegisterMe(G4HadronicInteraction *a)
void SetMinEnergy(G4double anEnergy)
void AddDataSet(G4VCrossSectionDataSet *aDataSet)
G4GLOB_DLL std::ostream G4cout
void AddProcess(const G4String &, G4ParticleDefinition *, G4bool isIon)
bool G4bool
Definition: G4Types.hh:79
static G4Triton * Triton()
Definition: G4Triton.cc:95
static const double GeV
Definition: G4SIunits.hh:214
static G4Deuteron * Deuteron()
Definition: G4Deuteron.cc:94
static const G4double emax
static G4ThreadLocal G4bool wasActivated
ExExChIonPhysics(G4int ver=0)
static G4GenericIon * GenericIon()
Definition: G4GenericIon.cc:93
static G4ThreadLocal G4HadronicInteraction * theFTFP
void SetMaxEnergy(const G4double anEnergy)
static G4ThreadLocal G4VComponentCrossSection * theGGNuclNuclXS
#define G4endl
Definition: G4ios.hh:61
static const double TeV
Definition: G4SIunits.hh:215
void RegisterProcess(G4VDiscreteProcess *)
static G4Alpha * Alpha()
Definition: G4Alpha.cc:89
static G4ThreadLocal G4VCrossSectionDataSet * theNuclNuclData
double G4double
Definition: G4Types.hh:76
static G4ThreadLocal G4BinaryLightIonReaction * theIonBC
static G4He3 * He3()
Definition: G4He3.cc:94