73{
74
76
79
82
84
85
86
87
88 if(fVerbose > 1) {
89 G4cout <<
"#Unstable decay " <<
" Z= " <<
Z <<
" A= " <<
A
91 }
92 const G4double tolerance = 10*CLHEP::eV;
93 const G4double dmlimit = 0.005*CLHEP::MeV;
98 for(
G4int i=0; i<6; ++i) {
101 if(Zres >= 0 && Ares >= Zres && Ares >= Afr[i]) {
102 if(Ares <= 4) {
103 for(
G4int j=0; j<6; ++j) {
104 if(Zres == Zfr[j] && Ares == Afr[j]) {
105 G4double delm = mass - masses[i] - masses[j];
106
107
108
109
110 if(delm > exca) {
111 mass2 = masses[i];
112 mass1 = masses[j];
113 exca = delm;
114 idx = i;
115 if(delm > 0.0) {
116 isChannel = true;
117 break;
118 }
119 }
120 }
121 }
122 }
123 if(isChannel) { break; }
124
126 G4double e = mass - mres - masses[i];
127
128
129
130
131
132
133 if(e >= exca) {
134 mass2 = masses[i];
135 mass1 = (Ares > 4 && e > 0.0) ? mres + e*
G4UniformRand() : mres;
136 exca = e;
137 idx = i;
138 if(e > 0.0) {
139 isChannel = true;
140 break;
141 }
142 }
143 }
144 }
145
147 if(fVerbose > 1) {
148 G4cout <<
"isChannel:" << isChannel <<
" idx=" << idx <<
" Zfr=" << Zfr[idx]
149 <<
" Arf=" << Afr[idx] <<
" delm=" << mass - massmin <<
G4endl;
150 }
151 if(!isChannel || mass < massmin) {
152 if(mass + dmlimit < massmin) { return false; }
153 if(fVerbose > 1) {
154 G4cout <<
"#Unstable decay correction: Z= " <<
Z <<
" A= " <<
A
155 << " idx= " << idx
156 << " deltaM(MeV)= " << mass - massmin
158 }
159 mass = massmin;
160 G4double e = std::max(lv.
e(), mass + tolerance);
161 G4double mom = std::sqrt((e - mass)*(e + mass));
164 }
165
166
167 G4double e2 = 0.5*((mass - mass1)*(mass + mass1) + mass2*mass2)/mass;
168 e2 = std::max(e2, mass2);
169 G4double mom = std::sqrt((e2 - mass2)*(e2 + mass2));
170
171
176 frag =
new G4Fragment(Afr[idx], Zfr[idx], mom2);
179 results->push_back(frag);
180
181
182 lv -= mom2;
185
189 return true;
190}
CLHEP::HepLorentzVector G4LorentzVector
G4ThreeVector G4RandomDirection()
G4GLOB_DLL std::ostream G4cout
Hep3Vector boostVector() const
HepLorentzVector & boost(double, double, double)
void set(double x, double y, double z, double t)
void SetZandA_asInt(G4int Znew, G4int Anew, G4int Lnew=0)
G4double GetExcitationEnergy() const
const G4LorentzVector & GetMomentum() const
void SetCreatorModelID(G4int value)
G4double GetCreationTime() const
void SetCreationTime(G4double time)
void SetMomentum(const G4LorentzVector &value)