93 : theEnvironment(90000000)
94{
95
96
100 nBarClust = 0;
101 totCharge = 0;
102 totBaryoN = 0;
103 f2all = 0;
105 theTargetPDG=targPDG;
106 G4int nHadrons=projHadrons.size();
107
108#ifdef debug
109 G4cout<<
"--->>G4QE::Const: Called targPDG="<<targPDG<<
", nInpHadr="<<nHadrons<<
G4endl;
110#endif
111 if(nHadrons<1 || targPDG==90000000)
112 {
113 G4cout <<
"---Warning---G4QEnv::Const:a#ofINPHadr=" << nHadrons
114 <<
",tPDG=" << targPDG <<
G4endl;
115
116 if(nHadrons)
117 {
118 for (
G4int ih=0; ih<nHadrons; ih++)
119 {
121#ifdef debug
122 G4cout <<
"*G4QE::Const:iH#" << ih <<
"," << curQH->
GetQC()
124#endif
125
127
128
130
132
133
140 if(
sqr(h1M+h2M) < chM2 )
141 {
145 {
147 ed << "QChip DecIn2 error: CM=" << std::sqrt(chM2) << " -> h1="
148 << h1QPDG << "(" << h1M << ") + h2=" << h1QPDG << "(" << h2M
149 <<
") = " << h1M+h2M <<
" **Failed**" <<
G4endl;
150 G4Exception(
"G4QEnvironment::G4QEnvironment()",
"HAD_CHPS_0000",
152 }
153 delete curQH;
155 theQHadrons.push_back(h1H);
157 theProjectiles.push_back(curQH);
158
159#ifdef debug
160 G4cout<<
"G4QE::Constr: QChipolino -> H1="<<h1QPDG<<h14M<<
G4endl;
161#endif
163 theQHadrons.push_back(curQH);
164#ifdef debug
165 G4cout<<
"G4QE::Constr: QChipolino -> H2="<<h2QPDG<<h24M<<
G4endl;
166#endif
167 }
168 else
169 {
171 ed <<
"LowMassChipolino in Input: " << ih <<
"," << curQH->
GetQC()
172 << curQH->
Get4Momentum() <<
", chipoM=" << std::sqrt(chM2) <<
" < m1="
173 << h1M << "(" << h1QPDG << ") + m2=" << h2M << "(" << h2QPDG << ") = "
175 G4Exception(
"G4QEnvironment::G4QEnvironment()",
"HAD_CHPS_0001",
177 }
178 }
179 theQHadrons.push_back(curQH);
181 theProjectiles.push_back(curQH);
182 }
183 }
184 else if(targPDG!=90000000)
185 {
187#ifdef debug
189#endif
190 theQHadrons.push_back(curQH);
191 }
192 if (nHadrons<0)
G4cout<<
"***Warning****G4QE::Const:NH="<<nHadrons<<
" < 0 !"<<
G4endl;
193 return;
194 }
196#ifdef debug
198#endif
199 G4int targA=targQPDG.GetBaryNum();
201 totCharge=targQPDG.GetCharge();
202 totBaryoN=targA;
204
205#ifdef debug
206 G4cout<<
"G4QE::C:PDG="<<targPDG<<
",C="<<totCharge<<
",M="<<targM<<
",n="<<nHadrons<<
G4endl;
207#endif
208 for(
G4int ipr=0; ipr<nHadrons; ipr++)
209 {
212 theProjectiles.push_back(curQH);
214 tot4Mom += h4Mom;
217#ifdef debug
221 G4cout<<
"G4QE::C:#"<<ipr<<
",PDG="<<hPDG<<hQC<<
",4M="<<h4Mom<<
",hNFr="<<hNFrag<<
G4endl;
222#endif
223 }
224#ifdef debug
225 G4cout<<
"G4QEnv::Const:tC="<<totCharge<<
",tB="<<totBaryoN<<
",tot4M="<<tot4Mom<<
G4endl;
226#endif
227#ifdef debug
228 G4cout<<
"G4QEnv::Const: --> tC="<<totCharge<<
",tB="<<totBaryoN<<
G4endl;
229#endif
231
233#ifdef debug
234 G4cout<<
"G4QEnv:Const:Before NCI:n="<<nP<<
",F="<<projHadrons[0]->GetNFragments()<<
",tC="
235 <<totCharge<<
",tB="<<totBaryoN<<
", nCl="<<nCl<<
G4endl;
236#endif
237 InitClustersVector(nCl,targA);
238#ifdef debug
239 G4cout<<
"G4QEnv::Const:NucClust,n="<<nCl<<
",F="<<projHadrons[0]->GetNFragments()<<
",tC="
240 <<totCharge<<
",tB="<<totBaryoN<<
G4endl;
241#endif
242 if(targPDG>80000000)
243 {
245#ifdef debug
246 G4cout<<
"G4QEnv::Const:nH="<<nHadrons<<
",PDG="<<projHadrons[0]->GetPDGCode()<<
",tC="
247 <<totCharge<<
",tB="<<totBaryoN<<
G4endl;
248#endif
249 if(nHadrons==1)
250 {
253#ifdef debug
254 G4cout<<
"G4QEnviron::Constructor: *** Only one input hadron*** PDG="<<opPDG<<
G4endl;
255#endif
256 if(opPDG==22)
257 {
259#ifdef debug
260 G4cout<<
"G4QEnvironment::Const: exM="<<exMass-targM<<
" > mPi0 ?"<<
G4endl;
261#endif
262 if(exMass<targM+135.977)
263 {
265
266 if(targM>999.&&!exEnviron.SplitBaryon())
267 {
268#ifdef debug
269 G4cout<<
"G4QEnv::Const:Photon's added to Output, Env="<<theEnvironment<<
G4endl;
270#endif
272#ifdef debug
274#endif
275 theQHadrons.push_back(
photon);
276 return;
277 }
278 else if(targM<=999.)
279 {
282 if(!
G4QHadron(tot4Mom).DecayIn2(prot4m,gam4m))
283 {
284#ifdef debug
285 G4cout<<
"*War*G4QEnv::Const:(P)Photon->Output, Env="<<theEnvironment<<
G4endl;
286#endif
288#ifdef debug
290#endif
291 theQHadrons.push_back(
photon);
292 return;
293 }
295 theQHadrons.push_back(proton);
297 theQHadrons.push_back(
photon);
299#ifdef debug
300 G4cout<<
"G4QEnv::Const:Fill gamma and N from gam+N"<<targPDG<<prot4m<<
G4endl;
301#endif
302 return;
303 }
304 }
305 }
306 else if(opPDG==13 || opPDG==15)
307 {
309 if(opPDG==15) nuPDG=16;
311
326
327
328
332#ifdef debug
333
334 G4cout<<
"G4QEnvironment::Const:mu4M="<<mu4m<<
",t4M="<<qt4m<<
",tgQP="<<qi4m<<
G4endl;
335#endif
336 while (tm<=fnm)
337 {
339 {
340 G4cout<<
"***G4QE::Constr:Muon error (1) 4M="<<mu4m<<
". Fill as it is."<<
G4endl;
342 theQHadrons.push_back(lepton);
343 return;
344 }
345#ifdef mudebug
346 G4cout<<
"G4QEnv::Const:i="<<qi4m<<
",t="<<qt4m<<
"->n="<<nu4m<<
"+q="<<qf4m<<
G4endl;
347#endif
348 fn4m=fd4m+qf4m;
350#ifdef mudebug
351 G4cout<<
"--G4QEnv::Const:M="<<tm<<
",GSM=="<<fnm<<
G4endl;
352#endif
353 }
354 fnN.Set4Momentum(fn4m);
355
357#ifdef mudebug
358 G4cout<<
"G4QEnv::Const:fM="<<tm<<fn4m<<
",GSM="<<fnm<<
G4endl;
359#endif
360 if(tm<fnm)
361 {
363 qt4m=tg4m+mu4m;
365 {
366 G4cout<<
"***G4QE::Constr:Muon error (2) 4M="<<mu4m<<
". Fill as it is."<<
G4endl;
368 theQHadrons.push_back(muon);
369 return;
370 }
372
373 EvaporateResidual(fnuc);
376#ifdef debug
377 G4cout<<
"G4QEnv::Const:Fill neutrino (1) "<<nuPDG<<nu4m<<
G4endl;
378#endif
379 theQHadrons.push_back(neutrino);
380 return;
381 }
383#ifdef debug
384 G4cout<<
"G4QEnv::Const:Fill neutrino (2) "<<nuPDG<<nu4m<<
G4endl;
385#endif
386 theQHadrons.push_back(neutrino);
387 if(tm<fnm+135.98)
388 {
389 if(!fnN.SplitBaryon())
390 {
391#ifdef mudebug
392 G4cout<<
"G4QEnv::Const: impossible to split nucleon after mu->nu"<<
G4endl;
393#endif
397 {
398 G4cout<<
"***G4QE::Constr:LepCapError(3),M="<<fn4m.
m()<<
"<"<<fnm<<
G4endl;
400 theQHadrons.push_back(resid);
402 return;
403 }
405#ifdef debug
407#endif
408 theQHadrons.push_back(
photon);
410#ifdef debug
411 G4cout<<
"G4QEnv::Const:Fill target "<<targQC<<qf4m<<
" in any form"<<
G4endl;
412#endif
413 EvaporateResidual(fnuc);
415 return;
416 }
417 }
418
419 fn4m=qf4m-qi4m;
421 fake=false;
422
423
425 }
426 }
427 for(
G4int ih=0; ih<nHadrons; ih++)
428 {
432#ifdef debug
433 G4cout<<
"G4QE:C:"<<ih<<
",F="<<hNFrag<<
",0="<<projHadrons[0]->GetNFragments()<<
G4endl;
434#endif
435 if(!hNFrag&&ch4M.
e()>0.)
436 {
439 {
441
442 if(!hPDG)
443 {
444
445
446
447 }
448 else
449 {
451 if(hQ<0)
452 {
453
454
455 }
456 else
457 {
459#ifdef debug
461#endif
462 theQHadrons.push_back(newHadr);
463#ifdef debug
464 G4cout<<
"G4QEnviron::Constructor: Fill h="<<hPDG<<ch4M<<
G4endl;
465 for(unsigned ipo=0; ipo<theQHadrons.size(); ipo++)
466 {
467 G4int hPDG = theQHadrons[ipo]->GetPDGCode();
469 G4int hNFrag= theQHadrons[ipo]->GetNFragments();
471 G4cout<<
"h#"<<ipo<<
": "<<hPDG<<hQC<<
",4M="<<h4Mom<<
",nFr="<<hNFrag<<
G4endl;
472 }
473#endif
474 }
475 }
476 }
477 else
478 {
480#ifdef debug
481 G4cout<<
"G4QE::Const:CreateQuasm, 4M="<<ch4M<<
",QC="<<hQC<<
",E="<<envPDG<<
",tC="
482 <<totCharge<<
",tB="<<totBaryoN<<
G4endl;
483#endif
484 CreateQuasmon(hQC, ch4M, fake);
485 }
486 }
487 }
488 }
489 else
490 {
491
494 if(!hPDG||hPDG==10)
495 {
496 G4cout<<
"---Warning---G4QEnvironment::Constructor:Vacuum,1st Hadron wrong PDG="<<hPDG
498
499 }
500 else
501 {
503 if(hQ<0)
504 {
505 G4cout<<
"---Warning---G4QEnviron::Constructor:Vacuum,Q<0, 1st HPDG="<<hPDG<<
G4endl;
506
507 }
508 else
509 {
512 if(!targPDG||targPDG==10)
G4cout<<
"G4QEnv::CreateQ; (1) PDG="<<targPDG<<
G4endl;
514 G4int tQ = tQPDG.GetQCode();
515 if(tQ<0||targPDG==10)
516 {
517 G4cout<<
"---Warning---G4QEnv::Constructor:TrgQC<0, Chipo?,PDG="<<targPDG<<
G4endl;
518
519 }
520 else
521 {
523 hQC+=tQPDG.GetQuarkContent();
524#ifdef debug
525 G4cout<<
"G4QEnv::Const:VacHadrTarg="<<h4Mom<<hQC<<
",E="<<theEnvironment<<
G4endl;
526#endif
528 theQuasmons.push_back(curQuasmon);
529 }
530 }
531 }
532 if(nHadrons>1)
for(
G4int ih=0; ih<nHadrons; ih++)
533 {
535#ifdef debug
537#endif
538 theQHadrons.push_back(newHadr);
539 }
540 }
541#ifdef chdebug
544 G4int nHad=theQHadrons.size();
545 if(nHad)
for(
G4int ih=0; ih<nHad; ih++)
546 {
547 finCharge+=theQHadrons[ih]->GetCharge();
548 finBaryoN+=theQHadrons[ih]->GetBaryonNumber();
549 }
550 G4int nQuas=theQuasmons.size();
551 if(nQuas)
for(
G4int iq=0; iq<nQuas; iq++)
552 {
553 finCharge+=theQuasmons[iq]->GetCharge();
554 finBaryoN+=theQuasmons[iq]->GetBaryonNumber();
555 }
556 if(finCharge!=totCharge || finBaryoN!=totBaryoN)
557 {
558 G4cout<<
"*::*G4QEnv::C:(0) tC="<<totCharge<<
",C="<<finCharge<<
",tB="<<totBaryoN
559 <<
",B="<<finBaryoN<<
",E="<<theEnvironment<<
G4endl;
560 if(nHad)
for(
G4int h=0; h<nHad; h++)
561 {
564 }
565 if(nQuas)
for(
G4int q=0; q<nQuas; q++)
566 {
569 }
570 }
571#endif
572}
static G4QCHIPSWorld * Get()
G4int GetQPEntries() const
G4LorentzVector Get4Momentum() const
G4int GetBaryonNumber() const
void SetQPDG(const G4QPDGCode &QPDG)
G4int GetNFragments() const
void Set4Momentum(const G4LorentzVector &aMom)
void InitByPDG(G4int newPDG)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
std::ostringstream G4ExceptionDescription