ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4IonPhysics.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4IonPhysics.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 //
27 //---------------------------------------------------------------------------
28 //
29 // Class: G4IonPhysics
30 //
31 // Author: A.Ivanchenko 02.03.2011
32 //
33 // Modified:
34 // 16.10.2012 A.Ribon: renamed G4IonFTFPBinaryCascadePhysics as G4IonPhysics
35 //
36 //---------------------------------------------------------------------------
37 
38 #include "G4IonPhysics.hh"
39 #include "G4SystemOfUnits.hh"
40 #include "G4ParticleDefinition.hh"
41 #include "G4ProcessManager.hh"
42 #include "G4Deuteron.hh"
43 #include "G4Triton.hh"
44 #include "G4He3.hh"
45 #include "G4Alpha.hh"
46 #include "G4GenericIon.hh"
47 #include "G4IonConstructor.hh"
48 
53 
54 #include "G4PreCompoundModel.hh"
55 #include "G4ExcitationHandler.hh"
56 #include "G4FTFBuilder.hh"
57 #include "G4HadronicInteraction.hh"
58 #include "G4BuilderType.hh"
60 
61 #include "G4HadronicParameters.hh"
62 
63 using namespace std;
64 
65 // factory
67 //
69 
71 
72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
73 
75  : G4IonPhysics("ionInelasticFTFP_BIC")
76 {
77  verbose = ver;
78 }
79 
80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
81 
83  : G4VPhysicsConstructor(nname),verbose(1)
84 {
86  if(verbose > 1) { G4cout << "### IonPhysics: " << nname << G4endl; }
87 }
88 
89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
90 
92 {
93  // Explictly setting pointers to zero is actually needed.
94  // These are static variables, in case we restart threads
95  // we need to re-create objects
96  delete theBuilder;
97  theBuilder = nullptr;
98 }
99 
100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
101 
103 {
104  // Construct ions
105  G4IonConstructor pConstructor;
106  pConstructor.ConstructParticle();
107 }
108 
109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
110 
112 {
114 
117  G4PreCompoundModel* thePreCompound = static_cast<G4PreCompoundModel*>(p);
118  if(!thePreCompound) { thePreCompound = new G4PreCompoundModel; }
119 
120  // Binary Cascade
121  G4HadronicInteraction* theIonBC =
122  new G4BinaryLightIonReaction(thePreCompound);
123  theIonBC->SetMinEnergy( 0.0 );
124  theIonBC->SetMaxEnergy( G4HadronicParameters::Instance()->GetMaxEnergyTransitionFTF_Cascade() );
125 
126  // FTFP
127  G4HadronicInteraction* theFTFP = nullptr;
128  if(emax > theIonBC->GetMaxEnergy()) {
129  theBuilder = new G4FTFBuilder("FTFP",thePreCompound);
130  theFTFP = theBuilder->GetModel();
131  theFTFP->SetMinEnergy( G4HadronicParameters::Instance()->GetMinEnergyTransitionFTF_Cascade() );
132  theFTFP->SetMaxEnergy( emax );
133  }
134 
135  G4CrossSectionInelastic* theNuclNuclData =
137 
138  AddProcess("dInelastic", G4Deuteron::Deuteron(),theIonBC,theFTFP,
139  theNuclNuclData);
140  AddProcess("tInelastic",G4Triton::Triton(),theIonBC,theFTFP,
141  theNuclNuclData);
142  AddProcess("He3Inelastic",G4He3::He3(),theIonBC,theFTFP,
143  theNuclNuclData);
144  AddProcess("alphaInelastic", G4Alpha::Alpha(),theIonBC,theFTFP,
145  theNuclNuclData);
146  AddProcess("ionInelastic",G4GenericIon::GenericIon(),theIonBC,theFTFP,
147  theNuclNuclData);
148 
149  if(verbose > 1) {
150  G4cout << "G4IonPhysics::ConstructProcess done! "
151  << G4endl;
152  }
153 }
154 
155 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
156 
159  G4HadronicInteraction* theIonBC,
160  G4HadronicInteraction* theFTFP,
162 {
163  G4HadronInelasticProcess* hadi = new G4HadronInelasticProcess(name, part);
164  G4ProcessManager* pManager = part->GetProcessManager();
165  pManager->AddDiscreteProcess(hadi);
166 
167  hadi->AddDataSet(xs);
168 
169  hadi->RegisterMe(theIonBC);
170  if(theFTFP) { hadi->RegisterMe(theFTFP); }
171 }
172 
173 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......