00001 // $Id: StFtpcVertex.hh,v 1.15 2009/11/23 16:38:11 fisyak Exp $ 00002 // $Log: StFtpcVertex.hh,v $ 00003 // Revision 1.15 2009/11/23 16:38:11 fisyak 00004 // Remove dependence on dst_vertex_st 00005 // 00006 // Revision 1.14 2004/04/06 18:59:21 oldi 00007 // New constructor which takes input data from StVertex added. 00008 // 00009 // Revision 1.13 2004/02/12 19:37:11 oldi 00010 // *** empty log message *** 00011 // 00012 // Revision 1.12 2003/09/02 17:58:17 perev 00013 // gcc 3.2 updates + WarnOff 00014 // 00015 // Revision 1.11 2002/11/06 13:48:06 oldi 00016 // IFlag and Id added as data members. 00017 // New functionality introduced (to clean up StFtpcTrackMaker.cxx). 00018 // 00019 // Revision 1.10 2002/06/04 13:43:54 oldi 00020 // Minor change: 'west' -> 'hemisphere' (just a naming convention) 00021 // 00022 // Revision 1.9 2002/04/05 16:51:20 oldi 00023 // Cleanup of MomentumFit (StFtpcMomentumFit is now part of StFtpcTrack). 00024 // Each Track inherits from StHelix, now. 00025 // Therefore it is possible to calculate, now: 00026 // - residuals 00027 // - vertex estimations obtained by back extrapolations of FTPC tracks 00028 // Chi2 was fixed. 00029 // Many additional minor (and major) changes. 00030 // 00031 // Revision 1.8 2002/03/15 10:04:41 oldi 00032 // Adjust eta segments not only to z-position of vertex but to x,y as well. 00033 // Avoid tracking if vertex position is outside of the inner radius of the Ftpc. 00034 // 00035 // Revision 1.7 2001/07/12 13:05:03 oldi 00036 // QA histogram of FTPC vertex estimation is generated. 00037 // FTPC vertex estimation is stored as pre vertex (id = 301) in any case, now. 00038 // 00039 // Revision 1.6 2001/01/25 15:22:43 oldi 00040 // Review of the complete code. 00041 // Fix of several bugs which caused memory leaks: 00042 // - Tracks were not allocated properly. 00043 // - Tracks (especially split tracks) were not deleted properly. 00044 // - TClonesArray seems to have a problem (it could be that I used it in a 00045 // wrong way). I changed all occurences to TObjArray which makes the 00046 // program slightly slower but much more save (in terms of memory usage). 00047 // Speed up of HandleSplitTracks() which is now 12.5 times faster than before. 00048 // Cleanup. 00049 // 00050 // Revision 1.5 2000/11/10 18:39:25 oldi 00051 // Changes due to replacement of StThreeVector by TVector3. 00052 // New constructor added to find the main vertex with given point array. 00053 // 00054 // Revision 1.4 2000/07/18 21:22:17 oldi 00055 // Changes due to be able to find laser tracks. 00056 // Cleanup: - new functions in StFtpcConfMapper, StFtpcTrack, and StFtpcPoint 00057 // to bundle often called functions 00058 // - short functions inlined 00059 // - formulas of StFormulary made static 00060 // - avoid streaming of objects of unknown size 00061 // (removes the bunch of CINT warnings during compile time) 00062 // - two or three minor bugs cured 00063 // 00064 // Revision 1.3 2000/05/15 14:28:16 oldi 00065 // problem of preVertex solved: if no main vertex is found (z = NaN) StFtpcTrackMaker stops with kStWarn, 00066 // refitting procedure completed and included in StFtpcTrackMaker (commented), 00067 // new constructor of StFtpcVertex due to refitting procedure, 00068 // minor cosmetic changes 00069 // 00070 // Revision 1.2 2000/05/11 15:14:54 oldi 00071 // Changed class names *Hit.* due to already existing class StFtpcHit.cxx in StEvent 00072 // 00073 // Revision 1.1 2000/05/10 13:39:36 oldi 00074 // Initial version of StFtpcTrackMaker 00075 // 00076 00078 // // 00079 // StFtpcVertex class - representation of the main vertex one // 00080 // // 00082 00083 #ifndef STAR_StFtpcVertex 00084 #define STAR_StFtpcVertex 00085 00086 #include <Stiostream.h> 00087 #include "TObject.h" 00088 #include "TObjArray.h" 00089 #include "TH1.h" 00090 #include "TMath.h" 00091 #include "TVector3.h" 00092 #include "St_DataSet.h" 00093 00094 class StVertex; 00095 00096 class StFtpcVertex : public TObject { 00097 00098 private: 00099 00100 TVector3 mCoord; // coordinates of vertex 00101 TVector3 mError; // errors on coordinates 00102 Int_t mIFlag; // flag to indicate vertex state 00103 Int_t mId; // vertex identification number 00104 00105 public: 00106 00107 StFtpcVertex(); // default constructor 00108 StFtpcVertex(TObjArray *hits, TH1F *vtx_pos = 0); // constructor from point array 00109 StFtpcVertex(St_DataSet *const geant); // constructor from geant 00110 StFtpcVertex(StVertex *vertex); // constructor from StPrimaryVertex 00111 StFtpcVertex(TObjArray *tracks, StFtpcVertex *vertex, Char_t hemisphere); // constructor form track array 00112 StFtpcVertex(Double_t pos[6], Int_t iFlag = 0, Int_t id = 0); // constructor from array of doubles 00113 StFtpcVertex(Double_t pos[3], Double_t err[3], 00114 Int_t iFlag = 0, Int_t id = 0); // constructor from arrays of doubles (with errors) 00115 StFtpcVertex(Double_t x, Double_t y, Double_t z, 00116 Double_t x_err, Double_t y_err, Double_t z_err, 00117 Int_t iFlag = 0, Int_t id = 0); // constructor from doubles with errors 00118 StFtpcVertex(const StFtpcVertex &vertex); // Copy constructor 00119 virtual ~StFtpcVertex(); // destructor 00120 00121 // getter 00122 Double_t GetX() const { return mCoord.X(); } 00123 Double_t GetY() const { return mCoord.Y(); } 00124 Double_t GetZ() const { return mCoord.Z(); } 00125 Double_t GetAbsZ() const { return TMath::Abs(mCoord.Z()); } 00126 Double_t GetXerr() const { return mError.X(); } 00127 Double_t GetYerr() const { return mError.Y(); } 00128 Double_t GetZerr() const { return mError.Z(); } 00129 Double_t GetRadius2() const { return TMath::Sqrt(GetX()*GetX() + GetY()*GetY()); } 00130 Double_t GetRadius3() const { return mCoord.Mag(); } 00131 TVector3 GetCoord() const { return mCoord; } 00132 TVector3 GetError() const { return mError; } 00133 Int_t GetIFlag() const { return mIFlag; } 00134 Int_t GetId() const { return mId; } 00135 00136 // setter 00137 void SetX(Double_t f) { mCoord.SetX(f); } 00138 void SetY(Double_t f) { mCoord.SetY(f); } 00139 void SetZ(Double_t f) { mCoord.SetZ(f); } 00140 void SetXerr(Double_t f) { mError.SetX(f); } 00141 void SetYerr(Double_t f) { mError.SetY(f); } 00142 void SetZerr(Double_t f) { mError.SetZ(f); } 00143 void SetIFlag(Int_t f) { mIFlag = f; } 00144 void SetId(Int_t f) { mId = f; } 00145 00146 void CheckXerr() { if (isnan(mError.x())) mError.SetX(0.); } 00147 void CheckYerr() { if (isnan(mError.y())) mError.SetY(0.); } 00148 void CheckZerr() { if (isnan(mError.z())) mError.SetZ(0.); } 00149 void CheckErr() { CheckXerr(); CheckYerr(); CheckZerr(); } 00150 Bool_t CoordIsNan() { return (Bool_t)(isnan(GetX()) || isnan(GetY()) || isnan(GetZ())); } 00151 Int_t CheckVertex(); 00152 00153 StFtpcVertex& operator=(const StFtpcVertex &vertex); // Assignment operator 00154 00155 ClassDef(StFtpcVertex, 1) //Ftpc vertex class 00156 }; 00157 00158 ostream& operator<< (ostream& s, const StFtpcVertex &vertex); // cout 00159 00160 #endif 00161
1.5.9