48 stringFragmentationModel(0),
69 #ifdef debug_PartonStringModel
71 G4cout<<
"-----------------------Parton-String model is runnung ------------"<<
G4endl;
81 G4cout<<
"-------------- Parton-String model: Generation of strings -------"<<G4endl<<
G4endl;
87 G4int QsumSec(0), BsumSec(0);
99 G4int attempts = 0, maxAttempts=1000;
102 if (attempts++ > maxAttempts )
108 while( theNuclNucleon )
110 if(theNuclNucleon->
AreYouHit()) theNuclNucleon->
Hit(
nullptr);
115 if(ProjResNucleus != 0)
118 while( theNuclNucleon )
120 if(theNuclNucleon->
AreYouHit()) theNuclNucleon->
Hit(
nullptr);
129 ed <<
"Target nucleus A Z " << theNucleus.
GetA_asInt() <<
" "
131 ed <<
"Initial states of projectile and target nucleus will be returned!"<<
G4endl;
132 G4Exception(
"G4VPartonStringModel::Scatter(): fails to generate or fragment strings ",
139 theResult->push_back(Hadron);
149 if (strings->size() == 0) { Success=
false;
continue; }
154 #ifdef debug_PartonStringModel
155 G4cout<<
"------------ Parton-String model: Number of produced strings ---- "<<strings->size()<<
G4endl;
158 for (
unsigned int astring=0; astring < strings->size(); astring++)
161 if((*strings)[astring]->IsExcited())
163 stringEnergy += (*strings)[astring]->GetLeftParton()->Get4Momentum().t();
164 stringEnergy += (*strings)[astring]->GetRightParton()->Get4Momentum().t();
165 (*strings)[astring]->LorentzRotate(toLab);
166 SumStringMom+=(*strings)[astring]->Get4Momentum();
167 #ifdef debug_PartonStringModel
168 G4cout<<
"String No "<<astring+1<<
" "<<(*strings)[astring]->Get4Momentum()<<
" "
169 <<(*strings)[astring]->Get4Momentum().mag()
170 <<
" Partons "<<(*strings)[astring]->GetLeftParton()->GetDefinition()->GetPDGEncoding()
171 <<
" "<<(*strings)[astring]->GetRightParton()->GetDefinition()->GetPDGEncoding()<<
G4endl;
176 stringEnergy += (*strings)[astring]->GetKineticTrack()->Get4Momentum().t();
177 (*strings)[astring]->LorentzRotate(toLab);
178 SumStringMom+=(*strings)[astring]->GetKineticTrack()->Get4Momentum();
179 #ifdef debug_PartonStringModel
180 G4cout<<
"A track No "<<astring+1<<
" "
181 <<(*strings)[astring]->GetKineticTrack()->Get4Momentum()<<
" "
182 <<(*strings)[astring]->GetKineticTrack()->Get4Momentum().mag()<<
" "
183 <<(*strings)[astring]->GetKineticTrack()->GetDefinition()->GetParticleName()<<
G4endl;
188 #ifdef debug_PartonStringModel
192 G4int hitsT(0), charged_hitsT(0);
193 G4int hitsP(0), charged_hitsP(0);
194 G4double ExcitationEt(0.), ExcitationEp(0.);
199 G4int numberProtonProjectileResidual( 0 ), numberNeutronProjectileResidual( 0 );
200 if(ProjResNucleus != 0)
203 G4int numberProtonProjectileHits( 0 ), numberNeutronProjectileHits( 0 );
204 while( theNuclNucleon )
209 #ifdef debug_PartonStringModel
210 ProjectileResidual4Momentum +=
tmp;
221 #ifdef debug_PartonStringModel
222 G4cout<<
"Projectile residual A, Z and E* "
226 G4cout<<
"Projectile residual 4 momentum "<<ProjectileResidual4Momentum<<
G4endl;
237 G4int numberProtonTargetHits( 0 ), numberNeutronTargetHits( 0 );
238 while( theNuclNucleon )
243 #ifdef debug_PartonStringModel
244 TargetResidual4Momentum +=
tmp;
256 #ifdef debug_PartonStringModel
257 G4cout<<
"Target residual A, Z and E* "
259 <<theNucleus.
GetZ_asInt() - charged_hitsT<<
" "
261 G4cout<<
"Target residual 4 momentum "<<TargetResidual4Momentum<<
G4endl;
262 Bsum+=( hitsT + hitsP);
263 Qsum+=(charged_hitsT + charged_hitsP);
264 G4cout<<
"Hitted # of nucleons of projectile and target "<<hitsP<<
" "<<hitsT<<
G4endl;
265 G4cout<<
"Hitted # of protons of projectile and target "
266 <<charged_hitsP<<
" "<<charged_hitsT<<G4endl<<
G4endl;
273 G4int numberProtonTargetResidual = theNucleus.
GetZ_asInt() - numberProtonTargetHits;
275 G4bool unphysicalResidual =
false;
276 if ( ( numberProtonTargetResidual > 3 && numberNeutronTargetResidual == 0 ) ||
277 ( numberProtonTargetResidual == 0 && numberNeutronTargetResidual > 1 ) ) {
278 unphysicalResidual =
true;
282 if ( ( numberProtonProjectileResidual > 3 && numberNeutronProjectileResidual == 0 ) ||
283 ( numberProtonProjectileResidual == 0 && numberNeutronProjectileResidual > 1 ) ) {
284 unphysicalResidual =
true;
288 if ( unphysicalResidual ) {
296 #ifdef debug_PartonStringModel
297 G4cout<<
"---------------- Attempt to fragment strings ------------- "<<attempts<<
G4endl;
303 #ifdef debug_PartonStringModel
304 QsumSec=0; BsumSec=0;
316 #ifdef debug_PartonStringModel
317 G4cout<<
"String fragmentation success (OK - #0, Not OK - 0) : "<<theResult<<
G4endl;
320 if(theResult == 0) {Success=
false;
continue;}
322 #ifdef debug_PartonStringModel
323 G4cout<<
"Parton-String model: Number of produced particles "<<theResult->size()<<
G4endl;
325 QsumSec = 0; BsumSec = 0;
330 for (
unsigned int i=0; i < theResult->size(); i++)
332 SumMass+=(*theResult)[i]->Get4Momentum().mag();
333 #ifdef debug_PartonStringModel
334 G4cout<<i<<
" : "<<(*theResult)[i]->GetDefinition()->GetParticleName()<<
" "
335 <<(*theResult)[i]->Get4Momentum()<<
" "
336 <<(*theResult)[i]->Get4Momentum().mag()<<
" "
337 <<(*theResult)[i]->GetDefinition()->GetPDGMass()<<
G4endl;
338 SumPsecondr+=(*theResult)[i]->Get4Momentum();
339 BsumSec += (*theResult)[i]->GetDefinition()->GetBaryonNumber();
340 QsumSec += (*theResult)[i]->GetDefinition()->GetPDGCharge();
344 #ifdef debug_PartonStringModel
345 G4cout<<G4endl<<
"-----------------------Parton-String model: balances -------------"<<
G4endl;
346 if(Qsum != QsumSec) {
348 G4cout<<
" Qsum != QsumSec "<<Qsum<<
" "<<QsumSec<<
G4endl;
350 if(Bsum != BsumSec) {
352 G4cout<<
" Bsum != BsumSec "<<Bsum<<
" "<<BsumSec<<
G4endl;
356 if((SumMass > InvMass)||(SumMass == 0.)) {Success=
false;}
357 std::for_each(strings->begin(), strings->end(),
DeleteString() );
362 #ifdef debug_PartonStringModel
363 G4cout <<
"Baryon number balance "<<Bsum-BsumSec<<
G4endl;
365 G4cout <<
"4 momentum balance "<<SumStringMom-SumPsecondr<<
G4endl;
366 G4cout<<
"---------------------End of Parton-String model work -------------"<<G4endl<<
G4endl;
374 outFile <<
GetModelName() <<
" has no description yet.\n";