Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4IonBinaryCascadePhysics.cc
이 파일의 문서화 페이지로 가기
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: G4IonBinaryCascadePhysics.cc 80671 2014-05-06 13:59:16Z gcosmo $
27 //
28 //---------------------------------------------------------------------------
29 //
30 // ClassName: G4IonBinaryCascadePhysics
31 //
32 // Author: V.Ivanchenko 09.11.2005
33 //
34 // Modified:
35 // 21.03.13 A.Ribon : replace LHEP with FTFP.
36 // 23.06.06 V.Ivanchenko set emaxLHEP=1 TeV
37 // 24.06.06 V.Ivanchenko fix typo
38 //
39 //----------------------------------------------------------------------------
40 //
41 
43 
44 #include "G4SystemOfUnits.hh"
45 #include "G4ParticleDefinition.hh"
46 #include "G4ProcessManager.hh"
47 #include "G4Deuteron.hh"
48 #include "G4Triton.hh"
49 #include "G4He3.hh"
50 #include "G4Alpha.hh"
51 #include "G4GenericIon.hh"
52 #include "G4IonConstructor.hh"
53 
58 
59 #include "G4PreCompoundModel.hh"
60 #include "G4ExcitationHandler.hh"
61 #include "G4FTFBuilder.hh"
62 #include "G4HadronicInteraction.hh"
63 #include "G4BuilderType.hh"
65 
66 // factory
68 //
70 
72 G4ThreadLocal std::vector<G4HadronInelasticProcess*>* G4IonBinaryCascadePhysics::G4MT_p_list = 0;
73 G4ThreadLocal std::vector<G4HadronicInteraction*>* G4IonBinaryCascadePhysics::G4MT_model_list = 0;
74 
80 
82  : G4VPhysicsConstructor("IonBinaryCascade"), verbose(ver)
83 {
84  theNuclNuclData = 0;
85  theGGNuclNuclXS = 0;
86  theIonBC = 0;
87  theFTFP = 0;
88  theBuilder = 0;
90  if(verbose > 1) G4cout << "### G4IonBinaryCascadePhysics" << G4endl;
91 }
92 
93 
95  G4int ver)
96  : G4VPhysicsConstructor(name), verbose(ver)
97 {
98  theNuclNuclData = 0;
99  theGGNuclNuclXS = 0;
100  theIonBC = 0;
101  theFTFP = 0;
102  theBuilder = 0;
104  if(verbose > 1) G4cout << "### G4IonBinaryCascadePhysics" << G4endl;
105 }
106 
107 
109 {
110  //Explicitly setting pointers TLS to 0 is
111  //needed, in case I create a new thread
112  //this variable is static!
113  if(wasActivated) {
114  delete theBuilder; theBuilder = 0;
115  delete theGGNuclNuclXS; theGGNuclNuclXS = 0;
116  delete theNuclNuclData; theNuclNuclData = 0;
117  G4int i;
118  if ( G4MT_p_list ) {
119  G4int n = G4MT_p_list->size();
120  for(i=0; i<n; i++) {delete (*G4MT_p_list)[i];}
121  delete G4MT_p_list;
122  G4MT_p_list = 0;
123  }
124  if ( G4MT_model_list ) {
125  G4int n = G4MT_model_list->size();
126  for(i=0; i<n; i++) {delete (*G4MT_model_list)[i];}
127  delete G4MT_model_list;
128  G4MT_model_list = 0;
129  }
130  }
131 }
132 
133 
135 {
136  if(wasActivated) { return; }
137  wasActivated = true;
138 
141  G4PreCompoundModel* thePreCompound = static_cast<G4PreCompoundModel*>(p);
142  if(!thePreCompound) { thePreCompound = new G4PreCompoundModel; }
143 
144  theIonBC = new G4BinaryLightIonReaction(thePreCompound);
145  theIonBC->SetMinEnergy(0.0);
146  theIonBC->SetMaxEnergy(4.0*GeV);
147  if ( G4MT_model_list == 0 ) G4MT_model_list = new std::vector<G4HadronicInteraction*>;
148  G4MT_model_list->push_back(theIonBC);
149 
150  theBuilder = new G4FTFBuilder("FTFP",thePreCompound);
152  theFTFP->SetMinEnergy(2.0*GeV);
153  theFTFP->SetMaxEnergy(100.0*TeV);
154  G4MT_model_list->push_back(theFTFP);
155 
157 
158  AddProcess("dInelastic", G4Deuteron::Deuteron());
159  AddProcess("tInelastic", G4Triton::Triton());
160  AddProcess("He3Inelastic", G4He3::He3());
161  AddProcess("alphaInelastic", G4Alpha::Alpha());
162  AddProcess("ionInelastic", G4GenericIon::GenericIon());
163 }
164 
165 
168 {
169  if ( G4MT_p_list == 0 ) G4MT_p_list = new std::vector<G4HadronInelasticProcess*>;
170  G4HadronInelasticProcess* hadi = new G4HadronInelasticProcess(name, part);
171  G4MT_p_list->push_back(hadi);
172  G4ProcessManager* pManager = part->GetProcessManager();
173  pManager->AddDiscreteProcess(hadi);
174 
176 
177  hadi->RegisterMe(theIonBC);
178  hadi->RegisterMe(theFTFP);
179 }
180 
181 
183 {
184  // Construct light ions
185  G4IonConstructor pConstructor;
186  pConstructor.ConstructParticle();
187 }
static G4GenericIon * GenericIon()
Definition: G4GenericIon.cc:93
static G4ThreadLocal G4bool wasActivated
#define G4_DECLARE_PHYSCONSTR_FACTORY(physics_constructor)
static G4He3 * He3()
Definition: G4He3.cc:94
const XML_Char * name
Definition: expat.h:151
void SetMinEnergy(G4double anEnergy)
void SetMaxEnergy(const G4double anEnergy)
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
void RegisterMe(G4HadronicInteraction *a)
#define G4endl
Definition: G4ios.hh:61
const char * p
Definition: xmltok.h:285
static G4ThreadLocal G4FTFBuilder * theBuilder
static void ConstructParticle()
G4HadronicInteraction * GetModel()
#define G4ThreadLocal
Definition: tls.hh:69
static G4Deuteron * Deuteron()
Definition: G4Deuteron.cc:94
static constexpr double TeV
Definition: G4SIunits.hh:218
bool G4bool
Definition: G4Types.hh:79
TString part[npart]
Definition: Style.C:32
static G4ThreadLocal G4BinaryLightIonReaction * theIonBC
static G4HadronicInteractionRegistry * Instance()
static G4Alpha * Alpha()
Definition: G4Alpha.cc:89
static G4ThreadLocal G4VComponentCrossSection * theGGNuclNuclXS
static G4ThreadLocal std::vector< G4HadronInelasticProcess * > * G4MT_p_list
void AddDataSet(G4VCrossSectionDataSet *aDataSet)
int G4int
Definition: G4Types.hh:78
static G4Triton * Triton()
Definition: G4Triton.cc:95
G4ProcessManager * GetProcessManager() const
void AddProcess(const G4String &, G4ParticleDefinition *)
static G4ThreadLocal G4VCrossSectionDataSet * theNuclNuclData
static G4ThreadLocal std::vector< G4HadronicInteraction * > * G4MT_model_list
G4GLOB_DLL std::ostream G4cout
Char_t n[5]
static G4ThreadLocal G4HadronicInteraction * theFTFP
G4HadronicInteraction * FindModel(const G4String &name)
static constexpr double GeV
Definition: G4SIunits.hh:217