Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4IonINCLXXPhysics.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: G4IonINCLXXPhysics.cc 79167 2014-02-19 15:57:01Z gcosmo $
27 //
28 //---------------------------------------------------------------------------
29 //
30 // ClassName: G4IonINCLXXPhysics
31 //
32 // Author: D. Mancusi
33 //
34 // Modified:
35 //
36 //----------------------------------------------------------------------------
37 //
38 
39 #include "G4IonINCLXXPhysics.hh"
40 
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 
54 
55 #include "G4INCLXXInterface.hh"
56 #include "G4PreCompoundModel.hh"
57 #include "G4ExcitationHandler.hh"
58 #include "G4FTFBuilder.hh"
59 #include "G4HadronicInteraction.hh"
60 #include "G4BuilderType.hh"
61 
62 // factory
64 //
66 
67 G4ThreadLocal std::vector<G4HadronInelasticProcess*>* G4IonINCLXXPhysics::p_list = 0;
68 G4ThreadLocal std::vector<G4HadronicInteraction*>* G4IonINCLXXPhysics::model_list = 0;
69 G4ThreadLocal G4VCrossSectionDataSet* G4IonINCLXXPhysics::theNuclNuclData = 0;
70 G4ThreadLocal G4VComponentCrossSection* G4IonINCLXXPhysics::theGGNuclNuclXS = 0;
71 G4ThreadLocal G4INCLXXInterface* G4IonINCLXXPhysics::theINCLXXDeuteron = 0;
72 G4ThreadLocal G4INCLXXInterface* G4IonINCLXXPhysics::theINCLXXTriton = 0;
73 G4ThreadLocal G4INCLXXInterface* G4IonINCLXXPhysics::theINCLXXHe3 = 0;
74 G4ThreadLocal G4INCLXXInterface* G4IonINCLXXPhysics::theINCLXXAlpha = 0;
75 G4ThreadLocal G4INCLXXInterface* G4IonINCLXXPhysics::theINCLXXIons = 0;
76 G4ThreadLocal G4HadronicInteraction* G4IonINCLXXPhysics::theFTFPDeuteron = 0;
77 G4ThreadLocal G4HadronicInteraction* G4IonINCLXXPhysics::theFTFPTriton = 0;
78 G4ThreadLocal G4HadronicInteraction* G4IonINCLXXPhysics::theFTFPHe3 = 0;
79 G4ThreadLocal G4HadronicInteraction* G4IonINCLXXPhysics::theFTFPAlpha = 0;
80 G4ThreadLocal G4HadronicInteraction* G4IonINCLXXPhysics::theFTFPIons = 0;
81 G4ThreadLocal G4FTFBuilder* G4IonINCLXXPhysics::theFTFPBuilderDeuteron = 0;
82 G4ThreadLocal G4FTFBuilder* G4IonINCLXXPhysics::theFTFPBuilderTriton = 0;
83 G4ThreadLocal G4FTFBuilder* G4IonINCLXXPhysics::theFTFPBuilderHe3 = 0;
84 G4ThreadLocal G4FTFBuilder* G4IonINCLXXPhysics::theFTFPBuilderAlpha = 0;
85 G4ThreadLocal G4FTFBuilder* G4IonINCLXXPhysics::theFTFPBuilderIons = 0;
86 G4ThreadLocal G4bool G4IonINCLXXPhysics::wasActivated = false;
87 
89  G4VPhysicsConstructor("IonINCLXX"),
90  verbose(ver)
91 {
92  // INCLXX light ion maximum energy is 3.0 GeV/nucleon
93  emax_d = 2 * 3.0 * GeV;
94  emax_t = 3 * 3.0 * GeV;
95  emax_he3 = 3 * 3.0 * GeV;
96  emax_alpha = 4 * 3.0 * GeV;
97  emax = 18 * 3.0 * GeV;
98  emaxFTFP = 1.*TeV;
99  emin = 0.*MeV;
101  if(verbose > 1) G4cout << "### G4IonINCLXXPhysics" << G4endl;
102 }
103 
105  G4int ver)
106  : G4VPhysicsConstructor(name),
107  verbose(ver)
108 {
109  // INCLXX light ion maximum energy is 3.0 GeV/nucleon
110  emax_d = 2 * 3.0 * GeV;
111  emax_t = 3 * 3.0 * GeV;
112  emax_he3 = 3 * 3.0 * GeV;
113  emax_alpha = 4 * 3.0 * GeV;
114  emax = 18 * 3.0 * GeV;
115  emaxFTFP = 1.*TeV;
116  emin = 0.*MeV;
118  if(verbose > 1) G4cout << "### G4IonINCLXXPhysics" << G4endl;
119 }
120 
122 {
123  //For MT need to explicitly set back pointers to zero:
124  //variables are static and if new threads are created we can have problems
125  //since variable is still pointing old value
126  if(wasActivated) {
127  delete theFTFPBuilderDeuteron; theFTFPBuilderDeuteron=0;
128  delete theFTFPBuilderTriton; theFTFPBuilderTriton=0;
129  delete theFTFPBuilderHe3; theFTFPBuilderHe3=0;
130  delete theFTFPBuilderAlpha; theFTFPBuilderAlpha=0;
131  delete theFTFPBuilderIons; theFTFPBuilderIons=0;
132  delete theGGNuclNuclXS; theGGNuclNuclXS=0;
133  delete theNuclNuclData; theGGNuclNuclXS=0;
134  G4int i;
135  if ( p_list ) {
136  G4int n = p_list->size();
137  for(i=0; i<n; i++) {delete (*p_list)[i];}
138  delete p_list; p_list = 0;
139  }
140  if ( model_list) {
141  G4int n = model_list->size();
142  for(i=0; i<n; i++) { delete (*model_list)[i];}
143  delete model_list; model_list = 0;
144  }
145  }
146 }
147 
149 {
150  if(wasActivated) return;
151  wasActivated = true;
152 
153  theINCLXXDeuteron= new G4INCLXXInterface();
154  theINCLXXTriton= new G4INCLXXInterface();
155  theINCLXXHe3= new G4INCLXXInterface();
156  theINCLXXAlpha= new G4INCLXXInterface();
157  theINCLXXIons= new G4INCLXXInterface();
158  if ( model_list == 0 ) model_list = new std::vector<G4HadronicInteraction*>;
159  model_list->push_back(theINCLXXDeuteron);
160  model_list->push_back(theINCLXXTriton);
161  model_list->push_back(theINCLXXHe3);
162  model_list->push_back(theINCLXXAlpha);
163  model_list->push_back(theINCLXXIons);
164 
165  G4ExcitationHandler* handler = new G4ExcitationHandler();
166  G4PreCompoundModel* thePreCompound = new G4PreCompoundModel(handler);
167 
168  theFTFPBuilderDeuteron = new G4FTFBuilder("FTFP",thePreCompound);
169  theFTFPDeuteron = theFTFPBuilderDeuteron->GetModel();
170  theFTFPBuilderTriton = new G4FTFBuilder("FTFP",thePreCompound);
171  theFTFPTriton = theFTFPBuilderTriton->GetModel();
172  theFTFPBuilderHe3 = new G4FTFBuilder("FTFP",thePreCompound);
173  theFTFPHe3 = theFTFPBuilderHe3->GetModel();
174  theFTFPBuilderAlpha = new G4FTFBuilder("FTFP",thePreCompound);
175  theFTFPAlpha = theFTFPBuilderAlpha->GetModel();
176  theFTFPBuilderIons = new G4FTFBuilder("FTFP",thePreCompound);
177  theFTFPIons = theFTFPBuilderIons->GetModel();
178  model_list->push_back(theFTFPDeuteron);
179  model_list->push_back(theFTFPTriton);
180  model_list->push_back(theFTFPHe3);
181  model_list->push_back(theFTFPAlpha);
182  model_list->push_back(theFTFPIons);
183 
184  theNuclNuclData = new G4CrossSectionInelastic( theGGNuclNuclXS = new G4ComponentGGNuclNuclXsc() );
185 
186  AddProcess("dInelastic", G4Deuteron::Deuteron(), theINCLXXDeuteron, theFTFPDeuteron, emax_d);
187  AddProcess("tInelastic", G4Triton::Triton(), theINCLXXTriton, theFTFPTriton, emax_t);
188  AddProcess("He3Inelastic", G4He3::He3(), theINCLXXHe3, theFTFPHe3, emax_he3);
189  AddProcess("alphaInelastic", G4Alpha::Alpha(), theINCLXXAlpha, theFTFPAlpha, emax_alpha);
190  AddProcess("ionInelastic", G4GenericIon::GenericIon(), theINCLXXIons, theFTFPIons, emax);
191 }
192 
193 void G4IonINCLXXPhysics::AddProcess(const G4String& name,
195  G4HadronicInteraction* hmodel,
196  G4HadronicInteraction* lmodel,
197  const G4double inclxxEnergyUpperLimit = 3.0 * GeV)
198 {
200  if ( p_list == 0 ) p_list = new std::vector<G4HadronInelasticProcess*>;
201  p_list->push_back(hadi);
202  G4ProcessManager* pManager = p->GetProcessManager();
203  pManager->AddDiscreteProcess(hadi);
204  hadi->AddDataSet(theNuclNuclData);
205  hmodel->SetMinEnergy(emin);
206  hmodel->SetMaxEnergy(inclxxEnergyUpperLimit);
207  hadi->RegisterMe(hmodel);
208  if(lmodel) {
209  lmodel->SetMinEnergy(inclxxEnergyUpperLimit - 100*MeV);
210  lmodel->SetMaxEnergy(emaxFTFP);
211  hadi->RegisterMe(lmodel);
212  }
213  if(verbose > 1) {
214  G4cout << "Register " << hadi->GetProcessName()
215  << " for " << p->GetParticleName()
216  << " INCLXX/G4DeexcitationHandler for E(MeV)= " << emin << " - " << inclxxEnergyUpperLimit;
217  if(lmodel) {
218  G4cout << " FTFP for E(MeV)= " << inclxxEnergyUpperLimit-MeV << " - " << emaxFTFP;
219  }
220  G4cout << G4endl;
221  }
222 }
223 
225 {
226  // Construct light ions
227  G4IonConstructor pConstructor;
228  pConstructor.ConstructParticle();
229 }
G4IonINCLXXPhysics(G4int ver=0)
const char * p
Definition: xmltok.h:285
G4_DECLARE_PHYSCONSTR_FACTORY(G4IonINCLXXPhysics)
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
const XML_Char * name
#define G4ThreadLocal
Definition: tls.hh:52
G4ProcessManager * GetProcessManager() const
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
INCL++ intra-nuclear cascade.
G4HadronicInteraction * GetModel()
static void ConstructParticle()
void RegisterMe(G4HadronicInteraction *a)
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
const G4int n
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
static G4Deuteron * Deuteron()
Definition: G4Deuteron.cc:94
virtual void ConstructProcess()
static G4GenericIon * GenericIon()
Definition: G4GenericIon.cc:93
void SetMaxEnergy(const G4double anEnergy)
#define G4endl
Definition: G4ios.hh:61
static G4Alpha * Alpha()
Definition: G4Alpha.cc:89
double G4double
Definition: G4Types.hh:76
static G4He3 * He3()
Definition: G4He3.cc:94
virtual void ConstructParticle()