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