CMBR::CMBR(TCHAR driveLetter) { tstring str = _T("\\\\.\\"); str.append({ driveLetter, 0 }); str.append(_T(":")); CMBR(str.c_str()); }
void Propagation::InitBkgArray(const std::string &BackRad) { // Routine to build the array of cumulative distribution of // background photons Bkg = BackRad; BkgE.resize(POINTS_VERY_FEW); BkgA.resize(POINTS_VERY_FEW); if (BackRad == "CMB") { double de = pow((double) eps_ph_sup_cmb / eps_ph_inf_cmb, 1. / POINTS_VERY_FEW); double e = eps_ph_inf_cmb; for (size_t i = 0; i < POINTS_VERY_FEW; i++) { BkgE[i] = e; BkgA[i] = CMBR(e); e *= de; } } else if (BackRad == "CIOB") { double de = pow((double) eps_ph_sup_ciob / eps_ph_inf_ciob, 1. / POINTS_VERY_FEW); double e = eps_ph_inf_ciob; for (size_t i = 0; i < POINTS_VERY_FEW; i++) { BkgE[i] = e; BkgA[i] = CIOBR(e); e *= de; } } else if (BackRad == "URB") { double de = pow((double) eps_ph_sup_urb / eps_ph_inf_urb, 1. / POINTS_VERY_FEW); double e = eps_ph_inf_urb; for (size_t i = 0; i < POINTS_VERY_FEW; i++) { BkgE[i] = e; BkgA[i] = URB(e); e *= de; } } else { double de = pow((double) eps_ph_sup_global / eps_ph_inf_global, (double) 1. / POINTS_VERY_FEW); double e = eps_ph_inf_global; for (size_t i = 0; i < POINTS_VERY_FEW; i++) { BkgE[i] = e; BkgA[i] = CBR(e); e *= de; } } // cumulate for (size_t i = 1; i < POINTS_VERY_FEW; i++) { BkgA[i] += BkgA[i - 1]; } // normalize double a = 1.0 / BkgA[POINTS_VERY_FEW - 1]; for (size_t i = 0; i < POINTS_VERY_FEW; i++) { BkgA[i] *= a; } }