49 #define G_RESPONSE_KERNEL_LIMITS
51 #define G_COMPUTE_IAQ_BIN_NO_WARNINGS
52 #define G_LOCATION_SMEARING_NO_WARNINGS
118 const double& phibar_max,
const double& phibar_bin_size)
124 int nphigeo = int(phigeo_max / phigeo_bin_size + 0.5);
125 int nphibar = int(phibar_max / phibar_bin_size + 0.5);
138 m_iaq.
card(
"CTYPE1",
"Phigeo",
"Geometrical scatter angle");
141 m_iaq.
card(
"CRPIX1", 1.0,
"Reference bin of geometrical scatter angle");
142 m_iaq.
card(
"CTYPE2",
"Phibar",
"Compton scatter angle");
145 m_iaq.
card(
"CRPIX2", 1.0,
"Reference bin of Compton scatter angle");
146 m_iaq.
card(
"BUNIT",
"Probability per bin",
"Unit of bins");
147 m_iaq.
card(
"TELESCOP",
"GRO",
"Name of telescope");
148 m_iaq.
card(
"INSTRUME",
"COMPTEL",
"Name of instrument");
149 m_iaq.
card(
"ORIGIN",
"GammaLib",
"Origin of FITS file");
150 m_iaq.
card(
"OBSERVER",
"Unknown",
"Observer that created FITS file");
278 m_iaq.
card(
"ENERGY", energy.
MeV(),
"[MeV] Source photon energy");
318 #if defined(G_DEBUG_SET_CONTINUUM)
319 std::cout <<
"Minimum energy=" << energy_min << std::endl;
320 std::cout <<
"Maximum energy=" << energy_max << std::endl;
332 for (
int k = 0; k < iaq.
npix(); ++k) {
337 for (
int i = 0; i < ebds.
size(); ++i) {
343 double weight = spectrum.
flux(ebds.
emin(i), ebds.
emax(i)) /
347 #if defined(G_DEBUG_SET_CONTINUUM)
364 for (
int k = 0; k < iaq.
npix(); ++k) {
365 double value =
m_iaq(k) * weight;
367 #if defined(G_DEBUG_SET_CONTINUUM)
375 #if defined(G_DEBUG_SET_CONTINUUM)
376 std::cout <<
"Energy=" << energy;
377 std::cout <<
" weight=" << weight;
378 std::cout <<
" sum=" << sum << std::endl;
400 else if (pplaw != NULL) {
401 m_iaq.
card(
"PLAWINX", pplaw->
index(),
"Power law spectral index");
403 else if (eplaw != NULL) {
404 m_iaq.
card(
"PLAWINX", eplaw->
index(),
"Power law spectral index");
407 m_iaq.
card(
"EIMIN", energy_min,
"[MeV] Minimum incident energy");
408 m_iaq.
card(
"EIMAX", energy_max,
"[MeV] Maximum incident energy");
439 iaq.
card(
"E1MIN",
m_e1min,
"[MeV] Minimum D1 energy deposit");
440 iaq.
card(
"E1MAX",
m_e1max,
"[MeV] Maximum D1 energy deposit");
441 iaq.
card(
"E2MIN",
m_e1min,
"[MeV] Minimum D2 energy deposit");
442 iaq.
card(
"E2MAX",
m_e1max,
"[MeV] Maximum D2 energy deposit");
443 iaq.
card(
"ZENITH",
m_zenith,
"[deg] Zenith angle for location smearing");
478 result.append(
"=== GCOMIaq ===");
520 result.append(
"yes");
629 GCaldb caldb(
"cgro",
"comptel");
703 for (
int i_phigeo = 0; i_phigeo < n_phigeo; ++i_phigeo) {
711 double etrue1 = energy - etrue2;
714 #if defined(G_DEBUG_COMPTON_KINEMATICS)
715 std::cout <<
"phigeo=" << phigeo;
716 std::cout <<
" etrue1=" << etrue1;
717 std::cout <<
" etrue2=" << etrue2;
721 #if defined(G_DEBUG_COMPTON_KINEMATICS)
726 for (
int i_phibar = 0; i_phibar < n_phibar; ++i_phibar) {
732 double response = 0.0;
735 for (
int i = 0; i < n_fine; ++i, phibar += dphibar) {
743 response *= dphibar_rad;
746 m_iaq(i_phigeo, i_phibar) = response;
749 #if defined(G_DEBUG_COMPTON_KINEMATICS)
756 #if defined(G_DEBUG_COMPTON_KINEMATICS)
757 std::cout <<
" Prob=" << sum << std::endl;
812 const double& etrue2,
813 const double& phibar)
816 double response = 0.0;
826 double e_low = position - 3.0 * sigma;
827 double e_high = position + 3.0 * sigma;
828 double e_min = (e1min < e_low) ? e_low : e1min;
829 double e_max = (e1max > e_high) ? e_high : e1max;
851 integral.eps(1.0e-6);
854 #if defined(G_COMPUTE_IAQ_BIN_NO_WARNINGS)
855 integral.silent(
true);
859 response = integral.romberg(e_min, e_max);
864 #if defined(G_DEBUG_COMPUTE_IAQ_BIN)
865 std::cout <<
" phibar=" << phibar;
866 std::cout <<
" e1min=" << e1min;
867 std::cout <<
" e1max=" << e1max;
868 std::cout <<
" e_min=" << e_min;
869 std::cout <<
" e_max=" << e_max;
870 std::cout <<
" response=" << response << std::endl;
893 #if defined(G_DEBUG_KLEIN_NISHINA)
898 for (
int i_phigeo = 0; i_phigeo < n_phigeo; ++i_phigeo) {
907 #if defined(G_DEBUG_KLEIN_NISHINA)
908 std::cout <<
"phigeo=" << phigeo <<
" prob_kn=" << prob_kn << std::endl;
913 for (
int i_phibar = 0; i_phibar < n_phibar; ++i_phibar) {
916 m_iaq(i_phigeo, i_phibar) *= prob_kn;
923 #if defined(G_DEBUG_KLEIN_NISHINA)
924 std::cout <<
"Sum of probabilities = " << sum << std::endl;
961 if (phigeo_lo < 0.0) {
964 if (phigeo_hi < 0.0) {
967 if (phigeo_lo > 180.0) {
970 if (phigeo_hi > 180.0) {
980 double v_low = 1.0 - 1.0 / (1.0 + (1.0 -
std::cos(phigeo_lo)) * alpha);
981 double v_high = 1.0 - 1.0 / (1.0 + (1.0 -
std::cos(phigeo_hi)) * alpha);
984 double prob_bin = (r_high - r_low);
987 const double v_zero = 0.0;
988 const double v_pi = 1.0 - 1.0 / (1.0 + 2.0 * alpha);
991 const double prob_tot = (r_pi - r_zero);
994 double prob_phigeo = prob_bin / prob_tot;
1026 double w = v * (1.0/a + 1.0) * (1.0/a + 1.0) +
1027 (2.0/(a*a) + 2.0/a - 1.0) *
std::log(1.0 - v) -
1029 1.0/(a*a) * 1.0/(1.0 - v);
1032 #if defined(G_DEBUG_KLEIN_NISHINA_INTEGRAL)
1034 w_test = v*( 1.0/a + 1.0 )*( 1.0/a + 1.0 );
1035 w_test = w_test + ( 2.0/(a*a) + 2.0/a - 1.0 )*
std::log(1.0 - v);
1036 w_test = w_test - (v*v)/2.0;
1037 w_test = w_test + 1.0/(a*a) * 1.0/(1.0 - v);
1039 std::cout <<
"w=" << w <<
" w_test=" << w_test << std::endl;
1063 double cfract = 1.0;
1064 if (energy >= 2.0) {
1065 cfract = 1.067 - 0.0295 * energy + 3.4e-4 * energy * energy;
1070 else if (cfract < 0.0) {
1088 double oalltr = ad1trans * v1trans * d1prob * cfract * mlhit * sveto;
1091 #if defined(G_DEBUG_WEIGHT_IAQ)
1092 std::cout <<
"Transmission coefficients:" << std::endl;
1093 std::cout <<
"==========================" << std::endl;
1094 std::cout <<
" Above D1 transmission ..........: " << ad1trans << std::endl;
1095 std::cout <<
" V1 veto dome transmission ......: " << v1trans << std::endl;
1096 std::cout <<
" D1 interaction probability .....: " << d1prob << std::endl;
1097 std::cout <<
" Compton scatter fraction .......: " << cfract << std::endl;
1098 std::cout <<
" Compton interaction probability : " << d1prob*cfract << std::endl;
1099 std::cout <<
" Multihit transmission ..........: " << mlhit << std::endl;
1100 std::cout <<
" Self-vetoing transmission ......: " << sveto << std::endl;
1101 std::cout <<
" Overall shape-independent trans.: " << oalltr << std::endl;
1109 for (
int i_phigeo = 0; i_phigeo < n_phigeo; ++i_phigeo) {
1128 #if defined(G_APPLY_PSD_CORRECTION_IN_RESPONSE_KERNEL)
1129 double psdtrn = 1.0;
1135 double oallpg = ad2trans * v23trans * d2prob * mscatt * psdtrn;
1138 double weight = oalltr * oallpg;
1141 #if defined(G_DEBUG_WEIGHT_IAQ)
1142 std::cout <<
" Phigeo .........................: " << phigeo << std::endl;
1143 std::cout <<
" Between D1 & D2 transmission ..: " << ad2trans << std::endl;
1144 std::cout <<
" V2+V3 veto dome transmission ..: " << v23trans << std::endl;
1145 std::cout <<
" D2 interaction probability ....: " << d2prob << std::endl;
1146 std::cout <<
" D1 multi-scatter transmission .: " << mscatt << std::endl;
1147 std::cout <<
" PSD correction ................: " << psdtrn << std::endl;
1148 std::cout <<
" Overall shape-dependent trans. : " << oallpg << std::endl;
1149 std::cout <<
" Overall transmission ..........: " << weight << std::endl;
1153 for (
int i_phibar = 0; i_phibar < n_phibar; ++i_phibar) {
1154 m_iaq(i_phigeo, i_phibar) *= weight;
1164 #if defined(G_COMPASS_LOCPSR)
1176 const double ZDIST = 158.0;
1177 const double SIGHD1 = 2.30;
1178 const double SIGHD2 = 1.96;
1179 const double SIGVD1 = 2.45;
1180 const double SIGVD2 = 2.17;
1181 const double CONCRI = 5.0;
1182 const int NFINE = 10;
1183 const int NFINEH = NFINE/2;
1190 std::vector<double> phigeo(n_phigeo, 0.0);
1191 std::vector<double> siggeo(n_phigeo, 0.0);
1192 std::vector<double> cnorms(n_phigeo, 0.0);
1196 double A1SQ = A1*A1;
1198 double A2SQ = A2*A2;
1199 double ZDIST2 = ZDIST * ZDIST;
1200 double SIGHT2 = SIGHD1*SIGHD1 + SIGHD2*SIGHD2;
1201 double SIGVT2 = SIGVD1*SIGVD1 + SIGVD2*SIGVD2;
1207 for (
int i_phigeo = 0; i_phigeo < n_phigeo; ++i_phigeo) {
1215 double SPHIG2 = SPHIG*SPHIG;
1216 double CPHIG2 = CPHIG*CPHIG;
1217 double SIGXY2 = A2SQ * CPHIG2 * (4.0 * A1SQ * SPHIG2 + CPHIG2 - A1SQ) +
1218 0.5 * A1SQ * (A2SQ*CPHIG2 +A1SQ*SPHIG2*(1.-0.75*CPHIG2));
1219 SIGXY2 = SIGXY2*SIGHT2/ZDIST2;
1220 double SIGZ2 = A2SQ*A2SQ*SPHIG2*CPHIG2 + A2SQ*A1SQ*(0.5-3.*CPHIG2*SPHIG2) +
1221 3.*A1SQ*A1SQ*SPHIG2*CPHIG2/8.;
1222 SIGZ2 = SIGZ2*SIGVT2/ZDIST2;
1228 double X0 = double(phigeo[i_phigeo] / (ROOT2*siggeo[i_phigeo]));
1229 cnorms[i_phigeo] = RT2PI*siggeo[i_phigeo]*(1.000 +
gammalib::erf(X0))/2.0;
1230 cnorms[i_phigeo] = 1./cnorms[i_phigeo];
1235 for (
int iphib = 0; iphib < n_phibar; ++iphib) {
1238 std::vector<double> values;
1239 #if defined(G_DEBUG_LOCATION_SMEARING)
1240 double sum_before = 0.0;
1242 for (
int i_phigeo = 0; i_phigeo < n_phigeo; ++i_phigeo) {
1243 values.push_back(
m_iaq(i_phigeo, iphib));
1244 #if defined(G_DEBUG_LOCATION_SMEARING)
1245 sum_before +=
m_iaq(i_phigeo, iphib);
1250 for (
int ibase = 0; ibase < n_phigeo; ++ibase) {
1253 double PHBASE = phigeo[ibase];
1256 double SUMBAS = 0.0;
1259 for (
int iconv = 0; iconv < n_phigeo; ++iconv) {
1263 double DELTA =
std::abs(PHBASE-phigeo[iconv]);
1264 if (DELTA < CONCRI * siggeo[iconv]) {
1267 double PHICEN = phigeo[iconv];
1268 double VALMED = values[iconv];
1269 double SIGMED = siggeo[iconv];
1270 double CNOMED = cnorms[iconv];
1271 double DERPSL = 0.0;
1272 double DERSIL = 0.0;
1273 double DERCNL = 0.0;
1274 double DERPSU = 0.0;
1275 double DERSIU = 0.0;
1276 double DERCNU = 0.0;
1278 double VALLOW = values[iconv-1];
1279 double SIGLOW = siggeo[iconv-1];
1280 double CNOLOW = cnorms[iconv-1];
1281 DERPSL = (VALMED-VALLOW)/m_phigeo_bin_size;
1282 DERSIL = (SIGMED-SIGLOW)/m_phigeo_bin_size;
1283 DERCNL = (CNOMED-CNOLOW)/m_phigeo_bin_size;
1285 if (iconv < (n_phigeo-1)) {
1286 double VALUPP = values[iconv+1];
1287 double SIGUPP = siggeo[iconv+1];
1288 double CNOUPP = cnorms[iconv+1];
1289 DERPSU = (VALUPP-VALMED)/m_phigeo_bin_size;
1290 DERSIU = (SIGUPP-SIGMED)/m_phigeo_bin_size;
1291 DERCNU = (CNOUPP-CNOMED)/m_phigeo_bin_size;
1298 if (iconv == (n_phigeo-1)) {
1305 for (
int ifine = 1; ifine <= NFINE; ++ifine) {
1313 double PHIFIN = PHICEN + (ifine-NFINEH-0.5)*DINTPO;
1314 double DELTAF = (ifine-NFINEH-0.5)*DINTPO;
1315 if (ifine <= NFINEH) {
1316 SIGMAF = SIGMED + DERSIL*DELTAF;
1317 VALUEF = VALMED + DERPSL*DELTAF;
1318 CNORMF = CNOMED + DERCNL*DELTAF;
1321 SIGMAF = SIGMED + DERSIU*DELTAF;
1322 VALUEF = VALMED + DERPSU*DELTAF;
1323 CNORMF = CNOMED + DERCNU*DELTAF;
1330 double arg = (PHIFIN-PHBASE)/SIGMAF;
1331 double VALUE = VALUEF * CNORMF *
std::exp(-0.5*arg*arg);
1332 SUMBAS = SUMBAS+VALUE;
1341 m_iaq(ibase, iphib) = SUMBAS * DINTPO;
1346 #if defined(G_DEBUG_LOCATION_SMEARING)
1347 double sum_after = 0.0;
1348 for (
int i_phigeo = 0; i_phigeo < n_phigeo; ++i_phigeo) {
1349 sum_after += convolved_values[i_phigeo];
1354 std::cout <<
" before=" << sum_before;
1355 std::cout <<
" after=" << sum_after;
1356 if (sum_before > 0.0) {
1357 std::cout <<
" (" << sum_after/sum_before <<
")";
1359 std::cout << std::endl;
1387 for (
int i_phigeo = 0; i_phigeo < n_phigeo; ++i_phigeo) {
1388 phigeos.
append((
double(i_phigeo) + 0.5) * m_phigeo_bin_size);
1392 for (
int i_phibar = 0; i_phibar < n_phibar; ++i_phibar) {
1395 std::vector<double> values;
1396 #if defined(G_DEBUG_LOCATION_SMEARING)
1397 double sum_before = 0.0;
1399 for (
int i_phigeo = 0; i_phigeo < n_phigeo; ++i_phigeo) {
1400 values.push_back(
m_iaq(i_phigeo, i_phibar));
1401 #if defined(G_DEBUG_LOCATION_SMEARING)
1402 sum_before +=
m_iaq(i_phigeo, i_phibar);
1407 std::vector<double> convolved_values;
1408 for (
int i_phigeo = 0; i_phigeo < n_phigeo; ++i_phigeo) {
1420 integral.
eps(1.0e-4);
1423 #if defined(G_LOCATION_SMEARING_NO_WARNINGS)
1428 double phigeo_min = phigeos[i_phigeo] - 5.0 * sigmas[i_phigeo];
1429 double phigeo_max = phigeos[i_phigeo] + 5.0 * sigmas[i_phigeo];
1432 double value = integral.
romberg(phigeo_min, phigeo_max);
1435 convolved_values.push_back(value);
1440 #if defined(G_DEBUG_LOCATION_SMEARING)
1441 double sum_after = 0.0;
1443 for (
int i_phigeo = 0; i_phigeo < n_phigeo; ++i_phigeo) {
1444 m_iaq(i_phigeo, i_phibar) = convolved_values[i_phigeo];
1445 #if defined(G_DEBUG_LOCATION_SMEARING)
1446 sum_after += convolved_values[i_phigeo];
1451 #if defined(G_DEBUG_LOCATION_SMEARING)
1453 std::cout <<
" before=" << sum_before;
1454 std::cout <<
" after=" << sum_after;
1455 if (sum_before > 0.0) {
1456 std::cout <<
" (" << sum_after/sum_before <<
")";
1458 std::cout << std::endl;
1490 const double zdist = 158.0;
1493 const double sighd1 = 2.30;
1494 const double sighd2 = 1.96;
1498 const double sigvd1 = 2.45;
1499 const double sigvd2 = 2.17;
1502 const double zdist2 = zdist * zdist;
1503 const double sight2 = sighd1*sighd1 + sighd2*sighd2;
1504 const double sigvt2 = sigvd1*sigvd1 + sigvd2*sigvd2;
1507 std::vector<double> sigmas;
1511 double a1sq = a1 * a1;
1512 double a2 =
std::cos(zenith * gammalib::deg2rad);
1513 double a2sq = a2 * a2;
1519 for (
int i_phigeo = 0; i_phigeo < n_phigeo; ++i_phigeo) {
1525 double cphig =
std::cos(phigeo * gammalib::deg2rad);
1526 double sphig =
std::sin(phigeo * gammalib::deg2rad);
1527 double cphig2 = cphig*cphig;
1528 double sphig2 = sphig*sphig;
1529 double sigxy2 = (a2sq * cphig2 *
1530 (4.0 * a1sq * sphig2 + cphig2 - a1sq) +
1532 (a2sq * cphig2 + a1sq * sphig2 * (1.0 - 0.75 * cphig2))) *
1536 double sigz2 = (a2sq * a2sq * sphig2 * cphig2 +
1537 a2sq * a1sq * (0.5 - 3.0 * cphig2 * sphig2) +
1538 3.0 * a1sq * a1sq * sphig2 * cphig2 / 8.0) *
1545 sigmas.push_back(siggeo);
1548 #if defined(G_DEBUG_LOCATION_SPREAD)
1549 std::cout <<
"phigeo=" << phigeo <<
" sigma=" << siggeo << std::endl;
1612 #if defined(G_RESPONSE_KERNEL_LIMITS)
1613 double e1 = (energy1 < 1.0e-20) ? 1.0e-20 : energy1;
1619 double e1 = energy1;
1625 double e2 = 0.5 * (
std::sqrt(term1 * e1 + e1*e1) - e1);
1630 #if defined(G_DEBUG_RESPONSE_KERNEL)
1631 std::cout <<
" e1=" << e1;
1632 std::cout <<
" e2=" << e2;
1633 std::cout <<
" jc=" << jc << std::endl;
1650 double etot = e1 + e2;
1656 #if defined(G_RESPONSE_KERNEL_LIMITS)
1664 #if defined(G_RESPONSE_KERNEL_LIMITS)
1671 #if defined(G_APPLY_PSD_CORRECTION_IN_RESPONSE_KERNEL)
1672 const double a1 = 1727.9;
1673 const double a2 = 2.530;
1674 d1 *= 1.0 - (1.0 / (a1 *
std::pow(e1, a2) + 1.0));
1679 #if defined(G_RESPONSE_KERNEL_LIMITS)
1686 value = jc * d1 * d2;
1706 double value = m_phigeos.interpolate(phigeo, m_values);
1712 double arg = (m_phigeo - phigeo) * m_wgt;
1713 value *= m_norm *
std::exp(-0.5 * arg * arg);
double m_phigeo_bin_size
Bin size in geometrical scatter angle (deg)
void clear(void)
Clear instance.
void compton_kinematics(const double &energy)
Generate IAQ matrix based on Compton kinematics.
Photon flux normalized power law spectral model class.
const int & naxis(void) const
Return dimension of image.
bool has_card(const int &cardno) const
Check existence of header card.
double romberg(std::vector< double > bounds, const int &order=5)
Perform Romberg integration.
double prob_no_multihit(const double &energy) const
Return probability that no multihit occured.
double m_phibar_bin_size
Bin size in Compton scatter angle (deg)
Abstract spectral model base class.
double eval(const double &phigeo)
Convolves response with Gaussian kernel.
Interface for the COMPTEL instrument response representation class.
double trans_D2(const double &energy, const double &phigeo) const
Return transmission of material between D1 and D2.
double prob_D2inter(const double &energy, const double &phigeo) const
Return D2 interaction probability.
double emax(const double &etrue) const
Return maximum energy.
double erf(const double &arg)
Computes error function.
void init_response(void)
Initialise COMPTEL response function and instrument characteristics.
double m_e1min
Minimum D1 energy (MeV)
double trans_D1(const double &energy) const
Return transmission above D1.
GVector abs(const GVector &vector)
Computes absolute of vector elements.
double m_etrue1
True D1 energy (MeV)
double prob_D1inter(const double &energy) const
Return D1 interaction probability.
int size(void) const
Return number of energy boundaries.
void save(const GFilename &filename, const bool &clobber=false) const
Save COMPTEL instrument response representation into FITS file.
double index(void) const
Return power law index.
GVector cos(const GVector &vector)
Computes cosine of vector elements.
double com_energy2(const double &energy, const double &phigeo)
Return D2 energy deposit.
double m_e1max
Maximum D1 energy (MeV)
bool has_extname(void) const
Signal if filename has an extension name.
double m_phigeo_max
Maximum geometrical scatter angle (deg)
void set(const GEnergy &energy, const GEbounds &ebounds)
Set mono-energetic IAQ.
double m_e1max
Maximum D1 energy (MeV)
double m_sin_phibar
sin(phibar)
GCOMIaq(void)
Void constructor.
std::vector< double > location_spread(const double &zenith) const
Compute location spread vector.
double sum(const GVector &vector)
Computes vector sum.
std::string extname(const std::string &defaultname="") const
Return extension name.
Interface for the COMPTEL Instrument Characteristics class.
double MeV(void) const
Return energy in MeV.
double eval(const double &energy1)
Computes product of D1 and D2 responses at energy E1 and phibar.
double m_phibar_resolution
Bin size for oversampling (deg)
GIntegral class interface definition.
double m_phibar_max
Maximum Compton scatter angle (deg)
const GFitsHeader & header(void) const
Return extension header.
FITS file class interface definition.
void klein_nishina(const double &energy)
Multiply IAQ matrix by the Klein-Nishina formula.
Energy flux normalized power law spectral model class interface definition.
Power law spectral model class.
virtual std::string classname(void) const =0
Return class name.
Implementation of support function used by COMPTEL classes.
COMPTEL instrument response representation class interface definition.
void location_smearing(const double &zenith)
Perform location smearing.
double m_e2max
Maximum D2 energy (MeV)
double psd_correction(const double &energy, const double &phigeo) const
Return PSD correction.
void saveto(const GFilename &filename, const bool &clobber=false)
Saves to specified FITS file.
double m_etmin
Minimum total energy (MeV)
double m_e2max
Maximum D2 energy (MeV)
void clear(void)
Clear instance.
GVector sqrt(const GVector &vector)
Computes square root of vector elements.
Calibration database class.
Energy boundaries container class.
std::string print(const GChatter &chatter=NORMAL) const
Print energy.
Interface for the COMPTEL D2 module response class.
Interface for the COMPTEL D1 module response class.
double compute_iaq_bin(const double &etrue1, const double &etrue2, const double &phibar)
Computes the IAQ for one bin.
double klein_nishina_bin(const double &energy, const double &phigeo)
Computes Klein-Nishina probability for one bin.
const GEnergy & emin(void) const
Return minimum energy of all intervals.
GEbounds m_ebounds
Energy boundaries.
GVector log(const GVector &vector)
Computes natural logarithm of vector elements.
double sigma(const double &etrue) const
Return photo peak standard deviation.
double ewidth(const double &etrue) const
Return energy threshold width.
GCOMD1Response m_response_d1
D1 module response.
bool m_psd_correct
PSD correction usage flag.
Power law spectral model class interface definition.
GEnergy elogmean(const int &index) const
Returns logarithmic mean energy for a given energy interval.
int m_num_energies
Number of energies for continuum IAQ.
GCOMD2Response m_response_d2
D2 module response.
double m_etrue2
True D2 energy (MeV)
double m_e1min
Minimum D1 energy (MeV)
Single precision FITS image class.
GCOMIaq & operator=(const GCOMIaq &iaq)
Assignment operator.
const std::string & extname(void) const
Return extension name.
void clear(void)
Clear energy boundaries.
Flux normalized power law spectral model class interface definition.
GCOMIaq * clone(void) const
Clone instance.
double m_cos_phibar
cos(phibar)
void silent(const bool &silent)
Set silence flag.
Abstract spectral model base class interface definition.
int naxes(const int &axis) const
Return dimension of an image axis.
GCOMInstChars m_ict
Instrument characteristics.
double prob_no_selfveto(const double &energy, const double &zenith) const
Return probability that photon was not self vetoed.
double m_e2min
Minimum D2 energy (MeV)
void eps(const double &eps)
Set relative precision.
std::string url(void) const
Return Uniform Resource Locator (URL)
const int & npix(void) const
Return size of pixel array.
double m_zenith
Zenith angle for location smearing (deg)
double position(const double &etrue) const
Return photo peak position.
double m_e2min
Minimum D2 energy (MeV)
void free_members(void)
Delete class members.
const GCOMD1Response & m_response_d1
Reference to D1 module response.
double index(void) const
Return power law index.
void weight_iaq(const double &energy)
Weight IAQ matrix.
GFitsImageFloat m_iaq
Response.
double emax(const double &etrue) const
Return maximum energy.
std::string print(const GChatter &chatter=NORMAL) const
Print COMPTEL instrument response representation information.
GVector pow(const GVector &vector, const double &power)
Computes tanh of vector elements.
GVector sin(const GVector &vector)
Computes sine of vector elements.
Energy boundaries class interface definition.
GFitsHDU * append(const GFitsHDU &hdu)
Append HDU to FITS file.
void init_members(void)
Initialise class members.
double index(void) const
Return power law index.
void clear(void)
Clear instance.
GVector exp(const GVector &vector)
Computes exponential of vector elements.
void remove_cards(void)
Remove any extra header cards.
void clear(void)
Clear instance.
double emin(const double &etrue) const
Return minimum energy.
~GCOMIaq(void)
Destructor.
const GCOMD2Response & m_response_d2
Reference to D2 module response.
const GEnergy & emax(void) const
Return maximum energy of all intervals.
virtual double flux(const GEnergy &emin, const GEnergy &emax) const =0
double trans_V1(const double &energy) const
Return V1 veto dome transmission.
double m_etmax
Maximum total energy (MeV)
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
void copy_members(const GCOMIaq &iaq)
Copy class members.
void append(const double &node)
Append one node to array.
Integration class interface definition.
GFitsHeaderCard & card(const int &cardno)
Return header card.
Energy flux normalized power law spectral model class.
double trans_V23(const double &energy, const double &phigeo) const
Return V2+V3 veto dome transmission.
void clear(void)
Clear instance.
double klein_nishina_integral(const double &v, const double &a)
Computes Klein-Nishina integral.
Filename class interface definition.
double multi_scatter(const double &energy, const double &phigeo) const
Return multi-scatter correction.
Class that handles energies in a unit independent way.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.