5780{
5785 if(thePDG<0) pap = 1;
5788
5790 G4int nChan = decV.size();
5791#ifdef debug
5792 G4cout<<
"G4Quasm::DecQHadron: PDG="<<thePDG<<
",m="<<m_value<<
",("<<nChan<<
" channels)"<<
G4endl;
5793#endif
5794 if(nChan)
5795 {
5797 if(nChan>1)
5798 {
5800 for(i=0; i<nChan; i++)
5801 {
5803#ifdef debug
5806#endif
5807 if(rnd<dC->GetDecayChanLimit() && m_value>dC->
GetMinMass())
break;
5808 }
5809 if(i>nChan-1) i=nChan-1;
5810 }
5812 G4int nPart=cV.size();
5813#ifdef debug
5814 G4cout<<
"G4Quasmon::DecayQHadron: resi="<<i<<
",nP="<<nPart<<
":"<<cV[0]->GetPDGCode()
5815 <<","<<cV[1]->GetPDGCode();
5816 if(nPart>2)
G4cout<<
","<<cV[2]->GetPDGCode();
5818#endif
5819 if(nPart<2||nPart>3)
5820 {
5821 G4cerr<<
"---Warning---G4Q::DecayQHadr:n="<<nPart<<
",ch#"<<i<<
",PDG="<<thePDG<<
G4endl;
5822 theFragments->push_back(qH);
5823 return theFragments;
5824 }
5825#ifdef debug
5826 G4cout<<
"G4Q::DecQH:Decay("<<ElMaDecays<<
") PDG="<<thePDG<<t<<m_value<<
",nP="<<nPart<<
G4endl;
5827#endif
5828 if(nPart==2)
5829 {
5833 G4int sPDG=cV[1]->GetPDGCode();
5834
5835 if ( (fPDG != 22 && sPDG != 22) || ElMaDecays) {
5836#ifdef debug
5837 G4cout<<
"G4Q::DecQH:Yes2,fPDG="<<fPDG<<
",sPDG="<<sPDG<<
",EMF="<<ElMaDecays<<
G4endl;
5838#endif
5839 if(cV[0]->GetWidth()==0.)
5840 {
5841 fHadr =
new G4QHadron(cV[0]->GetPDGCode());
5842 if(cV[1]->GetWidth()==0.)sHadr =
new G4QHadron(sPDG);
5843 else
5844 {
5849 }
5850 }
5851 else
5852 {
5863#ifdef debug
5864 G4cout<<
"G4Q::DQH:M="<<m_value<<
",mi="<<mim<<
",fd="<<fdm<<
",fm="<<fm<<
",sd="<<sdm
5866#endif
5867 }
5868#ifdef debug
5870#endif
5871 if(pap)
5872 {
5875 }
5878 if(!qH->DecayIn2(f4Mom,s4Mom))
5879 {
5880 delete fHadr;
5881 delete sHadr;
5882#ifdef debug
5883 G4cerr<<
"---Warning---G4Q::DecayQHadron:in2,PDGC="<<thePDG<<
", ch#"<<i<<
": 4M="
5884 <<qH->Get4Momentum()<<
"("<<qH->GetMass()<<
")->"<<f4Mom<<
"+"<<s4Mom<<
G4endl;
5885
5886#endif
5887 theFragments->push_back(qH);
5888 return theFragments;
5889 }
5890 else
5891 {
5892
5893
5894
5895 delete qH;
5896
5899 G4int nProd=theTmpQHV->size();
5900#ifdef debug
5901 G4cout<<
"G4Q::DecayQHadr:(DecayIn2) nOfProdForQH1="<<nProd<<
G4endl;
5902#endif
5903 if(nProd==1) theFragments->push_back((*theTmpQHV)[0]);
5904 else for(
G4int ip1=0; ip1<nProd; ip1++)
5905 {
5907 G4int tmpS=intTmpQHV->size();
5908 if(tmpS==1)theFragments->push_back((*intTmpQHV)[0]);
5909 else
5910 {
5911 theFragments->resize(tmpS+theFragments->size());
5912 copy(intTmpQHV->begin(), intTmpQHV->end(), theFragments->end()-tmpS);
5913 }
5914#ifdef debug
5915 G4cout<<
"G4Q::DecayQHadr:(DecayIn2) Copy Sec11 nProd="<<tmpS<<
G4endl;
5916#endif
5917 intTmpQHV->clear();
5918 delete intTmpQHV;
5919 }
5920 theTmpQHV->clear();
5921 delete theTmpQHV;
5924 nProd=theTmpQHV->size();
5925#ifdef debug
5926 G4cout<<
"G4Q::DecayQHadr:(DecayIn2) nOfProdForQH2="<<nProd<<
G4endl;
5927#endif
5928 if(nProd==1) theFragments->push_back((*theTmpQHV)[0]);
5929 else for(
G4int ip1=0; ip1<nProd; ip1++)
5930 {
5932 G4int tmpS=intTmpQHV->size();
5933 if(tmpS==1)theFragments->push_back((*intTmpQHV)[0]);
5934 else
5935 {
5936 theFragments->resize(tmpS+theFragments->size());
5937 copy(intTmpQHV->begin(), intTmpQHV->end(), theFragments->end()-tmpS);
5938 }
5939#ifdef debug
5940 G4cout<<
"G4Q::DecayQHadr:(DecayIn2) Copy Sec12 nProd="<<tmpS<<
G4endl;
5941#endif
5942 intTmpQHV->clear();
5943 delete intTmpQHV;
5944 }
5945 theTmpQHV->clear();
5946 delete theTmpQHV;
5947 }
5948#ifdef debug
5949 G4cout<<
"G4Q::DecQHadr: DecayIn2 is made with nH="<<theFragments->size()<<
G4endl;
5950#endif
5951 }
5952 else
5953 {
5954#ifdef debug
5955 if(thePDG==89999003||thePDG==90002999)
G4cerr<<
"*G4Q::DQH:8999003/90002999"<<
G4endl;
5956#endif
5957 theFragments->push_back(qH);
5958 }
5959 }
5960 else if(nPart==3)
5961 {
5966 G4int sPDG=cV[1]->GetPDGCode();
5967 G4int tPDG=cV[2]->GetPDGCode();
5968
5969 if ( (fPDG != 22 && sPDG != 22 && tPDG != 22) || ElMaDecays)
5970 {
5971#ifdef debug
5972 G4cout<<
"G4Q::DQH:Y,f="<<fPDG<<
",s="<<sPDG<<
",t="<<tPDG<<
",F="<<ElMaDecays<<
G4endl;
5973#endif
5974 if(cV[0]->GetWidth()==0.)
5975 {
5977 if(cV[1]->GetWidth()==0.)
5978 {
5980 if(cV[2]->GetWidth()==0.)tHadr =
new G4QHadron(tPDG);
5981 else
5982 {
5987 }
5988 }
5989 else
5990 {
6001 }
6002 }
6003 else
6004 {
6009 G4double fdm = m_value - smim - tmim;
6020 }
6021#ifdef debug
6022 G4cout<<
"G4Quasmon::DecayQHadron:3Dec. m1="<<fHadr->
GetMass()
6024#endif
6025 if(pap)
6026 {
6030 }
6034 if(!qH->DecayIn3(f4Mom,s4Mom,t4Mom))
6035 {
6036 delete fHadr;
6037 delete sHadr;
6038 delete tHadr;
6039 G4cerr<<
"---Warning---G4Q::DecayQHadron:in3,PDGC="<<thePDG<<
", ch#"<<i<<
G4endl;
6040 theFragments->push_back(qH);
6041 return theFragments;
6042 }
6043 else
6044 {
6045
6046
6047
6048 delete qH;
6049
6052 G4int nProd=theTmpQHV->size();
6053#ifdef debug
6054 G4cout<<
"G4Q::DecayQHadr:(DecayIn3) nOfProdForQH1="<<nProd<<
G4endl;
6055#endif
6056 if(nProd==1) theFragments->push_back((*theTmpQHV)[0]);
6057 else for(
G4int ip1=0; ip1<nProd; ip1++)
6058 {
6060 G4int tmpS=intTmpQHV->size();
6061 if(tmpS==1)theFragments->push_back((*intTmpQHV)[0]);
6062 else
6063 {
6064 theFragments->resize(tmpS+theFragments->size());
6065 copy(intTmpQHV->begin(), intTmpQHV->end(), theFragments->end()-tmpS);
6066 }
6067#ifdef debug
6068 G4cout<<
"G4Q::DecayQHadr:(DecayIn3) Copy Sec11 nProd="<<tmpS<<
G4endl;
6069#endif
6070 intTmpQHV->clear();
6071 delete intTmpQHV;
6072 }
6073 theTmpQHV->clear();
6074 delete theTmpQHV;
6075
6078 nProd=theTmpQHV->size();
6079#ifdef debug
6080 G4cout<<
"G4Q::DecayQHadr:(DecayIn3) nOfProdForQH2="<<nProd<<
G4endl;
6081#endif
6082 if(nProd==1) theFragments->push_back((*theTmpQHV)[0]);
6083 else for(
G4int ip1=0; ip1<nProd; ip1++)
6084 {
6086 G4int tmpS=intTmpQHV->size();
6087 if(tmpS==1)theFragments->push_back((*intTmpQHV)[0]);
6088 else
6089 {
6090 theFragments->resize(tmpS+theFragments->size());
6091 copy(intTmpQHV->begin(), intTmpQHV->end(), theFragments->end()-tmpS);
6092 }
6093#ifdef debug
6094 G4cout<<
"G4Q::DecayQHadr:(DecayIn3) Copy Sec12 nProd="<<tmpS<<
G4endl;
6095#endif
6096 intTmpQHV->clear();
6097 delete intTmpQHV;
6098 }
6099 theTmpQHV->clear();
6100 delete theTmpQHV;
6101
6104 nProd=theTmpQHV->size();
6105#ifdef debug
6106 G4cout<<
"G4Q::DecayQHadr:(DecayIn3) nOfProdForQH3="<<nProd<<
G4endl;
6107#endif
6108 if(nProd==1) theFragments->push_back((*theTmpQHV)[0]);
6109 else for(
G4int ip1=0; ip1<nProd; ip1++)
6110 {
6112 G4int tmpS=intTmpQHV->size();
6113 if(tmpS==1)theFragments->push_back((*intTmpQHV)[0]);
6114 else
6115 {
6116 theFragments->resize(tmpS+theFragments->size());
6117 copy(intTmpQHV->begin(), intTmpQHV->end(), theFragments->end()-tmpS);
6118 }
6119#ifdef debug
6120 G4cout<<
"G4Q::DecayQHadr:(DecayIn3) Copy Sec13 nProd="<<tmpS<<
G4endl;
6121#endif
6122 intTmpQHV->clear();
6123 delete intTmpQHV;
6124 }
6125 theTmpQHV->clear();
6126 delete theTmpQHV;
6127
6128 }
6129#ifdef debug
6130 G4cout<<
"G4Q::DecQHadr: DecayIn3 is made with nH="<<theFragments->size()<<
G4endl;
6131#endif
6132 }
6133 else theFragments->push_back(qH);
6134 }
6135 }
6136 else
6137 {
6138#ifdef debug
6139 G4cout<<
"G4Quas::DecQHadr:Fill PDG= "<<thePDG<<t<<m_value<<
" as it is ***0***>>"<<
G4endl;
6140#endif
6141 if(thePDG==89999003||thePDG==90002999)
G4cerr<<
"-War-G4Q::DQH:8999003/90002999"<<
G4endl;
6142 theFragments->push_back(qH);
6143 }
6144#ifdef debug
6145 G4cout<<
"G4Q::DecQHadr:=-= HADRON IS DECAYED =-= with nH="<<theFragments->size()<<
G4endl;
6146#endif
6147 return theFragments;
6148}
std::vector< G4QDecayChan * > G4QDecayChanVector
std::vector< G4QHadron * > G4QHadronVector
std::vector< G4QPDGCode * > G4QPDGCodeVector
G4DLLIMPORT std::ostream G4cerr
G4QParticle * GetQParticle(G4int PDG) const
G4double GetDecayChanLimit() const
G4double GetMinMass() const
G4LorentzVector Get4Momentum() const
void Set4Momentum(const G4LorentzVector &aMom)
G4QDecayChanVector GetDecayVector()
G4double MinMassOfFragm()
G4QHadronVector * DecayQHadron(G4QHadron *hadron)