2 // ********************************************************************
3 // * License and Disclaimer *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
27 //****************************************************************************************************************
29 template<class ParticipantType>
30 G4QGSModel<ParticipantType>::G4QGSModel()
32 G4VPartonStringModel::SetThisPointer(this);
33 SetEnergyMomentumCheckLevels(2*CLHEP::perCent, 150*CLHEP::MeV);
36 template<class ParticipantType>
37 G4QGSModel<ParticipantType>::G4QGSModel(const G4QGSModel &right)
39 G4VPartonStringModel::SetThisPointer(this);
40 std::pair<G4double, G4double> levels=right.GetEnergyMomentumCheckLevels();
41 SetEnergyMomentumCheckLevels(levels.first, levels.second);
44 template<class ParticipantType>
45 G4QGSModel<ParticipantType>& G4QGSModel<ParticipantType>::operator=(const G4QGSModel &right)
49 G4VPartonStringModel::SetThisPointer(this);
50 std::pair<G4double, G4double> levels=right.GetEnergyMomentumCheckLevels();
51 SetEnergyMomentumCheckLevels(levels.first, levels.second);
55 template<class ParticipantType>
56 G4QGSModel<ParticipantType>::~G4QGSModel()
60 template<class ParticipantType>
61 void G4QGSModel<ParticipantType>::Init(const G4Nucleus & aNucleus, const G4DynamicParticle & aProjectile)
63 // clean-up and consistency with design, HPW Feb 1999
64 theParticipants.Init(aNucleus.GetA_asInt(),aNucleus.GetZ_asInt());
65 theCurrentVelocity.setX(0);
66 theCurrentVelocity.setY(0);
68 // this is an approximation, neglecting the motion of nucleons in the nucleus & p,n mass differences. @@@
69 //G4double vz_old = aProjectile.Get4Momentum().pz()/
70 // (aProjectile.Get4Momentum().e() + G4Proton::Proton()->GetPDGMass());
72 if(std::abs(aProjectile.GetDefinition()->GetBaryonNumber()) !=0)
74 nCons = std::abs(aProjectile.GetDefinition()->GetBaryonNumber());
76 G4double pz_per_projectile = aProjectile.Get4Momentum().pz()/nCons;
77 //G4double e_per_projectile = aProjectile.Get4Momentum().vect()*aProjectile.Get4Momentum().vect();
78 // e_per_projectile /=nCons*nCons;
79 // e_per_projectile += G4Proton::Proton()->GetPDGMass()*G4Proton::Proton()->GetPDGMass();
80 G4double e_per_projectile = aProjectile.Get4Momentum()*aProjectile.Get4Momentum();
81 e_per_projectile += aProjectile.Get4Momentum().vect()*aProjectile.Get4Momentum().vect();
82 e_per_projectile /=nCons*nCons;
83 e_per_projectile = std::sqrt(e_per_projectile);
84 e_per_projectile += G4Proton::Proton()->GetPDGMass();
85 G4double vz = pz_per_projectile/e_per_projectile;
86 //--DEBUG-- G4cout << "IncomingMomentum - vz "<<aProjectile.Get4Momentum()<< ", " << vz <<G4endl;
87 theCurrentVelocity.setZ(vz);
88 theParticipants.DoLorentzBoost(-theCurrentVelocity);
89 G4LorentzVector Mom = aProjectile.Get4Momentum();
90 Mom.boost(-theCurrentVelocity);
91 G4ReactionProduct theProjectile;
92 theProjectile.SetDefinition(aProjectile.GetDefinition());
93 theProjectile.SetTotalEnergy(Mom.e());
94 theProjectile.SetMomentum(Mom.vect());
95 //--DEBUG-- G4cout << "PreInteractionMomentum "<<Mom<<G4endl;
96 theParticipants.BuildInteractions(theProjectile);
97 theParticipants.GetWoundedNucleus()->DoLorentzBoost(theCurrentVelocity);
100 template<class ParticipantType>
101 G4ExcitedStringVector * G4QGSModel<ParticipantType>::GetStrings()
103 // clean-up and consistancy with design, HPW Feb 1999
104 // also fixing a memory leak, removing unnecessary caching, and
105 // streamlining of logic
107 G4ExcitedStringVector* theStrings = new G4ExcitedStringVector;
108 G4ExcitedString * aString;
109 while( (aPair = theParticipants.GetNextPartonPair()) ) /* Loop checking, 26.10.2015, A.Ribon */
111 if (aPair->GetCollisionType() == G4PartonPair::DIFFRACTIVE)
113 aString = theDiffractiveStringBuilder.BuildString(aPair);
114 // G4cout << "diffractive "<<aString->Get4Momentum()<<G4endl;
118 aString = theSoftStringBuilder.BuildString(aPair);
119 // G4cout << "soft "<<aString->Get4Momentum()<<G4endl;
121 //--DEBUG-- G4cout << " QGSModel.icc::GetStrings() theCurrentVelocity " << theCurrentVelocity << G4endl;
122 aString->Boost(theCurrentVelocity);
123 theStrings->push_back(aString);
126 //--DEBUG-- G4cout << G4endl;
127 // for(G4int i=0; i<theStrings->size(); i++)
129 // G4cout << "String = "<<theStrings->operator[](i)->Get4Momentum()<<G4endl;
134 template<class ParticipantType>
135 G4V3DNucleus* G4QGSModel<ParticipantType>::GetWoundedNucleus() const
137 return theParticipants.GetWoundedNucleus();
140 template<class ParticipantType>
141 G4V3DNucleus* G4QGSModel<ParticipantType>::GetProjectileNucleus() const
146 template<class ParticipantType>
147 void G4QGSModel<ParticipantType>::ModelDescription(std::ostream& outFile) const
149 outFile << "The Quark-Gluon String (QGS) model simulates the interaction\n"
150 << "of protons, neutrons, pions and kaons with nuclei in the\n"
151 << "approximate energy range 20 GeV to 50 TeV. The model handles\n"
152 << "the selection of collision partners, splitting of the nucleons\n"
153 << "into quarks and di-quarks, the formation and excitation of\n"
154 << "quark-gluon strings, string hadronization and diffractive dissociation.\n";
157 //*********************************************************************************************************************