Commit 8befba3f97bf89fcf7d7e793fea05aebc17c454a

Authored by Josh Cardenzana
Committed by Jürgen Knödlseder
1 parent 830c9353

Add m_ebounds parameter to control response integration (#2713)

src/ctfindvar/ctfindvar.cpp
... ... @@ -496,9 +496,6 @@ void ctfindvar::fill_alpha_vector(const int& pix_number,
496 496 // Pixel position
497 497 GSkyDir pix_dir = m_counts.inx2dir(pix_number);
498 498  
499   - // Energy binning
500   - GEbounds ebounds((*this)["enumbins"].integer(), m_emin, m_emax);
501   -
502 499 // Loop over all observations
503 500 for (int i=0; i<m_obs.size(); i++) {
504 501 // Skip if observation does not overlap with this pixel position
... ... @@ -553,10 +550,10 @@ void ctfindvar::fill_alpha_vector(const int&amp; pix_number,
553 550  
554 551 // Compute background value
555 552 double value = 0.0;
556   - for (int e=0; e<ebounds.size(); e++) {
  553 + for (int e=0; e<m_ebounds.size(); e++) {
557 554 value += bkg->rate_ebin(instdir,
558   - ebounds.emin(e),
559   - ebounds.emax(e));
  555 + m_ebounds.emin(e),
  556 + m_ebounds.emax(e));
560 557 }
561 558  
562 559 // Multiply background rate with livetime and solid angle
... ... @@ -728,8 +725,9 @@ void ctfindvar::get_parameters(void)
728 725 }
729 726  
730 727 // Get the energy limits
731   - m_emin = GEnergy((*this)["emin"].real(), "TeV");
732   - m_emax = GEnergy((*this)["emax"].real(), "TeV");
  728 + m_emin = GEnergy((*this)["emin"].real(), "TeV");
  729 + m_emax = GEnergy((*this)["emax"].real(), "TeV");
  730 + m_ebounds = GEbounds((*this)["enumbins"].integer(), emin, emax);
733 731  
734 732 // Get minimum counts for a bin to be considered in Noff calculation
735 733 m_minoff = (*this)["minoff"].real();
... ...
src/ctfindvar/ctfindvar.hpp
... ... @@ -100,10 +100,10 @@ protected:
100 100 GNdarray m_pixsigmax; //!< Store distribution for pixel with max significance
101 101 GTime m_tstart; //!< Start time for variability study
102 102 GTime m_tstop; //!< Stop time for variability study
  103 + GEbounds m_ebounds; //!< Energy binning for response integration
103 104 GEnergy m_emin; //!< Minimum energy for events
104 105 GEnergy m_emax; //!< Maximum energy for events
105 106  
106   -
107 107 };
108 108  
109 109  
... ...