]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONTrack.h
Bug fix
[u/mrichter/AliRoot.git] / MUON / AliMUONTrack.h
CommitLineData
a9e2aefa 1#ifndef ALIMUONTRACK_H
2#define ALIMUONTRACK_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/*$Id$*/
30178c30 7// Revision of includes 07/05/2004
8
692de412 9/// \ingroup rec
10/// \class AliMUONTrack
11/// \brief Reconstructed track in ALICE dimuon spectrometer
12///
13////////////////////////////////////////////////////
14/// Reconstructed track in ALICE dimuon spectrometer
15////////////////////////////////////////////////////
3831f268 16
c1a185bf 17#include "AliMUONTrackParam.h" // object belongs to the class
ea94c18b 18#include <TClonesArray.h>
a9e2aefa 19
a9e2aefa 20class AliMUONHitForRec;
ea94c18b 21class AliMUONObjectPair;
a9e2aefa 22
30178c30 23class AliMUONTrack : public TObject
24{
a9e2aefa 25 public:
d837040f 26 AliMUONTrack(); // Default constructor
ea94c18b 27 AliMUONTrack(AliMUONObjectPair *segment); // Constructor from a segment
8429a5e4 28 virtual ~AliMUONTrack(); // Destructor
ea94c18b 29 AliMUONTrack (const AliMUONTrack& track); // copy constructor
30 AliMUONTrack& operator=(const AliMUONTrack& track); // assignment operator
a9e2aefa 31
a9e2aefa 32
2457f726 33 /// return pointeur to track parameters at vertex
ea94c18b 34 AliMUONTrackParam* GetTrackParamAtVertex() {return &fTrackParamAtVertex;}
2457f726 35 /// set track parameters at vertex
ea94c18b 36 void SetTrackParamAtVertex(const AliMUONTrackParam* trackParam) {fTrackParamAtVertex = *trackParam;}
de2cd600 37
2457f726 38 /// return array of track parameters at hit
ea94c18b 39 TClonesArray* GetTrackParamAtHit() const {return fTrackParamAtHit;}
2457f726 40 /// reset array of track parameters at hit
ea94c18b 41 void ResetTrackParamAtHit() { fTrackParamAtHit->Delete(); }
42 void AddTrackParamAtHit(const AliMUONTrackParam *trackParam, AliMUONHitForRec *hitForRec);
43 void RemoveTrackParamAtHit(AliMUONTrackParam *trackParam);
44 void UpdateTrackParamAtHit();
45 void UpdateCovTrackParamAtHit();
de2cd600 46
2457f726 47 /// return array of hitForRec at hit
ea94c18b 48 TClonesArray* GetHitForRecAtHit() const {return fHitForRecAtHit;}
2457f726 49 /// reset array of hitForRec at hit
ea94c18b 50 void ResetHitForRecAtHit() { fHitForRecAtHit->Delete(); }
6464217e 51 void AddHitForRecAtHit(const AliMUONHitForRec *hitForRec);
52
2457f726 53 /// return the number of hits attached to the track
ea94c18b 54 Int_t GetNTrackHits() const {return fNTrackHits;}
2457f726 55 /// set the number of hits attached to the track
6464217e 56 void SetNTrackHits(Int_t nTrackHits) {fNTrackHits = nTrackHits;}
de2cd600 57
208f139e 58 /// return kTrue if the vertex must be used to constrain the fit, kFalse if not
ea94c18b 59 Bool_t GetFitWithVertex() const {return fFitWithVertex;}
208f139e 60 /// set the flag telling whether the vertex must be used to constrain the fit or not
61 void SetFitWithVertex(Bool_t fitWithVertex) { fFitWithVertex = fitWithVertex; }
62 /// return the vertex used during the tracking procedure
ea94c18b 63 AliMUONHitForRec* GetVertex() const {return fVertex;}
64 void SetVertex(const AliMUONHitForRec* vertex);
65
66 /// return kTrue if the multiple scattering must be accounted for in the fit, kFalse if not
67 Bool_t GetFitWithMCS() const {return fFitWithMCS;}
68 /// set the flag telling whether the multiple scattering must be accounted for in the fit or not
69 void SetFitWithMCS(Bool_t fitWithMCS) {fFitWithMCS = fitWithMCS;}
70
71 Bool_t ComputeHitWeights(TMatrixD* mcsCovariances = 0);
72 Bool_t ComputeLocalChi2(Bool_t accountForMCS);
73 Double_t ComputeGlobalChi2(Bool_t accountForMCS);
208f139e 74
2457f726 75 /// return the minimum value of the function minimized by the fit
ea94c18b 76 Double_t GetFitFMin() const {return fGlobalChi2;}
2457f726 77 /// set the minimum value of the function minimized by the fit
ea94c18b 78 void SetFitFMin(Double_t chi2) { fGlobalChi2 = chi2;}
79
80 /// return kTRUE if the track has been improved
81 Bool_t IsImproved() const {return fImproved;}
82 /// set the flag telling whether the track has been improved or not
83 void SetImproved(Bool_t improved) { fImproved = improved;}
84
423b32ca 85 /// return 1,2,3 if track matches with trigger track, 0 if not
ea94c18b 86 Int_t GetMatchTrigger(void) const {return fMatchTrigger;}
c6ba19f7 87 /// returns the local trigger number corresponding to the trigger track
88 Int_t GetLoTrgNum(void) const {return floTrgNum;}
2457f726 89 /// set the flag telling whether track matches with trigger track or not
7771752e 90 void SetMatchTrigger(Int_t matchTrigger) {fMatchTrigger = matchTrigger;}
c6ba19f7 91 /// set the local trigger number corresponding to the trigger track
92 void SetLoTrgNum(Int_t loTrgNum) {floTrgNum = loTrgNum;}
2457f726 93 /// return the chi2 of trigger/track matching
6464217e 94 Double_t GetChi2MatchTrigger(void) const {return fChi2MatchTrigger;}
2457f726 95 /// set the chi2 of trigger/track matching
208f139e 96 void SetChi2MatchTrigger(Double_t chi2MatchTrigger) {fChi2MatchTrigger = chi2MatchTrigger;}
ea94c18b 97
208f139e 98 Int_t HitsInCommon(AliMUONTrack* track) const;
ea94c18b 99
100 Double_t GetNormalizedChi2() const;
101
208f139e 102 Bool_t* CompatibleTrack(AliMUONTrack* track, Double_t sigma2Cut) const; // return array of compatible chamber
b8dc484b 103
2457f726 104 /// return track number in TrackRefs
6464217e 105 Int_t GetTrackID() const {return fTrackID;}
2457f726 106 /// set track number in TrackRefs
6464217e 107 void SetTrackID(Int_t trackID) {fTrackID = trackID;}
108
7771752e 109 /// set word telling which trigger chambers where hit by track
110 UShort_t GetHitsPatternInTrigCh() const {return fHitsPatternInTrigCh;}
111 /// set word telling which trigger chambers where hit by track
112 void SetHitsPatternInTrigCh(UShort_t hitsPatternInTrigCh) {fHitsPatternInTrigCh = hitsPatternInTrigCh;}
113
423b32ca 114 /// set local trigger information for the matched trigger track
115 void SetLocalTrigger(Int_t loCirc, Int_t loStripX, Int_t loStripY, Int_t loDev, Int_t loLpt, Int_t loHpt);
116 /// return local trigger information for the matched trigger track
117 Int_t GetLocalTrigger(void) const { return fLocalTrigger; }
4a335550 118 /// number of triggering circuit
01413742 119 Int_t LoCircuit(void) const { return fLocalTrigger & 0xFF; }
4a335550 120 /// x-strip local trigger
423b32ca 121 Int_t LoStripX(void) const { return fLocalTrigger >> 8 & 0x1F; }
4a335550 122 /// y-strip local trigger
423b32ca 123 Int_t LoStripY(void) const { return fLocalTrigger >> 13 & 0x0F; }
4a335550 124 /// deviation local trigger
423b32ca 125 Int_t LoDev(void) const { return fLocalTrigger >> 17 & 0x1F; }
4a335550 126 /// low pt decision local trigger
423b32ca 127 Int_t LoLpt(void) const { return fLocalTrigger >> 22 & 0x03; }
4a335550 128 /// high pt decision local trigger
423b32ca 129 Int_t LoHpt(void) const { return fLocalTrigger >> 24 & 0x03; }
130
de2cd600 131 void RecursiveDump(void) const; // Recursive dump (with track hits)
6464217e 132
de2cd600 133 virtual void Print(Option_t* opt="") const;
a9e2aefa 134
d2b1e7bb 135 virtual void Clear(Option_t* opt="");
956019b6 136
ea94c18b 137
a9e2aefa 138 private:
ea94c18b 139
8cde4af5 140 AliMUONTrackParam fTrackParamAtVertex; //!< Track parameters at vertex
829425a5 141 TClonesArray *fTrackParamAtHit; ///< Track parameters at hit
142 TClonesArray *fHitForRecAtHit; ///< Cluster parameters at hit
2457f726 143 Int_t fNTrackHits; ///< Number of hits attached to the track
de2cd600 144
ea94c18b 145 Bool_t fFitWithVertex; //!< kTRUE if using the vertex to constrain the fit, kFALSE if not
208f139e 146 AliMUONHitForRec *fVertex; //!< Vertex used during the tracking procedure if required
147
ea94c18b 148 Bool_t fFitWithMCS; //!< kTRUE if accounting for multiple scattering in the fit, kFALSE if not
149
150 TMatrixD* fHitWeightsNonBending; //!< weights matrix, in non bending direction, of hits attached to the track
151 //!< (accounting for multiple scattering and hits resolution)
152 TMatrixD* fHitWeightsBending; //!< weights matrix, in bending direction, of hits attached to the track
153 //!< (accounting for multiple scattering and hits resolution)
154
155 Double_t fGlobalChi2; ///< Global chi2 of the track
156
157 Bool_t fImproved; //!< kTRUE if the track has been improved
158
423b32ca 159 Int_t fMatchTrigger; ///< 0 track does not match trigger
160 ///< 1 track match but does not pass pt cut
161 ///< 2 track match Low pt cut
162 ///< 3 track match High pt cut
c6ba19f7 163 Int_t floTrgNum; ///< the number of the corresponding loTrg, -1 if no matching
829425a5 164 Double_t fChi2MatchTrigger; ///< chi2 of trigger/track matching
de2cd600 165
829425a5 166 Int_t fTrackID; ///< track ID = track number in TrackRefs
7771752e 167 UShort_t fHitsPatternInTrigCh; ///< Word containing info on the hits left in trigger chambers
423b32ca 168
169 Int_t fLocalTrigger; ///< packed local trigger information
de2cd600 170
ea94c18b 171
172 // methods
173 Bool_t ComputeHitWeights(TMatrixD& hitWeightsNB, TMatrixD& hitWeightsB, TMatrixD* mcsCovariances = 0, AliMUONHitForRec* discardedHit = 0) const;
174 void ComputeMCSCovariances(TMatrixD& mcsCovariances) const;
175
176
177 ClassDef(AliMUONTrack, 7) // Reconstructed track in ALICE dimuon spectrometer
de2cd600 178};
a9e2aefa 179
180#endif