Geant4  10.00.p02
G4InuclEvaporation.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: G4InuclEvaporation.cc 66241 2012-12-13 18:34:42Z gunter $
27 //
28 // 20100114 M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly
29 // 20100405 M. Kelsey -- Pass const-ref std::vector<>
30 // 20100413 M. Kelsey -- Pass G4CollisionOutput by ref to ::collide(), use
31 // const_iterator.
32 // 20100428 M. Kelsey -- Use G4InuclParticleNames enum
33 // 20100429 M. Kelsey -- Change "case gamma:" to "case photon:"
34 // 20100517 M. Kelsey -- Follow new ctors for G4*Collider family. Make
35 // G4EvaporationInuclCollider a data member.
36 // 20100520 M. Kelsey -- Simplify collision loop, move momentum rotations to
37 // G4CollisionOutput, copy G4DynamicParticle directly from
38 // G4InuclParticle, no switch-block required. Fix scaling factors.
39 // 20100914 M. Kelsey -- Migrate to integer A and Z
40 // 20100924 M. Kelsey -- Migrate to "OutgoingNuclei" names in CollisionOutput
41 // 20110728 M. Kelsey -- Fix Coverity #28776, remove return after throw.
42 // 20120608 M. Kelsey -- Fix variable-name "shadowing" compiler warnings.
43 
44 #include <numeric>
45 
46 #include "G4InuclEvaporation.hh"
47 #include "globals.hh"
48 #include "G4SystemOfUnits.hh"
49 #include "G4IonTable.hh"
50 #include "G4V3DNucleus.hh"
53 #include "G4InuclNuclei.hh"
54 #include "G4Track.hh"
55 #include "G4Nucleus.hh"
56 #include "G4Nucleon.hh"
57 #include "G4NucleiModel.hh"
58 #include "G4HadronicException.hh"
59 #include "G4LorentzVector.hh"
62 #include "G4InuclParticle.hh"
63 #include "G4CollisionOutput.hh"
64 #include "G4InuclParticleNames.hh"
65 
66 using namespace G4InuclParticleNames;
67 
68 typedef std::vector<G4InuclElementaryParticle>::const_iterator particleIterator;
69 typedef std::vector<G4InuclNuclei>::const_iterator nucleiIterator;
70 
71 
73  : verboseLevel(0), evaporator(new G4EvaporationInuclCollider) {}
74 
76  throw G4HadronicException(__FILE__, __LINE__, "G4InuclEvaporation::copy_constructor meant to not be accessable.");
77 }
78 
80  delete evaporator;
81 }
82 
84  throw G4HadronicException(__FILE__, __LINE__, "G4InuclEvaporation::operator= meant to not be accessable.");
85 }
86 
87 
89  return false;
90 }
91 
93  return true;
94 }
95 
97  verboseLevel = verbose;
98 }
99 
101  G4FragmentVector* theResult = new G4FragmentVector;
102 
103  if (theNucleus.GetExcitationEnergy() <= 0.0) { // Check that Excitation Energy > 0
104  theResult->push_back(new G4Fragment(theNucleus));
105  return theResult;
106  }
107 
108  G4int A = theNucleus.GetA_asInt();
109  G4int Z = theNucleus.GetZ_asInt();
110  G4double mTar = G4NucleiProperties::GetNuclearMass(A, Z); // Mass of the target nucleus
111 
112  G4ThreeVector momentum = theNucleus.GetMomentum().vect();
113  G4double exitationE = theNucleus.GetExcitationEnergy();
114 
115  G4double mass = mTar;
116  G4ThreeVector boostToLab( momentum/mass );
117 
118  if ( verboseLevel > 2 )
119  G4cout << " G4InuclEvaporation : initial kinematics : boostToLab vector = " << boostToLab << G4endl
120  << " excitation energy : " << exitationE << G4endl;
121 
122  if (verboseLevel > 2) {
123  G4cout << "G4InuclEvaporation::BreakItUp >>> A: " << A << " Z: " << Z
124  << " exitation E: " << exitationE << " mass: " << mTar/GeV << " GeV"
125  << G4endl;
126  };
127 
128  G4InuclNuclei* nucleus = new G4InuclNuclei(A, Z);
129  nucleus->setExitationEnergy(exitationE);
130 
131  G4CollisionOutput output;
132  evaporator->collide(0, nucleus, output);
133 
134  const std::vector<G4InuclNuclei>& outgoingNuclei = output.getOutgoingNuclei();
135  const std::vector<G4InuclElementaryParticle>& particles = output.getOutgoingParticles();
136 
137  G4double eTot=0.0;
138  G4int i=1;
139 
140  if (!particles.empty()) {
141  G4int outgoingType;
142  particleIterator ipart = particles.begin();
143  for (; ipart != particles.end(); ipart++) {
144  outgoingType = ipart->type();
145 
146  if (verboseLevel > 2) {
147  G4cout << "Evaporated particle: " << i << " of type: "
148  << outgoingType << G4endl;
149  i++;
150  }
151 
152  eTot += ipart->getEnergy();
153 
154  G4LorentzVector vlab = ipart->getMomentum().boost(boostToLab);
155 
156  theResult->push_back( new G4Fragment(vlab, ipart->getDefinition()) );
157  }
158  }
159 
160  // G4cout << "# fragments " << output.getOutgoingNuclei().size() << G4endl;
161  if (!outgoingNuclei.empty()) {
162  nucleiIterator ifrag = outgoingNuclei.begin();
163  for (i=1; ifrag != outgoingNuclei.end(); ifrag++) {
164  if (verboseLevel > 2) {
165  G4cout << " Nuclei fragment: " << i << G4endl; i++;
166  }
167 
168  eTot += ifrag->getEnergy();
169 
170  G4LorentzVector vlab = ifrag->getMomentum().boost(boostToLab);
171 
172  G4int fragA = ifrag->getA();
173  G4int fragZ = ifrag->getZ();
174  if (verboseLevel > 2) {
175  G4cout << "boosted v" << vlab << G4endl;
176  }
177  theResult->push_back( new G4Fragment(fragA, fragZ, vlab) );
178  }
179  }
180 
181  //G4cout << ">>>> G4InuclEvaporation::BreakItUp end " << G4endl;
182  return theResult;
183 }
static G4double GetNuclearMass(const G4double A, const G4double Z)
CLHEP::Hep3Vector G4ThreeVector
std::vector< G4InuclNuclei >::const_iterator nucleiIterator
void setVerboseLevel(const G4int verbose)
G4FragmentVector * BreakItUp(const G4Fragment &theNucleus)
int G4int
Definition: G4Types.hh:78
const G4InuclEvaporation & operator=(const G4InuclEvaporation &right)
void setExitationEnergy(G4double e)
G4GLOB_DLL std::ostream G4cout
G4int GetA_asInt() const
Definition: G4Fragment.hh:238
bool G4bool
Definition: G4Types.hh:79
const G4LorentzVector & GetMomentum() const
Definition: G4Fragment.hh:271
std::vector< G4Fragment * > G4FragmentVector
Definition: G4Fragment.hh:65
static const double GeV
Definition: G4SIunits.hh:196
virtual void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &globalOutput)
G4bool operator!=(const G4InuclEvaporation &right) const
static const G4double A[nN]
G4EvaporationInuclCollider * evaporator
const std::vector< G4InuclNuclei > & getOutgoingNuclei() const
const std::vector< G4InuclElementaryParticle > & getOutgoingParticles() const
G4int GetZ_asInt() const
Definition: G4Fragment.hh:243
std::vector< G4InuclNuclei >::const_iterator nucleiIterator
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:64
#define G4endl
Definition: G4ios.hh:61
G4bool operator==(const G4InuclEvaporation &right) const
double G4double
Definition: G4Types.hh:76
std::vector< G4InuclElementaryParticle >::const_iterator particleIterator
G4double GetExcitationEnergy() const
Definition: G4Fragment.hh:255
CLHEP::HepLorentzVector G4LorentzVector