/* $Id$ */
+#include <TVector3.h>
+#include <TMath.h>
+
+#include "AliTrackParam.h"
+#include "AliExternalTrackParam.h"
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// class for fast math //
+// //
+// Class with a table for fast calculation of the //
+// asins. The valuse are calculated via //
+// linear interpolation. The values and the deltas are stored //
+// //
+///////////////////////////////////////////////////////////////////////////////
+
+
+Double_t AliFastMath::fgFastAsin[20000];
+
+AliFastMath::AliFastMath()
+{
+ //
+ // Standard constructor
+ // Initialises the asin tables
+ //
+ for (Int_t i=0;i<10000;i++){
+ fgFastAsin[2*i] = TMath::ASin(i/10000.);
+ fgFastAsin[2*i+1] = (TMath::ASin((i+1)/10000.)-fgFastAsin[2*i]);
+ }
+}
+
+Double_t AliFastMath::FastAsin(Double_t x)
+{
+ //
+ // Fast interpolation for the Asin
+ //
+ if (x>0){
+ Int_t index = int(x*10000);
+ return fgFastAsin[2*index]+(x*10000.-index)*fgFastAsin[2*index+1];
+ } else {
+ x*=-1;
+ Int_t index = int(x*10000);
+ return -(fgFastAsin[2*index]+(x*10000.-index)*fgFastAsin[2*index+1]);
+ }
+}
+
///////////////////////////////////////////////////////////////////////////////
// //
// base class for track parameters //
///////////////////////////////////////////////////////////////////////////////
-#include "AliTrackParam.h"
-#include "AliExternalTrackParam.h"
-#include "AliRunLoader.h"
-#include "AliRun.h"
-#include "AliMagF.h"
-
-
-Double_t FastMath::fgFastAsin[20000];
-
-FastMath::FastMath()
-{
- for (Int_t i=0;i<10000;i++){
- fgFastAsin[2*i] = TMath::ASin(i/10000.);
- fgFastAsin[2*i+1] = (TMath::ASin((i+1)/10000.)-fgFastAsin[2*i]);
- }
-}
-
-Double_t FastMath::FastAsin(Double_t x)
-{
- if (x>0){
- Int_t index = int(x*10000);
- return fgFastAsin[2*index]+(x*10000.-index)*fgFastAsin[2*index+1];
- }
- x*=-1;
- Int_t index = int(x*10000);
- return -(fgFastAsin[2*index]+(x*10000.-index)*fgFastAsin[2*index+1]);
-}
-
-FastMath gFastMath;
-
-
-
ClassImp(AliTrackParam)
-
-
-
//_____________________________________________________________________________
Bool_t AliTrackParam::RotateAndPropagateTo(Double_t alpha, Double_t x,
Double_t* length)
/* $Id$ */
+///////////////////////////////////////////////////////////////////////////////
+// //
+// class for fast math //
+// //
+// Class for generic track parameters //
+// //
+///////////////////////////////////////////////////////////////////////////////
+
#include <TObject.h>
-#include <TVector3.h>
+class TVector3;
class AliCluster;
class AliExternalTrackParam;
-class FastMath {
+class AliFastMath {
public:
- FastMath();
+ AliFastMath();
static Double_t FastAsin(Double_t x);
private:
- static Double_t fgFastAsin[20000];
+ static Double_t fgFastAsin[20000]; //Array to contain the asin values
};
class AliTrackParam: public TObject {
- public:
+public:
+ virtual ~AliTrackParam() {}
virtual const Double_t* GetParameter() const = 0;
virtual const Double_t* GetCovariance() const = 0;
virtual Double_t X() const = 0;