72 #ifdef debug_PartonStringModel
74 G4cout<<
"-----------------------Parton-String model is runnung ------------"<<
G4endl;
84 G4cout<<
"-------------- Parton-String model: Generation of strings -------"<<
G4endl<<
G4endl;
90 G4int QsumSec(0), BsumSec(0);
102 G4int attempts = 0, maxAttempts=1000;
105 if (attempts++ > maxAttempts )
107 Init(theNucleus,thePrimary);
111 while( theNuclNucleon )
113 if(theNuclNucleon->
AreYouHit()) theNuclNucleon->
Hit(
nullptr);
118 if(ProjResNucleus != 0)
121 while( theNuclNucleon )
123 if(theNuclNucleon->
AreYouHit()) theNuclNucleon->
Hit(
nullptr);
132 ed <<
"Target nucleus A Z " << theNucleus.
GetA_asInt() <<
" "
134 ed <<
"Initial states of projectile and target nucleus will be returned!"<<
G4endl;
135 G4Exception(
"G4VPartonStringModel::Scatter(): fails to generate or fragment strings ",
142 theResult->push_back(Hadron);
148 Init(theNucleus,thePrimary);
152 if (strings->empty()) { Success=
false;
continue; }
157 #ifdef debug_PartonStringModel
158 G4cout<<
"------------ Parton-String model: Number of produced strings ---- "<<strings->size()<<
G4endl;
161 #ifdef debug_heavyHadrons
167 G4int count_charm_strings = 0, count_bottom_strings = 0;
168 G4int count_charm_hadrons = 0, count_bottom_hadrons = 0;
171 for (
unsigned int astring=0; astring < strings->size(); astring++)
174 if((*strings)[astring]->IsExcited())
178 (*strings)[astring]->LorentzRotate(toLab);
179 SumStringMom+=(*strings)[astring]->Get4Momentum();
180 #ifdef debug_PartonStringModel
181 G4cout<<
"String No "<<astring+1<<
" "<<(*strings)[astring]->Get4Momentum()<<
" "
182 <<(*strings)[astring]->Get4Momentum().
mag()
183 <<
" Partons "<<(*strings)[astring]->GetLeftParton()->GetDefinition()->GetPDGEncoding()
184 <<
" "<<(*strings)[astring]->GetRightParton()->GetDefinition()->GetPDGEncoding()<<
G4endl;
187 #ifdef debug_heavyHadrons
188 G4int left_charm = (*strings)[astring]->GetLeftParton()->GetDefinition()->GetQuarkContent( 4 );
189 G4int left_anticharm = (*strings)[astring]->GetLeftParton()->GetDefinition()->GetAntiQuarkContent( 4 );
190 G4int right_charm = (*strings)[astring]->GetRightParton()->GetDefinition()->GetQuarkContent( 4 );
191 G4int right_anticharm = (*strings)[astring]->GetRightParton()->GetDefinition()->GetAntiQuarkContent( 4 );
192 G4int left_bottom = (*strings)[astring]->GetLeftParton()->GetDefinition()->GetQuarkContent( 5 );
193 G4int left_antibottom = (*strings)[astring]->GetLeftParton()->GetDefinition()->GetAntiQuarkContent( 5 );
194 G4int right_bottom = (*strings)[astring]->GetRightParton()->GetDefinition()->GetQuarkContent( 5 );
195 G4int right_antibottom = (*strings)[astring]->GetRightParton()->GetDefinition()->GetAntiQuarkContent( 5 );
196 if ( left_charm != 0 || left_anticharm != 0 || right_charm != 0 || right_anticharm != 0 ||
197 left_bottom != 0 || left_antibottom != 0 || right_bottom != 0 || right_antibottom != 0 ) {
198 count_charm_strings += left_charm - left_anticharm + right_charm - right_anticharm;
199 count_bottom_strings += left_bottom - left_antibottom + right_bottom - right_antibottom;
200 G4cout <<
"G4VPartonStringModel::Scatter : string #" << astring <<
" ("
201 << (*strings)[astring]->GetLeftParton()->GetDefinition()->GetParticleName() <<
" , "
202 << (*strings)[astring]->GetRightParton()->GetDefinition()->GetParticleName() <<
")" <<
G4endl;
209 (*strings)[astring]->LorentzRotate(toLab);
210 SumStringMom+=(*strings)[astring]->GetKineticTrack()->Get4Momentum();
211 #ifdef debug_PartonStringModel
212 G4cout<<
"A track No "<<astring+1<<
" "
213 <<(*strings)[astring]->GetKineticTrack()->Get4Momentum()<<
" "
214 <<(*strings)[astring]->GetKineticTrack()->Get4Momentum().
mag()<<
" "
215 <<(*strings)[astring]->GetKineticTrack()->GetDefinition()->GetParticleName()<<
G4endl;
218 #ifdef debug_heavyHadrons
219 G4int charm = (*strings)[astring]->GetKineticTrack()->GetDefinition()->GetQuarkContent( 4 );
220 G4int anticharm = (*strings)[astring]->GetKineticTrack()->GetDefinition()->GetAntiQuarkContent( 4 );
221 G4int bottom = (*strings)[astring]->GetKineticTrack()->GetDefinition()->GetQuarkContent( 5 );
222 G4int antibottom = (*strings)[astring]->GetKineticTrack()->GetDefinition()->GetAntiQuarkContent( 5 );
223 if ( charm != 0 || anticharm != 0 || bottom != 0 || antibottom != 0 ) {
224 count_charm_strings += charm - anticharm;
225 count_bottom_strings += bottom - antibottom;
226 G4cout <<
"G4VPartonStringModel::Scatter : track #" << astring <<
"\t"
227 << (*strings)[astring]->GetKineticTrack()->GetDefinition()->GetParticleName() <<
G4endl;
233 #ifdef debug_heavyHadrons
234 if ( count_charm_projectile != count_charm_strings ) {
235 G4cout <<
"G4VPartonStringModel::Scatter : CHARM VIOLATION in String formation ! #projectile="
236 << count_charm_projectile <<
" ; #strings=" << count_charm_strings <<
G4endl;
238 if ( count_bottom_projectile != count_bottom_strings ) {
239 G4cout <<
"G4VPartonStringModel::Scatter : BOTTOM VIOLATION in String formation ! #projectile="
240 << count_bottom_projectile <<
" ; #strings=" << count_bottom_strings <<
G4endl;
244 #ifdef debug_PartonStringModel
248 G4int hitsT(0), charged_hitsT(0);
249 G4int hitsP(0), charged_hitsP(0);
250 G4double ExcitationEt(0.), ExcitationEp(0.);
258 G4int numberProtonProjectileResidual( 0 ), numberNeutronProjectileResidual( 0 );
259 G4int numberLambdaProjectileResidual( 0 );
260 if(ProjResNucleus != 0)
263 G4int numberProtonProjectileHits( 0 ), numberNeutronProjectileHits( 0 );
264 G4int numberLambdaProjectileHits( 0 );
265 while( theNuclNucleon )
271 #ifdef debug_PartonStringModel
272 ProjectileResidual4Momentum += tmp;
284 G4int numberLambdaProjectile = 0;
290 #ifdef debug_PartonStringModel
291 G4cout<<
"Projectile residual A, Z (numberOfLambdasOrAntiLambdas) and E* "
294 << numberLambdaProjectile - numberLambdaProjectileHits <<
") "
296 G4cout<<
"Projectile residual 4 momentum "<<ProjectileResidual4Momentum<<
G4endl;
299 numberProtonProjectileHits, 0 );
300 numberLambdaProjectileResidual = std::max( numberLambdaProjectile - numberLambdaProjectileHits, 0 );
303 numberLambdaProjectile - numberNeutronProjectileHits, 0 );
310 G4int numberProtonTargetHits( 0 ), numberNeutronTargetHits( 0 );
311 while( theNuclNucleon )
316 #ifdef debug_PartonStringModel
317 TargetResidual4Momentum += tmp;
329 #ifdef debug_PartonStringModel
330 G4cout<<
"Target residual A, Z and E* "
332 <<theNucleus.
GetZ_asInt() - charged_hitsT<<
" "
334 G4cout<<
"Target residual 4 momentum "<<TargetResidual4Momentum<<
G4endl;
335 Bsum+=( hitsT + hitsP);
336 Qsum+=(charged_hitsT + charged_hitsP);
337 G4cout<<
"Hitted # of nucleons of projectile and target "<<hitsP<<
" "<<hitsT<<
G4endl;
338 G4cout<<
"Hitted # of protons of projectile and target "
346 G4int numberProtonTargetResidual = theNucleus.
GetZ_asInt() - numberProtonTargetHits;
348 G4bool unphysicalResidual =
false;
349 if ( ( numberProtonTargetResidual > 3 && numberNeutronTargetResidual == 0 ) ||
350 ( numberProtonTargetResidual == 0 && numberNeutronTargetResidual > 1 ) ) {
351 unphysicalResidual =
true;
360 if ( ( numberProtonProjectileResidual > 3 && numberNeutronProjectileResidual == 0 ) ||
361 ( numberProtonProjectileResidual == 0 && numberNeutronProjectileResidual > 1 &&
362 numberLambdaProjectileResidual == 0 ) ||
363 ( numberProtonProjectileResidual == 0 && numberNeutronProjectileResidual <= 1 &&
364 numberLambdaProjectileResidual > 0 ) ||
365 ( numberProtonProjectileResidual == 0 && numberNeutronProjectileResidual > 2 &&
366 numberLambdaProjectileResidual > 0 ) ||
367 ( numberLambdaProjectileResidual > 2 ) ||
368 ( numberProtonProjectileResidual > 0 && numberNeutronProjectileResidual == 0 &&
369 numberLambdaProjectileResidual > 0 ) ||
370 ( numberProtonProjectileResidual > 1 && numberNeutronProjectileResidual > 1 &&
371 numberLambdaProjectileResidual > 1 )
373 unphysicalResidual =
true;
378 if ( unphysicalResidual ) {
386 #ifdef debug_PartonStringModel
387 G4cout<<
"---------------- Attempt to fragment strings ------------- "<<attempts<<
G4endl;
393 #ifdef debug_PartonStringModel
394 QsumSec=0; BsumSec=0;
398 if(theResult !=
nullptr)
406 #ifdef debug_PartonStringModel
407 G4cout<<
"String fragmentation success (OK - #0, Not OK - 0) : "<<theResult<<
G4endl;
410 if(theResult == 0) {Success=
false;
continue;}
412 #ifdef debug_PartonStringModel
413 G4cout<<
"Parton-String model: Number of produced particles "<<theResult->size()<<
G4endl;
415 QsumSec = 0; BsumSec = 0;
419 for (
unsigned int i=0; i < theResult->size(); i++)
421 SumMass+=(*theResult)[i]->Get4Momentum().mag();
422 #ifdef debug_PartonStringModel
423 G4cout<<i<<
" : "<<(*theResult)[i]->GetDefinition()->GetParticleName()<<
" "
424 <<(*theResult)[i]->Get4Momentum()<<
" "
425 <<(*theResult)[i]->Get4Momentum().mag()<<
" "
426 <<(*theResult)[i]->GetDefinition()->GetPDGMass()<<
G4endl;
427 SumPsecondr+=(*theResult)[i]->Get4Momentum();
428 BsumSec += (*theResult)[i]->GetDefinition()->GetBaryonNumber();
429 QsumSec += (*theResult)[i]->GetDefinition()->GetPDGCharge();
432 #ifdef debug_heavyHadrons
433 G4int charm = (*theResult)[i]->GetDefinition()->GetQuarkContent( 4 );
434 G4int anticharm = (*theResult)[i]->GetDefinition()->GetAntiQuarkContent( 4 );
435 G4int bottom = (*theResult)[i]->GetDefinition()->GetQuarkContent( 5 );
436 G4int antibottom = (*theResult)[i]->GetDefinition()->GetAntiQuarkContent( 5 );
437 if ( charm != 0 || anticharm != 0 || bottom != 0 || antibottom != 0 ) {
438 count_charm_hadrons += charm - anticharm;
439 count_bottom_hadrons += bottom - antibottom;
440 G4cout <<
"G4VPartonStringModel::Scatter : hadron #" << i <<
"\t"
441 << (*theResult)[i]->GetDefinition()->GetParticleName() <<
G4endl;
446 #ifdef debug_heavyHadrons
447 if ( count_charm_projectile != count_charm_hadrons ) {
448 G4cout <<
"G4VPartonStringModel::Scatter : CHARM VIOLATION in String hadronization ! #projectile="
449 << count_charm_projectile <<
" ; #hadrons=" << count_charm_hadrons <<
G4endl;
451 if ( count_bottom_projectile != count_bottom_hadrons ) {
452 G4cout <<
"G4VPartonStringModel::Scatter : BOTTOM VIOLATION in String hadronization ! #projectile="
453 << count_bottom_projectile <<
" ; #hadrons=" << count_bottom_hadrons <<
G4endl;
457 #ifdef debug_PartonStringModel
458 G4cout<<
G4endl<<
"-----------------------Parton-String model: balances -------------"<<
G4endl;
459 if(Qsum != QsumSec) {
461 G4cout<<
" Qsum != QsumSec "<<Qsum<<
" "<<QsumSec<<
G4endl;
463 if(Bsum != BsumSec) {
465 G4cout<<
" Bsum != BsumSec "<<Bsum<<
" "<<BsumSec<<
G4endl;
469 if((SumMass > InvMass)||(SumMass == 0.)) {Success=
false;}
470 std::for_each(strings->begin(), strings->end(),
DeleteString() );
475 #ifdef debug_PartonStringModel
476 G4cout <<
"Baryon number balance "<<Bsum-BsumSec<<
G4endl;
478 G4cout <<
"4 momentum balance "<<SumStringMom-SumPsecondr<<
G4endl;
479 G4cout<<
"---------------------End of Parton-String model work -------------"<<
G4endl<<
G4endl;