Geant4_10
G4INCLCoulombNone.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 
44 #include "G4INCLCoulombNone.hh"
45 #include "G4INCLIntersection.hh"
46 
47 namespace G4INCL {
48 
51  if(intersection.exists) { // If the particle enters the nucleus
52  p->setPosition(intersection.position);
53  return new ParticleEntryAvatar(0.0, n, p);
54  } else // If the particle does NOT enter the nucleus
55  return NULL;
56  }
57 
59  // The avatar list that we will return
60  IAvatarList theAvatarList;
61 
62  // Loop over the particles in the cluster
63  ParticleList projectiles = c->getParticles();
64  std::list<Intersection> theIntersections;
65  G4double theFirstEntryTime = 1E+60; // a large time
66  G4int theFirstID = 0;
67  for(ParticleIter p=projectiles.begin(), e=projectiles.end(); p!=e; ++p) {
68  // Check if the particle enters the nucleus
70  (*p)->getPosition(),
71  (*p)->getPropagationVelocity(),
72  n->getUniverseRadius()));
73  // Store the intersections
74  theIntersections.push_back(intersection);
75  if(intersection.exists) {
76  // Position the particle at the entry point
77  (*p)->setPosition(intersection.position);
78 
79  // Keep track of the first entering particle
80  if(intersection.time < theFirstEntryTime) {
81  theFirstEntryTime = intersection.time;
82  theFirstID = (*p)->getID();
83  }
84  }
85  }
86 
87  std::list<Intersection>::const_iterator intIter = theIntersections.begin();
88  for(ParticleIter p=projectiles.begin(), e=projectiles.end(); p!=e; ++p, ++intIter) {
89 
90  if((*intIter).exists) {
91  // If the particle enters the nucleus, generate a ParticleEntryAvatar
92  // for it and add it to the list of avatars that we will return
93  if((*p)->getID() == theFirstID) {
94  // The first particle always enters exactly at t=0 (in order to
95  // avoid negative entry times due to rounding)
96  theAvatarList.push_back(new ParticleEntryAvatar(0.0, n, *p));
97  } else
98  theAvatarList.push_back(new ParticleEntryAvatar(intIter->time - theFirstEntryTime, n, *p));
99  }
100 
101  }
102 
103  return theAvatarList;
104  }
105 
106 }
ParticleList const & getParticles() const
ThreeVector getPropagationVelocity() const
Get the propagation velocity of the particle.
const char * p
Definition: xmltok.h:285
int G4int
Definition: G4Types.hh:78
Char_t n[5]
Intersection getEarlierTrajectoryIntersection(const ThreeVector &x0, const ThreeVector &p, const G4double r)
Compute the first intersection of a straight particle trajectory with a sphere.
virtual void setPosition(const G4INCL::ThreeVector &position)
Placeholder class for no Coulomb distortion.
ParticleEntryAvatar * bringToSurface(Particle *const p, Nucleus *const n) const
Position the particle on the surface of the nucleus.
const G4INCL::ThreeVector & getPosition() const
G4double getUniverseRadius() const
Getter for theUniverseRadius.
Intersection-point structure.
double G4double
Definition: G4Types.hh:76
tuple c
Definition: test.py:13
ParticleList::const_iterator ParticleIter
Simple class for computing intersections between a straight line and a sphere.