Ignore:
Timestamp:
10/17/06 10:04:04 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mdata/MDataPhrase.cc

    r8077 r8083  
    5454//   Gaus, Gausn, Landau, Landaun, Pol0-Pol10, Pow2-Pow5
    5555//
     56// In the constructor you can give rule, like
     57//   "HillasSource.fDist / MHillas.fLength"
     58// Where MHillas/HillasSource is the name of the parameter container in
     59// the parameter list and fDist/fLength is the name of the data members
     60// in the containers. The result will be fDist divided by fLength.
     61//
     62// In case you want to access a data-member which is a data member object
     63// you can acces it with (Remark: it must derive from MParContainer):
     64//   "MCameraLV.fPowerSupplyA.fVoltagePos5V"
     65// (THIS FEATURE IS CURRENTLY NOT SUPPORTED)
     66//
     67// You can also use parantheses:
     68//   "HillasDource.fDist / (MHillas.fLength + MHillas.fWidth)"
     69//
     70// Additional implementations:
     71//
     72//   isnan(x)  return 1 if x is NaN (Not a Number) otherwise 0
     73//   finite(x) return 1 if the number is a valid double (not NaN, inf)
     74//
     75// NaN (Not a Number) means normally a number which is to small to be
     76// stored in a floating point variable (eg. 0<x<1e-56 or similar) or
     77// a number which function is not defined (like asin(1.5))
     78//
     79// inf is the symbol for an infinite number.
     80//
     81//
     82// Constants
     83// ---------
     84//
     85// Most constants you might need can be found in TMath, eg:
     86//  TMath::Pi(), TMath::TwoPi(), TMath::Ln10(), TMath::LogE()
     87//  TMath::RadToDeg(), TMath::DegToRad();
     88//
     89//
     90// Variable Parameters
     91// ------------------------
     92// If you want to use variables, eg for fits you can use [0], [1], ...
     93// These values are initialized with 0 and set by calling
     94// SetVariables(), eg
     95//   [0]*MHillas.fArea
     96//
     97//
     98// Multi-argument functions
     99// ------------------------
     100// You can use multi-argument functions, too. Example:
     101//   "TMath::Hypot(MHillas.fMeanX, MHillas.MeanY)"
     102//   "pow(MHillas.fMeanX*MHillas.MeanY, -1.2)"
     103//
     104//
     105//
     106// To Do:
     107//  - The possibility to use other objects inheriting from MData
     108//    is missing.
     109//
    56110/////////////////////////////////////////////////////////////////////////////
    57111#include "MDataPhrase.h"
     
    329383    // More in TFormulaPrimitive.cxx
    330384    // More in TFormulaMathInterface
    331     TFormulaPrimitive::AddFormula(new TFormulaPrimitive("log2",   "log2",   (TFormulaPrimitive::GenFunc10)TMath::Log2));
    332     TFormulaPrimitive::AddFormula(new TFormulaPrimitive("fabs",   "fabs",   (TFormulaPrimitive::GenFunc10)TMath::Abs));
    333     TFormulaPrimitive::AddFormula(new TFormulaPrimitive("floor",  "floor",  (TFormulaPrimitive::GenFunc10)TMath::Floor));
    334     TFormulaPrimitive::AddFormula(new TFormulaPrimitive("ceil",   "ceil",   (TFormulaPrimitive::GenFunc10)TMath::Ceil));
    335 
    336     TFormulaPrimitive::AddFormula(new TFormulaPrimitive("nint",   "nint",   (TFormulaPrimitive::GenFunc10)MFastFun::Nint));
    337     TFormulaPrimitive::AddFormula(new TFormulaPrimitive("round",  "round",  (TFormulaPrimitive::GenFunc10)MFastFun::Nint));
    338     TFormulaPrimitive::AddFormula(new TFormulaPrimitive("sgn",    "sgn",    (TFormulaPrimitive::GenFunc10)MFastFun::Sign));
    339 
    340     TFormulaPrimitive::AddFormula(new TFormulaPrimitive("isnan",  "isnan",  (TFormulaPrimitive::GenFunc10)MFastFun::IsNaN));
    341     TFormulaPrimitive::AddFormula(new TFormulaPrimitive("finite", "finite", (TFormulaPrimitive::GenFunc10)MFastFun::Finite));
     385    if (!TFormulaPrimitive::FindFormula("isnan"))
     386    {
     387        TFormulaPrimitive::AddFormula(new TFormulaPrimitive("log2",   "log2",   (TFormulaPrimitive::GenFunc10)TMath::Log2));
     388        TFormulaPrimitive::AddFormula(new TFormulaPrimitive("fabs",   "fabs",   (TFormulaPrimitive::GenFunc10)TMath::Abs));
     389        TFormulaPrimitive::AddFormula(new TFormulaPrimitive("floor",  "floor",  (TFormulaPrimitive::GenFunc10)TMath::Floor));
     390        TFormulaPrimitive::AddFormula(new TFormulaPrimitive("ceil",   "ceil",   (TFormulaPrimitive::GenFunc10)TMath::Ceil));
     391
     392        TFormulaPrimitive::AddFormula(new TFormulaPrimitive("nint",   "nint",   (TFormulaPrimitive::GenFunc10)MFastFun::Nint));
     393        TFormulaPrimitive::AddFormula(new TFormulaPrimitive("round",  "round",  (TFormulaPrimitive::GenFunc10)MFastFun::Nint));
     394        TFormulaPrimitive::AddFormula(new TFormulaPrimitive("sgn",    "sgn",    (TFormulaPrimitive::GenFunc10)MFastFun::Sign));
     395
     396        TFormulaPrimitive::AddFormula(new TFormulaPrimitive("isnan",  "isnan",  (TFormulaPrimitive::GenFunc10)MFastFun::IsNaN));
     397        TFormulaPrimitive::AddFormula(new TFormulaPrimitive("finite", "finite", (TFormulaPrimitive::GenFunc10)MFastFun::Finite));
     398    }
    342399
    343400    //    TFormulaPrimitive is used to get direct acces to the function pointers
Note: See TracChangeset for help on using the changeset viewer.