51 #define G_READ "GCTAModelRadialProfile::read(GXmlElement&)"
52 #define G_WRITE "GCTAModelRadialProfile::write(GXmlElement&)"
174 if (
this != &model) {
248 const bool& gradients)
const
255 #if defined(G_NAN_CHECK)
257 std::cout <<
"*** ERROR: GCTAModelRadialProfile::eval";
258 std::cout <<
"(offset=" << offset <<
"): NaN/Inf encountered";
259 std::cout <<
" (value=" << value;
260 std::cout <<
", width=" <<
width();
261 std::cout <<
", core=" <<
core();
262 std::cout <<
", tail=" <<
tail();
263 std::cout <<
")" << std::endl;
297 const double offset_max = 10.0;
301 #if defined(G_DEBUG_MC)
312 offset = ran.
uniform() * offset_max;
315 value =
std::sin(offset * gammalib::deg2rad) *
eval(offset);
321 #if defined(G_DEBUG_MC)
328 #if defined(G_DEBUG_MC)
329 std::cout <<
"#=" << n_samples <<
" ";
333 double phi = 360.0 * ran.
uniform();
364 const double offset_max = 10.0;
490 result.append(
"=== GCTAModelRadialProfile ===");
495 for (
int i = 0; i <
size(); ++i) {
virtual std::string print(const GChatter &chatter=NORMAL) const
Print point source information.
double romberg(std::vector< double > bounds, const int &order=5)
Perform Romberg integration.
const std::string & name(void) const
Return parameter name.
Random number generator class definition.
GCTAModelRadialProfile(void)
Void constructor.
void free_members(void)
Delete class members.
double gradient(void) const
Return parameter gradient.
void init_members(void)
Initialise class members.
void write(GXmlElement &xml) const
Set or update parameter attributes in XML element.
GVector cos(const GVector &vector)
Computes cosine of vector elements.
double tail(void) const
Return profile tail.
virtual void clear(void)
Clear instance.
virtual GCTAModelRadialProfile * clone(void) const
Clone instance.
Random number generator class.
void init_members(void)
Initialise class members.
GIntegral class interface definition.
CTA radial model registry class definition.
double width(void) const
Return profile width.
double min(void) const
Return parameter minimum boundary.
Interface definition for the spatial model registry class.
bool is_notanumber(const double &x)
Signal if argument is not a number.
const double & scale(void) const
Return parameter scale.
bool is_infinite(const double &x)
Signal if argument is infinite.
virtual double omega(void) const
Returns integral over radial model (in steradians)
bool has_grad(void) const
Signal if parameter gradient is computed analytically.
void free_members(void)
Delete class members.
void free(void)
Free a parameter.
virtual double eval(const double &offset, const bool &gradients=false) const
Evaluate function.
void fix(void)
Fix a parameter.
GXmlElement * xml_need_par(const std::string &origin, GXmlElement &xml, const std::string &name)
Return pointer to parameter with given name in XML element.
virtual ~GCTAModelRadialProfile(void)
Destructor.
double uniform(void)
Returns random double precision floating value in range 0 to 1.
void clear(void)
Clear parameter.
GModelPar m_core
Core parameter.
CTA instrument direction class interface definition.
int size(void) const
Return number of model parameters.
CTA observation class interface definition.
void xml_check_parnum(const std::string &origin, const GXmlElement &xml, const int &number)
Checks number of parameters.
Radial Profile CTA model class.
virtual double mc_max_value(const GCTAObservation &obs) const
Return maximum function value for Monte Carlo simulations.
GModelPar m_tail
Tail parameter.
virtual GCTAInstDir mc(GRan &ran) const
Returns MC instrument direction.
virtual GCTAModelRadialProfile & operator=(const GCTAModelRadialProfile &model)
Assignment operator.
const GCTAModelRadialProfile g_cta_radial_profile_seed
virtual void read(const GXmlElement &xml)
Read model from XML element.
void read(const GXmlElement &xml)
Extract parameter attributes from XML element.
double value(void) const
Return parameter value.
const std::string & unit(void) const
Return parameter unit.
GVector pow(const GVector &vector, const double &power)
Computes tanh of vector elements.
Interface definition for the CTA radial model registry class.
GVector sin(const GVector &vector)
Computes sine of vector elements.
virtual void write(GXmlElement &xml) const
Write model into XML element.
Exception handler interface definition.
Radial Profile model class interface definition.
CTA instrument direction class.
GModelPar m_width
Width parameter.
Abstract radial acceptance model class.
void copy_members(const GCTAModelRadialProfile &model)
Copy class members.
double core(void) const
Return profile core.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
std::vector< GModelPar * > m_pars
Parameter pointers.
Integration class interface definition.
virtual GCTAModelRadial & operator=(const GCTAModelRadial &model)
Assignment operator.
virtual std::string type(void) const
Return model type.
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.
Spatial model registry class definition.
Mathematical function definitions.
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.