StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFormulary.hh
1 // $Id: StFormulary.hh,v 1.5 2003/09/16 15:27:01 jcs Exp $
2 // $Log: StFormulary.hh,v $
3 // Revision 1.5 2003/09/16 15:27:01 jcs
4 // removed inline as it would leave a few undefined reference
5 //
6 // Revision 1.4 2002/10/03 10:33:57 oldi
7 // Usage of gufld removed.
8 // Magnetic field is read by StMagUtilities, now.
9 //
10 // Revision 1.3 2002/04/09 16:10:11 oldi
11 // Method to get the magentic field factor moved to StFormulary. It works for
12 // simulation as well, now.
13 //
14 // Revision 1.2 2000/07/18 21:22:15 oldi
15 // Changes due to be able to find laser tracks.
16 // Cleanup: - new functions in StFtpcConfMapper, StFtpcTrack, and StFtpcPoint
17 // to bundle often called functions
18 // - short functions inlined
19 // - formulas of StFormulary made static
20 // - avoid streaming of objects of unknown size
21 // (removes the bunch of CINT warnings during compile time)
22 // - two or three minor bugs cured
23 //
24 // Revision 1.1 2000/05/10 13:39:05 oldi
25 // Initial version of StFtpcTrackMaker
26 //
27 
28 #ifndef STAR_StFormulary
29 #define STAR_StFormulary
30 
31 #include "TMath.h"
32 
33 #ifndef ROOT_Rtypes
34 #include "Rtypes.h"
35 #endif
36 
38 {
39  public:
40 
41  static Double_t CheckASinArg(Double_t asin_arg); // returns +1. if asin_arg>1. or -1. if asin_arg<-1.
42  static Double_t RelDiff(const Double_t p1, const Double_t p2); // retuns the relative difference of two values
43  static void Pq(const Double_t *p, const Double_t *q, Double_t x[2]); // x(y=0) values of a parabola
44  static Double_t Angle(const Double_t *x1, const Double_t *x2, Int_t dim = 3); // angle between to vectors
45  static Double_t Dist_squared(const Double_t *p1, const Double_t *p2, Int_t dim = 3); // squared distance of two points in space
46  static Double_t Dist(const Double_t *p1, const Double_t *p2, Int_t dim = 3); // distance of two points in space
47  static void VectorProd(const Double_t *a, const Double_t *b, Double_t *c); // vector product (3D)
48  static Double_t ScalarProd(const Double_t *a, const Double_t *b, Int_t dim = 3); // scalar product of two verctors
49  static Double_t Square(const Double_t *p, Int_t dim = 3); // squared length of a vector
50  static void Sum(const Double_t *p1, const Double_t *p2, Double_t *P, Int_t n = 3); // sum of two vectors
51  static void Diff(const Double_t *p1, const Double_t *p2, Double_t *P, Int_t n = 3); // difference of two vectors
52  static Double_t Abs(const Double_t *p, Int_t dim = 3); // length of a vector
53 
54  ClassDef(StFormulary,0) // Mathematical formulary
55 };
56 
57 
58 #endif