Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions
G4INCL::BinaryCollisionAvatar Class Reference

#include <G4INCLBinaryCollisionAvatar.hh>

Inheritance diagram for G4INCL::BinaryCollisionAvatar:
G4INCL::InteractionAvatar G4INCL::IAvatar

Public Member Functions

 BinaryCollisionAvatar (G4double, G4double, G4INCL::Nucleus *, G4INCL::Particle *, G4INCL::Particle *)
 
virtual ~BinaryCollisionAvatar ()
 
G4INCL::IChannelgetChannel ()
 
ParticleList getParticles () const
 
virtual void preInteraction ()
 
virtual FinalStatepostInteraction (FinalState *)
 
std::string dump () const
 
- Public Member Functions inherited from G4INCL::InteractionAvatar
 InteractionAvatar (G4double, G4INCL::Nucleus *, G4INCL::Particle *)
 
 InteractionAvatar (G4double, G4INCL::Nucleus *, G4INCL::Particle *, G4INCL::Particle *)
 
virtual ~InteractionAvatar ()
 
- Public Member Functions inherited from G4INCL::IAvatar
 IAvatar ()
 
 IAvatar (G4double time)
 
virtual ~IAvatar ()
 
G4INCL::FinalStategetFinalState ()
 
G4double getTime () const
 
AvatarType getType () const
 
G4bool isACollision () const
 
G4bool isADecay () const
 
void setType (AvatarType t)
 
long getID () const
 
std::string toString ()
 

Static Public Member Functions

static void setCutNN (const G4double c)
 
static G4double getCutNN ()
 
static G4double getCutNNSquared ()
 
- Static Public Member Functions inherited from G4INCL::InteractionAvatar
static void deleteBackupParticles ()
 Release the memory allocated for the backup particles. More...
 

Additional Inherited Members

- Static Public Attributes inherited from G4INCL::InteractionAvatar
static const G4double locEAccuracy = 1.E-4
 Target accuracy in the determination of the local-energy Q-value. More...
 
static const G4int maxIterLocE = 50
 Max number of iterations for the determination of the local-energy Q-value. More...
 
- Protected Member Functions inherited from G4INCL::InteractionAvatar
G4bool bringParticleInside (Particle *const p)
 
void preInteractionLocalEnergy (Particle *const p)
 Apply local-energy transformation, if appropriate. More...
 
void preInteractionBlocking ()
 Store the state of the particles before the interaction. More...
 
void preInteraction ()
 
FinalStatepostInteraction (FinalState *)
 
void restoreParticles () const
 Restore the state of both particles. More...
 
G4bool shouldUseLocalEnergy () const
 true if the given avatar should use local energy More...
 
G4bool enforceEnergyConservation (FinalState *const fs)
 Enforce energy conservation. More...
 
- Protected Attributes inherited from G4INCL::InteractionAvatar
NucleustheNucleus
 
Particleparticle1
 
Particleparticle2
 
ThreeVector boostVector
 
G4double oldTotalEnergy
 
G4double oldXSec
 
G4bool isPiN
 
- Protected Attributes inherited from G4INCL::IAvatar
G4double theTime
 
- Static Protected Attributes inherited from G4INCL::InteractionAvatar
static G4ThreadLocal ParticlebackupParticle1 = NULL
 
static G4ThreadLocal ParticlebackupParticle2 = NULL
 

Detailed Description

Definition at line 54 of file G4INCLBinaryCollisionAvatar.hh.

Constructor & Destructor Documentation

G4INCL::BinaryCollisionAvatar::BinaryCollisionAvatar ( G4double  time,
G4double  crossSection,
G4INCL::Nucleus n,
G4INCL::Particle p1,
G4INCL::Particle p2 
)

Definition at line 68 of file G4INCLBinaryCollisionAvatar.cc.

References G4INCL::CollisionAvatarType, and G4INCL::IAvatar::setType().

