78 explicit GPha(
const int& bins);
89 const double&
operator[](
const int& index)
const;
90 double&
operator()(
const int& index,
const int& col);
91 const double&
operator()(
const int& index,
const int& col)
const;
94 std::vector<double>&
operator[](
const std::string& colname);
95 const std::vector<double>&
operator[](
const std::string& colname)
const;
101 int size(
void)
const;
103 double&
at(
const int& index);
104 const double&
at(
const int& index)
const;
105 double&
at(
const int& index,
const int& col);
106 const double&
at(
const int& index,
const int& col)
const;
107 void append(
const std::string& name,
108 const std::vector<double>& column);
110 double counts(
void)
const;
113 const double&
areascal(
const int& index)
const;
115 const double&
backscal(
const int& index)
const;
119 const double&
outflow(
void)
const;
127 const std::string&
backfile(
void)
const;
129 const std::string&
corrfile(
void)
const;
131 const std::string&
respfile(
void)
const;
133 const std::string&
ancrfile(
void)
const;
134 void fill(
const GEnergy& energy,
const double& value = 1.0);
137 const bool& clobber =
false)
const;
Definition of interface for all GammaLib classes.
Energy boundaries class interface definition.
Filename class interface definition.
N-dimensional array class interface definition.
GPha operator-(const GPha &a, const GPha &b)
Spectrum subtraction operator friend.
GPha operator/(const GPha &pha, const double &scale)
Spectrum division operator friend.
GPha operator+(const GPha &a, const GPha &b)
Spectrum addition operator friend.
GPha operator*(const GPha &pha, const double &scale)
Spectrum scaling operator friend.
Interface class for all GammaLib classes.
Energy boundaries container class.
Class that handles energies in a unit independent way.
Abstract interface for FITS table.
N-dimensional array class.
Pulse Height Analyzer class.
virtual ~GPha(void)
Destructor.
void copy_members(const GPha &pha)
Copy class members.
friend GPha operator-(const GPha &a, const GPha &b)
Spectrum subtraction operator friend.
const std::string & ancrfile(void) const
Return Ancilliary Response File name.
std::string print(const GChatter &chatter=NORMAL) const
Print Pulse Height Analyzer spectrum.
GPha(void)
Void constructor.
void save(const GFilename &filename, const bool &clobber=false) const
Save Pulse Height Analyzer spectrum.
void fill(const GEnergy &energy, const double &value=1.0)
Fill spectrum with a value.
void alloc(const int &size)
Allocate spectrum.
double & operator[](const int &index)
Return content of spectral bin.
std::vector< double > m_backscal
Background scaling.
void init_members(void)
Initialise class members.
GEnergy m_emax_obs
Minimum energy of observation.
GNdarray counts_spectrum(void) const
Get number of counts in spectrum as GNdarray.
std::string m_ancrfile
ARF file.
friend GPha operator/(const GPha &pha, const double &scale)
Spectrum division operator friend.
double m_outflow
Number of outflowing events.
GFitsHeader m_header
FITS header cards.
GPha & operator*=(const double &scale)
Scale spectrum values.
void free_members(void)
Delete class members.
double & at(const int &index)
Return content of spectral bin.
void read(const GFits &fits)
Read Pulse Height Analyzer spectrum.
std::string classname(void) const
Return class name.
const double & exposure(void) const
Return exposure time.
void backscal(const int &index, const double &backscal)
Set background scaling factor.
GFilename m_filename
Filename of origin.
double m_exposure
Deadtime corr. exp. time (sec)
const GFitsHeader & header(void) const
Return FITS header.
void write(GFits &fits) const
Write Pulse Height Analyzer spectrum.
const std::string & respfile(void) const
Return Redistribution Matrix File name.
GEbounds m_ebounds
Energy boundaries.
GEnergy m_emin_obs
Minimum energy of observation.
const GFilename & filename(void) const
Return file name.
std::vector< double > m_counts
Counts data.
double m_overflow
Number of overflowing events.
const double & underflow(void) const
Return number of underflow counts.
const GEnergy & emax_obs(void) const
Return maximum energy of observations.
double counts(void) const
Number of counts in spectrum.
int column_index(const std::string &colname) const
Returns index of additional vector column.
double m_underflow
Number of underflowing events.
GPha & operator-=(const GPha &pha)
Subtract spectrum.
int size(void) const
Return number of bins in spectrum.
const double & outflow(void) const
Return number of outflow counts.
std::string m_respfile
RMF file.
GPha & operator/=(const double &scale)
Divide spectrum values.
const double & overflow(void) const
Return number of overflow counts.
const std::string & backfile(void) const
Return background file name.
GNdarray backscal_spectrum(void) const
Get background scaling factors as GNdarray.
std::string m_corrfile
Correction file.
friend GPha operator+(const GPha &a, const GPha &b)
Spectrum addition operator friend.
const std::string & corrfile(void) const
Return correction file name.
GPha * clone(void) const
Clone object.
void areascal(const int &index, const double &areascal)
Set area scaling factor.
int columns(void) const
Return number of additional columns.
std::vector< double > m_areascal
Area scaling.
const GEnergy & emin_obs(void) const
Return minimum energy of observations.
std::vector< std::vector< double > > m_coldata
Additional column data.
friend GPha operator*(const GPha &pha, const double &scale)
Spectrum scaling operator friend.
double & operator()(const int &index, const int &col)
Return content of additional columns.
void clear(void)
Clear object.
GPha & operator+=(const GPha &pha)
Add spectrum.
const GEbounds & ebounds(void) const
Return energy boundaries.
void load(const GFilename &filename)
Load Pulse Height Analyzer spectrum.
GPha & operator=(const GPha &pha)
Assignment operator.
std::vector< std::string > m_colnames
Additional column names.
void append(const std::string &name, const std::vector< double > &column)
Append additional column to spectrum.
std::string m_backfile
Background file.
const std::string extname_pha