52 const G4int G4StringChipsParticleLevelInterface::nbh=200;
53 G4double G4StringChipsParticleLevelInterface::bhmax=20.;
54 G4double G4StringChipsParticleLevelInterface::ehmax=20.;
55 G4double G4StringChipsParticleLevelInterface::bhdb=0.;
56 G4double G4StringChipsParticleLevelInterface::ehde=0.;
57 G4double G4StringChipsParticleLevelInterface::toth=0.;
58 G4int G4StringChipsParticleLevelInterface::bover=0;
59 G4int G4StringChipsParticleLevelInterface::eover=0;
60 G4int* G4StringChipsParticleLevelInterface::bhis =
61 new G4int[G4StringChipsParticleLevelInterface::nbh];
62 G4int* G4StringChipsParticleLevelInterface::ehis =
63 new G4int[G4StringChipsParticleLevelInterface::nbh];
69 G4cout<<
"G4StringChipsParticleLevelInterface::Constructor is called"<<
G4endl;
72 theEnergyLossPerFermi = 1.5*
GeV;
74 fractionOfSingleQuasiFreeNucleons = 0.5;
75 fractionOfPairedQuasiFreeNucleons = 0.05;
76 clusteringCoefficient = 5.;
78 halfTheStrangenessOfSee = 0.3;
80 fusionToExchange = 1.;
82 theInnerCoreDensityCut = 70.;
84 if(getenv(
"ChipsParameterTuning"))
86 G4cout <<
"Please enter the energy loss per fermi in GeV"<<
G4endl;
87 G4cin >> theEnergyLossPerFermi;
88 theEnergyLossPerFermi *=
GeV;
91 G4cout <<
"Please enter the fractionOfSingleQuasiFreeNucleons"<<
G4endl;
92 G4cin >> fractionOfSingleQuasiFreeNucleons;
93 G4cout <<
"Please enter the fractionOfPairedQuasiFreeNucleons"<<
G4endl;
94 G4cin >> fractionOfPairedQuasiFreeNucleons;
95 G4cout <<
"Please enter the clusteringCoefficient"<<
G4endl;
96 G4cin >> clusteringCoefficient;
99 G4cout <<
"Please enter halfTheStrangenessOfSee"<<
G4endl;
100 G4cin >> halfTheStrangenessOfSee;
102 G4cin >> etaToEtaPrime;
104 G4cin >> fusionToExchange;
105 G4cout <<
"Please enter the cut-off for calculating the nuclear radius in percent"<<
G4endl;
106 G4cin >> theInnerCoreDensityCut;
114 G4cout<<
"G4StringChipsParticleLevelInterface::ApplyYourself is called"<<
G4endl;
128 static const G4int pcl=4;
139 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate is called"<<
G4endl;
143 if(theSecondaries->size() == 1)
151 theFastResult->push_back(theFastSec);
152 return theFastResult;
166 unsigned int hitCount = 0;
181 G4int targetPDGCode = 90000000 + 1000*resZ + (resA-resZ);
185 if (resA>1) targetMass*=resA;
189 G4double targetEnergy = std::sqrt(hitMomentum.
mag2()+targetMass*targetMass);
196 G4double impactY = theImpact.second;
197 G4double impactPar2 = impactX*impactX + impactY*impactY;
203 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: r="<<std::sqrt(radius2)/
fermi
205 <<
", b/r="<<std::sqrt(impactPar2/radius2)<<
G4endl;
207 if(radius2 - impactPar2>0) pathlength = 2.*std::sqrt(radius2 - impactPar2);
215 if(nbi<nbh) bhis[nbi]++;
217 if(nei<nbh) ehis[nei]++;
220 G4double theEnergyLostInFragmentation = theEnergyLossPerFermi*pathlength/
fermi;
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++)
227 G4LorentzVector a4Mom = theSecondaries->operator[](secondary)->Get4Momentum();
229 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: ALL STRING particles "
230 << theSecondaries->operator[](secondary)->GetDefinition()->GetPDGCharge()<<
" "
231 << theSecondaries->operator[](secondary)->GetDefinition()->GetPDGEncoding()<<
" "
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;
241 std::pair<G4double, G4KineticTrack *> it;
243 it.second = theSecondaries->operator[](secondary);
245 for(current = theSorted.begin(); current!=theSorted.end(); current++)
247 if((*current).first > toSort)
249 theSorted.insert(current, it);
254 if(!inserted) theSorted.push_back(it);
264 std::list<std::pair<G4double,G4KineticTrack*> >::iterator firstEscape=theSorted.begin();
266 G4int particleCount = 0;
267 G4LorentzVector theLow = (*(theSorted.begin())).second->Get4Momentum();
271 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: CHIPS ENERGY LOST "
272 <<theEnergyLostInFragmentation<<
". Sorted rapidities event start"<<
G4endl;
275 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: total CHIPS energy = "
276 <<theEnergyLostInFragmentation<<
". Start rapidity sorting nS="<<theSorted.size()
281 std::vector<G4QContent> theContents;
282 std::vector<G4LorentzVector*> theMomenta;
288 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: Absorption nS="
289 <<theSorted.size()<<
G4endl;
291 G4bool EscapeExists =
false;
292 for(current = theSorted.begin(); current!=theSorted.end(); current++)
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;
301 firstEscape = current;
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;
358 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: sorted rapidities "
359 <<(*current).second->Get4Momentum().rapidity()<<
G4endl;
363 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: E="<<runningEnergy<<
", EL="
364 <<theEnergyLostInFragmentation<<
G4endl;
366 if(runningEnergy > theEnergyLostInFragmentation)
372 G4cout <<
"G4StringChipsParticleLevelInterface::Propagate: ABSORBED STRING particles "
373 <<(*current).second->GetDefinition()->GetPDGCharge()<<
" "
374 << (*current).second->GetDefinition()->GetPDGEncoding()<<
" "
375 << (*current).second->Get4Momentum() <<
G4endl;
378 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate:C="
379 <<current->second->GetDefinition()->GetPDGCharge()<<
", PDG="
380 <<current->second->GetDefinition()->GetPDGEncoding()<<
", 4M="
381 <<current->second->Get4Momentum()<<
G4endl;
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);
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;
404 theContents.push_back(aProjectile);
408 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: projectile momentum = "
413 theMomenta.push_back(aVec);
415 std::vector<G4QContent> theFinalContents;
416 std::vector<G4LorentzVector*> theFinalMomenta;
431 for(
G4int hp = theContents.size()-1; hp>=0; hp--)
438 EnFlow4M += *(theMomenta[hp]);
446 G4int nprt=(barys-1)/pcl+1;
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;
468 prtM=(-chgm)*mPiCh+brnm*mNeut;
469 prtQC=(-chgm)*PiMiQC+brnm*NeutQC;
473 prtM=chgm*mProt+(brnm-chgm)*mNeut;
474 prtQC=chgm*ProtQC+(brnm-chgm)*NeutQC;
479 G4int stmb=strm-brnm;
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;
489 prtM=chgm*mPiCh+(strm-brnm)*mKZer+brnm*mLamb;
490 prtQC=chgm*PiPlQC+(strm-brnm)*KZerQC+brnm*LambQC;
495 G4int bmst=brnm-strm;
498 prtM=(-chgm)*mPiCh+strm*mLamb+bmst*mNeut;
499 prtQC=(-chgm)*PiMiQC+strm*LambQC+bmst*NeutQC;
503 prtM=(chgm-bmst)*mPiCh+strm*mLamb+bmst*mProt;
504 prtQC=(chgm-bmst)*PiPlQC+strm*LambQC+bmst*ProtQC;
508 prtM=chgm*mProt+strm*mLamb+(bmst-chgm)*mNeut;
509 prtQC=chgm*ProtQC+strm*LambQC+(bmst-chgm)*NeutQC;
514 G4int bmst=brnm-strm;
517 prtM=(-strm)*mKChg+brnm*mProt+(chgm-bmst)*mPiCh;
518 prtQC=(-strm)*KPlsQC+brnm*ProtQC+(chgm-bmst)*PiPlQC;
522 prtM=(-strm)*mKChg+chgm*mProt+(brnm-chgm)*mNeut;
523 prtQC=(-strm)*KPlsQC+chgm*ProtQC+(brnm-chgm)*NeutQC;
527 prtM=chgm*mKChg+(-chgm-strm)*mKZer+brnm*mNeut;
528 prtQC=chgm*KPlsQC+(-chgm-strm)*AKZrQC+brnm*NeutQC;
532 prtM=(-strm)*mKChg+(-chgm)*mPiCh+brnm*mNeut;
533 prtQC=(-strm)*KPlsQC+(-chgm)*PiMiQC+brnm*NeutQC;
542 if(chgm<0) resM=(-chgm)*mPiCh+brnm*mNeut;
543 else resM=chgm*mProt+(brnm-chgm)*mNeut;
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;
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;
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;
570 projHV.push_back(aHadron);
574 projHV.push_back(fHadron);
578 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: nprt="<<nprt<<
G4endl;
585 projHV.push_back(aHadron);
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();
596 fractionOfPairedQuasiFreeNucleons,
597 clusteringCoefficient,
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;
614 if (particleCount!=0 && resA!=0)
620 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: CHIPS fragmentation, rA="
621 <<resA<<
", #AbsPt="<<particleCount<<
G4endl;
629 G4cerr <<
"Exception thrown of G4StringChipsParticleLevelInterface "<<
G4endl;
633 G4cerr <<
" Dumping the information in the pojectile list"<<
G4endl;
634 for(i=0; i< projHV.size(); i++)
636 G4cerr <<
" Incoming 4-momentum and PDG code of "<<i<<
"'th hadron: "
637 <<
" "<< projHV[i]->Get4Momentum()<<
" "<<projHV[i]->GetPDGCode()<<
G4endl;
646 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: NO CHIPS fragmentation, rA="
647 <<resA<<
", #AbsPt="<<particleCount<<
G4endl;
653 std::for_each(projHV.begin(), projHV.end(),
DeleteQHadron());
658 G4cout <<
"NEXT EVENT, EscapeExists="<<EscapeExists<<
G4endl;
662 if (EscapeExists)
for (current = firstEscape; current!=theSorted.end(); current++)
670 secondaries = aResult->
Decay();
671 for (
unsigned int aSecondary=0; aSecondary<secondaries->size(); aSecondary++)
677 secsec = bResult->
Decay();
678 for (
unsigned int bSecondary=0; bSecondary<secsec->size(); bSecondary++)
684 cur4Mom.
boost(targ4Mom.boostVector());
689 <<
"G4StringChipsParticleLevelInterface::Propagate: *Rho0* QGS dec2 PDG="
694 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS dec2 PDG="
697 theResult->push_back(theSec);
706 current4Mom.
boost(targ4Mom.boostVector());
711 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate:*Rho0* QGS decay PDG="
718 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS decay PDG="
721 theResult->push_back(theSec);
731 current4Mom.
boost(targ4Mom.boostVector());
736 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS stable PDG="
740 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS stable PDG="
743 theResult->push_back(theSec);
747 delete theSecondaries;
750 G4int maxParticle=output->size();
752 G4cout <<
"Number of particles from string"<<theResult->size()<<
G4endl;
753 G4cout <<
"Number of particles from chips"<<maxParticle<<
G4endl;
756 G4cout <<
"Number of particles from QGS="<<theResult->size()<<
G4endl;
757 G4cout <<
"Number of particles from CHIPS="<<maxParticle<<
G4endl;
759 if(maxParticle)
for(
G4int particle = 0; particle < maxParticle; particle++)
761 if(output->operator[](particle)->GetNFragments() != 0)
763 delete output->operator[](particle);
766 G4int pdgCode = output->operator[](particle)->GetPDGCode();
770 G4cerr <<
"PDG code of chips particle = "<<pdgCode<<
G4endl;
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;
806 G4cout <<
"Particle code produced = "<< pdgCode <<
G4endl;
812 G4LorentzVector current4Mom = output->operator[](particle)->Get4Momentum();
813 current4Mom.
boost(targ4Mom.boostVector());
817 G4cout<<
"G4StringChipsParticleLevelInterface::Propagate: *OUT* CHIPS PDG="
820 theResult->push_back(theSec);
825 G4cerr <<
"G4StringChipsParticleLevelInterface::Propagate: WARNING"<<
G4endl;
826 G4cerr <<
"Getting unknown pdgCode from chips in ParticleLevelInterface"<<
G4endl;
827 G4cerr <<
"skipping particle with pdgCode = "<<pdgCode<<G4endl<<
G4endl;
834 << output->operator[](particle)->Get4Momentum() <<
G4endl;
837 delete output->operator[](particle);
852 theResult->push_back(theSec);
853 if(!resZ && resA>0)
for(
G4int ni=1; ni<resA; ni++)
858 theResult->push_back(theSec);
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<<
" "
872 << particleCount<<
" "