49 stringFragmentationModel(0),
68 #ifdef debug_PartonStringModel
70 G4cout<<
"-----------------------Parton-String model is runnung ------------"<<
G4endl;
90 toZ.rotateZ(-1*Ptmp.phi());
91 toZ.rotateY(-1*Ptmp.theta());
95 G4int attempts = 0, maxAttempts=20;
96 while ( strings == NULL )
98 if (attempts++ > maxAttempts )
101 "G4VPartonStringModel::Scatter(): fails to generate strings");
111 #ifdef debug_PartonStringModel
112 G4cout<<
"Parton-String model: Number of produced strings "<<strings->size()<<
G4endl;
115 for (
unsigned int astring=0; astring < strings->size(); astring++)
118 if((*strings)[astring]->IsExcited())
120 stringEnergy += (*strings)[astring]->GetLeftParton()->Get4Momentum().t();
121 stringEnergy += (*strings)[astring]->GetRightParton()->Get4Momentum().t();
122 (*strings)[astring]->LorentzRotate(toLab);
123 SumStringMom+=(*strings)[astring]->Get4Momentum();
124 #ifdef debug_PartonStringModel
125 G4cout<<
"String No "<<astring+1<<
" "<<(*strings)[astring]->Get4Momentum()<<
" "
126 <<(*strings)[astring]->Get4Momentum().mag()
127 <<
" Partons "<<(*strings)[astring]->GetLeftParton()->GetDefinition()->GetPDGEncoding()
128 <<
" "<<(*strings)[astring]->GetRightParton()->GetDefinition()->GetPDGEncoding()<<
G4endl;
133 stringEnergy += (*strings)[astring]->GetKineticTrack()->Get4Momentum().t();
134 (*strings)[astring]->LorentzRotate(toLab);
135 SumStringMom+=(*strings)[astring]->GetKineticTrack()->Get4Momentum();
136 #ifdef debug_PartonStringModel
137 G4cout<<
"A track No "<<astring+1<<
" "
138 <<(*strings)[astring]->GetKineticTrack()->Get4Momentum()<<
" "
139 <<(*strings)[astring]->GetKineticTrack()->Get4Momentum().mag()<<
" "
140 <<(*strings)[astring]->GetKineticTrack()->GetDefinition()->GetParticleName()<<
G4endl;
144 #ifdef debug_PartonStringModel
149 G4int hitsT(0), charged_hitsT(0);
150 G4int hitsP(0), charged_hitsP(0);
151 G4double ExcitationEt(0.), ExcitationEp(0.);
157 if(ProjResNucleus != 0)
159 theNuclNucleon = ProjResNucleus->
StartLoop() ?
161 while( theNuclNucleon )
166 #ifdef debug_PartonStringModel
167 ProjectileResidual4Momentum += tmp;
176 #ifdef debug_PartonStringModel
177 G4cout<<
"Projectile residual A, Z and E* "
181 G4cout<<
"Projectile residual 4 momentum "<<ProjectileResidual4Momentum<<
G4endl;
188 theNuclNucleon = ResNucleus->
StartLoop() ?
190 while( theNuclNucleon )
195 #ifdef debug_PartonStringModel
196 TargetResidual4Momentum += tmp;
205 #ifdef debug_PartonStringModel
206 G4cout<<
"Target residual A, Z and E* "
208 <<theNucleus.
GetZ_asInt() - charged_hitsT<<
" "
210 G4cout<<
"Target residual 4 momentum "<<TargetResidual4Momentum<<
G4endl;
212 Bsum+=( hitsT + hitsP);
213 Qsum+=(charged_hitsT + charged_hitsP);
215 G4cout<<
"Hitted # of nucleons of projectile and target "<<hitsP<<
" "<<hitsT<<
G4endl;
216 G4cout<<
"Hitted # of protons of projectile and target "
217 <<charged_hitsP<<
" "<<charged_hitsT<<G4endl<<
G4endl;
225 G4double InvMass=SumStringMom.mag();
230 #ifdef debug_PartonStringModel
232 G4int QsumSec(0), BsumSec(0);
246 if(attempts > maxAttempts )
break;
248 #ifdef debug_PartonStringModel
249 G4cout<<
"Attempt to fragment the strings "<<attempts<<
G4endl;
250 G4cout<<
"Parton-String model: Number of produced particles "<<theResult->size()<<
G4endl;
252 QsumSec = 0; BsumSec = 0;
257 for (
unsigned int i=0; i < theResult->size(); i++)
259 SumMass+=(*theResult)[i]->Get4Momentum().mag();
260 #ifdef debug_PartonStringModel
261 G4cout<<i<<
" : "<<(*theResult)[i]->GetDefinition()->GetParticleName()<<
" "
262 <<(*theResult)[i]->Get4Momentum()<<
" "
263 <<(*theResult)[i]->Get4Momentum().mag()<<
" "
264 <<(*theResult)[i]->GetDefinition()->GetPDGMass()<<
G4endl;
265 SumPsecondr+=(*theResult)[i]->Get4Momentum();
266 BsumSec += (*theResult)[i]->GetDefinition()->GetBaryonNumber();
267 QsumSec += (*theResult)[i]->GetDefinition()->GetPDGCharge();
271 #ifdef debug_PartonStringModel
272 if(Qsum != QsumSec) {
274 G4cout<<
" Qsum != QsumSec "<<Qsum<<
" "<<QsumSec<<
G4endl;
276 if(Bsum != BsumSec) {
278 G4cout<<
" Bsum != BsumSec "<<Bsum<<
" "<<BsumSec<<
G4endl;
281 }
while(SumMass > InvMass);
283 std::for_each(strings->begin(), strings->end(),
DeleteString() );
286 #ifdef debug_PartonStringModel
287 G4cout<<G4endl<<
"Baryon number balance "<<Bsum-BsumSec<<
G4endl;
289 G4cout <<
"4 momentum balance "<<SumStringMom-SumPsecondr<<
G4endl;
290 G4cout<<
"End of string model work ------------"<<G4endl<<
G4endl;
298 outFile <<
GetModelName() <<
" has no description yet.\n";
G4VPartonStringModel(const G4String &modelName="Parton String Model")
std::vector< G4ExcitedString * > G4ExcitedStringVector
virtual G4KineticTrackVector * FragmentStrings(const G4ExcitedStringVector *theStrings)=0
G4VPartonStringModel * theThis
void SetMomentum(G4LorentzVector &aMomentum)
CLHEP::HepLorentzRotation G4LorentzRotation
virtual G4bool StartLoop()=0
virtual G4V3DNucleus * GetWoundedNucleus() const =0
virtual G4V3DNucleus * GetProjectileNucleus() const
virtual const G4LorentzVector & Get4Momentum() const
G4ParticleDefinition * GetDefinition() const
static void ConstructParticle()
const G4String & GetParticleName() const
G4KineticTrackVector * Scatter(const G4Nucleus &theNucleus, const G4DynamicParticle &thePrimary)
virtual const G4ParticleDefinition * GetDefinition() const
virtual void ModelDescription(std::ostream &outFile) const
G4GLOB_DLL std::ostream G4cout
G4VStringFragmentation * stringFragmentationModel
static G4Proton * Proton()
G4LorentzVector Get4Momentum() const
void Set4Momentum(const G4LorentzVector &momentum)
virtual G4String GetModelName() const
virtual ~G4VPartonStringModel()
virtual void Init(const G4Nucleus &theNucleus, const G4DynamicParticle &thePrimary)=0
virtual G4ExcitedStringVector * GetStrings()=0
virtual G4Nucleon * GetNextNucleon()=0
G4double GetPDGCharge() const
G4double GetBindingEnergy() const
G4int GetBaryonNumber() const
CLHEP::HepLorentzVector G4LorentzVector