Improving cluster visualization (Sacha)
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackK.h
CommitLineData
83dbc640 1#ifndef ALIMUONTRACKK_H
2#define ALIMUONTRACKK_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
30178c30 6/*$Id$*/
7// Revision of includes 07/05/2004
8
692de412 9/// \ingroup rec
10/// \class AliMUONTrack
11/// \brief Kalman track in MUON arm of ALICE
12
30178c30 13#include <TObject.h>
b035a148 14#include "AliMUONTrack.h" //AZ
30178c30 15
b035a148 16class TArrayD;
83dbc640 17class TMatrixD;
29f1b13a 18class AliMUONTrackReconstructor;
83dbc640 19class TClonesArray;
30178c30 20class TObjArray;
83dbc640 21class AliMUONSegment;
22class AliMUON;
23class AliMUONHitForRec;
24
b035a148 25//AZ class AliMUONTrackK : public TObject {
26class AliMUONTrackK : public AliMUONTrack {
83dbc640 27
28 public:
29
30 AliMUONTrackK(); // Default constructor
31 virtual ~AliMUONTrackK(); // Destructor
83dbc640 32
29f1b13a 33 //AliMUONTrackK(const AliMUONTrackReconstructor *TrackReconstructor, const AliMUONHitForRec *hitForRec); // Constructor
34 AliMUONTrackK(AliMUONTrackReconstructor *TrackReconstructor, TClonesArray *hitForRec); // Constructor
83dbc640 35 AliMUONTrackK(AliMUONSegment *segment); // Constructor from a segment
36
37 // Pointer to hits on track
38 TObjArray* GetHitOnTrack(void) const {return fTrackHitsPtr;} // ptr. to hits on track
39 Int_t GetNTrackHits(void) const {return fNTrackHits;} // hits on track
40 Double_t GetTrackQuality(void) const {return fChi2;} // track quality
41 TMatrixD* GetTrackParameters(void) const {return fTrackPar;} // track parameters
42 Double_t GetZ(void) const {return fPosition;} // Z-coordinate of track
43 TMatrixD* GetCovariance(void) const {return fCovariance;} // covariance matrix
44 Int_t GetTrackDir(void) const {return fTrackDir;} // get track propagation direction
45 void SetTrackDir(Int_t iDir) {fTrackDir = iDir;} // set track propagation direction
46 Bool_t GetBPFlag(void) const {return fBPFlag;} // get backpropagation flag
47 void SetBPFlag(Bool_t BPFlag) {fBPFlag = BPFlag;} // set backpropagation flag
48 Int_t GetRecover(void) const {return fRecover;} // return recover flag
49 void SetRecover(Int_t iRecover) {fRecover = iRecover;} // set recover flag
50 AliMUONSegment* GetStartSegment(void) const {return fStartSegment;} // return seed segment
51 Bool_t KalmanFilter(Int_t ichamBeg, Int_t ichamEnd, Bool_t Back, Double_t zDipole1, Double_t zDipole2); // Kalman filter
52 void StartBack(void); // start backpropagator
53 void SetTrackQuality(Int_t iChi2); // compute track quality or Chi2
30178c30 54 Bool_t KeepTrack(AliMUONTrackK* track0) const; // keep or discard track
83dbc640 55 void Kill(void); // kill track candidate
56 void Branson(void); // Branson correction
57 void GoToZ(Double_t zEnd); // propagate track to given Z
b035a148 58 void GoToVertex(Int_t iflag); // propagate track to the vertex
59 Bool_t Smooth(void); // apply smoother
60 Double_t GetChi2PerPoint(Int_t iPoint) const; // return Chi2 at point
61 void Print(FILE *lun) const; // print track information
337c9041 62 void Print(const char* /*opt*/) const {return;} // print track information
b035a148 63 AliMUONHitForRec* GetHitLastOk(void); // get hit before the skipped one
64 Int_t GetStation0(void); // return seed station number
65 Int_t DebugLevel(void) const {return fgDebug;} // return debug level
66 void SetDebugLevel(Int_t iDebug) {fgDebug = iDebug;} // set debug level
67 void FillMUONTrack(void); // set track parameters as for AliMUONTrack
68 void SetTrackParam(AliMUONTrackParam *trackParam, TMatrixD *par, Double_t z); // fill AliMUONTrackParam object
83dbc640 69
70 // What is necessary for sorting TClonesArray's
71 Bool_t IsSortable() const { return kTRUE; }
72 Int_t Compare(const TObject* trackK) const; // "Compare" function for sorting
73
74
75
76 protected:
77
30178c30 78 AliMUONTrackK (const AliMUONTrackK& source); // copy constructor
79 AliMUONTrackK& operator=(const AliMUONTrackK& source); // assignment operator
80
83dbc640 81 private:
82
b035a148 83 static Int_t fgDebug; // debug level
83dbc640 84 static Int_t fgNOfPoints; // number of points in event
85 static AliMUON *fgMUON; // pointer to MUON module
29f1b13a 86 static AliMUONTrackReconstructor *fgTrackReconstructor; // pointer to event reconstructor
83dbc640 87 static TClonesArray *fgHitForRec; // pointer to hits
88
89 AliMUONSegment *fStartSegment; // seed segment
90 Double_t fPosition; // Z-coordinate of track
91 Double_t fPositionNew; //! Z-coordinate of track
92 Double_t fChi2; // Chi2 of track
93 TObjArray *fTrackHitsPtr; // pointer to hits on track
94 Int_t fNTrackHits; // number of points on track
95 Int_t fTrackDir; // track direction (+(-) towards high (low) z)
96 Bool_t fBPFlag; // backpropagation flag (TRUE if backpropagation)
97 Int_t fRecover; // recover flag (!=0 if recovery procedure was applied)
98 AliMUONHitForRec *fSkipHit; // hit to skip during recovery procedure
99
100 TMatrixD *fTrackPar; // track parameters
101 TMatrixD *fTrackParNew; //! track parameters
102 TMatrixD *fCovariance; // covariance matrix
103 TMatrixD *fWeight; //! weight matrix (inverse of covariance)
104
b035a148 105 // For smoother
106 TObjArray *fParExtrap; //! extrapolated track parameters
107 TObjArray *fParFilter; //! filtered track parameters
108 TObjArray *fParSmooth; //! smoothed track parameters
109
110 TObjArray *fCovExtrap; //! extrapolated covariance matrices
111 TObjArray *fCovFilter; //! filtered covariance matrices
112
113 TObjArray *fJacob; //! Jacobian matrices
114 Int_t fNSteps; //!
115 TArrayD *fSteps; //!
116 TArrayD *fChi2Array; //!
117 TArrayD *fChi2Smooth; //!
118
83dbc640 119 // Functions
120
121 void EvalCovariance(Double_t dZ);
122 void ParPropagation(Double_t zEnd);
b035a148 123 void WeightPropagation(Double_t zEnd, Bool_t smooth);
83dbc640 124 void MSThin(Int_t sign);
125 void MSLine(Double_t dZ, Double_t X0);
126 Bool_t FindPoint(Int_t ichamb, Double_t zEnd, Int_t currIndx, Int_t iFB, AliMUONHitForRec *&hitAdd);
127 void TryPoint(TMatrixD &point, const TMatrixD &pointWeight, TMatrixD &trackParTmp, Double_t &dChi2);
128 void SetGeantParam(Double_t *VGeant3, Int_t iFB);
129 void GetFromGeantParam(Double_t *VGeant3, Int_t iFB);
b035a148 130 Bool_t Recover(void);
131 void AddMatrices(AliMUONTrackK *trackK, Double_t dChi2, AliMUONHitForRec *hitAdd);
132 void CreateMatrix(TObjArray *objArray);
133 void RemoveMatrices(Double_t zEnd);
134 void RemoveMatrices(AliMUONTrackK* trackK);
135 void Outlier();
136 void SortHits(Int_t iflag, TObjArray *array);
137 void DropBranches(Int_t imax, TObjArray *hits);
138 void DropBranches(AliMUONSegment *segment);
139 Bool_t ExistDouble(AliMUONHitForRec *hit);
140 Bool_t ExistDouble(void);
83dbc640 141
343146bf 142 private:
143 // Some constants
144 static const Int_t fgkSize; // number of track parameters
145 static const Int_t fgkNSigma; //4; // acceptance window width in sigmas
b035a148 146 static const Double_t fgkChi2max; //25; // chi2 cut in smoother for outlier detection
343146bf 147 static const Int_t fgkTriesMax; // max number of attempts to find exact position during tracking
148 static const Double_t fgkEpsilon; // tracking precision (cm)
149
83dbc640 150 ClassDef(AliMUONTrackK,0) // Kalman track in MUON arm of ALICE
151 };
152#endif