00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #define INCLXX_IN_GEANT4_MODE 1
00034
00035 #include "globals.hh"
00036
00046 #include "G4INCLEventInfo.hh"
00047 #include "G4INCLGlobals.hh"
00048 #include "G4INCLParticleTable.hh"
00049 #include <cmath>
00050
00051 namespace G4INCL {
00052
00053 Int_t EventInfo::eventNumber = 0;
00054
00055 #ifdef INCL_INVERSE_KINEMATICS
00056 void EventInfo::fillInverseKinematics(const Double_t gamma) {
00057 const Double_t beta = std::sqrt(1.-1./(gamma*gamma));
00058 for(Int_t i=0; i<nParticles; ++i) {
00059 Double_t mass;
00060 if(A[i]>0) {
00061 mass = ParticleTable::getTableMass(A[i],Z[i]);
00062 } else if(origin[i]==-1) {
00063 if(Z[i]==1)
00064 mass = ParticleTable::getTableParticleMass(PiPlus);
00065 else if(Z[i]==0)
00066 mass = ParticleTable::getTableParticleMass(PiZero);
00067 else
00068 mass = ParticleTable::getTableParticleMass(PiMinus);
00069 } else
00070 mass = 0.;
00071
00072 const Double_t ETot = EKin[i] + mass;
00073 const Double_t ETotPrime = gamma*(ETot - beta*pz[i]);
00074
00075
00076
00077
00078 Double_t invariantMass;
00079 if(A[i]>0 || origin[i]==-1) {
00080 invariantMass = std::sqrt(ETot*ETot - px[i]*px[i] - py[i]*py[i] - pz[i]*pz[i]);
00081 } else {
00082 invariantMass = 0.;
00083 }
00084 EKinPrime[i] = ETotPrime - invariantMass;
00085 pzPrime[i] = -gamma*(pz[i] - beta*ETot);
00086 const Double_t pPrime = std::sqrt(px[i]*px[i] + py[i]*py[i] + pzPrime[i]*pzPrime[i]);
00087 const Double_t cosThetaPrime = pzPrime[i]/pPrime;
00088 if(cosThetaPrime>=1.)
00089 thetaPrime[i] = 0.;
00090 else if(cosThetaPrime<=-1.)
00091 thetaPrime[i] = 180.;
00092 else
00093 thetaPrime[i] = 180.*std::acos(cosThetaPrime)/Math::pi;
00094 }
00095 }
00096 #endif // INCL_INVERSE_KINEMATICS
00097 }
00098