00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #include <utility>
00036 #include <list>
00037 #include <vector>
00038
00039 #include "G4StringChipsParticleLevelInterface.hh"
00040 #include "globals.hh"
00041 #include "G4SystemOfUnits.hh"
00042 #include "G4KineticTrackVector.hh"
00043 #include "G4Nucleon.hh"
00044 #include "G4Proton.hh"
00045 #include "G4Neutron.hh"
00046 #include "G4LorentzRotation.hh"
00047 #include "G4HadronicException.hh"
00048
00049
00050
00051 #ifdef hdebug_SCPLI
00052 const G4int G4StringChipsParticleLevelInterface::nbh=200;
00053 G4double G4StringChipsParticleLevelInterface::bhmax=20.;
00054 G4double G4StringChipsParticleLevelInterface::ehmax=20.;
00055 G4double G4StringChipsParticleLevelInterface::bhdb=0.;
00056 G4double G4StringChipsParticleLevelInterface::ehde=0.;
00057 G4double G4StringChipsParticleLevelInterface::toth=0.;
00058 G4int G4StringChipsParticleLevelInterface::bover=0;
00059 G4int G4StringChipsParticleLevelInterface::eover=0;
00060 G4int* G4StringChipsParticleLevelInterface::bhis =
00061 new G4int[G4StringChipsParticleLevelInterface::nbh];
00062 G4int* G4StringChipsParticleLevelInterface::ehis =
00063 new G4int[G4StringChipsParticleLevelInterface::nbh];
00064 #endif
00065
00066 G4StringChipsParticleLevelInterface::G4StringChipsParticleLevelInterface()
00067 {
00068 #ifdef debug
00069 G4cout<<"G4StringChipsParticleLevelInterface::Constructor is called"<<G4endl;
00070 #endif
00071
00072 theEnergyLossPerFermi = 1.5*GeV;
00073 nop = 152;
00074 fractionOfSingleQuasiFreeNucleons = 0.5;
00075 fractionOfPairedQuasiFreeNucleons = 0.05;
00076 clusteringCoefficient = 5.;
00077 temperature = 180.;
00078 halfTheStrangenessOfSee = 0.3;
00079 etaToEtaPrime = 0.3;
00080 fusionToExchange = 1.;
00081
00082 theInnerCoreDensityCut = 70.;
00083
00084 if(getenv("ChipsParameterTuning"))
00085 {
00086 G4cout << "Please enter the energy loss per fermi in GeV"<<G4endl;
00087 G4cin >> theEnergyLossPerFermi;
00088 theEnergyLossPerFermi *= GeV;
00089 G4cout << "Please enter nop"<<G4endl;
00090 G4cin >> nop;
00091 G4cout << "Please enter the fractionOfSingleQuasiFreeNucleons"<<G4endl;
00092 G4cin >> fractionOfSingleQuasiFreeNucleons;
00093 G4cout << "Please enter the fractionOfPairedQuasiFreeNucleons"<<G4endl;
00094 G4cin >> fractionOfPairedQuasiFreeNucleons;
00095 G4cout << "Please enter the clusteringCoefficient"<<G4endl;
00096 G4cin >> clusteringCoefficient;
00097 G4cout << "Please enter the temperature"<<G4endl;
00098 G4cin >> temperature;
00099 G4cout << "Please enter halfTheStrangenessOfSee"<<G4endl;
00100 G4cin >> halfTheStrangenessOfSee;
00101 G4cout << "Please enter the etaToEtaPrime"<<G4endl;
00102 G4cin >> etaToEtaPrime;
00103 G4cout << "Please enter the fusionToExchange"<<G4endl;
00104 G4cin >> fusionToExchange;
00105 G4cout << "Please enter the cut-off for calculating the nuclear radius in percent"<<G4endl;
00106 G4cin >> theInnerCoreDensityCut;
00107 }
00108 }
00109
00110 G4HadFinalState* G4StringChipsParticleLevelInterface::
00111 ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& theNucleus)
00112 {
00113 #ifdef debug
00114 G4cout<<"G4StringChipsParticleLevelInterface::ApplyYourself is called"<<G4endl;
00115 #endif
00116 return theModel.ApplyYourself(aTrack, theNucleus);
00117 }
00118
00119 G4ReactionProductVector* G4StringChipsParticleLevelInterface::
00120 Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus)
00121 {
00122 static const G4double mProt=G4Proton::Proton()->GetPDGMass();
00123 static const G4double mNeut=G4Neutron::Neutron()->GetPDGMass();
00124 static const G4double mLamb=G4Lambda::Lambda()->GetPDGMass();
00125 static const G4double mKChg=G4KaonPlus::KaonPlus()->GetPDGMass();
00126 static const G4double mKZer=G4KaonZero::KaonZero()->GetPDGMass();
00127 static const G4double mPiCh=G4PionMinus::PionMinus()->GetPDGMass();
00128 static const G4int pcl=4;
00129 static const G4QContent ProtQC(1,2,0,0,0,0);
00130 static const G4QContent NeutQC(2,1,0,0,0,0);
00131 static const G4QContent LambQC(1,1,1,0,0,0);
00132 static const G4QContent KPlsQC(0,1,0,0,0,1);
00133 static const G4QContent KMinQC(0,0,1,0,1,0);
00134 static const G4QContent AKZrQC(1,0,0,0,0,1);
00135 static const G4QContent KZerQC(1,0,0,0,0,1);
00136 static const G4QContent PiMiQC(1,0,0,0,1,0);
00137 static const G4QContent PiPlQC(0,1,0,1,0,0);
00138 #ifdef debug
00139 G4cout<<"G4StringChipsParticleLevelInterface::Propagate is called"<<G4endl;
00140 #endif
00141
00142
00143 if(theSecondaries->size() == 1)
00144 {
00145 G4ReactionProductVector* theFastResult = new G4ReactionProductVector;
00146 G4ReactionProduct* theFastSec;
00147 theFastSec = new G4ReactionProduct((*theSecondaries)[0]->GetDefinition());
00148 G4LorentzVector current4Mom = (*theSecondaries)[0]->Get4Momentum();
00149 theFastSec->SetTotalEnergy(current4Mom.t());
00150 theFastSec->SetMomentum(current4Mom.vect());
00151 theFastResult->push_back(theFastSec);
00152 return theFastResult;
00153
00154
00155 }
00156
00157
00158
00159
00160 theNucleus->StartLoop();
00161 G4Nucleon * aNucleon;
00162 G4int resA = 0;
00163 G4int resZ = 0;
00164 G4ThreeVector hitMomentum(0,0,0);
00165 G4double hitMass = 0;
00166 unsigned int hitCount = 0;
00167 while((aNucleon = theNucleus->GetNextNucleon()))
00168 {
00169 if(!aNucleon->AreYouHit())
00170 {
00171 resA++;
00172 resZ+=G4int (aNucleon->GetDefinition()->GetPDGCharge());
00173 }
00174 else
00175 {
00176 hitMomentum += aNucleon->GetMomentum().vect();
00177 hitMass += aNucleon->GetMomentum().m();
00178 hitCount ++;
00179 }
00180 }
00181 G4int targetPDGCode = 90000000 + 1000*resZ + (resA-resZ);
00182 G4double targetMass=mNeut;
00183 if (!resZ)
00184 {
00185 if (resA>1) targetMass*=resA;
00186 }
00187 else targetMass=G4ParticleTable::GetParticleTable()->FindIon(resZ,resA,0,resZ)
00188 ->GetPDGMass();
00189 G4double targetEnergy = std::sqrt(hitMomentum.mag2()+targetMass*targetMass);
00190
00191 G4LorentzVector targ4Mom(-1.*hitMomentum, targetEnergy);
00192
00193
00194 std::pair<G4double, G4double> theImpact = theNucleus->RefetchImpactXandY();
00195 G4double impactX = theImpact.first;
00196 G4double impactY = theImpact.second;
00197 G4double impactPar2 = impactX*impactX + impactY*impactY;
00198 G4double radius2 = theNucleus->GetNuclearRadius(theInnerCoreDensityCut*perCent);
00199
00200 radius2 *= radius2;
00201 G4double pathlength = 0.;
00202 #ifdef ppdebug
00203 G4cout<<"G4StringChipsParticleLevelInterface::Propagate: r="<<std::sqrt(radius2)/fermi
00204 <<", b="<<std::sqrt(impactPar2)/fermi<<", R="<<theNucleus->GetOuterRadius()/fermi
00205 <<", b/r="<<std::sqrt(impactPar2/radius2)<<G4endl;
00206 #endif
00207 if(radius2 - impactPar2>0) pathlength = 2.*std::sqrt(radius2 - impactPar2);
00208
00209 #ifdef hdebug_SCPLI
00210 toth+=1.;
00211 G4double bfm=std::sqrt(impactPar2)/fermi;
00212 G4double efm=pathlength/fermi;
00213 G4int nbi=static_cast<G4int>(bfm/bhdb);
00214 G4int nei=static_cast<G4int>(efm/ehde);
00215 if(nbi<nbh) bhis[nbi]++;
00216 else bover++;
00217 if(nei<nbh) ehis[nei]++;
00218 else eover++;
00219 #endif
00220 G4double theEnergyLostInFragmentation = theEnergyLossPerFermi*pathlength/fermi;
00221
00222
00223 std::list<std::pair<G4double, G4KineticTrack *> > theSorted;
00224 std::list<std::pair<G4double, G4KineticTrack *> >::iterator current;
00225 for(unsigned int secondary = 0; secondary<theSecondaries->size(); secondary++)
00226 {
00227 G4LorentzVector a4Mom = theSecondaries->operator[](secondary)->Get4Momentum();
00228 #ifdef CHIPSdebug
00229 G4cout<<"G4StringChipsParticleLevelInterface::Propagate: ALL STRING particles "
00230 << theSecondaries->operator[](secondary)->GetDefinition()->GetPDGCharge()<<" "
00231 << theSecondaries->operator[](secondary)->GetDefinition()->GetPDGEncoding()<<" "
00232 << a4Mom <<G4endl;
00233 #endif
00234 #ifdef pdebug
00235 G4cout<<"G4StringChipsParticleLevelInterface::Propagate: in C="
00236 <<theSecondaries->operator[](secondary)->GetDefinition()->GetPDGCharge()<<",PDG="
00237 <<theSecondaries->operator[](secondary)->GetDefinition()->GetPDGEncoding()
00238 <<",4M="<<a4Mom<<", current nS="<<theSorted.size()<<G4endl;
00239 #endif
00240 G4double toSort = a4Mom.rapidity();
00241 std::pair<G4double, G4KineticTrack *> it;
00242 it.first = toSort;
00243 it.second = theSecondaries->operator[](secondary);
00244 G4bool inserted = false;
00245 for(current = theSorted.begin(); current!=theSorted.end(); current++)
00246 {
00247 if((*current).first > toSort)
00248 {
00249 theSorted.insert(current, it);
00250 inserted = true;
00251 break;
00252 }
00253 }
00254 if(!inserted) theSorted.push_back(it);
00255 }
00256
00257 G4LorentzVector proj4Mom(0.,0.,0.,0.);
00258 G4int nD = 0;
00259 G4int nU = 0;
00260 G4int nS = 0;
00261 G4int nAD = 0;
00262 G4int nAU = 0;
00263 G4int nAS = 0;
00264 std::list<std::pair<G4double,G4KineticTrack*> >::iterator firstEscape=theSorted.begin();
00265 G4double runningEnergy = 0;
00266 G4int particleCount = 0;
00267 G4LorentzVector theLow = (*(theSorted.begin())).second->Get4Momentum();
00268 G4LorentzVector theHigh;
00269
00270 #ifdef CHIPSdebug
00271 G4cout<<"G4StringChipsParticleLevelInterface::Propagate: CHIPS ENERGY LOST "
00272 <<theEnergyLostInFragmentation<<". Sorted rapidities event start"<<G4endl;
00273 #endif
00274 #ifdef pdebug
00275 G4cout<<"G4StringChipsParticleLevelInterface::Propagate: total CHIPS energy = "
00276 <<theEnergyLostInFragmentation<<". Start rapidity sorting nS="<<theSorted.size()
00277 <<G4endl;
00278 #endif
00279
00280 G4QHadronVector projHV;
00281 std::vector<G4QContent> theContents;
00282 std::vector<G4LorentzVector*> theMomenta;
00283 G4ReactionProductVector* theResult = new G4ReactionProductVector;
00284 G4ReactionProduct* theSec;
00285 G4KineticTrackVector* secondaries;
00286 G4KineticTrackVector* secsec;
00287 #ifdef pdebug
00288 G4cout<<"G4StringChipsParticleLevelInterface::Propagate: Absorption nS="
00289 <<theSorted.size()<<G4endl;
00290 #endif
00291 G4bool EscapeExists = false;
00292 for(current = theSorted.begin(); current!=theSorted.end(); current++)
00293 {
00294 #ifdef pdebug
00295 G4cout<<"G4StringChipsParticleLevelInterface::Propagate: nq="
00296 <<(*current).second->GetDefinition()->GetQuarkContent(3)<<", naq="
00297 <<(*current).second->GetDefinition()->GetAntiQuarkContent(3)<<", PDG="
00298 <<(*current).second->GetDefinition()->GetPDGEncoding()<<",4M="
00299 <<(*current).second->Get4Momentum()<<G4endl;
00300 #endif
00301 firstEscape = current;
00302 G4KineticTrack* aResult = (*current).second;
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348 runningEnergy += aResult->Get4Momentum().t();
00349 G4double charge=aResult->GetDefinition()->GetPDGCharge();
00350 G4int strang=aResult->GetDefinition()->GetQuarkContent(3);
00351 G4int baryn=aResult->GetDefinition()->GetBaryonNumber();
00352 if (baryn>0 && charge>0 && strang<1) runningEnergy-=mProt;
00353 else if(baryn>0 && strang<1) runningEnergy-=mNeut;
00354 else if(baryn>0) runningEnergy-=mLamb;
00355 else if(baryn<0) runningEnergy+=mProt;
00356
00357 #ifdef CHIPSdebug
00358 G4cout<<"G4StringChipsParticleLevelInterface::Propagate: sorted rapidities "
00359 <<(*current).second->Get4Momentum().rapidity()<<G4endl;
00360 #endif
00361
00362 #ifdef pdebug
00363 G4cout<<"G4StringChipsParticleLevelInterface::Propagate: E="<<runningEnergy<<", EL="
00364 <<theEnergyLostInFragmentation<<G4endl;
00365 #endif
00366 if(runningEnergy > theEnergyLostInFragmentation)
00367 {
00368 EscapeExists = true;
00369 break;
00370 }
00371 #ifdef CHIPSdebug
00372 G4cout <<"G4StringChipsParticleLevelInterface::Propagate: ABSORBED STRING particles "
00373 <<(*current).second->GetDefinition()->GetPDGCharge()<<" "
00374 << (*current).second->GetDefinition()->GetPDGEncoding()<<" "
00375 << (*current).second->Get4Momentum() <<G4endl;
00376 #endif
00377 #ifdef pdebug
00378 G4cout<<"G4StringChipsParticleLevelInterface::Propagate:C="
00379 <<current->second->GetDefinition()->GetPDGCharge()<<", PDG="
00380 <<current->second->GetDefinition()->GetPDGEncoding()<<", 4M="
00381 <<current->second->Get4Momentum()<<G4endl;
00382 #endif
00383
00384
00385 particleCount++;
00386 theHigh = (*current).second->Get4Momentum();
00387 proj4Mom = (*current).second->Get4Momentum();
00388 proj4Mom.boost(-1.*targ4Mom.boostVector());
00389 nD = (*current).second->GetDefinition()->GetQuarkContent(1);
00390 nU = (*current).second->GetDefinition()->GetQuarkContent(2);
00391 nS = (*current).second->GetDefinition()->GetQuarkContent(3);
00392 nAD = (*current).second->GetDefinition()->GetAntiQuarkContent(1);
00393 nAU = (*current).second->GetDefinition()->GetAntiQuarkContent(2);
00394 nAS = (*current).second->GetDefinition()->GetAntiQuarkContent(3);
00395 G4QContent aProjectile(nD, nU, nS, nAD, nAU, nAS);
00396
00397 #ifdef CHIPSdebug_1
00398 G4cout <<G4endl;
00399 G4cout <<"G4StringChipsParticleLevelInterface::Propagate: Quark content: d="<<nD
00400 <<", u="<<nU<<", s="<<nS<< "Anti-quark content: anit-d="<<nAD<<", anti-u="<<nAU
00401 <<", anti-s="<<nAS<<". G4QContent is constructed"<<endl;
00402 #endif
00403
00404 theContents.push_back(aProjectile);
00405 G4LorentzVector* aVec = new G4LorentzVector((1./MeV)*proj4Mom);
00406
00407 #ifdef CHIPSdebug_1
00408 G4cout<<"G4StringChipsParticleLevelInterface::Propagate: projectile momentum = "
00409 <<*aVec<<G4endl;
00410 G4cout << G4endl;
00411 #endif
00412
00413 theMomenta.push_back(aVec);
00414 }
00415 std::vector<G4QContent> theFinalContents;
00416 std::vector<G4LorentzVector*> theFinalMomenta;
00417
00418
00419
00420
00421
00422
00423
00424
00425 G4QContent EnFlowQC(0,0,0,0,0,0);
00426 G4LorentzVector EnFlow4M(0.,0.,0.,0.);
00427
00428 G4int barys=0;
00429 G4int stras=0;
00430 G4int chars=0;
00431 for(G4int hp = theContents.size()-1; hp>=0; hp--)
00432 {
00433 G4QContent curQC=theContents[hp];
00434 G4int baryn = curQC.GetBaryonNumber();
00435 G4int stran = curQC.GetStrangeness();
00436 G4int charg = curQC.GetCharge();
00437 EnFlowQC += curQC;
00438 EnFlow4M += *(theMomenta[hp]);
00439 barys += baryn;
00440 stras += stran;
00441 chars += charg;
00442
00443 }
00444 if(barys>pcl)
00445 {
00446 G4int nprt=(barys-1)/pcl+1;
00447 G4int curb=barys;
00448 while (nprt>0)
00449 {
00450 nprt--;
00451 G4int brnm=pcl;
00452 curb-=brnm;
00453 G4double prtM=0.;
00454 G4double resM=0.;
00455 G4QContent prtQC(0,0,0,0,0,0);
00456 G4int strm=0;
00457 if(stras>0) strm=(stras-1)/nprt+1;
00458 else if(stras<0) strm=(stras+1)/nprt-1;
00459 G4int chgm=0;
00460 if(stras>0) chgm=(chars-1)/nprt+1;
00461 else if(stras<0) chgm=(chars+1)/nprt-1;
00462
00463
00464 if(!strm)
00465 {
00466 if(chgm<0)
00467 {
00468 prtM=(-chgm)*mPiCh+brnm*mNeut;
00469 prtQC=(-chgm)*PiMiQC+brnm*NeutQC;
00470 }
00471 else
00472 {
00473 prtM=chgm*mProt+(brnm-chgm)*mNeut;
00474 prtQC=chgm*ProtQC+(brnm-chgm)*NeutQC;
00475 }
00476 }
00477 else if(strm>=brnm)
00478 {
00479 G4int stmb=strm-brnm;
00480 if(chgm<0)
00481 {
00482 prtM=(-chgm)*mKChg+brnm*mLamb+std::abs(stmb+chgm)*mKZer;
00483 prtQC=(-chgm)*KMinQC+brnm*LambQC;
00484 if(stmb>-chgm) prtQC+=(stmb+chgm)*KZerQC;
00485 else if(stmb<-chgm) prtQC+=(-stmb-chgm)*AKZrQC;
00486 }
00487 else
00488 {
00489 prtM=chgm*mPiCh+(strm-brnm)*mKZer+brnm*mLamb;
00490 prtQC=chgm*PiPlQC+(strm-brnm)*KZerQC+brnm*LambQC;
00491 }
00492 }
00493 else if(strm>0)
00494 {
00495 G4int bmst=brnm-strm;
00496 if(chgm<0)
00497 {
00498 prtM=(-chgm)*mPiCh+strm*mLamb+bmst*mNeut;
00499 prtQC=(-chgm)*PiMiQC+strm*LambQC+bmst*NeutQC;
00500 }
00501 else if(chgm>=bmst)
00502 {
00503 prtM=(chgm-bmst)*mPiCh+strm*mLamb+bmst*mProt;
00504 prtQC=(chgm-bmst)*PiPlQC+strm*LambQC+bmst*ProtQC;
00505 }
00506 else
00507 {
00508 prtM=chgm*mProt+strm*mLamb+(bmst-chgm)*mNeut;
00509 prtQC=chgm*ProtQC+strm*LambQC+(bmst-chgm)*NeutQC;
00510 }
00511 }
00512 else
00513 {
00514 G4int bmst=brnm-strm;
00515 if(chgm>=bmst)
00516 {
00517 prtM=(-strm)*mKChg+brnm*mProt+(chgm-bmst)*mPiCh;
00518 prtQC=(-strm)*KPlsQC+brnm*ProtQC+(chgm-bmst)*PiPlQC;
00519 }
00520 else if(chgm>=-strm)
00521 {
00522 prtM=(-strm)*mKChg+chgm*mProt+(brnm-chgm)*mNeut;
00523 prtQC=(-strm)*KPlsQC+chgm*ProtQC+(brnm-chgm)*NeutQC;
00524 }
00525 else if(chgm>=0)
00526 {
00527 prtM=chgm*mKChg+(-chgm-strm)*mKZer+brnm*mNeut;
00528 prtQC=chgm*KPlsQC+(-chgm-strm)*AKZrQC+brnm*NeutQC;
00529 }
00530 else
00531 {
00532 prtM=(-strm)*mKChg+(-chgm)*mPiCh+brnm*mNeut;
00533 prtQC=(-strm)*KPlsQC+(-chgm)*PiMiQC+brnm*NeutQC;
00534 }
00535 }
00536 EnFlowQC-=prtQC;
00537 chgm=chars-chgm;
00538 strm=stras-strm;
00539 brnm=curb;
00540 if(!strm)
00541 {
00542 if(chgm<0) resM=(-chgm)*mPiCh+brnm*mNeut;
00543 else resM=chgm*mProt+(brnm-chgm)*mNeut;
00544 }
00545 else if(strm>=brnm)
00546 {
00547 G4int stmb=strm-brnm;
00548 if(chgm<0) resM=(-chgm)*mKChg+brnm*mLamb+std::abs(stmb+chgm)*mKZer;
00549 else resM=chgm*mPiCh+(strm-brnm)*mKZer+brnm*mLamb;
00550 }
00551 else if(strm>0)
00552 {
00553 G4int bmst=brnm-strm;
00554 if (chgm<0) resM=(-chgm)*mPiCh+strm*mLamb+bmst*mNeut;
00555 else if(chgm>=bmst) resM=(chgm-bmst)*mPiCh+strm*mLamb+bmst*mProt;
00556 else resM=chgm*mProt+strm*mLamb+(bmst-chgm)*mNeut;
00557 }
00558 else
00559 {
00560 G4int bmst=brnm-strm;
00561 if (chgm>=bmst) resM=(-strm)*mKChg+brnm*mProt+(chgm-bmst)*mPiCh;
00562 else if(chgm>=-strm) resM=(-strm)*mKChg+chgm*mProt+(brnm-chgm)*mNeut;
00563 else if(chgm>=0) resM=chgm*mKChg+(-chgm-strm)*mKZer+brnm*mNeut;
00564 else resM=(-strm)*mKChg+(-chgm)*mPiCh+brnm*mNeut;
00565 }
00566 G4LorentzVector prt4M=(prtM/(prtM+resM))*EnFlow4M;
00567 EnFlow4M-=prt4M;
00568 EnFlowQC-=prtQC;
00569 G4QHadron* aHadron = new G4QHadron(prtQC, prt4M);
00570 projHV.push_back(aHadron);
00571 if(nprt==1)
00572 {
00573 G4QHadron* fHadron = new G4QHadron(EnFlowQC, EnFlow4M);
00574 projHV.push_back(fHadron);
00575 nprt=0;
00576 }
00577 #ifdef debug
00578 G4cout<<"G4StringChipsParticleLevelInterface::Propagate: nprt="<<nprt<<G4endl;
00579 #endif
00580 }
00581 }
00582 else
00583 {
00584 G4QHadron* aHadron = new G4QHadron(EnFlowQC, EnFlow4M);
00585 projHV.push_back(aHadron);
00586 }
00587
00588
00589 size_t i;
00590 for (i=0; i<theFinalMomenta.size(); i++) delete theFinalMomenta[i];
00591 for (i=0; i<theMomenta.size(); i++) delete theMomenta[i];
00592 theFinalMomenta.clear();
00593 theMomenta.clear();
00594
00595 G4QNucleus::SetParameters(fractionOfSingleQuasiFreeNucleons,
00596 fractionOfPairedQuasiFreeNucleons,
00597 clusteringCoefficient,
00598 fusionToExchange);
00599 G4Quasmon::SetParameters(temperature, halfTheStrangenessOfSee, etaToEtaPrime);
00600
00601 #ifdef CHIPSdebug
00602 G4cout<<"G4StringChipsParticleLevelInterface::Propagate: G4QNucleus parameters "
00603 <<fractionOfSingleQuasiFreeNucleons<<" "<<fractionOfPairedQuasiFreeNucleons
00604 <<" "<<clusteringCoefficient<<G4endl;
00605 G4cout<<"G4Quasmon parameters "<<temperature<<" "<<halfTheStrangenessOfSee<<" "
00606 <<etaToEtaPrime << G4endl;
00607 G4cout<<"The Target PDG code = "<<targetPDGCode<<G4endl;
00608 G4cout<<"The projectile momentum = "<<1./MeV*proj4Mom<<G4endl;
00609 G4cout<<"The target momentum = "<<1./MeV*targ4Mom<<G4endl;
00610 #endif
00611
00612
00613 G4QHadronVector* output = 0;
00614 if (particleCount!=0 && resA!=0)
00615 {
00616
00617 G4QCHIPSWorld::Get()->GetParticles(nop);
00618 G4QEnvironment* pan= new G4QEnvironment(projHV, targetPDGCode);
00619 #ifdef pdebug
00620 G4cout<<"G4StringChipsParticleLevelInterface::Propagate: CHIPS fragmentation, rA="
00621 <<resA<<", #AbsPt="<<particleCount<<G4endl;
00622 #endif
00623 try
00624 {
00625 output = pan->Fragment();
00626 }
00627 catch(G4HadronicException& aR)
00628 {
00629 G4cerr << "Exception thrown of G4StringChipsParticleLevelInterface "<<G4endl;
00630 G4cerr << " targetPDGCode = "<< targetPDGCode <<G4endl;
00631 G4cerr << " The projectile momentum = "<<1./MeV*proj4Mom<<G4endl;
00632 G4cerr << " The target momentum = "<<1./MeV*targ4Mom<<G4endl<<G4endl;
00633 G4cerr << " Dumping the information in the pojectile list"<<G4endl;
00634 for(i=0; i< projHV.size(); i++)
00635 {
00636 G4cerr <<" Incoming 4-momentum and PDG code of "<<i<<"'th hadron: "
00637 <<" "<< projHV[i]->Get4Momentum()<<" "<<projHV[i]->GetPDGCode()<<G4endl;
00638 }
00639 throw;
00640 }
00641 delete pan;
00642 }
00643 else
00644 {
00645 #ifdef pdebug
00646 G4cout<<"G4StringChipsParticleLevelInterface::Propagate: NO CHIPS fragmentation, rA="
00647 <<resA<<", #AbsPt="<<particleCount<<G4endl;
00648 #endif
00649 output = new G4QHadronVector;
00650 }
00651
00652
00653 std::for_each(projHV.begin(), projHV.end(), DeleteQHadron());
00654 projHV.clear();
00655
00656
00657 #ifdef CHIPSdebug
00658 G4cout << "NEXT EVENT, EscapeExists="<<EscapeExists<<G4endl;
00659 #endif
00660
00661
00662 if (EscapeExists) for (current = firstEscape; current!=theSorted.end(); current++)
00663 {
00664 G4KineticTrack* aResult = (*current).second;
00665 G4ParticleDefinition* pdef=aResult->GetDefinition();
00666 secondaries = NULL;
00667
00668 if ( pdef->IsShortLived() )
00669 {
00670 secondaries = aResult->Decay();
00671 for (unsigned int aSecondary=0; aSecondary<secondaries->size(); aSecondary++)
00672 {
00673 G4KineticTrack* bResult=secondaries->operator[](aSecondary);
00674 G4ParticleDefinition* sdef=bResult->GetDefinition();
00675 if ( sdef->IsShortLived() )
00676 {
00677 secsec = bResult->Decay();
00678 for (unsigned int bSecondary=0; bSecondary<secsec->size(); bSecondary++)
00679 {
00680 G4KineticTrack* cResult=secsec->operator[](bSecondary);
00681 G4ParticleDefinition* cdef=cResult->GetDefinition();
00682 theSec = new G4ReactionProduct(cdef);
00683 G4LorentzVector cur4Mom = cResult->Get4Momentum();
00684 cur4Mom.boost(targ4Mom.boostVector());
00685 theSec->SetTotalEnergy(cur4Mom.t());
00686 theSec->SetMomentum(cur4Mom.vect());
00687 #ifdef trapdebug
00688 if(cdef->GetPDGEncoding()==113) G4cout
00689 <<"G4StringChipsParticleLevelInterface::Propagate: *Rho0* QGS dec2 PDG="
00690 <<cdef->GetPDGEncoding()<<",4M="<<cur4Mom<<", grandparPDG= "
00691 <<pdef->GetPDGEncoding()<<", parPDG= "<<sdef->GetPDGEncoding()<<G4endl;
00692 #endif
00693 #ifdef pdebug
00694 G4cout<<"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS dec2 PDG="
00695 <<sdef->GetPDGEncoding()<<",4M="<<cur4Mom<<G4endl;
00696 #endif
00697 theResult->push_back(theSec);
00698 }
00699 std::for_each(secsec->begin(), secsec->end(), DeleteKineticTrack());
00700 delete secsec;
00701 }
00702 else
00703 {
00704 theSec = new G4ReactionProduct(sdef);
00705 G4LorentzVector current4Mom = bResult->Get4Momentum();
00706 current4Mom.boost(targ4Mom.boostVector());
00707 theSec->SetTotalEnergy(current4Mom.t());
00708 theSec->SetMomentum(current4Mom.vect());
00709 #ifdef trapdebug
00710 if(sdef->GetPDGEncoding()==113)
00711 G4cout<<"G4StringChipsParticleLevelInterface::Propagate:*Rho0* QGS decay PDG="
00712 <<sdef->GetPDGEncoding()<<",4M="<<current4Mom<<", parentPDG= "
00713 <<pdef->GetPDGEncoding()<<G4endl;
00714
00715
00716 #endif
00717 #ifdef pdebug
00718 G4cout<<"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS decay PDG="
00719 <<sdef->GetPDGEncoding()<<",4M="<<current4Mom<<G4endl;
00720 #endif
00721 theResult->push_back(theSec);
00722 }
00723 }
00724 std::for_each(secondaries->begin(), secondaries->end(), DeleteKineticTrack());
00725 delete secondaries;
00726 }
00727 else
00728 {
00729 theSec = new G4ReactionProduct(aResult->GetDefinition());
00730 G4LorentzVector current4Mom = aResult->Get4Momentum();
00731 current4Mom.boost(targ4Mom.boostVector());
00732 theSec->SetTotalEnergy(current4Mom.t());
00733 theSec->SetMomentum(current4Mom.vect());
00734 #ifdef trapdebug
00735 if(aResult->GetDefinition()->GetPDGEncoding()==113)
00736 G4cout<<"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS stable PDG="
00737 <<aResult->GetDefinition()->GetPDGEncoding()<<",4M="<<current4Mom<<G4endl;
00738 #endif
00739 #ifdef pdebug
00740 G4cout<<"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS stable PDG="
00741 <<aResult->GetDefinition()->GetPDGEncoding()<<",4M="<<current4Mom<<G4endl;
00742 #endif
00743 theResult->push_back(theSec);
00744 }
00745 }
00746 std::for_each(theSecondaries->begin(), theSecondaries->end(), DeleteKineticTrack());
00747 delete theSecondaries;
00748
00749
00750 G4int maxParticle=output->size();
00751 #ifdef CHIPSdebug
00752 G4cout << "Number of particles from string"<<theResult->size()<<G4endl;
00753 G4cout << "Number of particles from chips"<<maxParticle<<G4endl;
00754 #endif
00755 #ifdef pdebug
00756 G4cout << "Number of particles from QGS="<<theResult->size()<<G4endl;
00757 G4cout << "Number of particles from CHIPS="<<maxParticle<<G4endl;
00758 #endif
00759 if(maxParticle) for(G4int particle = 0; particle < maxParticle; particle++)
00760 {
00761 if(output->operator[](particle)->GetNFragments() != 0)
00762 {
00763 delete output->operator[](particle);
00764 continue;
00765 }
00766 G4int pdgCode = output->operator[](particle)->GetPDGCode();
00767
00768
00769 #ifdef CHIPSdebug
00770 G4cerr << "PDG code of chips particle = "<<pdgCode<<G4endl;
00771 #endif
00772
00773 G4ParticleDefinition * theDefinition;
00774
00775
00776
00777
00778
00779 if(pdgCode>90000000)
00780 {
00781 G4int aZ = (pdgCode-90000000)/1000;
00782 if (aZ>1000) aZ=aZ%1000;
00783 G4int anN = pdgCode-90000000-1000*aZ;
00784 if(anN>1000) anN=anN%1000;
00785
00786 if(pdgCode==90000999) theDefinition = G4PionPlus::PionPlusDefinition();
00787 else if(pdgCode==89999001) theDefinition = G4PionMinus::PionMinusDefinition();
00788 else if(pdgCode==90999999) theDefinition = G4KaonZero::KaonZeroDefinition();
00789 else if(pdgCode==90999000) theDefinition = G4KaonMinus::KaonMinusDefinition();
00790 else if(pdgCode==89001000) theDefinition = G4KaonPlus::KaonPlusDefinition();
00791 else if(pdgCode==89000001) theDefinition = G4AntiKaonZero::AntiKaonZeroDefinition();
00792 else if(pdgCode==91000000) theDefinition = G4Lambda::LambdaDefinition();
00793 else if(pdgCode==92000000) theDefinition = G4Lambda::LambdaDefinition();
00794 else if(pdgCode==93000000) theDefinition = G4Lambda::LambdaDefinition();
00795 else if(pdgCode==94000000) theDefinition = G4Lambda::LambdaDefinition();
00796 else if(pdgCode==95000000) theDefinition = G4Lambda::LambdaDefinition();
00797 else if(pdgCode==96000000) theDefinition = G4Lambda::LambdaDefinition();
00798 else if(pdgCode==97000000) theDefinition = G4Lambda::LambdaDefinition();
00799 else if(pdgCode==98000000) theDefinition = G4Lambda::LambdaDefinition();
00800 else if(aZ == 0 && anN == 1) theDefinition = G4Neutron::Neutron();
00801 else theDefinition = G4ParticleTable::GetParticleTable()->FindIon(aZ,anN+aZ,0,aZ);
00802 }
00803 else theDefinition = G4ParticleTable::GetParticleTable()->FindParticle(pdgCode);
00804
00805 #ifdef CHIPSdebug
00806 G4cout << "Particle code produced = "<< pdgCode <<G4endl;
00807 #endif
00808
00809 if(theDefinition)
00810 {
00811 theSec = new G4ReactionProduct(theDefinition);
00812 G4LorentzVector current4Mom = output->operator[](particle)->Get4Momentum();
00813 current4Mom.boost(targ4Mom.boostVector());
00814 theSec->SetTotalEnergy(current4Mom.t());
00815 theSec->SetMomentum(current4Mom.vect());
00816 #ifdef pdebug
00817 G4cout<<"G4StringChipsParticleLevelInterface::Propagate: *OUT* CHIPS PDG="
00818 <<theDefinition->GetPDGEncoding()<<",4M="<<current4Mom<<G4endl;
00819 #endif
00820 theResult->push_back(theSec);
00821 }
00822 #ifdef pdebug
00823 else
00824 {
00825 G4cerr <<"G4StringChipsParticleLevelInterface::Propagate: WARNING"<<G4endl;
00826 G4cerr << "Getting unknown pdgCode from chips in ParticleLevelInterface"<<G4endl;
00827 G4cerr << "skipping particle with pdgCode = "<<pdgCode<<G4endl<<G4endl;
00828 }
00829 #endif
00830
00831 #ifdef CHIPSdebug
00832 G4cout <<"CHIPS particles "<<theDefinition->GetPDGCharge()<<" "
00833 << theDefinition->GetPDGEncoding()<<" "
00834 << output->operator[](particle)->Get4Momentum() <<G4endl;
00835 #endif
00836
00837 delete output->operator[](particle);
00838 }
00839 else
00840 {
00841 if(resA>0)
00842 {
00843 G4ParticleDefinition* theDefinition = G4Neutron::Neutron();
00844 if(resA==1)
00845 {
00846 if(resZ == 1) theDefinition = G4Proton::Proton();
00847 }
00848 else theDefinition = G4ParticleTable::GetParticleTable()->FindIon(resZ,resA,0,resZ);
00849 theSec = new G4ReactionProduct(theDefinition);
00850 theSec->SetTotalEnergy(theDefinition->GetPDGMass());
00851 theSec->SetMomentum(G4ThreeVector(0.,0.,0.));
00852 theResult->push_back(theSec);
00853 if(!resZ && resA>0) for(G4int ni=1; ni<resA; ni++)
00854 {
00855 theSec = new G4ReactionProduct(theDefinition);
00856 theSec->SetTotalEnergy(theDefinition->GetPDGMass());
00857 theSec->SetMomentum(G4ThreeVector(0.,0.,0.));
00858 theResult->push_back(theSec);
00859 }
00860 }
00861 }
00862 delete output;
00863
00864 #ifdef CHIPSdebug
00865 G4cout << "Number of particles"<<theResult->size()<<G4endl;
00866 G4cout << G4endl;
00867 G4cout << "QUASMON preparation info "
00868 << 1./MeV*proj4Mom<<" "
00869 << 1./MeV*targ4Mom<<" "
00870 << nD<<" "<<nU<<" "<<nS<<" "<<nAD<<" "<<nAU<<" "<<nAS<<" "
00871 << hitCount<<" "
00872 << particleCount<<" "
00873 << theLow<<" "
00874 << theHigh<<" "
00875 << G4endl;
00876 #endif
00877
00878 return theResult;
00879 }