source: trunk/MagicSoft/Mars/mbase/MMath.h@ 7455

Last change on this file since 7455 was 7409, checked in by tbretz, 19 years ago
*** empty log message ***
File size: 1.5 KB
Line 
1#ifndef MARS_MMath
2#define MARS_MMath
3
4#ifndef ROOT_TMath
5#include <TMath.h> // TMath is included here for convinience
6#endif
7
8class TVector3;
9class TArrayD;
10
11namespace MMath
12{
13 inline Double_t DegToHor() { return 1./15; }
14 inline Double_t HorToDeg() { return 15; }
15
16 inline Double_t RadToHor() { return TMath::RadToDeg()/15; }
17 inline Double_t HorToRad() { return 15/TMath::RadToDeg(); }
18
19 Double_t GaussProb(Double_t x, Double_t sigma, Double_t mean=0);
20
21 Double_t Significance(Double_t s, Double_t b);
22 Double_t SignificanceSym(Double_t s, Double_t b);
23 Double_t SignificanceLiMa(Double_t s, Double_t b, Double_t alpha=1);
24 Double_t SignificanceLiMaSigned(Double_t s, Double_t b, Double_t alpha=1);
25 Double_t SignificanceLiMaExc(Double_t s, Double_t b, Double_t alpha=1);
26
27 void ReducePrecision(Float_t &val);
28
29 TVector3 GetParab(const TVector3 &x, const TVector3 &y);
30 Double_t InterpolParabLin(const TVector3 &vx, const TVector3 &vy, Double_t x);
31 Double_t InterpolParabLog(const TVector3 &vx, const TVector3 &vy, Double_t x);
32 Double_t InterpolParabCos(const TVector3 &vx, const TVector3 &vy, Double_t x);
33
34 TArrayD LeastSqFitExpW1(Int_t n, Double_t *x, Double_t *y);
35 TArrayD LeastSqFitExp(Int_t n, Double_t *x, Double_t *y);
36 TArrayD LeastSqFitLog(Int_t n, Double_t *x, Double_t *y);
37 TArrayD LeastSqFitPowerLaw(Int_t n, Double_t *x, Double_t *y);
38
39 inline Double_t Sgn(Double_t d) { return d<0 ? -1 : 1; }
40}
41
42#endif
Note: See TracBrowser for help on using the repository browser.