70  : InteractionAvatar(time, n, p1, p2), theCrossSection(crossSection),
71  isParticle1Spectator(false),
72  isParticle2Spectator(false),
73  isElastic(false)
74  {
76  }
InteractionAvatar(G4double, G4INCL::Nucleus *, G4INCL::Particle *)
void setType(AvatarType t)
G4INCL::BinaryCollisionAvatar::~BinaryCollisionAvatar ( )
virtual

Definition at line 78 of file G4INCLBinaryCollisionAvatar.cc.

78  {
79  }

Member Function Documentation

std::string G4INCL::BinaryCollisionAvatar::dump ( ) const
virtual

Implements G4INCL::IAvatar.

Definition at line 235 of file G4INCLBinaryCollisionAvatar.cc.

References G4INCL::Particle::dump(), G4INCL::InteractionAvatar::particle1, G4INCL::InteractionAvatar::particle2, and G4INCL::IAvatar::theTime.

235  {
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  }
std::string dump() const
G4INCL::IChannel * G4INCL::BinaryCollisionAvatar::getChannel ( )
virtual

Check again the distance of approach. In order for the avatar to be realised, we have to perform a check in the CM system. We define a distance four-vector as

\[ (0, \Delta\vec{x}), \]

where $\Delta\vec{x}$ is the distance vector of the particles at their minimum distance of approach (i.e. at the avatar time). By boosting this four-vector to the CM frame of the two particles and we obtain a new four vector

\[ (\Delta t', \Delta\vec{x}'), \]

with a non-zero time component (the collision happens simultaneously for the two particles in the lab system, but not in the CM system). In order for the avatar to be realised, we require that

\[ |\Delta\vec{x}'| \leq \sqrt{\sigma/\pi}.\]

Note that $|\Delta\vec{x}'|\leq|\Delta\vec{x}|$; thus, the condition above is more restrictive than the check that we perform in G4INCL::Propagation::StandardPropagationModel::generateBinaryCollisionAvatar. In other words, the avatar generation cannot miss any physical collision avatars.

Implements G4INCL::InteractionAvatar.

Definition at line 81 of file G4INCLBinaryCollisionAvatar.cc.

References G4INCL::InteractionAvatar::boostVector, G4INCL::CrossSections::deltaProduction(), G4INCL::ThreeVector::dot(), G4INCL::CrossSections::elastic(), G4INCL::Book::getAcceptedCollisions(), G4INCL::Store::getBook(), G4INCL::Particle::getPosition(), G4INCL::Nucleus::getStore(), INCL_DEBUG, G4INCL::Particle::isDelta(), G4INCL::Particle::isNucleon(), G4INCL::Particle::isPion(), G4INCL::ThreeVector::mag2(), G4INCL::InteractionAvatar::particle1, G4INCL::InteractionAvatar::particle2, G4INCL::Particle::print(), G4INCL::CrossSections::recombination(), G4INCL::InteractionAvatar::restoreParticles(), G4INCL::Random::shoot(), G4INCL::KinematicsUtils::squareTotalEnergyInCM(), G4INCL::Math::tenPi, and G4INCL::InteractionAvatar::theNucleus.

81  {
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);
146  return new DeltaProductionChannel(particle1, particle2);
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);
166  return new RecombinationChannel(particle1, particle2);
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;
175  return new PionNucleonChannel(particle1, particle2, theNucleus);
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  }
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
Store * getStore() const
G4bool isDelta() const
Is it a Delta?
std::string print() const
G4double mag2() const
Book & getBook()
Definition: G4INCLStore.hh:237
const G4INCL::ThreeVector & getPosition() const
G4bool isNucleon() const
G4double shoot()
Definition: G4INCLRandom.cc:74
void restoreParticles() const
Restore the state of both particles.
double G4double
Definition: G4Types.hh:76
#define INCL_DEBUG(x)
G4bool isPion() const
Is this a pion?
G4double elastic(Particle const *const p1, Particle const *const p2)
static G4double G4INCL::BinaryCollisionAvatar::getCutNN ( )
inlinestatic

