Import Geant4 10.0.0 source tree
This commit is contained in:
+1285
-1422
File diff suppressed because it is too large
Load Diff
+12
-54
@@ -23,71 +23,29 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
#include "G4DiffractiveHHScatterer.hh"
|
||||
#include "G4DiffractiveExcitation.hh"
|
||||
#include "G4ExcitedString.hh"
|
||||
#include "G4LundStringFragmentation.hh"
|
||||
#include "G4KineticTrack.hh"
|
||||
#include "G4DiffractiveSplitableHadron.hh"
|
||||
#include "G4FTFParameters.hh" // Uzhi 21.04.08
|
||||
#include "G4FTFParameters.hh"
|
||||
|
||||
G4DiffractiveHHScatterer::G4DiffractiveHHScatterer()
|
||||
:
|
||||
theExcitation(new G4DiffractiveExcitation()),
|
||||
theStringFragmentation(new G4LundStringFragmentation())
|
||||
|
||||
//============================================================================
|
||||
|
||||
G4DiffractiveHHScatterer::G4DiffractiveHHScatterer() :
|
||||
theExcitation( new G4DiffractiveExcitation() ),
|
||||
theStringFragmentation( new G4LundStringFragmentation() )
|
||||
{}
|
||||
|
||||
G4DiffractiveHHScatterer::~G4DiffractiveHHScatterer()
|
||||
{}
|
||||
|
||||
void G4DiffractiveHHScatterer::CreateStrings()
|
||||
/*
|
||||
G4VSplitableHadron * aHadron,
|
||||
G4bool isProjectile,
|
||||
G4ExcitedString * FirstString,
|
||||
G4ExcitedString * SecondString,
|
||||
G4FTFParameters *theParameters)
|
||||
*/
|
||||
const
|
||||
//============================================================================
|
||||
|
||||
{}
|
||||
G4DiffractiveHHScatterer::~G4DiffractiveHHScatterer() {}
|
||||
|
||||
/* -------------------------------------------------------------------
|
||||
G4KineticTrackVector * G4DiffractiveHHScatterer::
|
||||
Scatter(const G4KineticTrack & aTrack, const G4KineticTrack & bTrack)
|
||||
{
|
||||
G4KineticTrackVector * result = new G4KineticTrackVector();
|
||||
|
||||
G4DiffractiveSplitableHadron aHadron(& aTrack);
|
||||
G4DiffractiveSplitableHadron bHadron(& bTrack);
|
||||
theParameters = new G4FTFParameters(aHadron.GetDefinition(), // -------- Uzhi 21.04.08
|
||||
1.,1., 100.);
|
||||
//s);// ------------------------- Uzhi 21.04.08
|
||||
if ( ! theExcitation->ExciteParticipants(& aHadron,
|
||||
& bHadron,
|
||||
theParameters)) // -------- Uzhi 21.04.08
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
G4ExcitedString * string;
|
||||
G4KineticTrackVector * fragments=NULL;
|
||||
//============================================================================
|
||||
|
||||
string = theExcitation->String(& aHadron, true); // Projectile
|
||||
fragments=theStringFragmentation->FragmentString(*string);
|
||||
for (unsigned int aFragment=0; aFragment < fragments->size(); aFragment++)
|
||||
{
|
||||
result->push_back(fragments->operator[](aFragment));
|
||||
}
|
||||
|
||||
string = theExcitation->String(& bHadron, false); // Target
|
||||
fragments=theStringFragmentation->FragmentString(*string);
|
||||
for (unsigned int bFragment=0; bFragment < fragments->size(); bFragment++)
|
||||
{
|
||||
result->push_back(fragments->operator[](bFragment));
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
*/
|
||||
void G4DiffractiveHHScatterer::CreateStrings() const {}
|
||||
|
||||
+156
-163
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4DiffractiveSplitableHadron.cc 74627 2013-10-17 07:04:38Z gcosmo $
|
||||
// GEANT4 tag $Name: $
|
||||
//
|
||||
|
||||
@@ -41,185 +41,178 @@
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
G4DiffractiveSplitableHadron::G4DiffractiveSplitableHadron()
|
||||
|
||||
{
|
||||
PartonIndex=-1;
|
||||
Parton[0] = new G4Parton(1);
|
||||
Parton[1] = new G4Parton(-1);
|
||||
}
|
||||
//============================================================================
|
||||
|
||||
G4DiffractiveSplitableHadron::G4DiffractiveSplitableHadron(const G4ReactionProduct & aPrimary)
|
||||
: G4VSplitableHadron(aPrimary)
|
||||
{
|
||||
PartonIndex=-2;
|
||||
Parton[0]=NULL;
|
||||
}
|
||||
|
||||
G4DiffractiveSplitableHadron::G4DiffractiveSplitableHadron(const G4Nucleon & aNucleon)
|
||||
: G4VSplitableHadron(aNucleon)
|
||||
{
|
||||
PartonIndex=-2;
|
||||
Parton[0]=NULL;
|
||||
}
|
||||
|
||||
G4DiffractiveSplitableHadron::G4DiffractiveSplitableHadron(const G4VKineticNucleon * aNucleon)
|
||||
: G4VSplitableHadron(aNucleon)
|
||||
{
|
||||
PartonIndex=-2;
|
||||
Parton[0]=NULL;
|
||||
}
|
||||
|
||||
G4DiffractiveSplitableHadron::~G4DiffractiveSplitableHadron()
|
||||
{
|
||||
//G4cout<<"Destruct G4DiffractiveSplitableHadron"<<Parton[0]<<" "<<Parton[1]<<G4endl;
|
||||
// if(Parton[0] != NULL){delete Parton[0]; delete Parton[1];}
|
||||
G4DiffractiveSplitableHadron::G4DiffractiveSplitableHadron() {
|
||||
PartonIndex = -1;
|
||||
Parton[0] = new G4Parton( 1 );
|
||||
Parton[1] = new G4Parton(-1 );
|
||||
}
|
||||
|
||||
|
||||
void G4DiffractiveSplitableHadron::SplitUp()
|
||||
//============================================================================
|
||||
|
||||
G4DiffractiveSplitableHadron::G4DiffractiveSplitableHadron( const G4ReactionProduct& aPrimary ) :
|
||||
G4VSplitableHadron( aPrimary )
|
||||
{
|
||||
//G4cout<<"SplitUp() IsSplit() Parton[0] "<<IsSplit()<<" "<<Parton[0]<<G4endl;
|
||||
if (IsSplit()) return;
|
||||
PartonIndex = -2;
|
||||
Parton[0] = NULL;
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
||||
G4DiffractiveSplitableHadron::G4DiffractiveSplitableHadron( const G4Nucleon& aNucleon ) :
|
||||
G4VSplitableHadron( aNucleon )
|
||||
{
|
||||
PartonIndex = -2;
|
||||
Parton[0] = NULL;
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
||||
G4DiffractiveSplitableHadron::G4DiffractiveSplitableHadron( const G4VKineticNucleon* aNucleon ) :
|
||||
G4VSplitableHadron( aNucleon )
|
||||
{
|
||||
PartonIndex = -2;
|
||||
Parton[0] = NULL;
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
||||
G4DiffractiveSplitableHadron::~G4DiffractiveSplitableHadron() {
|
||||
//G4cout << "Destruct G4DiffractiveSplitableHadron" << Parton[0] << " " << Parton[1] << G4endl;
|
||||
//if ( Parton[0] != NULL ) { delete Parton[0]; delete Parton[1]; }
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
||||
void G4DiffractiveSplitableHadron::SplitUp() {
|
||||
//G4cout << "SplitUp() IsSplit() Parton[0] " << IsSplit() << " " << Parton[0] << G4endl;
|
||||
if ( IsSplit() ) return;
|
||||
Splitting();
|
||||
// Split once only...
|
||||
if (Parton[0] != NULL) return;
|
||||
// Split once only...
|
||||
if ( Parton[0] != NULL ) return;
|
||||
|
||||
// flavours of quark ends
|
||||
|
||||
G4int PDGcode=GetDefinition()->GetPDGEncoding();
|
||||
// flavours of quark ends
|
||||
G4int PDGcode = GetDefinition()->GetPDGEncoding();
|
||||
G4int stringStart, stringEnd;
|
||||
ChooseStringEnds( PDGcode, &stringStart, &stringEnd );
|
||||
|
||||
G4int stringStart, stringEnd;
|
||||
ChooseStringEnds(PDGcode, &stringStart,&stringEnd);
|
||||
|
||||
Parton[0] = new G4Parton(stringStart);
|
||||
Parton[1] = new G4Parton(stringEnd);
|
||||
PartonIndex=-1;
|
||||
Parton[0] = new G4Parton( stringStart );
|
||||
Parton[1] = new G4Parton( stringEnd );
|
||||
PartonIndex = -1;
|
||||
}
|
||||
|
||||
G4Parton * G4DiffractiveSplitableHadron::GetNextParton()
|
||||
{
|
||||
++PartonIndex;
|
||||
if ( PartonIndex > 1 || PartonIndex < 0 ) return NULL;
|
||||
G4int PartonInd(PartonIndex); // Vova
|
||||
if(PartonIndex == 1) PartonIndex=-1; // Vova
|
||||
return Parton[PartonInd];
|
||||
// return Parton[PartonIndex];
|
||||
|
||||
//============================================================================
|
||||
|
||||
G4Parton* G4DiffractiveSplitableHadron::GetNextParton() {
|
||||
++PartonIndex;
|
||||
if ( PartonIndex > 1 || PartonIndex < 0 ) return NULL;
|
||||
G4int PartonInd( PartonIndex );
|
||||
if ( PartonIndex == 1 ) PartonIndex = -1;
|
||||
return Parton[ PartonInd ];
|
||||
}
|
||||
|
||||
G4Parton * G4DiffractiveSplitableHadron::GetNextAntiParton()
|
||||
{
|
||||
++PartonIndex; // Uzhi 22.11.10
|
||||
if ( PartonIndex > 1 || PartonIndex < 0 ) return NULL;
|
||||
G4int PartonInd(PartonIndex);
|
||||
if(PartonIndex == 1) PartonIndex=-1;
|
||||
return Parton[PartonInd];
|
||||
// return NULL; // to be looked at @@
|
||||
|
||||
//============================================================================
|
||||
|
||||
G4Parton* G4DiffractiveSplitableHadron::GetNextAntiParton() {
|
||||
++PartonIndex;
|
||||
if ( PartonIndex > 1 || PartonIndex < 0 ) return NULL;
|
||||
G4int PartonInd( PartonIndex );
|
||||
if ( PartonIndex == 1 ) PartonIndex = -1;
|
||||
return Parton[ PartonInd ];
|
||||
}
|
||||
|
||||
void G4DiffractiveSplitableHadron::SetFirstParton(G4int PDGcode)// Uzhi 24.11.10
|
||||
{
|
||||
delete Parton[0];
|
||||
Parton[0]=new G4Parton(PDGcode);
|
||||
|
||||
//============================================================================
|
||||
|
||||
void G4DiffractiveSplitableHadron::SetFirstParton( G4int PDGcode ) {
|
||||
delete Parton[0];
|
||||
Parton[0] = new G4Parton( PDGcode );
|
||||
}
|
||||
|
||||
void G4DiffractiveSplitableHadron::SetSecondParton(G4int PDGcode)// Uzhi 24.11.10
|
||||
{
|
||||
delete Parton[1];
|
||||
Parton[1]=new G4Parton(PDGcode);
|
||||
}
|
||||
//
|
||||
//----------------------- Implementation--------------------------
|
||||
//
|
||||
void G4DiffractiveSplitableHadron::ChooseStringEnds(G4int PDGcode,G4int * aEnd, G4int * bEnd) const
|
||||
{
|
||||
const G4double udspin1= 1./6.;
|
||||
const G4double uuspin1= 1./3.;
|
||||
// const G4double udspin0= 1./2.; //@
|
||||
|
||||
G4int absPDGcode=std::abs(PDGcode);
|
||||
|
||||
if ( absPDGcode < 1000 ) //-------------------- Meson -------------
|
||||
{
|
||||
G4int heavy= absPDGcode/ 100;
|
||||
G4int light= (absPDGcode %100)/10;
|
||||
|
||||
// G4int anti= std::pow(-1 , std::max( heavy, light));
|
||||
G4int anti= 1 -2 * ( std::max( heavy, light ) % 2 );
|
||||
if (PDGcode < 0 ) anti *=-1;
|
||||
|
||||
heavy *= anti;
|
||||
light *= -1 * anti;
|
||||
|
||||
if ( G4UniformRand() < 0.5 )
|
||||
{
|
||||
*aEnd=heavy;
|
||||
*bEnd=light;
|
||||
}
|
||||
else
|
||||
{
|
||||
*aEnd=light;
|
||||
*bEnd=heavy;
|
||||
}
|
||||
}
|
||||
else //-------------------- Barion --------------
|
||||
{
|
||||
G4int j1000 = PDGcode/ 1000;
|
||||
G4int j100 = (PDGcode % 1000) / 100;
|
||||
G4int j10 = (PDGcode % 100) / 10;
|
||||
|
||||
G4double random= G4UniformRand();
|
||||
|
||||
|
||||
if ( std::abs(j100) >= std::abs(j10) )
|
||||
{
|
||||
if ( random < udspin1 )
|
||||
{
|
||||
*aEnd=j1000;
|
||||
*bEnd= Diquark( j100, j10, 1);
|
||||
} else if ( random < (udspin1 + uuspin1) )
|
||||
{
|
||||
*aEnd= j10;
|
||||
*bEnd= Diquark( j1000, j100, 1);
|
||||
} else
|
||||
{
|
||||
*aEnd=j100;
|
||||
// Careful, there is no diquark q1=q2, (q1 q2)0,
|
||||
// possible for Omega-
|
||||
*bEnd= Diquark( j1000, j10, j1000 != j100 ? 0 : 1);
|
||||
}
|
||||
} else
|
||||
{
|
||||
// Lambda-like hadrons have two lightest quarks in spin 0
|
||||
if ( random < udspin1 )
|
||||
{
|
||||
*aEnd=j1000;
|
||||
// as above, but with charmed barions
|
||||
*bEnd= Diquark( j100, j10, j100 != j10 ? 0 : 10);
|
||||
} else if ( random < (udspin1 + uuspin1) )
|
||||
{
|
||||
*aEnd= j10;
|
||||
*bEnd= Diquark( j1000, j100, 1);
|
||||
} else
|
||||
{
|
||||
*aEnd=j100;
|
||||
*bEnd= Diquark( j1000, j10, 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
||||
void G4DiffractiveSplitableHadron::SetSecondParton( G4int PDGcode ) {
|
||||
delete Parton[1];
|
||||
Parton[1] = new G4Parton( PDGcode );
|
||||
}
|
||||
|
||||
G4int G4DiffractiveSplitableHadron::Diquark(G4int aquark,G4int bquark,G4int Spin) const
|
||||
{
|
||||
G4int diquarkPDG;
|
||||
|
||||
diquarkPDG = std::max( std::abs(aquark), std::abs(bquark) )*1000 +
|
||||
std::min( std::abs(aquark), std::abs(bquark) )*100 +
|
||||
2*Spin + 1;
|
||||
return ( aquark > 0 && bquark > 0 ) ? diquarkPDG : -1*diquarkPDG;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
||||
void G4DiffractiveSplitableHadron::ChooseStringEnds( G4int PDGcode, G4int* aEnd,
|
||||
G4int* bEnd ) const {
|
||||
const G4double udspin1 = 1.0/6.0;
|
||||
const G4double uuspin1 = 1.0/3.0;
|
||||
//const G4double udspin0 = 1.0/2.0;
|
||||
|
||||
G4int absPDGcode = std::abs( PDGcode );
|
||||
|
||||
if ( absPDGcode < 1000 ) { //-------------------- Meson -------------
|
||||
G4int heavy = absPDGcode/100;
|
||||
G4int light = (absPDGcode % 100)/10;
|
||||
//G4int anti = std::pow( -1 , std::max( heavy, light ) );
|
||||
G4int anti = 1 - 2*( std::max( heavy, light ) % 2 );
|
||||
if (PDGcode < 0 ) anti *= -1;
|
||||
heavy *= anti;
|
||||
light *= -1 * anti;
|
||||
if ( G4UniformRand() < 0.5 ) {
|
||||
*aEnd = heavy;
|
||||
*bEnd = light;
|
||||
} else {
|
||||
*aEnd = light;
|
||||
*bEnd = heavy;
|
||||
}
|
||||
} else { //-------------------- Baryon --------------
|
||||
G4int j1000 = PDGcode/1000;
|
||||
G4int j100 = (PDGcode % 1000)/100;
|
||||
G4int j10 = (PDGcode % 100)/10;
|
||||
G4double random = G4UniformRand();
|
||||
if ( std::abs( j100 ) >= std::abs( j10 ) ) {
|
||||
if ( random < udspin1 ) {
|
||||
*aEnd = j1000;
|
||||
*bEnd = Diquark( j100, j10, 1 );
|
||||
} else if ( random < udspin1 + uuspin1 ) {
|
||||
*aEnd = j10;
|
||||
*bEnd = Diquark( j1000, j100, 1 );
|
||||
} else {
|
||||
*aEnd = j100;
|
||||
// Careful, there is no diquark q1=q2, (q1 q2)0, possible for Omega-
|
||||
*bEnd = Diquark( j1000, j10, j1000 != j100 ? 0 : 1 );
|
||||
}
|
||||
} else {
|
||||
// Lambda-like hadrons have two lightest quarks in spin 0
|
||||
if ( random < udspin1 ) {
|
||||
*aEnd = j1000;
|
||||
// as above, but with charmed baryons
|
||||
*bEnd = Diquark( j100, j10, j100 != j10 ? 0 : 10 );
|
||||
} else if ( random < udspin1 + uuspin1 ) {
|
||||
*aEnd = j10;
|
||||
*bEnd = Diquark( j1000, j100, 1 );
|
||||
} else {
|
||||
*aEnd = j100;
|
||||
*bEnd = Diquark( j1000, j10, 1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
||||
G4int G4DiffractiveSplitableHadron::Diquark( G4int aquark, G4int bquark, G4int Spin) const {
|
||||
G4int diquarkPDG = std::max( std::abs( aquark ), std::abs( bquark ) ) * 1000 +
|
||||
std::min( std::abs( aquark ), std::abs( bquark ) ) * 100 +
|
||||
2*Spin + 1;
|
||||
return ( aquark > 0 && bquark > 0 ) ? diquarkPDG : -1*diquarkPDG;
|
||||
}
|
||||
|
||||
+155
-194
@@ -24,18 +24,19 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4ElasticHNScattering.cc 74627 2013-10-17 07:04:38Z gcosmo $
|
||||
//
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class implemetation file
|
||||
//
|
||||
// ---------------- G4ElasticHNScattering --------------
|
||||
// by V. Uzhinsky, March 2008.
|
||||
// elastic scattering used by Fritiof model
|
||||
// Take a projectile and a target
|
||||
// scatter the projectile and target
|
||||
// Take a projectile and a target
|
||||
// scatter the projectile and target
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
|
||||
#include "globals.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4PhysicalConstants.hh"
|
||||
@@ -49,233 +50,193 @@
|
||||
#include "G4FTFParameters.hh"
|
||||
//#include "G4ios.hh"
|
||||
|
||||
G4ElasticHNScattering::G4ElasticHNScattering()
|
||||
{
|
||||
}
|
||||
|
||||
G4bool G4ElasticHNScattering::
|
||||
ElasticScattering (G4VSplitableHadron *projectile,
|
||||
G4VSplitableHadron *target,
|
||||
G4FTFParameters *theParameters) const
|
||||
{
|
||||
// -------------------- Projectile parameters -----------------------------------
|
||||
G4LorentzVector Pprojectile=projectile->Get4Momentum();
|
||||
//============================================================================
|
||||
|
||||
if(Pprojectile.z() < 0.)
|
||||
{
|
||||
target->SetStatus(2);
|
||||
return false;
|
||||
}
|
||||
G4ElasticHNScattering::G4ElasticHNScattering() {}
|
||||
|
||||
G4bool PutOnMassShell(false);
|
||||
|
||||
G4double M0projectile = Pprojectile.mag();
|
||||
if(M0projectile < projectile->GetDefinition()->GetPDGMass())
|
||||
{
|
||||
PutOnMassShell=true;
|
||||
M0projectile=projectile->GetDefinition()->GetPDGMass();
|
||||
}
|
||||
//============================================================================
|
||||
|
||||
G4double Mprojectile2 = M0projectile * M0projectile;
|
||||
G4bool G4ElasticHNScattering::ElasticScattering( G4VSplitableHadron* projectile,
|
||||
G4VSplitableHadron* target,
|
||||
G4FTFParameters* theParameters ) const {
|
||||
projectile->IncrementCollisionCount( 1 );
|
||||
target->IncrementCollisionCount( 1 );
|
||||
|
||||
G4double AveragePt2=theParameters->GetAvaragePt2ofElasticScattering();
|
||||
// Projectile parameters
|
||||
G4LorentzVector Pprojectile = projectile->Get4Momentum();
|
||||
if ( Pprojectile.z() < 0.0 ) return false;
|
||||
G4bool PutOnMassShell( false );
|
||||
G4double M0projectile = Pprojectile.mag();
|
||||
if ( M0projectile < projectile->GetDefinition()->GetPDGMass() ) {
|
||||
PutOnMassShell = true;
|
||||
M0projectile = projectile->GetDefinition()->GetPDGMass();
|
||||
}
|
||||
G4double M0projectile2 = M0projectile * M0projectile;
|
||||
G4double AveragePt2 = theParameters->GetAvaragePt2ofElasticScattering();
|
||||
|
||||
// -------------------- Target parameters ----------------------------------------------
|
||||
// Target parameters
|
||||
G4LorentzVector Ptarget = target->Get4Momentum();
|
||||
G4double M0target = Ptarget.mag();
|
||||
if ( M0target < target->GetDefinition()->GetPDGMass() ) {
|
||||
PutOnMassShell = true;
|
||||
M0target = target->GetDefinition()->GetPDGMass();
|
||||
}
|
||||
G4double M0target2 = M0target * M0target;
|
||||
|
||||
G4LorentzVector Ptarget=target->Get4Momentum();
|
||||
// Transform momenta to cms and then rotate parallel to z axis;
|
||||
G4LorentzVector Psum;
|
||||
Psum = Pprojectile + Ptarget;
|
||||
G4LorentzRotation toCms( -1*Psum.boostVector() );
|
||||
G4LorentzVector Ptmp = toCms*Pprojectile;
|
||||
if ( Ptmp.pz() <= 0.0 ) return false;
|
||||
// "String" moving backwards in CMS, abort collision !
|
||||
//G4cout << " abort Collision! " << G4endl;
|
||||
toCms.rotateZ( -1*Ptmp.phi() );
|
||||
toCms.rotateY( -1*Ptmp.theta() );
|
||||
G4LorentzRotation toLab( toCms.inverse() );
|
||||
Pprojectile.transform( toCms );
|
||||
Ptarget.transform( toCms );
|
||||
|
||||
G4double M0target = Ptarget.mag();
|
||||
// Putting on mass-on-shell, if needed
|
||||
G4double PZcms2, PZcms;
|
||||
G4double S = Psum.mag2();
|
||||
G4double SqrtS = std::sqrt( S );
|
||||
if ( SqrtS < M0projectile + M0target ) return false;
|
||||
|
||||
if(M0target < target->GetDefinition()->GetPDGMass())
|
||||
{
|
||||
PutOnMassShell=true;
|
||||
M0target=target->GetDefinition()->GetPDGMass();
|
||||
}
|
||||
|
||||
G4double Mtarget2 = M0target * M0target;
|
||||
PZcms2 = ( S*S + sqr( M0projectile2 ) + sqr( M0target2 )
|
||||
- 2*S*M0projectile2 - 2*S*M0target2 - 2*M0projectile2*M0target2 ) / 4.0 / S;
|
||||
|
||||
// Transform momenta to cms and then rotate parallel to z axis;
|
||||
if ( PZcms2 < 0.0 ) { // It can be in an interaction with off-shell nuclear nucleon
|
||||
if ( M0projectile > projectile->GetDefinition()->GetPDGMass() ) {
|
||||
// An attempt to de-excite the projectile
|
||||
// It is assumed that the target is in the ground state
|
||||
M0projectile = projectile->GetDefinition()->GetPDGMass();
|
||||
M0projectile2 = M0projectile * M0projectile;
|
||||
PZcms2= ( S*S + sqr( M0projectile2 ) + sqr( M0target2 )
|
||||
- 2*S*M0projectile2 - 2*S*M0target2 - 2*M0projectile2*M0target2 ) / 4.0 / S;
|
||||
if ( PZcms2 < 0.0 ) { return false; } // Nonsuccesful attempt to de-excitate the projectile
|
||||
} else {
|
||||
return false; // The projectile was not excited, but the energy was too low to put
|
||||
// the target nucleon on mass-shell
|
||||
}
|
||||
}
|
||||
|
||||
G4LorentzVector Psum;
|
||||
Psum=Pprojectile+Ptarget;
|
||||
PZcms = std::sqrt( PZcms2 );
|
||||
|
||||
G4LorentzRotation toCms(-1*Psum.boostVector());
|
||||
if ( PutOnMassShell ) {
|
||||
if ( Pprojectile.z() > 0.0 ) {
|
||||
Pprojectile.setPz( PZcms );
|
||||
Ptarget.setPz( -PZcms );
|
||||
} else {
|
||||
Pprojectile.setPz( -PZcms );
|
||||
Ptarget.setPz( PZcms );
|
||||
};
|
||||
Pprojectile.setE( std::sqrt( M0projectile2 + Pprojectile.x() * Pprojectile.x() +
|
||||
Pprojectile.y() * Pprojectile.y() + PZcms2 ) );
|
||||
Ptarget.setE( std::sqrt( M0target2 + Ptarget.x() * Ptarget.x() + Ptarget.y() * Ptarget.y() +
|
||||
PZcms2 ) );
|
||||
}
|
||||
|
||||
G4LorentzVector Ptmp=toCms*Pprojectile;
|
||||
G4double maxPtSquare = PZcms2;
|
||||
|
||||
if ( Ptmp.pz() <= 0. )
|
||||
{
|
||||
// "String" moving backwards in CMS, abort collision !!
|
||||
//G4cout << " abort Collision!! " << G4endl;
|
||||
target->SetStatus(2);
|
||||
return false;
|
||||
}
|
||||
|
||||
toCms.rotateZ(-1*Ptmp.phi());
|
||||
toCms.rotateY(-1*Ptmp.theta());
|
||||
|
||||
G4LorentzRotation toLab(toCms.inverse());
|
||||
// Now we can calculate the transferred Pt
|
||||
G4double Pt2;
|
||||
G4double ProjMassT2, ProjMassT;
|
||||
G4double TargMassT2, TargMassT;
|
||||
G4LorentzVector Qmomentum;
|
||||
|
||||
Pprojectile.transform(toCms);
|
||||
Ptarget.transform(toCms);
|
||||
do {
|
||||
Qmomentum = G4LorentzVector( GaussianPt( AveragePt2, maxPtSquare ), 0.0 );
|
||||
Pt2 = G4ThreeVector( Qmomentum.vect() ).mag2();
|
||||
ProjMassT2 = M0projectile2 + Pt2;
|
||||
ProjMassT = std::sqrt( ProjMassT2 );
|
||||
TargMassT2 = M0target2 + Pt2;
|
||||
TargMassT = std::sqrt( TargMassT2 );
|
||||
} while ( SqrtS < ProjMassT + TargMassT );
|
||||
|
||||
// ---------------------- Putting on mass-on-shell, if needed ------------------------
|
||||
G4double PZcms2, PZcms;
|
||||
PZcms2 = ( S*S + sqr( ProjMassT2 ) + sqr( TargMassT2 )
|
||||
- 2.0*S*ProjMassT2 - 2.0*S*TargMassT2 - 2.0*ProjMassT2*TargMassT2 ) / 4.0 / S;
|
||||
|
||||
G4double S=Psum.mag2();
|
||||
// G4double SqrtS=std::sqrt(S);
|
||||
if ( PZcms2 < 0.0 ) { PZcms2 = 0.0; }; // to avoid the exactness problem
|
||||
PZcms = std::sqrt( PZcms2 );
|
||||
Pprojectile.setPz( PZcms );
|
||||
Ptarget.setPz( -PZcms );
|
||||
Pprojectile += Qmomentum;
|
||||
Ptarget -= Qmomentum;
|
||||
|
||||
PZcms2=(S*S+Mprojectile2*Mprojectile2+Mtarget2*Mtarget2-
|
||||
2*S*Mprojectile2-2*S*Mtarget2-2*Mprojectile2*Mtarget2)/4./S;
|
||||
// Transform back and update SplitableHadron Participant.
|
||||
Pprojectile.transform( toLab );
|
||||
Ptarget.transform( toLab );
|
||||
|
||||
if(PZcms2 < 0.)
|
||||
{ // It can be in an interaction with off-shell nuclear nucleon
|
||||
if(M0projectile > projectile->GetDefinition()->GetPDGMass())
|
||||
{ // An attempt to de-excite the projectile
|
||||
// It is assumed that the target is in the ground state
|
||||
M0projectile = projectile->GetDefinition()->GetPDGMass();
|
||||
Mprojectile2=M0projectile*M0projectile;
|
||||
PZcms2=(S*S+Mprojectile2*Mprojectile2+Mtarget2*Mtarget2-
|
||||
2*S*Mprojectile2 - 2*S*Mtarget2 - 2*Mprojectile2*Mtarget2)
|
||||
/4./S;
|
||||
// Calculation of the creation time
|
||||
projectile->SetTimeOfCreation( target->GetTimeOfCreation() );
|
||||
projectile->SetPosition( target->GetPosition() );
|
||||
|
||||
if(PZcms2 < 0.){ return false;} // Non succesful attempt after the de-excitation
|
||||
}
|
||||
else // if(M0projectile > projectile->GetDefinition()->GetPDGMass())
|
||||
{
|
||||
target->SetStatus(2);
|
||||
return false; // The projectile was not excited,
|
||||
// but the energy was too low to put
|
||||
// the target nucleon on mass-shell
|
||||
} // end of if(M0projectile > projectile->GetDefinition()->GetPDGMass())
|
||||
} // end of if(PZcms2 < 0.)
|
||||
// Creation time and position of target nucleon were determined at
|
||||
// ReggeonCascade() of G4FTFModel
|
||||
|
||||
PZcms = std::sqrt(PZcms2);
|
||||
projectile->Set4Momentum( Pprojectile );
|
||||
target->Set4Momentum( Ptarget );
|
||||
|
||||
if(PutOnMassShell)
|
||||
{
|
||||
if(Pprojectile.z() > 0.)
|
||||
{
|
||||
Pprojectile.setPz( PZcms);
|
||||
Ptarget.setPz( -PZcms);
|
||||
}
|
||||
else // if(Pprojectile.z() > 0.)
|
||||
{
|
||||
Pprojectile.setPz(-PZcms);
|
||||
Ptarget.setPz( PZcms);
|
||||
};
|
||||
//projectile->IncrementCollisionCount( 1 );
|
||||
//target->IncrementCollisionCount( 1 );
|
||||
|
||||
Pprojectile.setE(std::sqrt(Mprojectile2+
|
||||
Pprojectile.x()*Pprojectile.x()+
|
||||
Pprojectile.y()*Pprojectile.y()+
|
||||
PZcms2));
|
||||
Ptarget.setE(std::sqrt( Mtarget2 +
|
||||
Ptarget.x()*Ptarget.x()+
|
||||
Ptarget.y()*Ptarget.y()+
|
||||
PZcms2));
|
||||
} // end of if(PutOnMassShell)
|
||||
|
||||
G4double maxPtSquare = PZcms2;
|
||||
|
||||
// ------ Now we can calculate the transfered Pt --------------------------
|
||||
G4double Pt2;
|
||||
G4double ProjMassT2; //, ProjMassT;
|
||||
G4double TargMassT2; //, TargMassT;
|
||||
|
||||
G4LorentzVector Qmomentum;
|
||||
Qmomentum=G4LorentzVector(GaussianPt(AveragePt2,maxPtSquare),0);
|
||||
|
||||
Pt2=G4ThreeVector(Qmomentum.vect()).mag2();
|
||||
|
||||
ProjMassT2=Mprojectile2+Pt2;
|
||||
// ProjMassT =std::sqrt(ProjMassT2);
|
||||
|
||||
TargMassT2=Mtarget2+Pt2;
|
||||
// TargMassT =std::sqrt(TargMassT2);
|
||||
|
||||
PZcms2=(S*S+ProjMassT2*ProjMassT2+
|
||||
TargMassT2*TargMassT2-
|
||||
2.*S*ProjMassT2-2.*S*TargMassT2-
|
||||
2.*ProjMassT2*TargMassT2)/4./S;
|
||||
if(PZcms2 < 0 ) {PZcms2=0;};// to avoid the exactness problem
|
||||
PZcms =std::sqrt(PZcms2);
|
||||
|
||||
Pprojectile.setPz( PZcms);
|
||||
Ptarget.setPz( -PZcms);
|
||||
|
||||
Pprojectile += Qmomentum;
|
||||
Ptarget -= Qmomentum;
|
||||
|
||||
// Transform back and update SplitableHadron Participant.
|
||||
Pprojectile.transform(toLab);
|
||||
Ptarget.transform(toLab);
|
||||
/* // Maybe it will be needed for an exact calculations--------------------
|
||||
G4double TargetMomentum=std::sqrt(Ptarget.x()*Ptarget.x()+
|
||||
Ptarget.y()*Ptarget.y()+
|
||||
Ptarget.z()*Ptarget.z());
|
||||
*/
|
||||
|
||||
// Calculation of the creation time ---------------------
|
||||
projectile->SetTimeOfCreation(target->GetTimeOfCreation());
|
||||
projectile->SetPosition(target->GetPosition());
|
||||
// Creation time and position of target nucleon were determined at
|
||||
// ReggeonCascade() of G4FTFModel
|
||||
// ------------------------------------------------------
|
||||
|
||||
projectile->Set4Momentum(Pprojectile);
|
||||
target->Set4Momentum(Ptarget);
|
||||
|
||||
projectile->IncrementCollisionCount(1);
|
||||
target->IncrementCollisionCount(1);
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// --------- private methods ----------------------
|
||||
//============================================================================
|
||||
|
||||
G4ThreeVector G4ElasticHNScattering::GaussianPt(G4double AveragePt2, G4double maxPtSquare) const
|
||||
{ // @@ this method is used in FTFModel as well. Should go somewhere common!
|
||||
|
||||
G4double Pt2(0.);
|
||||
if(AveragePt2 <= 0.) {Pt2=0.;}
|
||||
else
|
||||
{
|
||||
Pt2 = -AveragePt2 * std::log(1. + G4UniformRand() *
|
||||
(std::exp(-maxPtSquare/AveragePt2)-1.));
|
||||
}
|
||||
G4double Pt=std::sqrt(Pt2);
|
||||
G4double phi=G4UniformRand() * twopi;
|
||||
|
||||
return G4ThreeVector (Pt*std::cos(phi), Pt*std::sin(phi), 0.);
|
||||
}
|
||||
|
||||
G4ElasticHNScattering::G4ElasticHNScattering(const G4ElasticHNScattering &)
|
||||
{
|
||||
throw G4HadronicException(__FILE__, __LINE__, "G4ElasticHNScattering copy contructor not meant to be called");
|
||||
G4ThreeVector G4ElasticHNScattering::GaussianPt( G4double AveragePt2,
|
||||
G4double maxPtSquare ) const {
|
||||
// @@ this method is used in FTFModel as well. Should go somewhere common!
|
||||
G4double Pt2( 0.0 );
|
||||
if ( AveragePt2 <= 0.0 ) {
|
||||
Pt2 = 0.0;
|
||||
} else {
|
||||
Pt2 = -AveragePt2 * std::log( 1.0 + G4UniformRand() *
|
||||
( std::exp( -maxPtSquare/AveragePt2 ) -1.0 ) );
|
||||
}
|
||||
G4double Pt = std::sqrt( Pt2 );
|
||||
G4double phi = G4UniformRand() * twopi;
|
||||
return G4ThreeVector( Pt * std::cos( phi ), Pt * std::sin( phi ), 0.0 );
|
||||
}
|
||||
|
||||
|
||||
G4ElasticHNScattering::~G4ElasticHNScattering()
|
||||
{
|
||||
//============================================================================
|
||||
|
||||
G4ElasticHNScattering::G4ElasticHNScattering( const G4ElasticHNScattering& ) {
|
||||
throw G4HadronicException( __FILE__, __LINE__,
|
||||
"G4ElasticHNScattering copy contructor not meant to be called" );
|
||||
}
|
||||
|
||||
|
||||
const G4ElasticHNScattering & G4ElasticHNScattering::operator=(const G4ElasticHNScattering &)
|
||||
{
|
||||
throw G4HadronicException(__FILE__, __LINE__, "G4ElasticHNScattering = operator not meant to be called");
|
||||
//return *this; //A.R. 25-Jul-2012 : fix Coverity
|
||||
//============================================================================
|
||||
|
||||
G4ElasticHNScattering::~G4ElasticHNScattering() {}
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
||||
const G4ElasticHNScattering & G4ElasticHNScattering::operator=( const G4ElasticHNScattering& ) {
|
||||
throw G4HadronicException( __FILE__, __LINE__,
|
||||
"G4ElasticHNScattering = operator not meant to be called" );
|
||||
}
|
||||
|
||||
|
||||
int G4ElasticHNScattering::operator==(const G4ElasticHNScattering &) const
|
||||
{
|
||||
throw G4HadronicException(__FILE__, __LINE__, "G4ElasticHNScattering == operator not meant to be called");
|
||||
//return false; //A.R. 25-Jul-2012 : fix Coverity
|
||||
//============================================================================
|
||||
|
||||
int G4ElasticHNScattering::operator==( const G4ElasticHNScattering& ) const {
|
||||
throw G4HadronicException( __FILE__, __LINE__,
|
||||
"G4ElasticHNScattering == operator not meant to be called" );
|
||||
}
|
||||
|
||||
int G4ElasticHNScattering::operator!=(const G4ElasticHNScattering &) const
|
||||
{
|
||||
throw G4HadronicException(__FILE__, __LINE__, "G4ElasticHNScattering != operator not meant to be called");
|
||||
//return true; //A.R. 25-Jul-2012 : fix Coverity
|
||||
|
||||
//============================================================================
|
||||
|
||||
int G4ElasticHNScattering::operator!=( const G4ElasticHNScattering& ) const {
|
||||
throw G4HadronicException( __FILE__, __LINE__,
|
||||
"G4ElasticHNScattering != operator not meant to be called" );
|
||||
}
|
||||
|
||||
+893
-1023
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+636
-661
File diff suppressed because it is too large
Load Diff
+263
-193
@@ -24,9 +24,10 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id$
|
||||
// $Id: G4FTFParticipants.cc 74627 2013-10-17 07:04:38Z gcosmo $
|
||||
// GEANT4 tag $Name: $
|
||||
//
|
||||
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
//
|
||||
@@ -47,233 +48,302 @@
|
||||
#include "G4ios.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4FTFParameters.hh" // Uzhi 29.03.08
|
||||
#include "G4FTFParameters.hh"
|
||||
#include "G4DiffractiveSplitableHadron.hh"
|
||||
#include "G4VSplitableHadron.hh"
|
||||
|
||||
G4FTFParticipants::G4FTFParticipants() :
|
||||
theProjectileNucleus(0),
|
||||
currentInteraction(-1)
|
||||
{
|
||||
}
|
||||
|
||||
G4FTFParticipants::G4FTFParticipants(const G4FTFParticipants &): G4VParticipants()
|
||||
, theProjectileNucleus(0), currentInteraction(-1) //A.R. 14-Aug-2012 Coverity fix.
|
||||
//============================================================================
|
||||
|
||||
//#define debugFTFparticipant
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
||||
G4FTFParticipants::G4FTFParticipants() : currentInteraction( -1 ) {}
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
||||
G4FTFParticipants::G4FTFParticipants( const G4FTFParticipants& ) :
|
||||
G4VParticipants(), currentInteraction( -1 )
|
||||
{
|
||||
G4Exception("G4FTFParticipants::G4FTFParticipants()","HAD_FTF_001",
|
||||
FatalException," Must not use copy ctor()");
|
||||
G4Exception( "G4FTFParticipants::G4FTFParticipants()", "HAD_FTF_001",
|
||||
FatalException, " Must not use copy ctor()" );
|
||||
}
|
||||
|
||||
|
||||
G4FTFParticipants::~G4FTFParticipants()
|
||||
{
|
||||
if ( theProjectileNucleus != NULL ) delete theProjectileNucleus;
|
||||
}
|
||||
//============================================================================
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
G4FTFParticipants::~G4FTFParticipants() {}
|
||||
|
||||
void G4FTFParticipants::SetProjectileNucleus(G4V3DNucleus * aNucleus)
|
||||
{
|
||||
if (theProjectileNucleus) delete theProjectileNucleus;
|
||||
|
||||
theProjectileNucleus = aNucleus;
|
||||
}
|
||||
|
||||
G4V3DNucleus * G4FTFParticipants::GetProjectileNucleus()
|
||||
{
|
||||
return theProjectileNucleus;
|
||||
}
|
||||
//============================================================================
|
||||
|
||||
void G4FTFParticipants::InitProjectileNucleus(G4int theA, G4int theZ)
|
||||
{
|
||||
if ( theProjectileNucleus == NULL ) theProjectileNucleus = new G4Fancy3DNucleus();
|
||||
theProjectileNucleus->Init(theA, theZ);
|
||||
theProjectileNucleus->SortNucleonsDecZ();
|
||||
}
|
||||
//-------------------------------------------------------------------------
|
||||
void G4FTFParticipants::GetList(const G4ReactionProduct &thePrimary,
|
||||
G4FTFParameters *theParameters)
|
||||
{
|
||||
//G4cout<<"Participants::GetList"<<G4endl;
|
||||
//G4cout<<"thePrimary "<<thePrimary.GetMomentum()<<G4endl;
|
||||
StartLoop(); // reset Loop over Interactions
|
||||
void G4FTFParticipants::GetList( const G4ReactionProduct& thePrimary,
|
||||
G4FTFParameters* theParameters ) {
|
||||
|
||||
for(unsigned int i=0; i<theInteractions.size(); i++) delete theInteractions[i];
|
||||
theInteractions.clear();
|
||||
#ifdef debugFTFparticipant
|
||||
G4cout << "Participants::GetList" << G4endl
|
||||
<< "thePrimary " << thePrimary.GetMomentum() << G4endl << G4endl;
|
||||
#endif
|
||||
|
||||
G4double deltaxy=2 * fermi; // Extra nuclear radius
|
||||
//G4cout<<"theProjectileNucleus "<<theProjectileNucleus<<G4endl;
|
||||
if(theProjectileNucleus == 0)
|
||||
{ // Hadron-nucleus or anti-baryon-nucleus interactions
|
||||
//G4cout<<"Hadron-nucleus or anti-baryon-nucleus interactions"<<G4endl;
|
||||
G4double betta_z = thePrimary.GetMomentum().z() / thePrimary.GetTotalEnergy();
|
||||
if ( betta_z < 1.0e-10 ) betta_z = 1.0e-10;
|
||||
|
||||
G4double impactX(0.), impactY(0.);
|
||||
StartLoop(); // reset Loop over Interactions
|
||||
|
||||
G4VSplitableHadron * primarySplitable=new G4DiffractiveSplitableHadron(thePrimary);
|
||||
//G4cout<<"Prim in Part "<<primarySplitable->Get4Momentum()<<G4endl;
|
||||
G4double xyradius;
|
||||
xyradius =theNucleus->GetOuterRadius() + deltaxy; // Impact parameter sampling
|
||||
|
||||
// G4bool nucleusNeedsShift = true; // Uzhi 20 July 2009
|
||||
|
||||
do
|
||||
{
|
||||
std::pair<G4double, G4double> theImpactParameter;
|
||||
theImpactParameter = theNucleus->ChooseImpactXandY(xyradius);
|
||||
impactX = theImpactParameter.first;
|
||||
impactY = theImpactParameter.second;
|
||||
for ( unsigned int i = 0; i < theInteractions.size(); i++ ) delete theInteractions[i];
|
||||
theInteractions.clear();
|
||||
|
||||
G4ThreeVector thePosition(impactX, impactY, -DBL_MAX);
|
||||
primarySplitable->SetPosition(thePosition);
|
||||
G4double deltaxy = 2.0 * fermi; // Extra nuclear radius
|
||||
|
||||
theNucleus->StartLoop();
|
||||
G4Nucleon * nucleon;
|
||||
if ( theProjectileNucleus == 0 ) { // Hadron-nucleus or anti-baryon-nucleus interactions
|
||||
|
||||
G4int TrN(0);
|
||||
while ( (nucleon=theNucleus->GetNextNucleon()) )
|
||||
{
|
||||
G4double impact2= sqr(impactX - nucleon->GetPosition().x()) +
|
||||
sqr(impactY - nucleon->GetPosition().y());
|
||||
G4double impactX( 0.0 ), impactY( 0.0 );
|
||||
|
||||
if ( theParameters->GetProbabilityOfInteraction(impact2/fermi/fermi)
|
||||
> G4UniformRand() )
|
||||
{
|
||||
primarySplitable->SetStatus(1); // It takes part in the interaction
|
||||
|
||||
G4VSplitableHadron * targetSplitable=0;
|
||||
if ( ! nucleon->AreYouHit() )
|
||||
{
|
||||
targetSplitable= new G4DiffractiveSplitableHadron(*nucleon);
|
||||
nucleon->Hit(targetSplitable);
|
||||
nucleon->SetBindingEnergy(3.*nucleon->GetBindingEnergy());
|
||||
//G4cout<<" Part nucl "<<TrN<<" "<<nucleon->Get4Momentum()<<G4endl;
|
||||
//G4cout<<" Part nucl "<<G4endl;
|
||||
targetSplitable->SetStatus(1); // It takes part in the interaction
|
||||
}
|
||||
G4InteractionContent * aInteraction =
|
||||
new G4InteractionContent(primarySplitable);
|
||||
aInteraction->SetTarget(targetSplitable);
|
||||
aInteraction->SetTargetNucleon(nucleon); // Uzhi 16.07.09
|
||||
aInteraction->SetStatus(1); // Uzhi Feb26
|
||||
theInteractions.push_back(aInteraction);
|
||||
}
|
||||
TrN++;
|
||||
}
|
||||
} while ( theInteractions.size() == 0 );
|
||||
|
||||
//if ( theInteractions.size() == 0 ) delete primarySplitable; //A.R. 14-Aug-2012 Coverity fix
|
||||
|
||||
// G4cout << "Number of Hit nucleons " << theInteractions.size()
|
||||
// << "\t" << impactX/fermi << "\t"<<impactY/fermi
|
||||
// << "\t" << std::sqrt(sqr(impactX)+sqr(impactY))/fermi <<G4endl;
|
||||
|
||||
return;
|
||||
} // end of if(theProjectileNucleus == 0)
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Projectile and target are nuclei
|
||||
//-------------------------------------------------------------------
|
||||
//VU G4VSplitableHadron * primarySplitable=new G4DiffractiveSplitableHadron(thePrimary);
|
||||
//G4cout<<"Prim in Part "<<primarySplitable->Get4Momentum()<<G4endl;
|
||||
//G4cout<<"Projectile and target are nuclei"<<G4endl;
|
||||
//G4cout<<thePrimary.GetMomentum()<<G4endl;
|
||||
//G4cout<<"Part Pr Tr "<<theProjectileNucleus<<" "<<theNucleus<<G4endl;
|
||||
G4VSplitableHadron* primarySplitable = new G4DiffractiveSplitableHadron( thePrimary );
|
||||
|
||||
#ifdef debugFTFparticipant
|
||||
G4cout << "Hadron-nucleus or anti-baryon-nucleus interactions" << G4endl;
|
||||
#endif
|
||||
|
||||
G4double xyradius;
|
||||
xyradius =theProjectileNucleus->GetOuterRadius() + // Impact parameter sampling
|
||||
theNucleus->GetOuterRadius() + deltaxy;
|
||||
xyradius = theNucleus->GetOuterRadius() + deltaxy; // Range of impact parameter sampling
|
||||
|
||||
do { // while ( theInteractions.size() == 0 )
|
||||
|
||||
G4double impactX(0.), impactY(0.);
|
||||
std::pair< G4double, G4double > theImpactParameter;
|
||||
theImpactParameter = theNucleus->ChooseImpactXandY( xyradius );
|
||||
impactX = theImpactParameter.first;
|
||||
impactY = theImpactParameter.second;
|
||||
|
||||
do
|
||||
{
|
||||
//G4cout<<"New interaction list"<<G4endl;
|
||||
std::pair<G4double, G4double> theImpactParameter;
|
||||
theImpactParameter = theNucleus->ChooseImpactXandY(xyradius);
|
||||
impactX = theImpactParameter.first;
|
||||
impactY = theImpactParameter.second;
|
||||
//G4cout<<"B "<<std::sqrt(sqr(impactX)+sqr(impactY))/fermi<<G4endl;
|
||||
#ifdef debugFTFparticipant
|
||||
G4cout << "New interaction list," << " b= "
|
||||
<< std::sqrt( sqr(impactX ) + sqr( impactY ) )/fermi << G4endl;
|
||||
#endif
|
||||
|
||||
G4ThreeVector thePosition(impactX, impactY, -DBL_MAX);
|
||||
//VU primarySplitable->SetPosition(thePosition);
|
||||
G4ThreeVector thePosition( impactX, impactY, 0.0 );
|
||||
primarySplitable->SetPosition( thePosition );
|
||||
|
||||
theProjectileNucleus->StartLoop();
|
||||
G4Nucleon * ProjectileNucleon;
|
||||
G4int PrNuclN(0);
|
||||
theNucleus->StartLoop();
|
||||
G4Nucleon* nucleon;
|
||||
|
||||
while ( (ProjectileNucleon=theProjectileNucleus->GetNextNucleon()) )
|
||||
{
|
||||
G4VSplitableHadron * ProjectileSplitable=0;
|
||||
//G4cout<<G4endl<<"Prj N mom "<<ProjectileNucleon->Get4Momentum()<<"-------------"<<G4endl;
|
||||
theNucleus->StartLoop();
|
||||
G4Nucleon * TargetNucleon;
|
||||
#ifdef debugFTFparticipant
|
||||
G4int TrN( 0 );
|
||||
#endif
|
||||
|
||||
G4int TrNuclN(0);
|
||||
while ( (TargetNucleon=theNucleus->GetNextNucleon()) )
|
||||
{
|
||||
//G4cout<<"Trg N mom "<<TargetNucleon->Get4Momentum()<<G4endl;
|
||||
G4double impact2=
|
||||
sqr(impactX+ProjectileNucleon->GetPosition().x()-TargetNucleon->GetPosition().x())+
|
||||
sqr(impactY+ProjectileNucleon->GetPosition().y()-TargetNucleon->GetPosition().y());
|
||||
while ( ( nucleon = theNucleus->GetNextNucleon() ) ) {
|
||||
|
||||
G4VSplitableHadron * TargetSplitable=0;
|
||||
G4double impact2 = sqr( impactX - nucleon->GetPosition().x() ) +
|
||||
sqr( impactY - nucleon->GetPosition().y() );
|
||||
|
||||
if ( theParameters->GetProbabilityOfInteraction(impact2/fermi/fermi)
|
||||
> G4UniformRand() )
|
||||
{ // An Interaction has happend!
|
||||
//G4cout<<"An Interaction has happend"<<G4endl;
|
||||
//G4cout<<"PrN TrN "<<PrNuclN<<" "<<TrNuclN<<" "<<ProjectileNucleon->GetPosition().z()/fermi<<" "<<TargetNucleon->GetPosition().z()/fermi<<" "<<ProjectileNucleon->GetPosition().z()/fermi + TargetNucleon->GetPosition().z()/fermi <<G4endl;
|
||||
if ( theParameters->GetProbabilityOfInteraction( impact2/fermi/fermi ) >
|
||||
G4UniformRand() ) {
|
||||
primarySplitable->SetStatus( 1 ); // It takes part in the interaction
|
||||
G4VSplitableHadron* targetSplitable = 0;
|
||||
if ( ! nucleon->AreYouHit() ) {
|
||||
targetSplitable = new G4DiffractiveSplitableHadron( *nucleon );
|
||||
nucleon->Hit( targetSplitable );
|
||||
targetSplitable->SetStatus( 1 ); // It takes part in the interaction
|
||||
|
||||
if ( ! ProjectileNucleon->AreYouHit() )
|
||||
{ // Projectile nucleon was not involved until now.
|
||||
ProjectileSplitable= new G4DiffractiveSplitableHadron(*ProjectileNucleon);
|
||||
ProjectileNucleon->Hit(ProjectileSplitable);
|
||||
ProjectileNucleon->SetBindingEnergy(3.*ProjectileNucleon->GetBindingEnergy());
|
||||
ProjectileSplitable->SetStatus(1); // It takes part in the interaction
|
||||
}
|
||||
else
|
||||
{ // Projectile nucleon was involved before.
|
||||
ProjectileSplitable=ProjectileNucleon->GetSplitableHadron();
|
||||
} // End of if ( ! Projectileucleon->AreYouHit() )
|
||||
#ifdef debugFTFparticipant
|
||||
G4cout << "Participated nucleons #, " << TrN << " " << "Splitable Pr* Tr* "
|
||||
<< primarySplitable << " " << targetSplitable << G4endl;
|
||||
#endif
|
||||
|
||||
if ( ! TargetNucleon->AreYouHit() )
|
||||
{ // Target nucleon was not involved until now
|
||||
TargetSplitable= new G4DiffractiveSplitableHadron(*TargetNucleon);
|
||||
TargetNucleon->Hit(TargetSplitable);
|
||||
TargetNucleon->SetBindingEnergy(3.*ProjectileNucleon->GetBindingEnergy());
|
||||
TargetSplitable->SetStatus(1); // It takes part in the interaction
|
||||
}
|
||||
else
|
||||
{ // Target nucleon was involved before.
|
||||
TargetSplitable=TargetNucleon->GetSplitableHadron();
|
||||
} // End of if ( ! TargetNeucleon->AreYouHit() )
|
||||
}
|
||||
G4InteractionContent* aInteraction = new G4InteractionContent( primarySplitable );
|
||||
G4Nucleon* PrNucleon = 0;
|
||||
aInteraction->SetProjectileNucleon( PrNucleon );
|
||||
aInteraction->SetTarget( targetSplitable );
|
||||
aInteraction->SetTargetNucleon( nucleon );
|
||||
aInteraction->SetStatus( 1 );
|
||||
aInteraction->SetInteractionTime( ( primarySplitable->GetPosition().z() +
|
||||
nucleon->GetPosition().z() ) / betta_z );
|
||||
theInteractions.push_back( aInteraction );
|
||||
}
|
||||
|
||||
G4InteractionContent * anInteraction =
|
||||
new G4InteractionContent(ProjectileSplitable);
|
||||
anInteraction->SetTarget(TargetSplitable);
|
||||
anInteraction->SetTargetNucleon(TargetNucleon);
|
||||
anInteraction->SetStatus(1); // Uzhi Feb26
|
||||
// anInteraction->SetInteractionTime(ProjectileNucleon->GetPosition().z()+
|
||||
// TargetNucleon->GetPosition().z());
|
||||
//G4cout<<"Z's pr tr "<<ProjectileNucleon->GetPosition().z()/fermi<<" "<<TargetNucleon->GetPosition().z()/fermi<<" "<<ProjectileNucleon->GetPosition().z()/fermi + TargetNucleon->GetPosition().z()/fermi <<G4endl;
|
||||
theInteractions.push_back(anInteraction);
|
||||
//G4cout<<"Ppr tr "<<ProjectileSplitable<<" "<<TargetSplitable<<G4endl;
|
||||
} // End of An Interaction has happend!
|
||||
TrNuclN++;
|
||||
} // End of while ( (TargetNucleon=theNucleus->GetNextNucleon()) )
|
||||
PrNuclN++;
|
||||
} // End of while ( (ProjectileNucleon=theProjectileNucleus->GetNextNucleon()) )
|
||||
} while ( theInteractions.size() == 0 ); // end of while ( theInteractions.size() == 0 )
|
||||
#ifdef debugFTFparticipant
|
||||
TrN++;
|
||||
#endif
|
||||
|
||||
//std::sort(theInteractions.begin(),theInteractions.end()); // ????
|
||||
}
|
||||
|
||||
// G4cout << "Number of primary collisions " << theInteractions.size()
|
||||
// << "\t" << impactX/fermi << "\t"<<impactY/fermi
|
||||
// << "\t" << std::sqrt(sqr(impactX)+sqr(impactY))/fermi <<G4endl;
|
||||
//G4int Uzhi; G4cin >> Uzhi;
|
||||
} while ( theInteractions.size() == 0 );
|
||||
|
||||
#ifdef debugFTFparticipant
|
||||
G4cout << "Number of Hit nucleons " << theInteractions.size() << "\t Bx " << impactX/fermi
|
||||
<< "\t By " << impactY/fermi << "\t B "
|
||||
<< std::sqrt( sqr( impactX ) + sqr( impactY ) )/fermi << G4endl << G4endl;
|
||||
#endif
|
||||
|
||||
//SortInteractionsIncT(); // Not need because nucleons are sorted in increasing z-coordinates.
|
||||
ShiftInteractionTime(); // To put correct times and z-coordinates
|
||||
return;
|
||||
}
|
||||
//--------------------------------------------------------------
|
||||
|
||||
// Implementation (private) methods
|
||||
} // end of if ( theProjectileNucleus == 0 )
|
||||
|
||||
// Projectile and target are nuclei
|
||||
|
||||
#ifdef debugFTFparticipant
|
||||
G4cout << "Projectile and target are nuclei" << G4endl;
|
||||
#endif
|
||||
|
||||
G4double xyradius;
|
||||
xyradius = theProjectileNucleus->GetOuterRadius() + // Range of impact parameter sampling
|
||||
theNucleus->GetOuterRadius() + deltaxy;
|
||||
|
||||
G4double impactX( 0.0 ), impactY( 0.0 );
|
||||
|
||||
do { // while ( theInteractions.size() == 0 )
|
||||
|
||||
std::pair< G4double, G4double > theImpactParameter;
|
||||
theImpactParameter = theNucleus->ChooseImpactXandY( xyradius );
|
||||
impactX = theImpactParameter.first;
|
||||
impactY = theImpactParameter.second;
|
||||
|
||||
#ifdef debugFTFparticipant
|
||||
G4cout << "New interaction list, " << "b "
|
||||
<< std::sqrt( sqr( impactX ) + sqr( impactY ) )/fermi << G4endl;
|
||||
#endif
|
||||
|
||||
G4ThreeVector theBeamPosition( impactX, impactY, 0.0 );
|
||||
|
||||
theProjectileNucleus->StartLoop();
|
||||
G4Nucleon* ProjectileNucleon;
|
||||
|
||||
#ifdef debugFTFparticipant
|
||||
G4int PrNuclN( 0 );
|
||||
#endif
|
||||
|
||||
while ( ( ProjectileNucleon = theProjectileNucleus->GetNextNucleon() ) ) {
|
||||
|
||||
G4VSplitableHadron* ProjectileSplitable = 0;
|
||||
theNucleus->StartLoop();
|
||||
G4Nucleon* TargetNucleon = 0;
|
||||
|
||||
#ifdef debugFTFparticipant
|
||||
G4int TrNuclN( 0 );
|
||||
#endif
|
||||
|
||||
while ( ( TargetNucleon = theNucleus->GetNextNucleon() ) ) {
|
||||
|
||||
G4double impact2 = sqr( impactX + ProjectileNucleon->GetPosition().x() -
|
||||
TargetNucleon->GetPosition().x() ) +
|
||||
sqr( impactY + ProjectileNucleon->GetPosition().y() -
|
||||
TargetNucleon->GetPosition().y() );
|
||||
G4VSplitableHadron* TargetSplitable = 0;
|
||||
if ( theParameters->GetProbabilityOfInteraction( impact2/fermi/fermi ) >
|
||||
G4UniformRand() ) { // An interaction has happend!
|
||||
|
||||
#ifdef debugFTFparticipant
|
||||
G4cout << G4endl << "An Interaction has happend" << G4endl << "Proj N mom " << PrNuclN
|
||||
<< " " << ProjectileNucleon->Get4Momentum() << "-------------" << G4endl
|
||||
<< "Targ N mom " << TrNuclN << " " << TargetNucleon->Get4Momentum() << G4endl
|
||||
<< "PrN TrN Z coords " << ProjectileNucleon->GetPosition().z()/fermi
|
||||
<< " " << TargetNucleon->GetPosition().z()/fermi
|
||||
<< " " << ProjectileNucleon->GetPosition().z()/fermi +
|
||||
TargetNucleon->GetPosition().z()/fermi << G4endl;
|
||||
#endif
|
||||
|
||||
if ( ! ProjectileNucleon->AreYouHit() ) {
|
||||
// Projectile nucleon was not involved until now.
|
||||
ProjectileSplitable = new G4DiffractiveSplitableHadron( *ProjectileNucleon );
|
||||
ProjectileNucleon->Hit( ProjectileSplitable );
|
||||
ProjectileSplitable->SetStatus( 1 ); // It takes part in the interaction
|
||||
} else { // Projectile nucleon was involved before.
|
||||
ProjectileSplitable = ProjectileNucleon->GetSplitableHadron();
|
||||
}
|
||||
|
||||
if ( ! TargetNucleon->AreYouHit() ) { // Target nucleon was not involved until now
|
||||
TargetSplitable = new G4DiffractiveSplitableHadron( *TargetNucleon );
|
||||
TargetNucleon->Hit( TargetSplitable );
|
||||
TargetSplitable->SetStatus( 1 ); // It takes part in the interaction
|
||||
} else { // Target nucleon was involved before.
|
||||
TargetSplitable = TargetNucleon->GetSplitableHadron();
|
||||
}
|
||||
|
||||
G4InteractionContent* anInteraction = new G4InteractionContent( ProjectileSplitable );
|
||||
anInteraction->SetTarget( TargetSplitable );
|
||||
anInteraction->SetProjectileNucleon( ProjectileNucleon );
|
||||
anInteraction->SetTargetNucleon( TargetNucleon );
|
||||
anInteraction->SetInteractionTime( ( ProjectileNucleon->GetPosition().z() +
|
||||
TargetNucleon->GetPosition().z() ) / betta_z );
|
||||
anInteraction->SetStatus( 1 );
|
||||
|
||||
#ifdef debugFTFparticipant
|
||||
G4cout << "Part anInteraction->GetInteractionTime() "
|
||||
<< anInteraction->GetInteractionTime()/fermi << G4endl
|
||||
<< "Splitable Pr* Tr* " << ProjectileSplitable << " "
|
||||
<< TargetSplitable << G4endl;
|
||||
#endif
|
||||
|
||||
theInteractions.push_back( anInteraction );
|
||||
|
||||
} // End of an Interaction has happend!
|
||||
|
||||
#ifdef debugFTFparticipant
|
||||
TrNuclN++;
|
||||
#endif
|
||||
|
||||
} // End of while ( ( TargetNucleon = theNucleus->GetNextNucleon() ) )
|
||||
|
||||
#ifdef debugFTFparticipant
|
||||
PrNuclN++;
|
||||
#endif
|
||||
|
||||
} // End of while ( ( ProjectileNucleon = theProjectileNucleus->GetNextNucleon() ) )
|
||||
|
||||
if ( theInteractions.size() != 0 ) theProjectileNucleus->DoTranslation( theBeamPosition );
|
||||
|
||||
} while ( theInteractions.size() == 0 );
|
||||
|
||||
SortInteractionsIncT();
|
||||
ShiftInteractionTime();
|
||||
|
||||
#ifdef debugFTFparticipant
|
||||
G4cout << G4endl << "Number of primary collisions " << theInteractions.size()
|
||||
<< "\t Bx " << impactX/fermi << "\t By " << impactY/fermi
|
||||
<< "\t B " << std::sqrt( sqr( impactX ) + sqr( impactY ) )/fermi << G4endl
|
||||
<< "FTF participant End. #######################" << G4endl << G4endl;
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
||||
bool G4FTFPartHelperForSortInT( const G4InteractionContent* Int1,
|
||||
const G4InteractionContent* Int2 ) {
|
||||
return Int1->GetInteractionTime() < Int2->GetInteractionTime();
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
||||
void G4FTFParticipants::SortInteractionsIncT() { // on increased T
|
||||
if ( theInteractions.size() < 2 ) return; // Avoid unnecesary work
|
||||
std::sort( theInteractions.begin(), theInteractions.end(), G4FTFPartHelperForSortInT );
|
||||
}
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
||||
void G4FTFParticipants::ShiftInteractionTime() {
|
||||
G4double InitialTime = theInteractions[0]->GetInteractionTime();
|
||||
for ( unsigned int i = 1; i < theInteractions.size(); i++ ) {
|
||||
G4double InterTime = theInteractions[i]->GetInteractionTime() - InitialTime;
|
||||
theInteractions[i]->SetInteractionTime( InterTime );
|
||||
G4InteractionContent* aCollision = theInteractions[i];
|
||||
G4VSplitableHadron* projectile = aCollision->GetProjectile();
|
||||
G4VSplitableHadron* target = aCollision->GetTarget();
|
||||
G4ThreeVector prPosition = projectile->GetPosition();
|
||||
prPosition.setZ( target->GetPosition().z() );
|
||||
projectile->SetPosition( prPosition );
|
||||
projectile->SetTimeOfCreation( InterTime );
|
||||
target->SetTimeOfCreation( InterTime );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user