65{
71
72 #ifdef debug_PartonStringModel
74 G4cout<<
"-----------------------Parton-String model is runnung ------------"<<
G4endl;
84 G4cout<<
"-------------- Parton-String model: Generation of strings -------"<<
G4endl<<
G4endl;
89 }
90 G4int QsumSec(0), BsumSec(0);
92 #endif
93
100
102 G4int attempts = 0, maxAttempts=1000;
103 do
104 {
105 if (attempts++ > maxAttempts )
106 {
107 Init(theNucleus,thePrimary);
108
111 while( theNuclNucleon )
112 {
113 if(theNuclNucleon->AreYouHit()) theNuclNucleon->Hit(nullptr);
115 }
116
118 if(ProjResNucleus != 0)
119 {
121 while( theNuclNucleon )
122 {
123 if(theNuclNucleon->AreYouHit()) theNuclNucleon->Hit(nullptr);
125 }
126 }
127
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 ",
137
140 Position, aPrimary.Get4Momentum());
142 theResult->push_back(Hadron);
143 return theResult;
144 }
145
146 Success=true;
147
148 Init(theNucleus,thePrimary);
149
151
152 if (strings->empty()) { Success=false; continue; }
153
154
156
157 #ifdef debug_PartonStringModel
158 G4cout<<
"------------ Parton-String model: Number of produced strings ---- "<<strings->size()<<
G4endl;
159 #endif
160
161 #ifdef debug_heavyHadrons
162
167 G4int count_charm_strings = 0, count_bottom_strings = 0;
168 G4int count_charm_hadrons = 0, count_bottom_hadrons = 0;
169 #endif
170
171 for ( unsigned int astring=0; astring < strings->size(); astring++)
172 {
173
174 if((*strings)[astring]->IsExcited())
175 {
176
177
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;
185 #endif
186
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;
203 }
204 #endif
205 }
206 else
207 {
208
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;
216 #endif
217
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;
228 }
229 #endif
230 }
231 }
232
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;
237 }
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;
241 }
242 #endif
243
244 #ifdef debug_PartonStringModel
248 G4int hitsT(0), charged_hitsT(0);
249 G4int hitsP(0), charged_hitsP(0);
250 G4double ExcitationEt(0.), ExcitationEp(0.);
251 #endif
252
253
254
255
257
258 G4int numberProtonProjectileResidual( 0 ), numberNeutronProjectileResidual( 0 );
259 G4int numberLambdaProjectileResidual( 0 );
260 if(ProjResNucleus != 0)
261 {
263 G4int numberProtonProjectileHits( 0 ), numberNeutronProjectileHits( 0 );
264 G4int numberLambdaProjectileHits( 0 );
265 while( theNuclNucleon )
266 {
267 if(theNuclNucleon->AreYouHit())
268 {
271 #ifdef debug_PartonStringModel
272 ProjectileResidual4Momentum += tmp;
273 hitsP++;
275 ExcitationEp +=theNuclNucleon->GetBindingEnergy();
276 #endif
277 theNuclNucleon->SetMomentum(tmp);
281 }
283 }
284 G4int numberLambdaProjectile = 0;
289 }
290 #ifdef debug_PartonStringModel
291 G4cout<<
"Projectile residual A, Z (numberOfLambdasOrAntiLambdas) and E* "
294 << numberLambdaProjectile - numberLambdaProjectileHits << ") "
296 G4cout<<
"Projectile residual 4 momentum "<<ProjectileResidual4Momentum<<
G4endl;
297 #endif
299 numberProtonProjectileHits, 0 );
300 numberLambdaProjectileResidual = std::max( numberLambdaProjectile - numberLambdaProjectileHits, 0 );
303 numberLambdaProjectile - numberNeutronProjectileHits, 0 );
304 }
305
307
308
310 G4int numberProtonTargetHits( 0 ), numberNeutronTargetHits( 0 );
311 while( theNuclNucleon )
312 {
313 if(theNuclNucleon->AreYouHit())
314 {
316 #ifdef debug_PartonStringModel
317 TargetResidual4Momentum += tmp;
318 hitsT++;
319 if ( theNuclNucleon->GetDefinition() ==
G4Proton::Proton() ) ++charged_hitsT;
320 ExcitationEt +=theNuclNucleon->GetBindingEnergy();
321 #endif
322 theNuclNucleon->SetMomentum(tmp);
323 if ( theNuclNucleon->GetDefinition() ==
G4Proton::Proton() ) ++numberProtonTargetHits;
324 if ( theNuclNucleon->GetDefinition() ==
G4Neutron::Neutron() ) ++numberNeutronTargetHits;
325 }
327 }
328
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 "
341 #endif
342
343
344
345
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;
352
353
354 }
355
356
357
358
359
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 )
372 ) {
373 unphysicalResidual = true;
374
375
376
377 }
378 if ( unphysicalResidual ) {
379
380 Success = false;
381 continue;
382 }
383
384
385
386 #ifdef debug_PartonStringModel
387 G4cout<<
"---------------- Attempt to fragment strings ------------- "<<attempts<<
G4endl;
388 #endif
389
390 G4double InvMass=SumStringMom.mag();
392
393 #ifdef debug_PartonStringModel
394 QsumSec=0; BsumSec=0;
396 #endif
397
398 if(theResult != nullptr)
399 {
401 delete theResult;
402 }
403
405
406 #ifdef debug_PartonStringModel
407 G4cout<<
"String fragmentation success (OK - #0, Not OK - 0) : "<<theResult<<
G4endl;
408 #endif
409
410 if(theResult == 0) {Success=false; continue;}
411
412 #ifdef debug_PartonStringModel
413 G4cout<<
"Parton-String model: Number of produced particles "<<theResult->size()<<
G4endl;
415 QsumSec = 0; BsumSec = 0;
416 #endif
417
418 SumMass=0.;
419 for ( unsigned int i=0; i < theResult->size(); i++)
420 {
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();
430 #endif
431
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;
442 }
443 #endif
444 }
445
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;
450 }
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;
454 }
455 #endif
456
457 #ifdef debug_PartonStringModel
458 G4cout<<
G4endl<<
"-----------------------Parton-String model: balances -------------"<<
G4endl;
459 if(Qsum != QsumSec) {
461 G4cout<<
" Qsum != QsumSec "<<Qsum<<
" "<<QsumSec<<
G4endl;
462 }
463 if(Bsum != BsumSec) {
465 G4cout<<
" Bsum != BsumSec "<<Bsum<<
" "<<BsumSec<<
G4endl;
466 }
467 #endif
468
469 if((SumMass > InvMass)||(SumMass == 0.)) {Success=false;}
470 std::for_each(strings->begin(), strings->end(),
DeleteString() );
471 delete strings;
472
473 } while(!Success);
474
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;
480 #endif
481
482 return theResult;
483}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
std::vector< G4ExcitedString * > G4ExcitedStringVector
CLHEP::HepLorentzVector G4LorentzVector
G4GLOB_DLL std::ostream G4cout
HepLorentzRotation & rotateY(double delta)
HepLorentzRotation & rotateZ(double delta)
HepLorentzRotation inverse() const
static G4AntiLambda * Definition()
static G4AntiNeutron * Definition()
static G4AntiProton * Definition()
G4ParticleDefinition * GetDefinition() const
G4LorentzVector Get4Momentum() const
void Set4Momentum(const G4LorentzVector &momentum)
static G4Lambda * Definition()
static G4Neutron * Neutron()
static G4Neutron * Definition()
G4int GetQuarkContent(G4int flavor) const
G4double GetPDGCharge() const
G4int GetNumberOfLambdasInHypernucleus() const
G4bool IsHypernucleus() const
G4bool IsAntiHypernucleus() const
G4int GetBaryonNumber() const
G4int GetNumberOfAntiLambdasInAntiHypernucleus() const
const G4String & GetParticleName() const
G4int GetAntiQuarkContent(G4int flavor) const
static G4Proton * Definition()
static G4Proton * Proton()
virtual G4double GetOuterRadius()=0
virtual G4Nucleon * GetNextNucleon()=0
virtual G4bool StartLoop()=0
virtual G4V3DNucleus * GetWoundedNucleus() const =0
virtual void Init(const G4Nucleus &theNucleus, const G4DynamicParticle &thePrimary)=0
virtual G4ExcitedStringVector * GetStrings()=0
G4V3DNucleus * GetProjectileNucleus() const override
virtual G4KineticTrackVector * FragmentStrings(const G4ExcitedStringVector *theStrings)=0