41#define G_RESPONSE "GCOSObservation::response(GResponse&)"
42#define G_READ "GCOSObservation::read(GXmlElement&)"
43#define G_WRITE "GCOSObservation::write(GXmlElement&)"
44#define G_LOAD "GCOSObservation::load(std::vector<GFilename>&, GFilename&, "\
114 load(eventname, spacename, rspname);
140 load(eventnames, spacename, rspname);
274 if (cosrsp == NULL) {
275 std::string cls = std::string(
typeid(&rsp).
name());
276 std::string msg =
"Response of type \""+cls+
"\" is "
277 "not a COSI response. Please specify a "
278 "COSI response as argument.";
326 std::vector<GFilename> eventnames;
327 for (
int i = 0; i < xml.
elements(
"parameter"); ++i) {
329 if (element->
attribute(
"name") ==
"EventList") {
330 std::string eventname = element->
attribute(
"file");
332 eventnames.push_back(
GFilename(eventname));
345 load(eventnames, spacename, rspname);
441 std::vector<GFilename> eventnames;
442 eventnames.push_back(eventname);
445 load(eventnames, spacename, rspname);
483 if (eventnames.size() == 0) {
484 std::string msg =
"The eventnames vector is empty but the method "
485 "needs at least one event list name. Please "
486 "specify at least one event list name.";
491 for (
int i = 0; i < eventnames.size(); ++i) {
549 result.append(
"=== GCOSObservation ===");
const GCOSObservation g_obs_cos_seed
COSI observation class definition.
Exception handler interface definition.
Observation registry class definition.
GFilename m_rspname
Response filename.
virtual void write(GXmlElement &xml) const
Write COSI observation into XML element.
bool is_binned(void) const
Check whether observation is binned.
void copy_members(const GCOSObservation &obs)
Copy class members.
virtual double ontime(void) const
Return ontime.
void free_members(void)
Delete class members.
virtual ~GCOSObservation(void)
Destructor.
GCOSObservation(void)
Void constructor.
virtual double livetime(void) const
Return livetime.
bool is_unbinned(void) const
Check whether observation is unbinned.
void load(const GFilename &eventname, const GFilename &spacename, const GFilename &rspname)
Load data for an unbinned observation.
double m_ontime
Ontime (sec)
virtual const GCOSResponse * response(void) const
Return pointer to response function.
double m_deadc
Deadtime correction.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print observation information.
GFilename m_spacename
Space craft filename.
std::string m_instrument
Instrument name.
virtual std::string instrument(void) const
Return instrument.
virtual GCOSObservation * clone(void) const
Clone COSI observation.
virtual GCOSObservation & operator=(const GCOSObservation &obs)
Assignment operator.
GCOSResponse m_response
Response functions.
double m_livetime
Livetime (sec)
GCOSSpaceCraft m_spacecraft
Space craft information.
virtual void clear(void)
Clear COSI observation.
void init_members(void)
Initialise class members.
virtual void read(const GXmlElement &xml)
Read COSI observation from XML element.
std::vector< GFilename > m_eventnames
Event list filenames.
COSI instrument response function class.
virtual void clear(void)
Clear instance.
void load(const GFilename &filename)
const GGti & gti(void) const
Return Good Time Intervals.
void clear(void)
Clear space craft.
const double & deadc(void) const
Return deadtime correction factor.
const double & ontime(void) const
Return ontime in seconds.
void load(const GFilename &filename)
Load COSI space craft file.
const double & livetime(void) const
Return livetime in seconds.
void gti(const GGti >i)
Set Good Time Intervals.
virtual std::string print(const GChatter &chatter=NORMAL) const =0
Print content of object.
void clear(void)
Clear file name.
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.
std::string m_name
Observation name.
std::string m_id
Observation identifier.
Abstract instrument response base class.
const GXmlAttribute * attribute(const int &index) const
Return attribute.
virtual GXmlNode * append(const GXmlNode &node)
Append XML child node.
virtual GXmlElement * element(const int &index)
Return pointer to GXMLElement child.
virtual int elements(void) const
Return number of GXMLElement children of node.
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.
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.