66{
67#ifdef debug
68 G4cout<<
"G4StringChipsInterface::Propagate is called"<<
G4endl;
69#endif
70
71
72 if(theSecondaries->size() == 1)
73 throw G4HadronicException(__FILE__, __LINE__,
"G4StringChipsInterface: Only one particle from String models!");
74
75
79 G4double inpactPar2 = impactX*impactX + impactY*impactY;
80
82 radius2 *= radius2;
84 if(radius2 - inpactPar2>0) pathlength = 2.*std::sqrt(radius2 - inpactPar2);
85 G4double theEnergyLostInFragmentation = theEnergyLossPerFermi*pathlength/fermi;
86
87
88 std::list<std::pair<G4double, G4KineticTrack *> > theSorted;
89 std::list<std::pair<G4double, G4KineticTrack *> >::iterator current;
90 for(unsigned int secondary = 0; secondary<theSecondaries->size(); secondary++)
91 {
92 G4LorentzVector a4Mom = theSecondaries->operator[](secondary)->Get4Momentum();
93
94#ifdef CHIPSdebug
95 G4cout <<
"ALL STRING particles "<<theSecondaries->operator[](secondary)->GetDefinition()->GetPDGCharge()<<
" "
96 << theSecondaries->operator[](secondary)->GetDefinition()->GetPDGEncoding()<<" "
98#endif
99
101 std::pair<G4double, G4KineticTrack *> it;
102 it.first = toSort;
103 it.second = theSecondaries->operator[](secondary);
105 for(current = theSorted.begin(); current!=theSorted.end(); current++)
106 {
107 if((*current).first > toSort)
108 {
109 theSorted.insert(current, it);
110 inserted = true;
111 break;
112 }
113 }
114 if(!inserted)
115 {
116 theSorted.push_front(it);
117 }
118 }
119
121
122
123
124
125
126
133 std::list<std::pair<G4double, G4KineticTrack *> >::iterator firstEscaping = theSorted.begin();
135 G4int particleCount = 0;
136 G4LorentzVector theLow = (*(theSorted.begin())).second->Get4Momentum();
138
139#ifdef CHIPSdebug
140 G4cout <<
"CHIPS ENERGY LOST "<<theEnergyLostInFragmentation<<
G4endl;
142#endif
143
147#ifdef pdebug
148 G4cout<<
"G4StringChipsInterface::Propagate: Absorption"<<
G4endl;
149#endif
150
151
152 for(current = theSorted.begin(); current!=theSorted.end(); current++)
153 {
154 firstEscaping = current;
155 if((*current).second->GetDefinition()->GetQuarkContent(3)!=0 ||
156 (*current).second->GetDefinition()->GetAntiQuarkContent(3) !=0)
157 {
160 secondaries = NULL;
162 {
163 secondaries = aResult->
Decay();
164 }
165 if ( secondaries == NULL )
166 {
171 theResult->push_back(theSec);
172 }
173 else
174 {
175 for (unsigned int aSecondary=0; aSecondary<secondaries->size(); aSecondary++)
176 {
177 theSec =
new G4ReactionProduct(secondaries->operator[](aSecondary)->GetDefinition());
178 G4LorentzVector current4Mom = secondaries->operator[](aSecondary)->Get4Momentum();
181 theResult->push_back(theSec);
182 }
184 delete secondaries;
185 }
186 continue;
187 }
188 runningEnergy += (*current).second->Get4Momentum().t();
189 if(runningEnergy > theEnergyLostInFragmentation) break;
190
191#ifdef CHIPSdebug
192 G4cout <<
"ABSORBED STRING particles "<<current->second->GetDefinition()->GetPDGCharge()<<
" "
193 << current->second->GetDefinition()->GetPDGEncoding()<<" "
194 << current->second->Get4Momentum() <<
G4endl;
195#endif
196#ifdef pdebug
197 G4cout<<
"G4StringChipsInterface::Propagate:C="
198 <<current->second->GetDefinition()->GetPDGCharge()<<", PDG="
199 << current->second->GetDefinition()->GetPDGEncoding()<<", 4M="
200 << current->second->Get4Momentum() <<
G4endl;
201#endif
202
203
204 particleCount++;
205 theHigh = (*current).second->Get4Momentum();
206 proj4Mom += (*current).second->Get4Momentum();
207
208#ifdef CHIPSdebug
209 G4cout <<
"sorted rapidities "<<current->second->Get4Momentum().rapidity()<<
G4endl;
210#endif
211
212
213 nD += (*current).second->GetDefinition()->GetQuarkContent(1);
214 nU += (*current).second->GetDefinition()->GetQuarkContent(2);
215 nS += (*current).second->GetDefinition()->GetQuarkContent(3);
216 nAD += (*current).second->GetDefinition()->GetAntiQuarkContent(1);
217 nAU += (*current).second->GetDefinition()->GetAntiQuarkContent(2);
218 nAS += (*current).second->GetDefinition()->GetAntiQuarkContent(3);
219 }
220
221
222#ifdef CHIPSdebug
223 G4cout <<
"Quark content: d="<<nD<<
", u="<<nU<<
", s="<< nS <<
G4endl;
224 G4cout <<
"Anti-quark content: anit-d="<<nAD<<
", anti-u="<<nAU<<
", anti-s="<< nAS <<
G4endl;
225#endif
226
227 G4QContent theProjectiles(nD, nU, nS, nAD, nAU, nAS);
228
229#ifdef CHIPSdebug
230 G4cout <<
"G4QContent is constructed"<<endl;
231#endif
232
233
234
243 {
245 {
246 resA++;
248 }
249 else
250 {
253 hitCount ++;
254 }
255 }
256 G4int targetPDGCode = 90000000 + 1000*resZ + (resA-resZ);
258 targetMass -= hitMass;
259 G4double targetEnergy = std::sqrt(hitMomentum.mag2()+targetMass*targetMass);
260
262
263
265
266
267 G4double fractionOfSingleQuasiFreeNucleons = 0.5;
268 G4double fractionOfPairedQuasiFreeNucleons = 0.05;
269 G4double clusteringCoefficient = 5.;
271 G4double halfTheStrangenessOfSee = 0.3;
273
275 fractionOfPairedQuasiFreeNucleons,
276 clusteringCoefficient);
278 halfTheStrangenessOfSee,
279 etaToEtaPrime);
280
281#ifdef CHIPSdebug
282 G4cout <<
"G4QNucleus parameters "<< fractionOfSingleQuasiFreeNucleons <<
" "
283 << fractionOfPairedQuasiFreeNucleons <<
" "<< clusteringCoefficient <<
G4endl;
284 G4cout <<
"G4Quasmon parameters "<< temperature <<
" "<< halfTheStrangenessOfSee <<
" "
285 <<etaToEtaPrime <<
G4endl;
286 G4cout <<
"The Target PDG code = "<<targetPDGCode<<
G4endl;
287 G4cout <<
"The projectile momentum = "<<1./MeV*proj4Mom<<
G4endl;
288 G4cout <<
"The target momentum = "<<1./MeV*targ4Mom<<
G4endl;
289#endif
290
291
292
293
296
297 proj4Mom.boost(-1.*targ4Mom.boostVector());
298
300 toZ.
rotateZ(-1*proj4Mom.phi());
301 toZ.
rotateY(-1*proj4Mom.theta());
302 proj4Mom = toZ*proj4Mom;
304
305#ifdef CHIPSdebug
306 G4cout <<
"a Boosted projectile vector along z"<<proj4Mom<<
" "<<proj4Mom.mag()<<
G4endl;
307#endif
308
310 projHV.push_back(iH);
311
312
314 if (particleCount!=0)
315 {
317 try
318 {
320 }
322 {
323 G4cerr <<
"Exception thrown passing through G4ChiralInvariantPhaseSpace "<<
G4endl;
325 G4cerr <<
" Dumping the information in the pojectile list"<<
G4endl;
326 for(size_t i=0; i< projHV.size(); i++)
327 {
328 G4cerr <<
" Incoming 4-momentum and PDG code of "<<i<<
"'th hadron: "
329 <<
" "<< projHV[i]->Get4Momentum()<<
" "<<projHV[i]->GetPDGCode()<<
G4endl;
330 }
331 throw;
332 }
333 std::for_each(projHV.begin(), projHV.end(),
DeleteQHadron());
334 projHV.clear();
335 delete pan;
336 }
338
339
340#ifdef CHIPSdebug
341 G4cout <<
"NEXT EVENT"<<endl;
342#endif
343
344
345 for(current = firstEscaping; current!=theSorted.end(); current++)
346 {
349 secondaries = NULL;
351 {
352 secondaries = aResult->
Decay();
353 }
354 if ( secondaries == NULL )
355 {
358 current4Mom = toLab*current4Mom;
359 current4Mom.
boost(targ4Mom.boostVector());
362 theResult->push_back(theSec);
363 }
364 else
365 {
366 for (unsigned int aSecondary=0; aSecondary<secondaries->size(); aSecondary++)
367 {
368 theSec =
new G4ReactionProduct(secondaries->operator[](aSecondary)->GetDefinition());
369 G4LorentzVector current4Mom = secondaries->operator[](aSecondary)->Get4Momentum();
370 current4Mom = toLab*current4Mom;
371 current4Mom.
boost(targ4Mom.boostVector());
374 theResult->push_back(theSec);
375 }
377 delete secondaries;
378 }
379 }
381 delete theSecondaries;
382
383
384#ifdef CHIPSdebug
385 G4cout <<
"Number of particles from string"<<theResult->size()<<
G4endl;
386 G4cout <<
"Number of particles from chips"<<output->size()<<
G4endl;
387#endif
388
389 for(unsigned int particle = 0; particle < output->size(); particle++)
390 {
391 if(output->operator[](particle)->GetNFragments() != 0)
392 {
393 delete output->operator[](particle);
394 continue;
395 }
396
397 G4int pdgCode = output->operator[](particle)->GetPDGCode();
399
400
401
402
403
404 if(pdgCode>90000000)
405 {
406 G4int aZ = (pdgCode-90000000)/1000;
407 if (aZ>1000) aZ=aZ%1000;
408 G4int anN = pdgCode-90000000-1000*aZ;
409 if(anN>1000) anN=anN%1000;
420 }
421 else
422 {
424 }
425#ifdef CHIPSdebug
426 G4cout <<
"Particle code produced = "<< pdgCode <<
G4endl;
427#endif
428
430 G4LorentzVector current4Mom = output->operator[](particle)->Get4Momentum();
431 current4Mom = toLab*current4Mom;
432 current4Mom.
boost(targ4Mom.boostVector());
435 theResult->push_back(theSec);
436
437#ifdef CHIPSdebug
441#endif
442
443 delete output->operator[](particle);
444 }
445 delete output;
446#ifdef CHIPSdebug
447 G4cout <<
"Number of particles"<<theResult->size()<<
G4endl;
449
450 G4cout <<
"QUASMON preparation info "
451 << 1./MeV*proj4Mom<<" "
452 << 1./MeV*targ4Mom<<" "
453 << nD<<" "<<nU<<" "<<nS<<" "<<nAD<<" "<<nAU<<" "<<nAS<<" "
454 << hitCount<<" "
455 << particleCount<<" "
456 << theLow<<" "
457 << theHigh<<" "
459#endif
460
461 return theResult;
462}
std::vector< G4QHadron * > G4QHadronVector
std::vector< G4ReactionProduct * > G4ReactionProductVector
G4DLLIMPORT std::ostream G4cerr
HepLorentzRotation & rotateY(double delta)
HepLorentzRotation & rotateZ(double delta)
HepLorentzRotation inverse() const
HepLorentzVector & boost(double, double, double)
G4KineticTrackVector * Decay()
G4ParticleDefinition * GetDefinition() const
const G4LorentzVector & Get4Momentum() const
static G4Lambda * LambdaDefinition()
static G4Neutron * Neutron()
virtual G4ParticleDefinition * GetDefinition() const
const G4LorentzVector & GetMomentum() const
G4int GetPDGEncoding() const
G4double GetPDGWidth() const
G4double GetPDGCharge() const
G4double GetPDGLifeTime() const
G4ParticleDefinition * FindIon(G4int atomicNumber, G4int atomicMass, G4double excitationEnergy)
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
static G4QCHIPSWorld * Get()
G4QParticleVector * GetParticles(G4int nOfParts=0)
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 G4Nucleon * GetNextNucleon()=0
virtual G4bool StartLoop()=0
virtual G4double GetMass()=0
virtual G4double GetNuclearRadius()=0