46 #define G_EVAL "GCOMModelDRM::eval(GEvent&, GObservation&, bool&)"
47 #define G_NRED "GCOMModelDRM::npred(GEnergy&, GTime&, GObservation&)"
48 #define G_MC "GCOMModelDRM::mc(GObservation&, GRan&)"
49 #define G_READ "GCOMModelDRM::read(GXmlElement&)"
50 #define G_WRITE "GCOMModelDRM::write(GXmlElement&)"
159 if (
this != &model) {
240 const bool& gradients)
const
244 if (observation == NULL) {
245 std::string cls = std::string(
typeid(&obs).
name());
246 std::string msg =
"Observation of type \""+cls+
"\" is not a COMPTEL "
247 "observations. Please specify a COMPTEL observation "
255 std::string cls = std::string(
typeid(&event).
name());
256 std::string msg =
"Event of type \""+cls+
"\" is not a COMPTEL event. "
257 "Please specify a COMPTEL event as argument.";
270 int index = bin->
index();
296 #if defined(G_NAN_CHECK)
298 std::cout <<
"*** ERROR: GCOMModelDRM::eval";
299 std::cout <<
"(index=" << index <<
"):";
300 std::cout <<
" NaN/Inf encountered";
301 std::cout <<
" (value=" << value;
302 std::cout <<
")" << std::endl;
330 const GTime& obsTime,
337 std::string msg =
"Spatial integration of DRM model is not implemented.";
366 std::string msg =
"Monte Carlo simulation of DRM model is not implemented.";
432 for (
int k = 0; k < n; ++k) {
443 src = xml.
append(
"source");
486 result.append(
"=== GCOMModelDRM ===");
496 for (
int i = 0; i <
size(); ++i) {
void free_members(void)
Delete class members.
const int & index(void) const
Return bin index.
virtual void clear(void)
Clear instance.
virtual GCOMModelDRM * clone(void) const
Clone instance.
const double & factor_gradient(void) const
Return parameter factor gradient.
double norm(const GVector &vector)
Computes vector norm.
virtual double npred(const GEnergy &obsEng, const GTime &obsTime, const GObservation &obs) const
Return spatially integrated DRM model.
const std::string & name(void) const
Return parameter name.
std::string print_attributes(void) const
Print model attributes.
Interface definition for the model registry class.
double gradient(void) const
Return parameter gradient.
void write(GXmlElement &xml) const
Set or update parameter attributes in XML element.
virtual GCOMEventCube * mc(const GObservation &obs, GRan &ran) const
Return simulated list of events.
COMPTEL observation class interface definition.
Abstract interface for the event classes.
void free_members(void)
Delete class members.
Random number generator class.
void init_members(void)
Initialise class members.
virtual int elements(void) const
Return number of GXMLElement children of node.
virtual void write(GXmlElement &xml) const
Write model into XML element.
GFilename xml_file_reduce(const GXmlElement &xml, const std::string &filename)
Reduce file name provided for writing as XML attribute.
bool is_free(void) const
Signal if parameter is free.
COMPTEL event bin class interface definition.
bool is_notanumber(const double &x)
Signal if argument is not a number.
std::vector< GModelPar * > m_pars
Pointers to all model parameters.
int size(void) const
Return number of parameters in model.
const double & scale(void) const
Return parameter scale.
bool is_infinite(const double &x)
Signal if argument is infinite.
void init_members(void)
Initialise class members.
virtual ~GCOMModelDRM(void)
Destructor.
bool has_grad(void) const
Signal if parameter gradient is computed analytically.
const GXmlAttribute * attribute(const int &index) const
Return attribute.
const std::string & name(void) const
Return parameter name.
void free(void)
Free a parameter.
const GSkyMap & map(void) const
Return DRI sky map.
GXmlElement * xml_need_par(const std::string &origin, GXmlElement &xml, const std::string &name)
Return pointer to parameter with given name in XML element.
void clear(void)
Clear parameter.
Abstract data model class.
COMPTEL DRM model class interface definition.
virtual GModelData & operator=(const GModelData &model)
Assignment operator.
std::string instruments(void) const
Returns instruments to which model applies.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print model information.
Abstract observation base class.
COMPTEL event bin container class.
void xml_check_parnum(const std::string &origin, const GXmlElement &xml, const int &number)
Checks number of parameters.
GFilename m_filename
Name of DRM FITS file.
void copy_members(const GCOMModelDRM &model)
Copy class members.
void write_attributes(GXmlElement &xml) const
Write model attributes.
void free_members(void)
Delete class members.
GCOMModelDRM(void)
Void constructor.
virtual GXmlElement * element(const int &index)
Return pointer to GXMLElement child.
void clear(void)
Clear file name.
virtual void clear(void)
Clear COMPTEL Data Space.
void range(const double &min, const double &max)
Set minimum and maximum parameter boundaries.
void read(const GXmlElement &xml)
Extract parameter attributes from XML element.
double value(void) const
Return parameter value.
Interface class for COMPTEL observations.
void load(const GFilename &filename)
Load COMPTEL Data Space from DRI FITS file.
Exception handler interface definition.
GModelPar m_norm
Normalisation.
void read_attributes(const GXmlElement &xml)
Read model attributes.
virtual double eval(const GEvent &event, const GObservation &obs, const bool &gradients=false) const
Evaluate function.
Model registry class definition.
virtual GXmlNode * append(const GXmlNode &node)
Append XML child node.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
virtual double size(void) const
Return size of event bin.
virtual std::string type(void) const
Return model type.
const GCOMModelDRM g_com_drm_seed
virtual void read(const GXmlElement &xml)
Read model from XML element.
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.
const double * pixels(void) const
Returns pointer to pixel data.
void init_members(void)
Initialise class members.
virtual GCOMModelDRM & operator=(const GCOMModelDRM &model)
Assignment operator.
Class that handles energies in a unit independent way.
GFilename xml_file_expand(const GXmlElement &xml, const std::string &filename)
Expand file name provided as XML attribute for loading.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
void xml_check_type(const std::string &origin, GXmlElement &xml, const std::string &type)
Checks the model type.