00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00116
00117
00118
00120
00121 #ifndef STAR_StFtpcTrack
00122 #define STAR_StFtpcTrack
00123
00124 #include "TObjArray.h"
00125 #include "TVector3.h"
00126
00127 #include "StPhysicalHelix.hh"
00128 #include "StThreeVector.hh"
00129 #include "StDetectorId.h"
00130
00131 #include "MIntArray.h"
00132 #include "StFtpcPoint.hh"
00133 #include "StFtpcVertex.hh"
00134 #include "StFtpcTrackingParams.hh"
00135
00136 #include "phys_constants.h"
00137
00138 class StFtpcPoint;
00139 class StFtpcVertex;
00140
00141 class StFtpcTrack : public StPhysicalHelix, public TObject {
00142
00143 private:
00144
00145
00146 TObjArray *mPoints;
00147 MIntArray *mPointNumbers;
00148 Int_t mRowsWithPoints;
00149
00150 Int_t mTrackNumber;
00151 Int_t mGlobTrackId;
00152 Double_t mChi2Circle;
00153 Double_t mChi2Length;
00154 Double_t mTrackLength;
00155 Double_t mRadius;
00156 Double_t mCenterX;
00157 Double_t mCenterY;
00158 Double_t mAlpha0;
00159 Int_t mPid;
00160 Short_t mNMax;
00161 Double_t mRFirst;
00162 Double_t mRLast;
00163 Double_t mAlphaFirst;
00164 Double_t mAlphaLast;
00165 Bool_t mFromMainVertex;
00166
00167
00168 TVector3 mP;
00169 TVector3 mV;
00170 TVector3 mL;
00171 Int_t mQ;
00172 Double_t mChiSq[2];
00173 Double_t mTheta;
00174 Double_t mDca;
00175
00176
00177 Double_t mdEdx;
00178 Int_t mNumdEdxHits;
00179
00180
00181 public:
00182
00183 StFtpcTrack();
00184 StFtpcTrack(Int_t tracknumber);
00185 virtual ~StFtpcTrack();
00186
00187 void SetDefaults();
00188 void AddPoint(StFtpcPoint *point);
00189 void AddForwardPoint(StFtpcPoint* point);
00190 void Fit();
00191 void Fit(StFtpcVertex *vertex, Double_t max_Dca, Bool_t primary_fit);
00192 void CalculateNMax();
00193 Double_t CalcDca(StFtpcVertex *vertex, Bool_t primaryFit);
00194 Double_t CalcAlpha0();
00195 void CalcAndSetAlpha0() { this->SetAlpha0(this->CalcAlpha0()); }
00196 void CalcResiduals(Bool_t primaryFit);
00197 void CalcGlobResiduals();
00198 void CalcPrimResiduals();
00199
00200
00201 void MomentumFit(StFtpcVertex *vertex = 0);
00202
00203 StThreeVector<Double_t> helixMomentum() const;
00204 StThreeVector<Double_t> momentum() const;
00205 StThreeVector<Double_t> localMomentum(Double_t s);
00206 Double_t chi2Rad() const;
00207 Double_t chi2Lin() const;
00208
00209
00210 TObjArray *GetHits() const { return mPoints; }
00211 MIntArray *GetHitNumbers() const { return mPointNumbers; }
00212 Int_t GetRowsWithPoints() const { return mRowsWithPoints; }
00213 Int_t GetTrackNumber() const { return mTrackNumber; }
00214 Int_t GetGlobalTrackId() const { return mGlobTrackId; }
00215 Double_t GetChi2Circle() const { return mChi2Circle; }
00216 Double_t GetChi2Length() const { return mChi2Length; }
00217 Double_t GetTrackLength() const { return mTrackLength; }
00218 Double_t GetRadius() const { return mRadius; }
00219 Double_t GetCenterX() const { return mCenterX; }
00220 Double_t GetCenterY() const { return mCenterY; }
00221 Double_t GetAlpha0() const { return mAlpha0; }
00222 Double_t GetPid() const { return mPid; }
00223 Short_t GetNMax() const { return mNMax; }
00224 Double_t GetRFirst() const { return mRFirst; }
00225 Double_t GetRLast() const { return mRLast; }
00226 Double_t GetMeanR() const { return TMath::Abs((mRFirst+mRLast)/2.); }
00227 Double_t GetAlphaFirst() const { return mAlphaFirst; }
00228 Double_t GetAlphaLast() const { return mAlphaLast; }
00229 Double_t GetMeanAlpha();
00230 Int_t GetNumberOfPoints() const { return mPoints->GetEntriesFast(); }
00231 Bool_t ComesFromMainVertex() const { return mFromMainVertex; }
00232 TVector3 GetMomentum() const { return mP; }
00233 Double_t GetPx() const { return mP.X(); }
00234 Double_t GetPy() const { return mP.Y(); }
00235 Double_t GetPz() const { return mP.Z(); }
00236 Double_t GetP() const;
00237 Double_t GetPt() const;
00238 Double_t GetPseudoRapidity() const;
00239 Double_t GetEta() const;
00240 Double_t GetRapidity() const;
00241 Int_t GetHemisphere() const;
00242 Int_t GetSector() const;
00243 StDetectorId GetDetectorId() const { return (GetHemisphere() == 1.) ? kFtpcWestId : kFtpcEastId; }
00244
00245
00246
00247 TVector3 GetVertex() const { return mV; }
00248 TVector3 GetFirstPointOnTrack()const { return mV; }
00249 TVector3 GetLastPointOnTrack() const { return mL; }
00250 Int_t GetCharge() const { return mQ; }
00251 Double_t const *GetChiSq() const { return mChiSq; }
00252 Double_t GetTheta() const { return mTheta; }
00253 Double_t GetDca() const { return mDca; }
00254
00255 Double_t GetdEdx() const { return mdEdx; }
00256 Int_t GetNumdEdxHits() const { return mNumdEdxHits; }
00257
00258
00259 void SetTrackNumber(Int_t number);
00260 void SetGlobalTrackId(Int_t f) { mGlobTrackId = f; }
00261 void SetRowsWithPoints(Int_t f) { mRowsWithPoints = f; }
00262
00263 void SetPx(Double_t f) { mP.SetX(f); }
00264 void SetPy(Double_t f) { mP.SetY(f); }
00265 void SetPz(Double_t f) { mP.SetZ(f); }
00266
00267 void SetdEdx(Double_t f) { mdEdx = f; }
00268 void SetNumdEdxHits(Int_t f) { mNumdEdxHits = f; }
00269
00270 void SetChi2Circle(Double_t f) { mChi2Circle = f; }
00271 void SetChi2Length(Double_t f) { mChi2Length = f; }
00272 void SetRadius(Double_t f) { mRadius = f; }
00273 void SetCenterX(Double_t f) { mCenterX = f; }
00274 void SetCenterY(Double_t f) { mCenterY = f; }
00275 void SetAlpha0(Double_t f) { mAlpha0 = f; }
00276 void SetCharge(Int_t f) { mQ = f; }
00277 void SetPid(Int_t f) { mPid = f; }
00278 void SetRLast(Double_t f) { mRLast = f; }
00279 void SetRFirst(Double_t f) { mRFirst = f; }
00280 void SetAlphaLast(Double_t f) { mAlphaLast = f; }
00281 void SetAlphaFirst(Double_t f) { mAlphaFirst = f; }
00282
00283 void SetDca(Double_t f) { mDca = f; }
00284 void SetNMax(Short_t f) { mNMax = f; }
00285 void ComesFromMainVertex(Bool_t f) { mFromMainVertex = f; }
00286
00287 void SetProperties(Bool_t fUsage, Int_t mTrackNumber);
00288 void SetPointDependencies();
00289
00290 protected:
00291
00292 Int_t CircleFit(Double_t x[],Double_t y[], Double_t xw[], Double_t yw[], Int_t num);
00293 void LineFit(Double_t *x, Double_t *y, Double_t *z, Double_t *xw, Double_t *yw, Int_t num);
00294
00295 StThreeVector<Double_t> mHelixMomentum;
00296 StThreeVector<Double_t> mFullMomentum;
00297 StThreeVector<Double_t> mVertex;
00298 Double_t mXCenter, mYCenter, mFitRadius, mChi2Rad;
00299 Double_t mArcOffset, mArcSlope, mChi2Lin;
00300 Double_t mZField;
00301 Int_t mIterSteps;
00302 Int_t mVertexPointOffset;
00303
00304 ClassDef(StFtpcTrack, 1)
00305 };
00306
00307
00308
00309 #endif