Files
geant4/source/processes/hadronic/models/parton_string/qgsm/include/G4QGSModel.icc
T
2016-06-09 15:07:44 +02:00

127 lines
5.7 KiB
Plaintext

//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * 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. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// #include "G4ios.hh"
//****************************************************************************************************************
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(std::abs(aProjectile.GetDefinition()->GetBaryonNumber()) !=0)
{
nCons = std::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 = std::sqrt(e_per_projectile);
e_per_projectile += G4Proton::Proton()->GetPDGMass();
G4double vz = pz_per_projectile/e_per_projectile;
//--DEBUG-- G4cout << "IncomingMomentum - vz "<<aProjectile.Get4Momentum()<< ", " << vz <<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-- G4cout << "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()<<G4endl;
}
else
{
aString = theSoftStringBuilder.BuildString(aPair);
// G4cout << "soft "<<aString->Get4Momentum()<<G4endl;
}
//--DEBUG-- G4cout << " QGSModel.icc::GetStrings() theCurrentVelocity " << theCurrentVelocity << G4endl;
aString->Boost(theCurrentVelocity);
theStrings->push_back(aString);
delete aPair;
}
//--DEBUG-- G4cout << G4endl;
// for(G4int i=0; i<theStrings->size(); i++)
// {
// G4cout << "String = "<<theStrings->operator[](i)->Get4Momentum()<<G4endl;
// }
return theStrings;
}
template<class ParticipantType>
G4V3DNucleus* G4QGSModel<ParticipantType>::GetWoundedNucleus() const
{
return theParticipants.GetWoundedNucleus();
}
//*********************************************************************************************************************