StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EEmcL3Tracks.h
1 /* Hey Emacs this is -*-c++-*- */
2 #ifndef EEmcL3Tracks_h
3 #define EEmcL3Tracks_h
4 /*********************************************************************
5  * $Id: EEmcL3Tracks.h,v 1.11 2003/09/11 19:41:02 zolnie Exp $
6  *********************************************************************
7  * $Log: EEmcL3Tracks.h,v $
8  * Revision 1.11 2003/09/11 19:41:02 zolnie
9  * updates for gcc3.2
10  *
11  * Revision 1.10 2003/09/02 17:57:55 perev
12  * gcc 3.2 updates + WarnOff
13  *
14  * Revision 1.9 2003/06/02 17:34:35 zolnie
15  * fixed bug in EEmcHelix
16  *
17  * Revision 1.8 2003/05/31 02:31:30 zolnie
18  * bring the changes back
19  *
20  * Revision 1.6 2003/05/30 21:07:52 zolnie
21  * added track length and number of points
22  *
23  * Revision 1.5 2003/05/30 20:37:09 zolnie
24  * added L3 track flag to EEmcHelix
25  *
26  * Revision 1.4 2003/05/28 21:02:49 zolnie
27  * added getNumberOfTracks method
28  *
29  * Revision 1.3 2003/05/27 19:11:44 zolnie
30  * added dE/dx info
31  *
32  * Revision 1.2 2003/05/26 14:44:34 zolnie
33  * rewritten implementation of EEmcL3Tracks using TClonesArray
34  * introduced a common Makefile and mklinkdef.pl
35  *
36  * Revision 1.1 2003/05/20 19:22:59 zolnie
37  * new additions for ..... :)
38  *
39  *********************************************************************/
40 #include <cmath>
41 #include <ctime>
42 
43 #ifndef MAXFLOAT
44 #define MAXFLOAT 3E38
45 #endif
46 
47 
48 #include "TObject.h"
49 #include "TClonesArray.h"
50 
51 class EEmcHelix : public TObject {
52 public:
53  EEmcHelix() { mOx=mOy=mOz=mPx=mPy=mPz=mLength=mB=0.0; mQ=mPoints=mFlag=0; };
54  EEmcHelix(Float_t x, Float_t y, Float_t z, Float_t px, Float_t py, Float_t pz,
55  Int_t q, Float_t B, Int_t np, Float_t l , Int_t mFlag);
56  EEmcHelix(const EEmcHelix &h);
57 
58  void setOrigin (Float_t x ,Float_t y ,Float_t z ) { mOx=x; mOy=y; mOz=z; }
59  void setMomentum(Float_t px,Float_t py,Float_t pz) { mPx=px;mPy=py;mPz=pz;}
60  void setQ (Int_t q ) { mQ = q; }
61  void setB (Float_t B ) { mB = B; }
62  void setFlag (Int_t f ) { mFlag = f; }
63  void setPoints (Int_t n ) { mPoints = n; }
64  void setLength (Float_t l ) { mLength = l; }
65 
66  void getOrigin (Float_t &x,Float_t &y,Float_t &z) const {x=mOx;y=mOy;z=mOz;}
67  void getMomentum(Float_t &x,Float_t &y,Float_t &z) const {x=mPx;y=mPy;z=mPz;}
68 
69  Float_t Ox() const { return mOx; }
70  Float_t Oy() const { return mOy; }
71  Float_t Oz() const { return mOz; }
72  Float_t Px() const { return mPx; }
73  Float_t Py() const { return mPy; }
74  Float_t Pt() const { return ::sqrt(mPx*mPx+mPy*mPy); }
75  Float_t Pz() const { return mPz; }
76  Int_t Q () const { return mQ; }
77  Float_t B () const { return mB; }
78  Int_t Points() const { return mPoints;}
79  Float_t Length() const { return mLength;}
80  Int_t Flag() const { return mFlag;}
81 
82  void print(FILE *fd=stdout) const;
83 
84 private:
85  Float_t mOx; // origin x
86  Float_t mOy; // origin y
87  Float_t mOz; // origin z
88  Float_t mPx; // x momentum at origin
89  Float_t mPy; // y momentum at origin
90  Float_t mPz; // z momentum at origin
91  Float_t mB; // field
92  Int_t mQ; // charge
93  Int_t mPoints; //
94  Float_t mLength; //
95  Int_t mFlag; // 0==primary, 1==secondary
96 
97 
98  ClassDef(EEmcHelix,4)
99 };
100 
101 class EEmcL3Tracks : public TObject {
102 public:
103  EEmcL3Tracks();
104  virtual ~EEmcL3Tracks();
105  int add (EEmcHelix &h, Float_t dedx);
106  void clear();
107  void setVertex(float x,float y,float z) {mVertX=x; mVertY=y; mVertZ=z;};
108 
109  void getVertex(float& x,float& y,float& z) {x=mVertX; y=mVertY; z=mVertZ;};
110  Float_t getdEdx (int i) {return((0<=i && i<mNTracks)?mDedx[i]:-MAXFLOAT);}
111  Int_t getNumberOfTracks() {return mNTracks;}
112  EEmcHelix* getHelix (int i) ;
113 
114  void print(FILE *f = stdout) const;
115 
116 private:
117  static const Int_t mAllocTracks;
118  Int_t mTrackSize;
119  Int_t mNTracks; //
120  Float_t mVertX; //
121  Float_t mVertY; //
122  Float_t mVertZ; //
123  TClonesArray *mHelix; //-> array with helices
124  Float_t *mDedx; //[mNTracks]
125  ClassDef(EEmcL3Tracks,2)
126 };
127 #endif
128 
129