source: trunk/source/processes/hadronic/models/parton_string/qgsm/include/G4QGSModel.icc@ 1036

Last change on this file since 1036 was 819, checked in by garnier, 17 years ago

import all except CVS

File size: 5.7 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
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. *
10// * *
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. *
17// * *
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// ********************************************************************
25//
26// #include "G4ios.hh"
27
28//****************************************************************************************************************
29template<class ParticipantType>
30G4QGSModel<ParticipantType>::G4QGSModel()
31 {
32 G4VPartonStringModel::SetThisPointer(this);
33 }
34template<class ParticipantType>
35G4QGSModel<ParticipantType>::G4QGSModel(const G4QGSModel &right)
36 {
37 G4VPartonStringModel::SetThisPointer(this);
38 }
39template<class ParticipantType>
40G4QGSModel<ParticipantType>::~G4QGSModel()
41 {
42 }
43
44template<class ParticipantType>
45void G4QGSModel<ParticipantType>::Init(const G4Nucleus & aNucleus, const G4DynamicParticle & aProjectile)
46 {
47 // clean-up and consistency with design, HPW Feb 1999
48 theParticipants.Init(aNucleus.GetN(),aNucleus.GetZ());
49 theCurrentVelocity.setX(0);
50 theCurrentVelocity.setY(0);
51 // HPW Feb 1999
52 // this is an approximation, neglecting the motion of nucleons in the nucleus & p,n mass differences. @@@
53// G4double vz_old = aProjectile.Get4Momentum().pz()/
54// (aProjectile.Get4Momentum().e() + G4Proton::Proton()->GetPDGMass());
55 G4double nCons = 1;
56 if(std::abs(aProjectile.GetDefinition()->GetBaryonNumber()) !=0)
57 {
58 nCons = std::abs(aProjectile.GetDefinition()->GetBaryonNumber());
59 }
60 G4double pz_per_projectile = aProjectile.Get4Momentum().pz()/nCons;
61// G4double e_per_projectile = aProjectile.Get4Momentum().vect()*aProjectile.Get4Momentum().vect();
62// e_per_projectile /=nCons*nCons;
63// e_per_projectile += G4Proton::Proton()->GetPDGMass()*G4Proton::Proton()->GetPDGMass();
64 G4double e_per_projectile = aProjectile.Get4Momentum()*aProjectile.Get4Momentum();
65 e_per_projectile += aProjectile.Get4Momentum().vect()*aProjectile.Get4Momentum().vect();
66 e_per_projectile /=nCons*nCons;
67 e_per_projectile = std::sqrt(e_per_projectile);
68 e_per_projectile += G4Proton::Proton()->GetPDGMass();
69 G4double vz = pz_per_projectile/e_per_projectile;
70//--DEBUG-- G4cout << "IncomingMomentum - vz "<<aProjectile.Get4Momentum()<< ", " << vz <<G4endl;
71 theCurrentVelocity.setZ(vz);
72 theParticipants.DoLorentzBoost(-theCurrentVelocity);
73 G4LorentzVector Mom = aProjectile.Get4Momentum();
74 Mom.boost(-theCurrentVelocity);
75 G4ReactionProduct theProjectile;
76 theProjectile.SetDefinition(aProjectile.GetDefinition());
77 theProjectile.SetTotalEnergy(Mom.e());
78 theProjectile.SetMomentum(Mom.vect());
79//--DEBUG-- G4cout << "PreInteractionMomentum "<<Mom<<G4endl;
80 theParticipants.BuildInteractions(theProjectile);
81 theParticipants.GetWoundedNucleus()->DoLorentzBoost(theCurrentVelocity);
82 }
83
84template<class ParticipantType>
85G4ExcitedStringVector * G4QGSModel<ParticipantType>::GetStrings()
86{
87 // clean-up and consistancy with design, HPW Feb 1999
88 // also fixing a memory leak, removing unnecessary caching, and
89 // streamlining of logic
90 G4PartonPair* aPair;
91 G4ExcitedStringVector* theStrings = new G4ExcitedStringVector;
92 G4ExcitedString * aString;
93 while( (aPair = theParticipants.GetNextPartonPair()) )
94 {
95 if (aPair->GetCollisionType() == G4PartonPair::DIFFRACTIVE)
96 {
97 aString = theDiffractiveStringBuilder.BuildString(aPair);
98 // G4cout << "diffractive "<<aString->Get4Momentum()<<G4endl;
99 }
100 else
101 {
102 aString = theSoftStringBuilder.BuildString(aPair);
103 // G4cout << "soft "<<aString->Get4Momentum()<<G4endl;
104 }
105//--DEBUG-- G4cout << " QGSModel.icc::GetStrings() theCurrentVelocity " << theCurrentVelocity << G4endl;
106 aString->Boost(theCurrentVelocity);
107 theStrings->push_back(aString);
108 delete aPair;
109 }
110//--DEBUG-- G4cout << G4endl;
111// for(G4int i=0; i<theStrings->size(); i++)
112// {
113// G4cout << "String = "<<theStrings->operator[](i)->Get4Momentum()<<G4endl;
114// }
115 return theStrings;
116}
117
118template<class ParticipantType>
119G4V3DNucleus* G4QGSModel<ParticipantType>::GetWoundedNucleus() const
120{
121 return theParticipants.GetWoundedNucleus();
122}
123
124
125//*********************************************************************************************************************
126
Note: See TracBrowser for help on using the repository browser.