Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4INCLEventInfo.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 G4INCLEventInfo.cc
40 * \brief Simple container for output of event results.
41 *
42 * Contains the results of an INCL cascade.
43 *
44 * \date 21 January 2011
45 * \author Davide Mancusi
46 */
47
48#include "G4INCLEventInfo.hh"
49#include "G4INCLGlobals.hh"
51#include <cmath>
52
53namespace G4INCL {
54
56
57#ifdef INCL_INVERSE_KINEMATICS
58 void EventInfo::fillInverseKinematics(const Double_t gamma) {
59 const Double_t beta = std::sqrt(1.-1./(gamma*gamma));
60 for(Int_t i=0; i<nParticles; ++i) {
61 Double_t mass;
62 if(A[i]>0) {
63 mass = ParticleTable::getTableMass(A[i],Z[i]);
64 } else if(origin[i]==-1) { // cascade particles with A=0, must be pions
65 if(Z[i]==1)
67 else if(Z[i]==0)
69 else
71 } else // gamma rays
72 mass = 0.;
73
74 const Double_t ETot = EKin[i] + mass;
75 const Double_t ETotPrime = gamma*(ETot - beta*pz[i]);
76 /* Using the invariant mass here avoids negative kinetic energies with
77 * particles produced by the de-excitation models, which do not
78 * necessarily use the same mass look-up tables as INCL.
79 */
80 Double_t invariantMass;
81 if(A[i]>0 || origin[i]==-1) { // massive particles
82 invariantMass = std::sqrt(ETot*ETot - px[i]*px[i] - py[i]*py[i] - pz[i]*pz[i]);
83 } else { // gamma rays
84 invariantMass = 0.;
85 }
86 EKinPrime[i] = ETotPrime - invariantMass;
87 pzPrime[i] = -gamma*(pz[i] - beta*ETot);
88 const Double_t pPrime = std::sqrt(px[i]*px[i] + py[i]*py[i] + pzPrime[i]*pzPrime[i]);
89 const Double_t cosThetaPrime = pzPrime[i]/pPrime;
90 if(cosThetaPrime>=1.)
91 thetaPrime[i] = 0.;
92 else if(cosThetaPrime<=-1.)
93 thetaPrime[i] = 180.;
94 else
95 thetaPrime[i] = 180.*std::acos(cosThetaPrime)/Math::pi;
96 }
97 }
98#endif // INCL_INVERSE_KINEMATICS
99}
100
Simple container for output of event results.
static NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
static ParticleMassFn getTableParticleMass
Static pointer to the mass function for particles.
const G4double pi
G4int Int_t
G4double Double_t
Short_t origin[maxSizeParticles]
Origin of the particle.
static Int_t eventNumber
Number of the event.
Short_t A[maxSizeParticles]
Particle mass number.
Short_t Z[maxSizeParticles]
Particle charge number.
Float_t EKin[maxSizeParticles]
Particle kinetic energy [MeV].
Float_t px[maxSizeParticles]
Particle momentum, x component [MeV/c].
Int_t nParticles
Total number of emitted particles.
Float_t pz[maxSizeParticles]
Particle momentum, z component [MeV/c].
Float_t py[maxSizeParticles]
Particle momentum, y component [MeV/c].