40 const std::vector<G4double>& expa,
41 const std::vector<G4double>& expcs,
42 const std::vector<G4double>& experr,
45 : nuclz(z), izotop_chsq(0.), average_ratio(0.), aver_rat_err(0.),
46 aver_lhood(0.), aver_matched(0.), exper_as(expa), exper_cs(expcs),
47 exper_err(experr), checkable(check), nucleable(nucl) {}
52 if (std::abs(z-nuclz) >= small)
return;
55 std::size_t simulatedAsSize = simulated_as.size();
56 for (std::size_t i = 0; i<simulatedAsSize && !here; ++i) {
57 if (std::abs(simulated_as[i] - a) < small) {
58 simulated_cs[i] += 1.0;
64 simulated_as.push_back(a);
65 simulated_cs.push_back(1.0);
70 std::size_t simulatedAsSize = simulated_as.size();
71 for(std::size_t i = 0; i < simulatedAsSize ; ++i) {
72 double err = std::sqrt(simulated_cs[i]) / simulated_cs[i];
74 simulated_prob.push_back(simulated_cs[i] / nev);
75 simulated_cs[i] *= csec / nev;
76 simulated_errors.push_back(simulated_cs[i] * err);
96 std::size_t simulatedAsSize = simulated_as.size();
97 for(std::size_t iz = 0; iz < simulatedAsSize; ++iz) {
98 cs += simulated_cs[iz];
99 err += simulated_errors[iz];
102 return std::pair<G4double, G4double>(cs, err);
108 G4cout <<
"\n ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ "
109 <<
"\n **** izotop Z **** " << nuclz <<
G4endl;
118 std::vector<G4bool> not_used(simulated_cs.size(),
true);
119 std::size_t nmatched = exper_as.size();
120 std::size_t nused = simulated_cs.size();
122 std::size_t experAsSize = exper_as.size();
124 for (std::size_t iz = 0; iz < experAsSize; ++iz) {
127 exp_cs += exper_cs[iz];
128 exp_cs_err += exper_err[iz];
131 std::size_t simulatedAsSize = simulated_as.size();
132 for (std::size_t i = 0; i<simulatedAsSize && !found; ++i) {
133 if (std::fabs(simulated_as[i] - a) < small) {
134 G4double rat = simulated_cs[i] / exper_cs[iz];
136 lhood += std::log10(rat) * std::log10(rat);
139 = std::sqrt(simulated_errors[i]*simulated_errors[i] +
140 exper_err[iz]*exper_err[iz] * rat*rat) / exper_cs[iz];
141 average_ratio += rat;
142 aver_rat_err += rat_err;
144 G4cout <<
" A " << a <<
" exp.cs " << exper_cs[iz] <<
" err "
145 << exper_err[iz] <<
G4endl <<
" sim. cs " << simulated_cs[i]
146 <<
" err " << simulated_errors[i] <<
G4endl
147 <<
" ratio " << rat <<
" err " << rat_err <<
G4endl
148 <<
" simulated production rate " << simulated_prob[i] <<
G4endl;
151 izotop_chsq += (rat - 1.0) * (rat - 1.0) / rat_err / rat_err;
157 if (found) --nmatched;
159 G4cout <<
" not found exper.: A " << a <<
" exp.cs " << exper_cs[iz]
160 <<
" err " << exper_err[iz] <<
G4endl;
163 G4cout <<
" not found in simulations " << nmatched <<
G4endl
164 <<
" not found in exper: " << nused <<
G4endl;
166 std::size_t simulatedAsSize = simulated_as.size();
167 for(std::size_t i = 0; i < simulatedAsSize; ++i) {
168 inucl_cs += simulated_cs[i];
169 inucl_cs_err += simulated_errors[i];
172 G4cout <<
" extra simul.: A " << simulated_as[i] <<
" sim. cs "
173 << simulated_cs[i] <<
" err " << simulated_errors[i] <<
G4endl;
175 G4cout <<
" simulated production rate " << simulated_prob[i] <<
G4endl;
178 G4int matched =
G4int(exper_as.size() - nmatched);
182 aver_matched = matched;
183 lhood = std::pow(10.0, std::sqrt(lhood/matched));
185 G4cout <<
" matched " << matched <<
" CHSQ " << std::sqrt(izotop_chsq) / matched
187 <<
" raw chsq " << izotop_chsq <<
G4endl
188 <<
" average ratio " << average_ratio / matched
189 <<
" err " << aver_rat_err / matched <<
G4endl
190 <<
" lhood " << lhood <<
G4endl;
197 G4cout <<
" exper. cs " << exp_cs <<
" err " << exp_cs_err <<
G4endl
198 <<
" inucl. cs " << inucl_cs <<
" err " << inucl_cs_err <<
G4endl
199 <<
" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ "
G4NuclWatcher(G4int z, const std::vector< G4double > &expa, const std::vector< G4double > &expcs, const std::vector< G4double > &experr, G4bool check, G4bool nucl)