Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4INCLBinaryCollisionAvatar.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 // INCL++ intra-nuclear cascade model
27 // Pekka Kaitaniemi, CEA and Helsinki Institute of Physics
28 // Davide Mancusi, CEA
29 // Alain Boudard, CEA
30 // Sylvie Leray, CEA
31 // Joseph Cugnon, University of Liege
32 //
33 #define INCLXX_IN_GEANT4_MODE 1
34 
35 #include "globals.hh"
36 
37 /*
38  * G4INCLBinaryCollisionAvatar.cc
39  *
40  * \date Jun 5, 2009
41  * \author Pekka Kaitaniemi
42  */
43 
45 #include "G4INCLElasticChannel.hh"
48 #include "G4INCLCrossSections.hh"
49 #include "G4INCLKinematicsUtils.hh"
50 #include "G4INCLRandom.hh"
51 #include "G4INCLParticleTable.hh"
52 #include "G4INCLPauliBlocking.hh"
54 #include "G4INCLStore.hh"
55 #include "G4INCLBook.hh"
56 #include "G4INCLLogger.hh"
57 #include <string>
58 #include <sstream>
59 // #include <cassert>
60 
61 namespace G4INCL {
62 
63  // WARNING: if you update the default cutNN value, make sure you update the
64  // cutNNSquared variable, too.
65  G4ThreadLocal G4double BinaryCollisionAvatar::cutNN = 1910.0;
66  G4ThreadLocal G4double BinaryCollisionAvatar::cutNNSquared = 3648100.0; // 1910.0 * 1910.0
67 
70  : InteractionAvatar(time, n, p1, p2), theCrossSection(crossSection),
71  isParticle1Spectator(false),
72  isParticle2Spectator(false),
73  isElastic(false)
74  {
76  }
77 
79  }
80 
82  // We already check cutNN at avatar creation time, but we have to check it
83  // again here. For composite projectiles, we might have created independent
84  // avatars with no cutNN before any collision took place.
85  if(particle1->isNucleon()
86  && particle2->isNucleon()
89  // Below a certain cut value we don't do anything:
90  if(energyCM2 < cutNNSquared) {
91  INCL_DEBUG("CM energy = sqrt(" << energyCM2 << ") MeV < sqrt(" << cutNNSquared
92  << ") MeV = cutNN" << "; returning a NULL channel" << std::endl);
94  return NULL;
95  }
96  }
97 
98  /** Check again the distance of approach. In order for the avatar to be
99  * realised, we have to perform a check in the CM system. We define a
100  * distance four-vector as
101  * \f[ (0, \Delta\vec{x}), \f]
102  * where \f$\Delta\vec{x}\f$ is the distance vector of the particles at
103  * their minimum distance of approach (i.e. at the avatar time). By
104  * boosting this four-vector to the CM frame of the two particles and we
105  * obtain a new four vector
106  * \f[ (\Delta t', \Delta\vec{x}'), \f]
107  * with a non-zero time component (the collision happens simultaneously for
108  * the two particles in the lab system, but not in the CM system). In order
109  * for the avatar to be realised, we require that
110  * \f[ |\Delta\vec{x}'| \leq \sqrt{\sigma/\pi}.\f]
111  * Note that \f$|\Delta\vec{x}'|\leq|\Delta\vec{x}|\f$; thus, the condition
112  * above is more restrictive than the check that we perform in
113  * G4INCL::Propagation::StandardPropagationModel::generateBinaryCollisionAvatar.
114  * In other words, the avatar generation cannot miss any physical collision
115  * avatars.
116  */
117  ThreeVector minimumDistance = particle1->getPosition();
118  minimumDistance -= particle2->getPosition();
119  const G4double betaDotX = boostVector.dot(minimumDistance);
120  const G4double minDist = Math::tenPi*(minimumDistance.mag2() + betaDotX*betaDotX / (1.-boostVector.mag2()));
121  if(minDist > theCrossSection) {
122  INCL_DEBUG("CM distance of approach is too small: " << minDist << ">" <<
123  theCrossSection <<"; returning a NULL channel" << std::endl);
125  return NULL;
126  }
127 
128  if(particle1->isNucleon() && particle2->isNucleon()) { // NN->NN
130  particle2);
132  particle2);
133 
134  if(elasticCX/(elasticCX + deltaProductionCX) < Random::shoot()) {
135  // NN -> N Delta channel is chosen
136  isElastic = false;
137  } else
138  isElastic = true;
139 
140  if(isElastic) { // Elastic NN channel
141  INCL_DEBUG("NN interaction: elastic channel chosen" << std::endl);
142  return new ElasticChannel(particle1, particle2);
143  } else { // Delta production
144  // Inelastic NN channel
145  INCL_DEBUG("NN interaction: inelastic channel chosen" << std::endl);
147  }
148  } else if((particle1->isNucleon() && particle2->isDelta()) ||
149  (particle1->isDelta() && particle2->isNucleon())) {
151  particle2);
153  particle2);
154 
155  if(elasticCX/(elasticCX + recombinationCX) < Random::shoot()) {
156  // N Delta -> NN channel is chosen
157  isElastic = false;
158  } else
159  isElastic = true;
160 
161  if(isElastic) { // Elastic N Delta channel
162  INCL_DEBUG("NDelta interaction: elastic channel chosen" << std::endl);
163  return new ElasticChannel(particle1, particle2);
164  } else { // Recombination
165  INCL_DEBUG("NDelta interaction: recombination channel chosen" << std::endl);
167  }
168  } else if(particle1->isDelta() && particle2->isDelta()) {
169  isElastic = true;
170  INCL_DEBUG("DeltaDelta interaction: elastic channel chosen" << std::endl);
171  return new ElasticChannel(particle1, particle2);
172  } else if((particle1->isNucleon() && particle2->isPion()) ||
173  (particle1->isPion() && particle2->isNucleon())) {
174  isElastic = false;
176  } else {
177  INCL_DEBUG("BinaryCollisionAvatar can only handle nucleons (for the moment)."
178  << std::endl
179  << particle1->print()
180  << std::endl
181  << particle2->print()
182  << std::endl);
184  return NULL;
185  }
186  }
187 
189  isParticle1Spectator = particle1->isTargetSpectator();
190  isParticle2Spectator = particle2->isTargetSpectator();
192  }
193 
195  // Call the postInteraction method of the parent class
196  // (provides Pauli blocking and enforces energy conservation)
198 
199  switch(fs->getValidity()) {
200  case PauliBlockedFS:
202  break;
205  case ParticleBelowZeroFS:
206  break;
207  case ValidFS:
210  // Store time and cross section of the first collision
214 
215  // Store position and momentum of the spectator on the first
216  // collision
217  if((isParticle1Spectator && isParticle2Spectator) || (!isParticle1Spectator && !isParticle2Spectator)) {
218  INCL_ERROR("First collision must be within a target spectator and a non-target spectator");
219  }
220  if(isParticle1Spectator) {
223  } else {
226  }
227 
228  // Store the elasticity of the first collision
230  }
231  }
232  return fs;
233  }
234 
235  std::string BinaryCollisionAvatar::dump() const {
236  std::stringstream ss;
237  ss << "(avatar " << theTime <<" 'nn-collision" << std::endl
238  << "(list " << std::endl
239  << particle1->dump()
240  << particle2->dump()
241  << "))" << std::endl;
242  return ss.str();
243  }
244 
245 }
FinalStateValidity getValidity() const
void incrementBlockedCollisions()
Definition: G4INCLBook.hh:72
G4double dot(const ThreeVector &v) const
G4double deltaProduction(Particle const *const p1, Particle const *const p2)
G4int getAcceptedCollisions() const
Definition: G4INCLBook.hh:99
G4double recombination(Particle const *const p1, Particle const *const p2)
G4double squareTotalEnergyInCM(Particle const *const p1, Particle const *const p2)
const G4double tenPi
#define INCL_ERROR(x)
G4bool isTargetSpectator() const
const G4INCL::ThreeVector & getMomentum() const
Store * getStore() const
G4bool isDelta() const
Is it a Delta?
std::string print() const
#define G4ThreadLocal
Definition: tls.hh:52
G4double mag2() const
static G4ThreadLocal Particle * backupParticle2
void incrementAcceptedCollisions()
Definition: G4INCLBook.hh:71
void setType(AvatarType t)
Book & getBook()
Definition: G4INCLStore.hh:237
G4double getCurrentTime()
Definition: G4INCLBook.hh:97
void setFirstCollisionXSec(const G4double x)
Definition: G4INCLBook.hh:84
FinalState * postInteraction(FinalState *)
static G4ThreadLocal Particle * backupParticle1
virtual FinalState * postInteraction(FinalState *)
const G4int n
void setFirstCollisionTime(const G4double t)
Definition: G4INCLBook.hh:81
Delta-nucleon recombination channel.
const G4INCL::ThreeVector & getPosition() const
std::string dump() const
G4bool isNucleon() const
G4double shoot()
Definition: G4INCLRandom.cc:74
void restoreParticles() const
Restore the state of both particles.
G4double mag() const
BinaryCollisionAvatar(G4double, G4double, G4INCL::Nucleus *, G4INCL::Particle *, G4INCL::Particle *)
double G4double
Definition: G4Types.hh:76
#define INCL_DEBUG(x)
void setFirstCollisionIsElastic(const G4bool e)
Definition: G4INCLBook.hh:93
G4bool isPion() const
Is this a pion?
void setFirstCollisionSpectatorMomentum(const G4double x)
Definition: G4INCLBook.hh:90
G4double elastic(Particle const *const p1, Particle const *const p2)
void setFirstCollisionSpectatorPosition(const G4double x)
Definition: G4INCLBook.hh:87