121{
128 static const G4int pcl=4;
138#ifdef debug
139 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate is called"<<
G4endl;
140#endif
141
142
143 if(theSecondaries->size() == 1)
144 {
151 theFastResult->push_back(theFastSec);
152 return theFastResult;
153
154
155 }
156
157
158
159
166 unsigned int hitCount = 0;
168 {
170 {
171 resA++;
173 }
174 else
175 {
178 hitCount ++;
179 }
180 }
181 G4int targetPDGCode = 90000000 + 1000*resZ + (resA-resZ);
183 if (!resZ)
184 {
185 if (resA>1) targetMass*=resA;
186 }
189 G4double targetEnergy = std::sqrt(hitMomentum.mag2()+targetMass*targetMass);
190
192
193
196 G4double impactY = theImpact.second;
197 G4double impactPar2 = impactX*impactX + impactY*impactY;
199
200 radius2 *= radius2;
202#ifdef ppdebug
203 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: r="<<std::sqrt(radius2)/fermi
204 <<
", b="<<std::sqrt(impactPar2)/fermi<<
", R="<<theNucleus->
GetOuterRadius()/fermi
205 <<
", b/r="<<std::sqrt(impactPar2/radius2)<<
G4endl;
206#endif
207 if(radius2 - impactPar2>0) pathlength = 2.*std::sqrt(radius2 - impactPar2);
208
209#ifdef hdebug_SCPLI
210 toth+=1.;
211 G4double bfm=std::sqrt(impactPar2)/fermi;
215 if(nbi<nbh) bhis[nbi]++;
216 else bover++;
217 if(nei<nbh) ehis[nei]++;
218 else eover++;
219#endif
220 G4double theEnergyLostInFragmentation = theEnergyLossPerFermi*pathlength/fermi;
221
222
223 std::list<std::pair<G4double, G4KineticTrack *> > theSorted;
224 std::list<std::pair<G4double, G4KineticTrack *> >::iterator current;
225 for(unsigned int secondary = 0; secondary<theSecondaries->size(); secondary++)
226 {
227 G4LorentzVector a4Mom = theSecondaries->operator[](secondary)->Get4Momentum();
228#ifdef CHIPSdebug
229 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: ALL STRING particles "
230 << theSecondaries->operator[](secondary)->GetDefinition()->GetPDGCharge()<<" "
231 << theSecondaries->operator[](secondary)->GetDefinition()->GetPDGEncoding()<<" "
233#endif
234#ifdef pdebug
235 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: in C="
236 <<theSecondaries->operator[](secondary)->GetDefinition()->GetPDGCharge()<<",PDG="
237 <<theSecondaries->operator[](secondary)->GetDefinition()->GetPDGEncoding()
238 <<
",4M="<<a4Mom<<
", current nS="<<theSorted.size()<<
G4endl;
239#endif
241 std::pair<G4double, G4KineticTrack *> it;
242 it.first = toSort;
243 it.second = theSecondaries->operator[](secondary);
245 for(current = theSorted.begin(); current!=theSorted.end(); current++)
246 {
247 if((*current).first > toSort)
248 {
249 theSorted.insert(current, it);
250 inserted = true;
251 break;
252 }
253 }
254 if(!inserted) theSorted.push_back(it);
255 }
256
264 std::list<std::pair<G4double,G4KineticTrack*> >::iterator firstEscape=theSorted.begin();
266 G4int particleCount = 0;
267 G4LorentzVector theLow = (*(theSorted.begin())).second->Get4Momentum();
269
270#ifdef CHIPSdebug
271 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: CHIPS ENERGY LOST "
272 <<theEnergyLostInFragmentation<<
". Sorted rapidities event start"<<
G4endl;
273#endif
274#ifdef pdebug
275 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: total CHIPS energy = "
276 <<theEnergyLostInFragmentation<<". Start rapidity sorting nS="<<theSorted.size()
278#endif
279
281 std::vector<G4QContent> theContents;
282 std::vector<G4LorentzVector*> theMomenta;
287#ifdef pdebug
288 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: Absorption nS="
289 <<theSorted.size()<<
G4endl;
290#endif
291 G4bool EscapeExists =
false;
292 for(current = theSorted.begin(); current!=theSorted.end(); current++)
293 {
294#ifdef pdebug
295 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: nq="
296 <<(*current).second->GetDefinition()->GetQuarkContent(3)<<", naq="
297 <<(*current).second->GetDefinition()->GetAntiQuarkContent(3)<<", PDG="
298 <<(*current).second->GetDefinition()->GetPDGEncoding()<<",4M="
299 <<(*current).second->Get4Momentum()<<
G4endl;
300#endif
301 firstEscape = current;
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
352 if (baryn>0 && charge>0 && strang<1) runningEnergy-=mProt;
353 else if(baryn>0 && strang<1) runningEnergy-=mNeut;
354 else if(baryn>0) runningEnergy-=mLamb;
355 else if(baryn<0) runningEnergy+=mProt;
356
357#ifdef CHIPSdebug
358 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: sorted rapidities "
359 <<(*current).second->Get4Momentum().rapidity()<<
G4endl;
360#endif
361
362#ifdef pdebug
363 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: E="<<runningEnergy<<
", EL="
364 <<theEnergyLostInFragmentation<<
G4endl;
365#endif
366 if(runningEnergy > theEnergyLostInFragmentation)
367 {
368 EscapeExists = true;
369 break;
370 }
371#ifdef CHIPSdebug
372 G4cout <<
"G4StringChipsParticleLevelInterface::Propagate: ABSORBED STRING particles "
373 <<(*current).second->GetDefinition()->GetPDGCharge()<<" "
374 << (*current).second->GetDefinition()->GetPDGEncoding()<<" "
375 << (*current).second->Get4Momentum() <<
G4endl;
376#endif
377#ifdef pdebug
378 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate:C="
379 <<current->second->GetDefinition()->GetPDGCharge()<<", PDG="
380 <<current->second->GetDefinition()->GetPDGEncoding()<<", 4M="
381 <<current->second->Get4Momentum()<<
G4endl;
382#endif
383
384
385 particleCount++;
386 theHigh = (*current).second->Get4Momentum();
387 proj4Mom = (*current).second->Get4Momentum();
388 proj4Mom.
boost(-1.*targ4Mom.boostVector());
389 nD = (*current).second->GetDefinition()->GetQuarkContent(1);
390 nU = (*current).second->GetDefinition()->GetQuarkContent(2);
391 nS = (*current).second->GetDefinition()->GetQuarkContent(3);
392 nAD = (*current).second->GetDefinition()->GetAntiQuarkContent(1);
393 nAU = (*current).second->GetDefinition()->GetAntiQuarkContent(2);
394 nAS = (*current).second->GetDefinition()->GetAntiQuarkContent(3);
395 G4QContent aProjectile(nD, nU, nS, nAD, nAU, nAS);
396
397#ifdef CHIPSdebug_1
399 G4cout <<
"G4StringChipsParticleLevelInterface::Propagate: Quark content: d="<<nD
400 <<", u="<<nU<<", s="<<nS<< "Anti-quark content: anit-d="<<nAD<<", anti-u="<<nAU
401 <<", anti-s="<<nAS<<". G4QContent is constructed"<<endl;
402#endif
403
404 theContents.push_back(aProjectile);
406
407#ifdef CHIPSdebug_1
408 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: projectile momentum = "
411#endif
412
413 theMomenta.push_back(aVec);
414 }
415 std::vector<G4QContent> theFinalContents;
416 std::vector<G4LorentzVector*> theFinalMomenta;
417
418
419
420
421
422
423
424
427
431 for(
G4int hp = theContents.size()-1; hp>=0; hp--)
432 {
437 EnFlowQC += curQC;
438 EnFlow4M += *(theMomenta[hp]);
439 barys += baryn;
440 stras += stran;
441 chars += charg;
442
443 }
444 if(barys>pcl)
445 {
446 G4int nprt=(barys-1)/pcl+1;
448 while (nprt>0)
449 {
450 nprt--;
452 curb-=brnm;
457 if(stras>0) strm=(stras-1)/nprt+1;
458 else if(stras<0) strm=(stras+1)/nprt-1;
460 if(stras>0) chgm=(chars-1)/nprt+1;
461 else if(stras<0) chgm=(chars+1)/nprt-1;
462
463
464 if(!strm)
465 {
466 if(chgm<0)
467 {
468 prtM=(-chgm)*mPiCh+brnm*mNeut;
469 prtQC=(-chgm)*PiMiQC+brnm*NeutQC;
470 }
471 else
472 {
473 prtM=chgm*mProt+(brnm-chgm)*mNeut;
474 prtQC=chgm*ProtQC+(brnm-chgm)*NeutQC;
475 }
476 }
477 else if(strm>=brnm)
478 {
479 G4int stmb=strm-brnm;
480 if(chgm<0)
481 {
482 prtM=(-chgm)*mKChg+brnm*mLamb+std::abs(stmb+chgm)*mKZer;
483 prtQC=(-chgm)*KMinQC+brnm*LambQC;
484 if(stmb>-chgm) prtQC+=(stmb+chgm)*KZerQC;
485 else if(stmb<-chgm) prtQC+=(-stmb-chgm)*AKZrQC;
486 }
487 else
488 {
489 prtM=chgm*mPiCh+(strm-brnm)*mKZer+brnm*mLamb;
490 prtQC=chgm*PiPlQC+(strm-brnm)*KZerQC+brnm*LambQC;
491 }
492 }
493 else if(strm>0)
494 {
495 G4int bmst=brnm-strm;
496 if(chgm<0)
497 {
498 prtM=(-chgm)*mPiCh+strm*mLamb+bmst*mNeut;
499 prtQC=(-chgm)*PiMiQC+strm*LambQC+bmst*NeutQC;
500 }
501 else if(chgm>=bmst)
502 {
503 prtM=(chgm-bmst)*mPiCh+strm*mLamb+bmst*mProt;
504 prtQC=(chgm-bmst)*PiPlQC+strm*LambQC+bmst*ProtQC;
505 }
506 else
507 {
508 prtM=chgm*mProt+strm*mLamb+(bmst-chgm)*mNeut;
509 prtQC=chgm*ProtQC+strm*LambQC+(bmst-chgm)*NeutQC;
510 }
511 }
512 else
513 {
514 G4int bmst=brnm-strm;
515 if(chgm>=bmst)
516 {
517 prtM=(-strm)*mKChg+brnm*mProt+(chgm-bmst)*mPiCh;
518 prtQC=(-strm)*KPlsQC+brnm*ProtQC+(chgm-bmst)*PiPlQC;
519 }
520 else if(chgm>=-strm)
521 {
522 prtM=(-strm)*mKChg+chgm*mProt+(brnm-chgm)*mNeut;
523 prtQC=(-strm)*KPlsQC+chgm*ProtQC+(brnm-chgm)*NeutQC;
524 }
525 else if(chgm>=0)
526 {
527 prtM=chgm*mKChg+(-chgm-strm)*mKZer+brnm*mNeut;
528 prtQC=chgm*KPlsQC+(-chgm-strm)*AKZrQC+brnm*NeutQC;
529 }
530 else
531 {
532 prtM=(-strm)*mKChg+(-chgm)*mPiCh+brnm*mNeut;
533 prtQC=(-strm)*KPlsQC+(-chgm)*PiMiQC+brnm*NeutQC;
534 }
535 }
536 EnFlowQC-=prtQC;
537 chgm=chars-chgm;
538 strm=stras-strm;
539 brnm=curb;
540 if(!strm)
541 {
542 if(chgm<0) resM=(-chgm)*mPiCh+brnm*mNeut;
543 else resM=chgm*mProt+(brnm-chgm)*mNeut;
544 }
545 else if(strm>=brnm)
546 {
547 G4int stmb=strm-brnm;
548 if(chgm<0) resM=(-chgm)*mKChg+brnm*mLamb+std::abs(stmb+chgm)*mKZer;
549 else resM=chgm*mPiCh+(strm-brnm)*mKZer+brnm*mLamb;
550 }
551 else if(strm>0)
552 {
553 G4int bmst=brnm-strm;
554 if (chgm<0) resM=(-chgm)*mPiCh+strm*mLamb+bmst*mNeut;
555 else if(chgm>=bmst) resM=(chgm-bmst)*mPiCh+strm*mLamb+bmst*mProt;
556 else resM=chgm*mProt+strm*mLamb+(bmst-chgm)*mNeut;
557 }
558 else
559 {
560 G4int bmst=brnm-strm;
561 if (chgm>=bmst) resM=(-strm)*mKChg+brnm*mProt+(chgm-bmst)*mPiCh;
562 else if(chgm>=-strm) resM=(-strm)*mKChg+chgm*mProt+(brnm-chgm)*mNeut;
563 else if(chgm>=0) resM=chgm*mKChg+(-chgm-strm)*mKZer+brnm*mNeut;
564 else resM=(-strm)*mKChg+(-chgm)*mPiCh+brnm*mNeut;
565 }
567 EnFlow4M-=prt4M;
568 EnFlowQC-=prtQC;
570 projHV.push_back(aHadron);
571 if(nprt==1)
572 {
574 projHV.push_back(fHadron);
575 nprt=0;
576 }
577#ifdef debug
578 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: nprt="<<nprt<<
G4endl;
579#endif
580 }
581 }
582 else
583 {
585 projHV.push_back(aHadron);
586 }
587
588
589 size_t i;
590 for (i=0; i<theFinalMomenta.size(); i++) delete theFinalMomenta[i];
591 for (i=0; i<theMomenta.size(); i++) delete theMomenta[i];
592 theFinalMomenta.clear();
593 theMomenta.clear();
594
596 fractionOfPairedQuasiFreeNucleons,
597 clusteringCoefficient,
598 fusionToExchange);
600
601#ifdef CHIPSdebug
602 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: G4QNucleus parameters "
603 <<fractionOfSingleQuasiFreeNucleons<<" "<<fractionOfPairedQuasiFreeNucleons
604 <<
" "<<clusteringCoefficient<<
G4endl;
605 G4cout<<
"G4Quasmon parameters "<<temperature<<
" "<<halfTheStrangenessOfSee<<
" "
606 <<etaToEtaPrime <<
G4endl;
607 G4cout<<
"The Target PDG code = "<<targetPDGCode<<
G4endl;
608 G4cout<<
"The projectile momentum = "<<1./MeV*proj4Mom<<
G4endl;
609 G4cout<<
"The target momentum = "<<1./MeV*targ4Mom<<
G4endl;
610#endif
611
612
614 if (particleCount!=0 && resA!=0)
615 {
616
619#ifdef pdebug
620 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: CHIPS fragmentation, rA="
621 <<resA<<
", #AbsPt="<<particleCount<<
G4endl;
622#endif
623 try
624 {
626 }
628 {
629 G4cerr <<
"Exception thrown of G4StringChipsParticleLevelInterface "<<
G4endl;
631 G4cerr <<
" The projectile momentum = "<<1./MeV*proj4Mom<<
G4endl;
633 G4cerr <<
" Dumping the information in the pojectile list"<<
G4endl;
634 for(i=0; i< projHV.size(); i++)
635 {
636 G4cerr <<
" Incoming 4-momentum and PDG code of "<<i<<
"'th hadron: "
637 <<
" "<< projHV[i]->Get4Momentum()<<
" "<<projHV[i]->GetPDGCode()<<
G4endl;
638 }
639 throw;
640 }
641 delete pan;
642 }
643 else
644 {
645#ifdef pdebug
646 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: NO CHIPS fragmentation, rA="
647 <<resA<<
", #AbsPt="<<particleCount<<
G4endl;
648#endif
650 }
651
652
653 std::for_each(projHV.begin(), projHV.end(),
DeleteQHadron());
654 projHV.clear();
655
656
657#ifdef CHIPSdebug
658 G4cout <<
"NEXT EVENT, EscapeExists="<<EscapeExists<<
G4endl;
659#endif
660
661
662 if (EscapeExists) for (current = firstEscape; current!=theSorted.end(); current++)
663 {
666 secondaries = NULL;
667
669 {
670 secondaries = aResult->
Decay();
671 for (unsigned int aSecondary=0; aSecondary<secondaries->size(); aSecondary++)
672 {
676 {
677 secsec = bResult->
Decay();
678 for (unsigned int bSecondary=0; bSecondary<secsec->size(); bSecondary++)
679 {
684 cur4Mom.
boost(targ4Mom.boostVector());
687#ifdef trapdebug
689 <<"G4StringChipsParticleLevelInterface::Propagate: *Rho0* QGS dec2 PDG="
692#endif
693#ifdef pdebug
694 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS dec2 PDG="
696#endif
697 theResult->push_back(theSec);
698 }
700 delete secsec;
701 }
702 else
703 {
706 current4Mom.
boost(targ4Mom.boostVector());
709#ifdef trapdebug
711 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate:*Rho0* QGS decay PDG="
714
715
716#endif
717#ifdef pdebug
718 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS decay PDG="
720#endif
721 theResult->push_back(theSec);
722 }
723 }
725 delete secondaries;
726 }
727 else
728 {
731 current4Mom.
boost(targ4Mom.boostVector());
734#ifdef trapdebug
736 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS stable PDG="
738#endif
739#ifdef pdebug
740 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS stable PDG="
742#endif
743 theResult->push_back(theSec);
744 }
745 }
747 delete theSecondaries;
748
749
750 G4int maxParticle=output->size();
751#ifdef CHIPSdebug
752 G4cout <<
"Number of particles from string"<<theResult->size()<<
G4endl;
753 G4cout <<
"Number of particles from chips"<<maxParticle<<
G4endl;
754#endif
755#ifdef pdebug
756 G4cout <<
"Number of particles from QGS="<<theResult->size()<<
G4endl;
757 G4cout <<
"Number of particles from CHIPS="<<maxParticle<<
G4endl;
758#endif
759 if(maxParticle)
for(
G4int particle = 0; particle < maxParticle; particle++)
760 {
761 if(output->operator[](particle)->GetNFragments() != 0)
762 {
763 delete output->operator[](particle);
764 continue;
765 }
766 G4int pdgCode = output->operator[](particle)->GetPDGCode();
767
768
769#ifdef CHIPSdebug
770 G4cerr <<
"PDG code of chips particle = "<<pdgCode<<
G4endl;
771#endif
772
774
775
776
777
778
779 if(pdgCode>90000000)
780 {
781 G4int aZ = (pdgCode-90000000)/1000;
782 if (aZ>1000) aZ=aZ%1000;
783 G4int anN = pdgCode-90000000-1000*aZ;
784 if(anN>1000) anN=anN%1000;
785
802 }
804
805#ifdef CHIPSdebug
806 G4cout <<
"Particle code produced = "<< pdgCode <<
G4endl;
807#endif
808
809 if(theDefinition)
810 {
812 G4LorentzVector current4Mom = output->operator[](particle)->Get4Momentum();
813 current4Mom.
boost(targ4Mom.boostVector());
816#ifdef pdebug
817 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: *OUT* CHIPS PDG="
819#endif
820 theResult->push_back(theSec);
821 }
822#ifdef pdebug
823 else
824 {
825 G4cerr <<
"G4StringChipsParticleLevelInterface::Propagate: WARNING"<<
G4endl;
826 G4cerr <<
"Getting unknown pdgCode from chips in ParticleLevelInterface"<<
G4endl;
828 }
829#endif
830
831#ifdef CHIPSdebug
834 << output->operator[](particle)->Get4Momentum() <<
G4endl;
835#endif
836
837 delete output->operator[](particle);
838 }
839 else
840 {
841 if(resA>0)
842 {
844 if(resA==1)
845 {
847 }
852 theResult->push_back(theSec);
853 if(!resZ && resA>0)
for(
G4int ni=1; ni<resA; ni++)
854 {
858 theResult->push_back(theSec);
859 }
860 }
861 }
862 delete output;
863
864#ifdef CHIPSdebug
865 G4cout <<
"Number of particles"<<theResult->size()<<
G4endl;
867 G4cout <<
"QUASMON preparation info "
868 << 1./MeV*proj4Mom<<" "
869 << 1./MeV*targ4Mom<<" "
870 << nD<<" "<<nU<<" "<<nS<<" "<<nAD<<" "<<nAU<<" "<<nAS<<" "
871 << hitCount<<" "
872 << particleCount<<" "
873 << theLow<<" "
874 << theHigh<<" "
876#endif
877
878 return theResult;
879}
CLHEP::HepLorentzVector G4LorentzVector
std::vector< G4QHadron * > G4QHadronVector
std::vector< G4ReactionProduct * > G4ReactionProductVector
CLHEP::Hep3Vector G4ThreeVector
G4DLLIMPORT std::ostream G4cerr
HepLorentzVector & boost(double, double, double)
static G4AntiKaonZero * AntiKaonZeroDefinition()
static G4KaonMinus * KaonMinusDefinition()
static G4KaonPlus * KaonPlus()
static G4KaonPlus * KaonPlusDefinition()
static G4KaonZero * KaonZero()
static G4KaonZero * KaonZeroDefinition()
G4KineticTrackVector * Decay()
G4ParticleDefinition * GetDefinition() const
const G4LorentzVector & Get4Momentum() const
static G4Lambda * Lambda()
static G4Lambda * LambdaDefinition()
static G4Neutron * Neutron()
virtual G4ParticleDefinition * GetDefinition() const
const G4LorentzVector & GetMomentum() const
G4bool IsShortLived() const
G4double GetPDGMass() const
G4int GetPDGEncoding() const
G4int GetQuarkContent(G4int flavor) const
G4double GetPDGCharge() const
G4int GetBaryonNumber() const
G4ParticleDefinition * FindIon(G4int atomicNumber, G4int atomicMass, G4double excitationEnergy)
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
static G4PionMinus * PionMinus()
static G4PionMinus * PionMinusDefinition()
static G4PionPlus * PionPlusDefinition()
static G4Proton * Proton()
static G4QCHIPSWorld * Get()
G4QParticleVector * GetParticles(G4int nOfParts=0)
G4int GetBaryonNumber() const
G4int GetStrangeness() const
G4QHadronVector * Fragment()
static void SetParameters(G4double fN=.1, G4double fD=.05, G4double cP=4., G4double mR=1., G4double nD=.8 *CLHEP::fermi)
static void SetParameters(G4double temper=180., G4double ssin2g=.3, G4double etaetap=.3)
void SetMomentum(const G4double x, const G4double y, const G4double z)
void SetTotalEnergy(const G4double en)
std::pair< G4double, G4double > RefetchImpactXandY()
virtual G4double GetOuterRadius()=0
virtual G4Nucleon * GetNextNucleon()=0
virtual G4bool StartLoop()=0
virtual G4double GetNuclearRadius()=0