Files
geant4/source/processes/hadronic/models/parton_string/qgsm/include/G4QGSModel.icc
T
2016-06-09 10:49:58 +02:00

123 lines
5.3 KiB
Plaintext

//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#include <stdlib.h>
//****************************************************************************************************************
template<class ParticipantType>
G4QGSModel<ParticipantType>::G4QGSModel()
{
G4VPartonStringModel::SetThisPointer(this);
}
template<class ParticipantType>
G4QGSModel<ParticipantType>::G4QGSModel(const G4QGSModel &right)
{
G4VPartonStringModel::SetThisPointer(this);
}
template<class ParticipantType>
G4QGSModel<ParticipantType>::~G4QGSModel()
{
}
template<class ParticipantType>
void G4QGSModel<ParticipantType>::Init(const G4Nucleus & aNucleus, const G4DynamicParticle & aProjectile)
{
// clean-up and consistency with design, HPW Feb 1999
theParticipants.Init(aNucleus.GetN(),aNucleus.GetZ());
theCurrentVelocity.setX(0);
theCurrentVelocity.setY(0);
// HPW Feb 1999
// this is an approximation, neglecting the motion of nucleons in the nucleus & p,n mass differences. @@@
// G4double vz_old = aProjectile.Get4Momentum().pz()/
// (aProjectile.Get4Momentum().e() + G4Proton::Proton()->GetPDGMass());
G4double nCons = 1;
if(abs(aProjectile.GetDefinition()->GetBaryonNumber()) !=0)
{
nCons = abs(aProjectile.GetDefinition()->GetBaryonNumber());
}
G4double pz_per_projectile = aProjectile.Get4Momentum().pz()/nCons;
// G4double e_per_projectile = aProjectile.Get4Momentum().vect()*aProjectile.Get4Momentum().vect();
// e_per_projectile /=nCons*nCons;
// e_per_projectile += G4Proton::Proton()->GetPDGMass()*G4Proton::Proton()->GetPDGMass();
G4double e_per_projectile = aProjectile.Get4Momentum()*aProjectile.Get4Momentum();
e_per_projectile += aProjectile.Get4Momentum().vect()*aProjectile.Get4Momentum().vect();
e_per_projectile /=nCons*nCons;
e_per_projectile = sqrt(e_per_projectile);
e_per_projectile += G4Proton::Proton()->GetPDGMass();
G4double vz = pz_per_projectile/e_per_projectile;
//--DEBUG-- cout << "IncomingMomentum "<<aProjectile.Get4Momentum()<<G4endl;
theCurrentVelocity.setZ(vz);
theParticipants.DoLorentzBoost(-theCurrentVelocity);
G4LorentzVector Mom = aProjectile.Get4Momentum();
Mom.boost(-theCurrentVelocity);
G4ReactionProduct theProjectile;
theProjectile.SetDefinition(aProjectile.GetDefinition());
theProjectile.SetTotalEnergy(Mom.e());
theProjectile.SetMomentum(Mom.vect());
//--DEBUG-- cout << "PreInteractionMomentum "<<Mom<<G4endl;
theParticipants.BuildInteractions(theProjectile);
theParticipants.GetWoundedNucleus()->DoLorentzBoost(theCurrentVelocity);
}
template<class ParticipantType>
G4ExcitedStringVector * G4QGSModel<ParticipantType>::GetStrings()
{
// clean-up and consistancy with design, HPW Feb 1999
// also fixing a memory leak, removing unnecessary caching, and
// streamlining of logic
G4PartonPair* aPair;
G4ExcitedStringVector* theStrings = new G4ExcitedStringVector;
G4ExcitedString * aString;
while(aPair = theParticipants.GetNextPartonPair())
{
if (aPair->GetCollisionType() == G4PartonPair::DIFFRACTIVE)
{
aString = theDiffractiveStringBuilder.BuildString(aPair);
// G4cout << "diffractive "<<aString->Get4Momentum()<<std::endl;
}
else
{
aString = theSoftStringBuilder.BuildString(aPair);
// G4cout << "soft "<<aString->Get4Momentum()<<std::endl;
}
aString->Boost(theCurrentVelocity);
theStrings->push_back(aString);
delete aPair;
}
//--DEBUG-- cout << G4endl;
// for(G4int i=0; i<theStrings->size(); i++)
// {
// cout << "String = "<<theStrings->operator[](i)->Get4Momentum()<<G4endl;
// }
return theStrings;
}
template<class ParticipantType>
G4V3DNucleus* G4QGSModel<ParticipantType>::GetWoundedNucleus() const
{
return theParticipants.GetWoundedNucleus();
}
//*********************************************************************************************************************