775 for( i=0; i<4; ++i )pseudoParticle[i].set(0,0,0);
778 for( i=0; i<vecLen; ++i )
779 pseudoParticle[0] = pseudoParticle[0] + (vec[i]->GetMomentum());
785 G4double r1, r2, a1, ran1, ran2, xxh, exh, pxTemp, pyTemp, pzTemp;
789 a1 = std::sqrt(-2.0*
G4Log(r2));
790 ran1 = a1*std::sin(r1)*0.020*numberofFinalStateNucleons*
GeV;
791 ran2 = a1*std::cos(r1)*0.020*numberofFinalStateNucleons*
GeV;
794 pseudoParticle[0] = pseudoParticle[0]+fermir;
795 pseudoParticle[2] = temp;
796 pseudoParticle[3] = pseudoParticle[0];
798 pseudoParticle[1] = pseudoParticle[2].
cross(pseudoParticle[3]);
800 pseudoParticle[1] = pseudoParticle[1].
rotate(rotation, pseudoParticle[3]);
801 pseudoParticle[2] = pseudoParticle[3].
cross(pseudoParticle[1]);
802 for(
G4int ii=1; ii<=3; ii++)
804 p = pseudoParticle[ii].
mag();
808 pseudoParticle[ii]= pseudoParticle[ii] * (1./
p);
814 currentParticle.
SetMomentum( pxTemp, pyTemp, pzTemp );
819 targetParticle.
SetMomentum( pxTemp, pyTemp, pzTemp );
821 for( i=0; i<vecLen; ++i )
823 pxTemp = pseudoParticle[1].
dot(vec[i]->GetMomentum());
824 pyTemp = pseudoParticle[2].
dot(vec[i]->GetMomentum());
825 pzTemp = pseudoParticle[3].
dot(vec[i]->GetMomentum());
826 vec[i]->SetMomentum( pxTemp, pyTemp, pzTemp );
832 Defs1( modifiedOriginal, currentParticle, targetParticle, vec, vecLen );
837 if( atomicWeight >= 1.5 )
841 const G4double alem[] = { 1.40, 2.30, 2.70, 3.00, 3.40, 4.60, 7.00 };
842 const G4double val0[] = { 0.00, 0.40, 0.48, 0.51, 0.54, 0.60, 0.65 };
845 if( alekw > alem[0] )
848 for(
G4int j=1; j<7; ++j )
850 if( alekw < alem[j] )
852 G4double rcnve = (val0[j] - val0[j-1]) / (alem[j] - alem[j-1]);
853 exh = rcnve * alekw + val0[j-1] - rcnve * alem[j-1];
859 const G4double cfa = 0.025*((atomicWeight-1.)/120.)*
G4Exp(-(atomicWeight-1.)/120.);
867 dekin += ekin*(1.0-xxh);
876 if( pp1 < 0.001*
MeV )
879 G4double sintheta = std::sqrt(1. - costheta*costheta);
882 pp*sintheta*std::sin(phi)*MeV,
894 dekin += ekin*(1.0-xxh);
903 if( pp1 < 0.001*MeV )
906 G4double sintheta = std::sqrt(1. - costheta*costheta);
908 targetParticle.
SetMomentum( pp*sintheta*std::cos(phi)*MeV,
909 pp*sintheta*std::sin(phi)*MeV,
914 for( i=0; i<vecLen; ++i )
916 ekin = vec[i]->GetKineticEnergy()/GeV - cfa*(1+
normal()/2.0);
921 vec[i]->GetDefinition() == aPiZero &&
923 dekin += ekin*(1.0-xxh);
925 if (vec[i]->GetDefinition()->GetParticleSubType() ==
"pi") {
929 vec[i]->SetKineticEnergy( ekin*GeV );
930 pp = vec[i]->GetTotalMomentum()/
MeV;
931 pp1 = vec[i]->GetMomentum().mag()/
MeV;
932 if( pp1 < 0.001*MeV )
935 G4double sintheta = std::sqrt(1. - costheta*costheta);
937 vec[i]->SetMomentum( pp*sintheta*std::cos(phi)*MeV,
938 pp*sintheta*std::sin(phi)*MeV,
942 vec[i]->SetMomentum( vec[i]->GetMomentum() * (pp/pp1) );
945 if( (ek1 != 0.0) && (npions > 0) )
947 dekin = 1.0 + dekin/ek1;
960 G4double sintheta = std::sqrt(1. - costheta*costheta);
962 currentParticle.
SetMomentum( pp*sintheta*std::cos(phi)*MeV,
963 pp*sintheta*std::sin(phi)*MeV,
979 G4double sintheta = std::sqrt(1. - costheta*costheta);
981 targetParticle.
SetMomentum( pp*sintheta*std::cos(phi)*MeV,
982 pp*sintheta*std::sin(phi)*MeV,
989 for( i=0; i<vecLen; ++i )
991 if (vec[i]->GetDefinition()->GetParticleSubType() ==
"pi")
993 vec[i]->SetKineticEnergy(
std::max( 0.001*MeV, dekin*vec[i]->GetKineticEnergy() ) );
994 pp = vec[i]->GetTotalMomentum()/
MeV;
995 pp1 = vec[i]->GetMomentum().mag()/
MeV;
999 G4double sintheta = std::sqrt(1. - costheta*costheta);
1001 vec[i]->SetMomentum( pp*sintheta*std::cos(phi)*MeV,
1002 pp*sintheta*std::sin(phi)*MeV,
1005 vec[i]->SetMomentum( vec[i]->GetMomentum() * (pp/pp1) );
G4double GetTotalMomentum() const
void Defs1(const G4ReactionProduct &modifiedOriginal, G4ReactionProduct ¤tParticle, G4ReactionProduct &targetParticle, G4FastVector< G4ReactionProduct, 256 > &vec, G4int &vecLen)
CLHEP::Hep3Vector G4ThreeVector
double dot(const Hep3Vector &) const
void SetKineticEnergy(const G4double en)
void SetMomentum(const G4double x, const G4double y, const G4double z)
const G4String & GetParticleSubType() const
static constexpr double twopi
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
static G4PionPlus * PionPlus()
static G4PionZero * PionZero()
G4double GetKineticEnergy() const
G4double G4Log(G4double x)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
T max(const T t1, const T t2)
brief Return the largest of the two arguments
static G4PionMinus * PionMinus()
static constexpr double GeV
G4ThreeVector GetMomentum() const
static constexpr double MeV
static constexpr double pi
Hep3Vector cross(const Hep3Vector &) const
Hep3Vector & rotate(double, const Hep3Vector &)