Definition at line 76 of file G4INCLBinaryCollisionAvatar.hh.

76 { return cutNN; }
static G4double G4INCL::BinaryCollisionAvatar::getCutNNSquared ( )
inlinestatic

Definition at line 78 of file G4INCLBinaryCollisionAvatar.hh.

Referenced by G4INCL::StandardPropagationModel::generateBinaryCollisionAvatar().

78 { return cutNNSquared; }
ParticleList G4INCL::BinaryCollisionAvatar::getParticles ( ) const
inlinevirtual

Implements G4INCL::IAvatar.

Definition at line 59 of file G4INCLBinaryCollisionAvatar.hh.

References G4INCL::InteractionAvatar::particle1, and G4INCL::InteractionAvatar::particle2.

59  {
60  ParticleList theParticleList;
61  theParticleList.push_back(particle1);
62  theParticleList.push_back(particle2);
63  return theParticleList;
64  };
UnorderedVector< Particle * > ParticleList
FinalState * G4INCL::BinaryCollisionAvatar::postInteraction ( FinalState fs)
virtual

Implements G4INCL::IAvatar.

Definition at line 194 of file G4INCLBinaryCollisionAvatar.cc.

References G4INCL::InteractionAvatar::backupParticle1, G4INCL::InteractionAvatar::backupParticle2, G4INCL::Book::getAcceptedCollisions(), G4INCL::Store::getBook(), G4INCL::Book::getCurrentTime(), G4INCL::Particle::getMomentum(), G4INCL::Particle::getPosition(), G4INCL::Nucleus::getStore(), G4INCL::FinalState::getValidity(), INCL_ERROR, G4INCL::Book::incrementAcceptedCollisions(), G4INCL::Book::incrementBlockedCollisions(), G4INCL::ThreeVector::mag(), G4INCL::NoEnergyConservationFS, G4INCL::InteractionAvatar::oldXSec, G4INCL::ParticleBelowFermiFS, G4INCL::ParticleBelowZeroFS, G4INCL::PauliBlockedFS, G4INCL::InteractionAvatar::postInteraction(), G4INCL::Book::setFirstCollisionIsElastic(), G4INCL::Book::setFirstCollisionSpectatorMomentum(), G4INCL::Book::setFirstCollisionSpectatorPosition(), G4INCL::Book::setFirstCollisionTime(), G4INCL::Book::setFirstCollisionXSec(), G4INCL::InteractionAvatar::theNucleus, and G4INCL::ValidFS.

194  {
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  }
void incrementBlockedCollisions()
Definition: G4INCLBook.hh:72
G4int getAcceptedCollisions() const
Definition: G4INCLBook.hh:99
#define INCL_ERROR(x)
const G4INCL::ThreeVector & getMomentum() const
Store * getStore() const
static G4ThreadLocal Particle * backupParticle2
void incrementAcceptedCollisions()
Definition: G4INCLBook.hh:71
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
void setFirstCollisionTime(const G4double t)
Definition: G4INCLBook.hh:81
const G4INCL::ThreeVector & getPosition() const
G4double mag() const
double G4double
Definition: G4Types.hh:76
void setFirstCollisionIsElastic(const G4bool e)
Definition: G4INCLBook.hh:93
void setFirstCollisionSpectatorMomentum(const G4double x)
Definition: G4INCLBook.hh:90
void setFirstCollisionSpectatorPosition(const G4double x)
Definition: G4INCLBook.hh:87
void G4INCL::BinaryCollisionAvatar::preInteraction ( )
virtual
static void G4INCL::BinaryCollisionAvatar::setCutNN ( const G4double  c)
inlinestatic

Definition at line 71 of file G4INCLBinaryCollisionAvatar.hh.

References test::c.

Referenced by G4INCL::INCL::INCL().

71  {
72  cutNN = c;
73  cutNNSquared = cutNN*cutNN;
74  }

The documentation for this class was generated from the following files: