StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StiNodePars.h
1 #ifndef __StiNodePars_h_
2 #define __StiNodePars_h_
3 #include "Rtypes.h"
4 
5 #define kEC 2.99792458e-4
6 #define kZEROHZ 2e-6 //minimal/zero mag field
7 #define kZEROPTI 1e-3 //minimal/zero 1/pt
8 #define kZEROCURV (kZEROHZ*kZEROPTI) //minimal/zero curvature
9 #define kBIGPT 10 //Pt when energy loss ignored
10 
11 
12 
13 class StiNodePars {
14  public:
15  enum {kX=0,kY=1,kZ=2,kPhi=3,kPtin=4,kTan=5,kCurv=6,kHz=7};
16  void reset(){memset(this,0,sizeof(StiNodePars));_cosCA=1;}
17  void ready();
18  int isZeroH() const { return fabs(P[kHz]) <= kZEROHZ;}
19  StiNodePars &merge(double wt,StiNodePars &other);
20  StiNodePars &operator=(const StiNodePars& fr);
21  void rotate(double alfa);
22  int nan() const;
24  double operator[](Int_t idx) const {return P[idx];}
25  double &operator[](Int_t idx) {return P[idx];}
26  double x() const {return P[kX];}
27  double y() const {return P[kY];}// local Y-coordinate of this track (reference plane)
28  double z() const {return P[kZ];}// local Z-coordinate of this track (reference plane)
29  double eta() const {return P[kPhi];}// phi angle
30  double phi() const {return P[kPhi];}// phi angle again
31  double ptin() const {return P[kPtin];}// signed invert pt [sign = sign(-qB)]
32  double tanl() const {return P[kTan];}// tangent of the track momentum dip angle
33  double curv() const {return P[kCurv];}// signed curvature [sign = sign(-qB)]
34  double rxy2() const {return (P[kX]*P[kX]+P[kY]*P[kY]);}
35  double rxy() const {return sqrt(P[kX]*P[kX]+P[kY]*P[kY]);}
36  double hz() const {return P[kHz];}// Z component magnetic field in units Pt(Gev) = Hz * RCurv(cm)
37  double &x() {return P[kX];}
38  double &y() {return P[kY];}
39  double &z() {return P[kZ];}
40  double &eta() {return P[kPhi];}
41  double &ptin() {return P[kPtin];}
42  double &tanl() {return P[kTan];}
43  double &curv() {return P[kCurv];}
44  double &hz() {return P[kHz];}
45  double *A(Int_t i) {return &P[i];}
46 
47  Int_t check(const char *pri=0) const;
48  void print() const;
49 
51  double _cosCA;
52  double _sinCA;
53  double P[8]; // array of parameters. see below
54 };
55 
56 class StiELoss
57 {
58 public:
59 float mELoss,mLen,mDens,mX0;
60 };
61 
62 inline void StiNodePars::ready()
63 {
64 _cosCA=cos(P[kPhi]);_sinCA=sin(P[kPhi]);
65  if (fabs(P[kHz])<= kZEROHZ) {
66  P[kCurv] = kZEROCURV; P[kPtin]= kZEROPTI;
67  } else {
68  P[kCurv] = P[kHz]*P[kPtin];
69  }
70 }
71 
72 
73 #endif
double _cosCA
sine and cosine of cross angle
Definition: StiNodePars.h:51
double operator[](Int_t idx) const
accessors
Definition: StiNodePars.h:24