Files
geant4/source/processes/hadronic/models/parton_string/qgsm/include/G4QGSModel.icc
T
2016-06-30 14:12:05 +02:00

156 lines
6.8 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. *
// ********************************************************************
//
//****************************************************************************************************************
template<class ParticipantType>
G4QGSModel<ParticipantType>::G4QGSModel()
{
G4VPartonStringModel::SetThisPointer(this);
SetEnergyMomentumCheckLevels(2*CLHEP::perCent, 150*CLHEP::MeV);
}
template<class ParticipantType>
G4QGSModel<ParticipantType>::G4QGSModel(const G4QGSModel &right)
{
G4VPartonStringModel::SetThisPointer(this);
std::pair<G4double, G4double> levels=right.GetEnergyMomentumCheckLevels();
SetEnergyMomentumCheckLevels(levels.first, levels.second);
}
template<class ParticipantType>
G4QGSModel<ParticipantType>& G4QGSModel<ParticipantType>::operator=(const G4QGSModel &right)
{
if (this != &right )
{
G4VPartonStringModel::SetThisPointer(this);
std::pair<G4double, G4double> levels=right.GetEnergyMomentumCheckLevels();
SetEnergyMomentumCheckLevels(levels.first, levels.second);
}
}
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
/*
G4cout<<"QGSM Init A Z "<<aNucleus.GetA_asInt()<<" "<<aNucleus.GetZ_asInt()<<G4endl;
G4cout<<"Projectile "<<aProjectile.GetDefinition()->GetParticleName()<<" "<<aProjectile.GetDefinition()->GetBaryonNumber()<<G4endl;
G4cout<<" "<<aProjectile.Get4Momentum()<<G4endl;
*/
theParticipants.Init(aNucleus.GetA_asInt(),aNucleus.GetZ_asInt());
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());
/* //Uzhi 15.05.2015
G4double nCons = 1;
if(std::abs(aProjectile.GetDefinition()->GetBaryonNumber()) !=0)
{
nCons = std::abs(aProjectile.GetDefinition()->GetBaryonNumber());
}
*/
// Transformation to hN/NN CMS system ---------------------------------
//Uzhi 15.05.2015 G4double pz_per_projectile = aProjectile.Get4Momentum().pz()/nCons;
//Uzhi 15.05.2015 G4double EperHN=aProjectile.Get4Momentum().e()/nCons + G4Proton::Proton()->GetPDGMass();
G4double vz = 0.; //pz_per_projectile/EperHN;
theCurrentVelocity.setZ(vz);
theParticipants.DoLorentzBoost(-theCurrentVelocity); // Lorentz boost of the target nucleus
G4LorentzVector Mom = aProjectile.Get4Momentum();
Mom.boost(-theCurrentVelocity); // Lorentz boost of the projectile
// End of the transformation ------------------------------------------
G4ReactionProduct theProjectile;
theProjectile.SetDefinition(aProjectile.GetDefinition());
theProjectile.SetTotalEnergy(Mom.e());
theProjectile.SetMomentum(Mom.vect());
theParticipants.BuildInteractions(theProjectile);
theParticipants.GetWoundedNucleus()->DoLorentzBoost(theCurrentVelocity); // Backward transformation
}
template<class ParticipantType>
G4ExcitedStringVector * G4QGSModel<ParticipantType>::GetStrings()
{
//G4cout<<"G4ExcitedStringVector * G4QGSModel<ParticipantType>::GetStrings()"<<G4endl;
// 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()) ) /* Loop checking, 07.08.2015, A.Ribon */
{
//G4cout<<"aPair->GetCollisionType() "<<aPair->GetCollisionType()<<G4endl;
if (aPair->GetCollisionType() == G4PartonPair::DIFFRACTIVE)
{
aString = theDiffractiveStringBuilder.BuildString(aPair);
//G4cout << "diffractive "<<aString->Get4Momentum()<<G4endl;
}
else
{
aString = theSoftStringBuilder.BuildString(aPair);
//G4cout << "soft "<<aString->Get4Momentum()<<G4endl;
}
aString->Boost(theCurrentVelocity);
theStrings->push_back(aString);
delete aPair;
}
return theStrings;
}
template<class ParticipantType>
G4V3DNucleus* G4QGSModel<ParticipantType>::GetWoundedNucleus() const
{
return theParticipants.GetWoundedNucleus();
}
template<class ParticipantType> // Uzhi Nov. 2012
G4V3DNucleus* G4QGSModel<ParticipantType>::GetProjectileNucleus() const
{
return 0;
}
template<class ParticipantType>
void G4QGSModel<ParticipantType>::ModelDescription(std::ostream& outFile) const
{
outFile << "The Quark-Gluon String (QGS) model simulates the interaction\n"
<< "of protons, neutrons, pions and kaons with nuclei in the\n"
<< "approximate energy range 20 GeV to 50 TeV. The model handles\n"
<< "the selection of collision partners, splitting of the nucleons\n"
<< "into quarks and di-quarks, the formation and excitation of\n"
<< "quark-gluon strings, string hadronization and diffractive dissociation.\n";
}
//*********************************************************************************************************************