Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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// INCL++ revision: v5.1.8
34//
35#define INCLXX_IN_GEANT4_MODE 1
36
37#include "globals.hh"
38
39/** \file G4INCLCoulombNone.cc
40 * \brief Placeholder class for no Coulomb distortion.
41 *
42 * \date 14 February 2011
43 * \author Davide Mancusi
44 */
45
46#include "G4INCLCoulombNone.hh"
47#include "G4INCLIntersection.hh"
48
49namespace G4INCL {
50
53 if(intersection.exists) { // If the particle enters the nucleus
54 p->setPosition(intersection.position);
55 return new ParticleEntryAvatar(0.0, n, p);
56 } else // If the particle does NOT enter the nucleus
57 return NULL;
58 }
59
61 // The avatar list that we will return
62 IAvatarList theAvatarList;
63
64 // Loop over the particles in the cluster
65 ParticleList projectiles = c->getParticles();
66 std::list<Intersection> theIntersections;
67 G4double theFirstEntryTime = 1E+60; // a large time
68 G4int theFirstID = 0;
69 for(ParticleIter p=projectiles.begin(); p!=projectiles.end(); ++p) {
70 // Check if the particle enters the nucleus
72 (*p)->getPosition(),
73 (*p)->getPropagationVelocity(),
74 n->getUniverseRadius()));
75 // Store the intersections
76 theIntersections.push_back(intersection);
77 if(intersection.exists) {
78 // Position the particle at the entry point
79 (*p)->setPosition(intersection.position);
80
81 // Keep track of the first entering particle
82 if(intersection.time < theFirstEntryTime) {
83 theFirstEntryTime = intersection.time;
84 theFirstID = (*p)->getID();
85 }
86 }
87 }
88
89 std::list<Intersection>::const_iterator intIter = theIntersections.begin();
90 for( ParticleIter p=projectiles.begin(); p!=projectiles.end(); ++p, ++intIter) {
91
92 if((*intIter).exists) {
93 // If the particle enters the nucleus, generate a ParticleEntryAvatar
94 // for it and add it to the list of avatars that we will return
95 if((*p)->getID() == theFirstID) {
96 // The first particle always enters exactly at t=0 (in order to
97 // avoid negative entry times due to rounding)
98 theAvatarList.push_back(new ParticleEntryAvatar(0.0, n, *p));
99 } else
100 theAvatarList.push_back(new ParticleEntryAvatar(intIter->time - theFirstEntryTime, n, *p));
101 }
102
103 }
104
105 return theAvatarList;
106 }
107
108}
Placeholder class for no Coulomb distortion.
Simple class for computing intersections between a straight line and a sphere.
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
ParticleList const & getParticles() const
ParticleEntryAvatar * bringToSurface(Particle *const p, Nucleus *const n) const
Position the particle on the surface of the nucleus.
static Intersection getEarlierTrajectoryIntersection(const ThreeVector &x0, const ThreeVector &p, const G4double r)
Compute the first intersection of a straight particle trajectory with a sphere.
ThreeVector getPropagationVelocity() const
Get the propagation velocity of the particle.
const G4INCL::ThreeVector & getPosition() const
virtual void setPosition(const G4INCL::ThreeVector &position)
std::list< IAvatar * > IAvatarList
std::list< G4INCL::Particle * > ParticleList
std::list< G4INCL::Particle * >::const_iterator ParticleIter
Intersection-point structure.