Import Geant4 9.3.0 source tree
This commit is contained in:
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4PolarizationHelper.cc,v 1.4 2007/11/01 17:30:25 schaelic Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4PolarizationHelper.cc,v 1.5 2009/11/12 12:57:15 schaelic Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// GEANT4 Class file
|
||||
//
|
||||
@@ -96,9 +96,9 @@ G4ThreeVector G4PolarizationHelper::GetSpinInPRF(const G4ThreeVector &uZ, const
|
||||
}
|
||||
|
||||
G4double perp = std::sqrt(sqr(uZ.x())+sqr(uZ.y()));
|
||||
G4double invPerp = uZ.z()/perp;
|
||||
G4double invPerp = 1./perp;
|
||||
|
||||
G4ThreeVector uX(uZ.x()*invPerp,uZ.y()*invPerp,-perp);
|
||||
G4ThreeVector uX(uZ.x()*uZ.z()*invPerp,uZ.y()*uZ.z()*invPerp,-perp);
|
||||
G4ThreeVector uY(-uZ.y()*invPerp,uZ.x()*invPerp,0);
|
||||
|
||||
return G4ThreeVector(spin*uX,spin*uY,spin*uZ);
|
||||
@@ -134,6 +134,8 @@ void G4PolarizationHelper::TestPolarizationTransformations()
|
||||
G4cout<<yAxis<<" "<<yAxis.mag()<<"\n";
|
||||
G4ThreeVector xAxis = yAxis.cross(zAxis);
|
||||
G4cout<<xAxis<<" "<<xAxis.mag()<<"\n\n";
|
||||
|
||||
G4cout<<"spat : "<<xAxis*yAxis.cross(zAxis)<<"\n\n";
|
||||
}
|
||||
G4cout<<"========================================\n\n";
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4PolarizedAnnihilationModel.cc,v 1.6 2007/07/10 09:38:17 schaelic Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4PolarizedAnnihilationModel.cc,v 1.9 2009/11/12 12:57:15 schaelic Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// -------------------------------------------------------------------
|
||||
//
|
||||
@@ -82,13 +82,7 @@ void G4PolarizedAnnihilationModel::Initialise(const G4ParticleDefinition*,
|
||||
{
|
||||
// G4eeToTwoGammaModel::Initialise(part,dv);
|
||||
if(gIsInitialised) return;
|
||||
|
||||
if(pParticleChange)
|
||||
gParticleChange =
|
||||
reinterpret_cast<G4ParticleChangeForGamma*>(pParticleChange);
|
||||
else
|
||||
gParticleChange = new G4ParticleChangeForGamma();
|
||||
|
||||
gParticleChange = GetParticleChangeForGamma();
|
||||
gIsInitialised = true;
|
||||
}
|
||||
|
||||
@@ -354,7 +348,7 @@ void G4PolarizedAnnihilationModel::SampleSecondaries(std::vector<G4DynamicPartic
|
||||
G4cout<<"ERROR: PolarizedAnnihilation Polarization Vector at epsil = "
|
||||
<<epsil<<" is too large!!! \n"
|
||||
<<"annihi pol1= "<<finalGamma1Polarization<<", ("<<n1<<")\n";
|
||||
finalGamma1Polarization+=1./std::sqrt(n1);
|
||||
finalGamma1Polarization*=1./std::sqrt(n1);
|
||||
}
|
||||
|
||||
// define polarization of first final state photon
|
||||
@@ -385,7 +379,7 @@ void G4PolarizedAnnihilationModel::SampleSecondaries(std::vector<G4DynamicPartic
|
||||
G4cout<<"ERROR: PolarizedAnnihilation Polarization Vector at epsil = "<<epsil<<" is too large!!! \n";
|
||||
G4cout<<"annihi pol2= "<<finalGamma2Polarization<<", ("<<n2<<")\n";
|
||||
|
||||
finalGamma2Polarization+=1./std::sqrt(n2);
|
||||
finalGamma2Polarization*=1./std::sqrt(n2);
|
||||
}
|
||||
finalGamma2Polarization.SetPhoton();
|
||||
finalGamma2Polarization.RotateAz(nInteractionFrame,Phot2Direction);
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4StokesVector.cc,v 1.3 2006/11/17 11:59:03 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4StokesVector.cc,v 1.4 2009/11/12 12:57:15 schaelic Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
//
|
||||
// GEANT4 Class file
|
||||
//
|
||||
@@ -96,7 +96,7 @@ void G4StokesVector::RotateAz(G4ThreeVector nInteractionFrame,
|
||||
// G4double hel=sgn(cross(yParticleFrame*nInteractionFrame)*zInteractionFrame);
|
||||
// Why not particleDirection instead of zInteractionFrame ???!!!
|
||||
// -> is the same, since SYSIN is called with p1, and p2 as first parameter!
|
||||
G4double hel=(cross(yParticleFrame*nInteractionFrame)*particleDirection)>0?1.:-1.;
|
||||
G4double hel=(yParticleFrame.cross(nInteractionFrame)*particleDirection)>0?1.:-1.;
|
||||
|
||||
G4double sinphi=hel*std::sqrt(1.-cosphi*cosphi);
|
||||
// G4cout<<" sin2 + cos2 -1 = "<<(sinphi*sinphi+cosphi*cosphi-1)<<"\n";
|
||||
@@ -124,7 +124,7 @@ void G4StokesVector::InvRotateAz(G4ThreeVector nInteractionFrame,
|
||||
else if (cosphi<-1)cosphi=-1.;
|
||||
|
||||
// check sign once more!
|
||||
G4double hel=(cross(yParticleFrame*nInteractionFrame)*particleDirection)>0?1.:-1.;
|
||||
G4double hel=(yParticleFrame.cross(nInteractionFrame)*particleDirection)>0?1.:-1.;
|
||||
G4double sinphi=hel*std::sqrt(std::fabs(1.-cosphi*cosphi));
|
||||
RotateAz(cosphi,-sinphi);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user