Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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// INCL++ revision: v5.1.8
34//
35#define INCLXX_IN_GEANT4_MODE 1
36
37#include "globals.hh"
38
39/*
40 * G4INCLBinaryCollisionAvatar.cc
41 *
42 * \date Jun 5, 2009
43 * \author Pekka Kaitaniemi
44 */
45
52#include "G4INCLRandom.hh"
56#include "G4INCLStore.hh"
57#include "G4INCLBook.hh"
58#include "G4INCLLogger.hh"
59#include <string>
60#include <sstream>
61// #include <cassert>
62
63namespace G4INCL {
64
67
70 : InteractionAvatar(time, n, p1, p2), theCrossSection(crossSection)
71 {
73 }
74
76 }
77
79 // We already check cutNN at avatar creation time, but we have to check it
80 // again here. For composite projectiles, we might have created independent
81 // avatars with no cutNN before any collision took place.
86 // Below a certain cut value we don't do anything:
87 if(energyCM2 < cutNNSquared) {
88 DEBUG("CM energy = sqrt(" << energyCM2 << ") MeV < sqrt(" << cutNNSquared
89 << ") MeV = cutNN" << "; returning a NULL channel" << std::endl);
91 return NULL;
92 }
93 }
94
95 /** Check again the distance of approach. In order for the avatar to be
96 * realised, we have to perform a check in the CM system. We define a
97 * distance four-vector as
98 * \f[ (0, \Delta\vec{x}), \f]
99 * where \f$\Delta\vec{x}\f$ is the distance vector of the particles at
100 * their minimum distance of approach (i.e. at the avatar time). By
101 * boosting this four-vector to the CM frame of the two particles and we
102 * obtain a new four vector
103 * \f[ (\Delta t', \Delta\vec{x}'), \f]
104 * with a non-zero time component (the collision happens simultaneously for
105 * the two particles in the lab system, but not in the CM system). In order
106 * for the avatar to be realised, we require that
107 * \f[ |\Delta\vec{x}'| \leq \sqrt{\sigma/\pi}.\f]
108 * Note that \f$|\Delta\vec{x}'|\leq|\Delta\vec{x}|\f$; thus, the condition
109 * above is more restrictive than the check that we perform in
110 * G4INCL::Propagation::StandardPropagationModel::generateBinaryCollisionAvatar.
111 * In other words, the avatar generation cannot miss any physical collision
112 * avatars.
113 */
114 ThreeVector minimumDistance = particle1->getPosition();
115 minimumDistance -= particle2->getPosition();
116 const G4double betaDotX = boostVector.dot(minimumDistance);
117 const G4double minDist = Math::tenPi*(minimumDistance.mag2() + betaDotX*betaDotX / (1.-boostVector.mag2()));
118 if(minDist > theCrossSection) {
119 DEBUG("CM distance of approach is too small: " << minDist << ">" <<
120 theCrossSection <<"; returning a NULL channel" << std::endl);
122 return NULL;
123 }
124
125 if(particle1->isNucleon() && particle2->isNucleon()) { // NN->NN
127 particle2);
129 particle2);
130
131 G4bool isElastic = true;
132 if(elasticCX/(elasticCX + deltaProductionCX) < Random::shoot()) {
133 // NN -> N Delta channel is chosen
134 isElastic = false;
135 }
136
137 if(isElastic) { // Elastic NN channel
138 DEBUG("NN interaction: elastic channel chosen" << std::endl);
140 } else { // Delta production
141 // Inelastic NN channel
142 DEBUG("NN interaction: inelastic channel chosen" << std::endl);
144 }
145 } else if((particle1->isNucleon() && particle2->isDelta()) ||
148 particle2);
150 particle2);
151
152 G4bool isElastic = true;
153 if(elasticCX/(elasticCX + recombinationCX) < Random::shoot()) {
154 // N Delta -> NN channel is chosen
155 isElastic = false;
156 }
157
158 if(isElastic) { // Elastic N Delta channel
159 DEBUG("NDelta interaction: elastic channel chosen" << std::endl);
161 } else { // Recombination
162 DEBUG("NDelta interaction: recombination channel chosen" << std::endl);
164 }
165 } else if(particle1->isDelta() && particle2->isDelta()) {
166 DEBUG("DeltaDelta interaction: elastic channel chosen" << std::endl);
168 } else if((particle1->isNucleon() && particle2->isPion()) ||
169 (particle1->isPion() && particle2->isNucleon())) {
171 } else {
172 DEBUG("BinaryCollisionAvatar can only handle nucleons (for the moment)."
173 << std::endl
174 << particle1->print()
175 << std::endl
176 << particle2->print()
177 << std::endl);
179 return NULL;
180 }
181 }
182
185 }
186
188 // Call the postInteraction method of the parent class
189 // (provides Pauli blocking and enforces energy conservation)
191
192 switch(fs->getValidity()) {
193 case PauliBlockedFS:
195 break;
199 break;
200 case ValidFS:
206 }
207 }
208 return fs;
209 }
210
211 std::string BinaryCollisionAvatar::dump() const {
212 std::stringstream ss;
213 ss << "(avatar " << theTime <<" 'nn-collision" << std::endl
214 << "(list " << std::endl
215 << particle1->dump()
216 << particle2->dump()
217 << "))" << std::endl;
218 return ss.str();
219 }
220
221}
#define DEBUG(x)
Delta-nucleon recombination channel.
double G4double
Definition: G4Types.hh:64
bool G4bool
Definition: G4Types.hh:67
BinaryCollisionAvatar(G4double, G4double, G4INCL::Nucleus *, G4INCL::Particle *, G4INCL::Particle *)
virtual FinalState * postInteraction(FinalState *)
void incrementAcceptedCollisions()
Definition: G4INCLBook.hh:68
G4int getAcceptedCollisions() const
Definition: G4INCLBook.hh:85
void incrementBlockedCollisions()
Definition: G4INCLBook.hh:69
void setFirstCollisionTime(G4double t)
Definition: G4INCLBook.hh:76
G4double getCurrentTime()
Definition: G4INCLBook.hh:83
void setFirstCollisionXSec(G4double x)
Definition: G4INCLBook.hh:79
static G4double elastic(Particle const *const p1, Particle const *const p2)
static G4double deltaProduction(Particle const *const p1, Particle const *const p2)
static G4double recombination(Particle const *const p1, Particle const *const p2)
FinalStateValidity getValidity() const
void setType(AvatarType t)
FinalState * postInteraction(FinalState *)
void restoreParticles() const
Restore the state of both particles.
G4bool shouldUseLocalEnergy() const
true if the given avatar should use local energy
static G4double squareTotalEnergyInCM(Particle const *const p1, Particle const *const p2)
Store * getStore() const
std::string dump() const
const G4INCL::ThreeVector & getPosition() const
G4bool isPion() const
Is this a pion?
std::string print() const
G4bool isDelta() const
Is it a Delta?
G4bool isNucleon() const
static G4double shoot()
Definition: G4INCLRandom.hh:99
Book * getBook()
Definition: G4INCLStore.hh:243
G4double dot(const ThreeVector &v) const
G4double mag2() const
const G4double tenPi
@ CollisionAvatarType
@ ParticleBelowZeroFS
@ NoEnergyConservationFS
@ ParticleBelowFermiFS