46 #define G_COMPASS_THRESHOLD
194 double response = 0.0;
214 #if defined(G_COMPASS_THRESHOLD)
217 if (ereco <= thresl) {
222 response *= (ereco - thresl) /
m_ewidth;
236 response *=
std::exp(-0.5 * arg * arg);
238 else if (ereco >
m_emax) {
239 double arg = (
m_emax-ereco) / 0.1;
240 response *=
std::exp(-0.5 * arg * arg);
322 GFits fits(filename);
357 int num = table.
nrows();
372 for (
int i = 0; i < num; ++i) {
414 col_energy.
unit(
"MeV");
415 col_position.
unit(
"MeV");
416 col_width.
unit(
"MeV");
417 col_emin.
unit(
"MeV");
418 col_ewidth.
unit(
"MeV");
419 col_emax.
unit(
"MeV");
422 for (
int i = 0; i < num; ++i) {
434 table.
append(col_position);
436 table.
append(col_amplitude);
461 result.append(
"=== GCOMD1Response ===");
470 result.append(
"not defined");
602 #if defined(G_RENORMALIZE)
void read(const GFitsTable &table)
Read COMPTEL D1 module response.
void unit(const std::string &unit)
Set column unit.
int size(void) const
Return number of nodes in node array.
void load(const std::string &sdaname)
Load COMPTEL D1 module response.
~GCOMD1Response(void)
Destructor.
FITS table double column class interface definition.
GFitsTable * table(const int &extno)
Get pointer to table HDU.
GVector abs(const GVector &vector)
Computes absolute of vector elements.
std::vector< double > m_emaxs
Upper energy limit of D1.
const GCaldb & caldb(void) const
Return calibration database.
GCOMD1Response * clone(void) const
Clone instance.
bool is_empty(void) const
Signal if filename is empty.
GFilename filename(const std::string &detector, const std::string &filter, const std::string &codename, const std::string &date, const std::string &time, const std::string &expr)
Return calibration file name based on selection parameters.
void write(GFitsBinTable &table)
Write COMPTEL D1 module response.
void clear(void)
Clear node array.
GFitsTableCol * append(const GFitsTableCol &column)
Append column to the table.
FITS table float column class interface definition.
GCaldb m_caldb
Calibration database.
bool is_empty(void) const
Signals if there are no nodes in node array.
GNodeArray m_energies
Input energies.
std::vector< double > m_ewidths
Lower energy threshold width of D1.
void free_members(void)
Delete class members.
void init_members(void)
Initialise class members.
Calibration database class.
void update_cache(const double &etrue) const
Update computation cache.
Interface for the COMPTEL D1 module response class.
Abstract interface for FITS table column.
bool exists(void) const
Checks whether file exists.
double interpolate(const double &value, const std::vector< double > &vector) const
Interpolate value.
Abstract interface for FITS table.
std::vector< double > m_sigmas
Photo peak width in MeV.
GCOMD1Response(void)
Void constructor.
std::string print(const GChatter &chatter=NORMAL) const
Print COMPTEL D1 module response information.
std::vector< double > m_amplitudes
Photo peak amplitude.
COMPTEL D1 module response class interface definition.
const std::string & extname(void) const
Return extension name.
void copy_members(const GCOMD1Response &rsp)
Copy class members.
const int & nrows(void) const
Return number of rows in table.
virtual double real(const int &row, const int &inx=0) const =0
std::vector< double > m_positions
Photo peak position in MeV.
GCOMD1Response & operator=(const GCOMD1Response &rsp)
Assignment operator.
std::string print(const GChatter &chatter=NORMAL) const
Print calibration database information.
FITS binary table class definition.
GVector exp(const GVector &vector)
Computes exponential of vector elements.
void clear(void)
Clear instance.
std::string filepath(const std::string &pathname, const std::string &filename)
Build file path from path name and file name.
double operator()(const double &etrue, const double &ereco) const
D1 module response evaluation operator.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
void append(const double &node)
Append one node to array.
void close(void)
Close FITS file.
std::vector< double > m_emins
Lower energy threshold of D1.
void clear(void)
Clear calibration database.
FITS table double column.
std::string rootdir(void) const
Return path to CALDB root directory.
Mathematical function definitions.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
FITS table abstract base class interface definition.