43#define G_RESPONSE "GSPIObservation::response(GResponse&)"
44#define G_READ "GSPIObservation::read(GXmlElement&)"
45#define G_READ_FITS "GSPIObservation::read(GFits&)"
46#define G_WRITE "GSPIObservation::write(GXmlElement&)"
244 if (spirsp == NULL) {
245 std::string cls = std::string(
typeid(&rsp).
name());
246 std::string msg =
"Response of type \""+cls+
"\" is "
247 "not a INTEGRAL/SPI response. Please specify a "
248 "INTEGRAL/SPI response as argument.";
461 #pragma omp critical(GSPIObservation_load)
467 GFits fits(filename);
496 result.append(
"=== GSPIObservation ===");
522 if (reduced_chatter >
SILENT) {
Exception handler interface definition.
Observation registry class definition.
INTEGRAL/SPI event bin container class definition.
const GSPIObservation g_obs_spi_seed
INTEGRAL/SPI observation class definition.
Class that handles energies in a unit independent way.
virtual void read(const GFits &file)=0
virtual std::string print(const GChatter &chatter=NORMAL) const =0
Print content of object.
std::string url(void) const
Return Uniform Resource Locator (URL)
bool is_empty(void) const
Signal if filename is empty.
void clear(void)
Clear file name.
void close(void)
Close FITS file.
Interface definition for the observation registry class.
Abstract observation base class.
const std::string & statistic(void) const
Return optimizer statistic.
const std::string & name(void) const
Return observation name.
virtual GEvents * events(void)
Return events.
void init_members(void)
Initialise class members.
virtual GObservation & operator=(const GObservation &obs)
Assignment operator.
GEvents * m_events
Pointer to event container.
void free_members(void)
Delete class members.
Abstract instrument response base class.
INTEGRAL/SPI event bin container class.
INTEGRAL/SPI observation class.
double m_deadc
Deadtime correction.
double m_ontime
Ontime (sec)
void load(const GFilename &filename)
Load Observation Group.
GSPIObservation(void)
Void constructor.
void copy_members(const GSPIObservation &obs)
Copy class members.
virtual double ontime(void) const
Return ontime.
virtual void read(const GXmlElement &xml)
Read INTEGRAL/SPI observation from XML element.
virtual ~GSPIObservation(void)
Destructor.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print observation information.
void init_members(void)
Initialise class members.
virtual double livetime(void) const
Return livetime.
GFilename m_rsp_filename
Response FITS filename (optional)
virtual void write(GXmlElement &xml) const
Write INTEGRAL/SPI observation into XML element.
virtual GSPIObservation * clone(void) const
Clone INTEGRAL/SPI observation.
GSPIResponse m_response
Response functions.
virtual GSPIObservation & operator=(const GSPIObservation &obs)
Assignment operator.
GFilename m_rsp_grpname
Response group FITS filename (optional)
virtual const GSPIResponse * response(void) const
Return pointer to response function.
virtual void clear(void)
Clear INTEGRAL/SPI observation.
double m_livetime
Livetime (sec)
std::string m_instrument
Instrument name.
GFilename m_filename
OG FITS filename.
virtual std::string instrument(void) const
Return instrument.
void free_members(void)
Delete class members.
INTEGRAL/SPI instrument response function class.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print INTEGRAL/SPI response information.
void load(const GFilename &filename)
Load SPI response from file.
void rspname(const GFilename &rspname)
Set response name.
virtual void clear(void)
Clear instance.
const double & energy_keV(void) const
Return line IRF energy in keV.
void set(const GSPIObservation &obs, const GEnergy &energy=GEnergy())
Set response for a specific observation.
const GXmlAttribute * attribute(const int &index) const
Return attribute.
bool has_attribute(const std::string &name) const
Check if element has a given attribute.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
const GXmlElement * xml_get_par(const std::string &origin, const GXmlElement &xml, const std::string &name)
Return pointer to parameter with given name in XML element.
double todouble(const std::string &arg)
Convert string into double precision value.
std::string xml_get_attr(const std::string &origin, const GXmlElement &xml, const std::string &name, const std::string &attribute)
Return attribute value for a given parameter in XML element.
GXmlElement * xml_need_par(const std::string &origin, GXmlElement &xml, const std::string &name)
Return pointer to parameter with given name in XML element.
GFilename xml_file_reduce(const GXmlElement &xml, const std::string &filename)
Reduce file name provided for writing as XML attribute.
GChatter reduce(const GChatter &chatter)
Reduce chattiness by one level.
bool xml_has_par(const GXmlElement &xml, const std::string &name)
Checks if parameter with given name in XML element exists.
GFilename xml_file_expand(const GXmlElement &xml, const std::string &filename)
Expand file name provided as XML attribute for loading.