Line data Source code
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$*/
7 : // Revision of includes 07/05/2004
8 :
9 : /// \ingroup rec
10 : /// \class AliMUONTrack
11 : /// \brief Reconstructed track in ALICE dimuon spectrometer
12 : ///
13 : ////////////////////////////////////////////////////
14 : /// Reconstructed track in ALICE dimuon spectrometer
15 : ////////////////////////////////////////////////////
16 :
17 : #include <TObjArray.h>
18 : #include <TMatrixD.h>
19 :
20 : class AliMUONVCluster;
21 : class AliMUONObjectPair;
22 : class AliMUONTrackParam;
23 :
24 : class AliMUONTrack : public TObject
25 : {
26 : public:
27 : AliMUONTrack(); // Default constructor
28 : AliMUONTrack(AliMUONObjectPair *segment, Double_t bendingVertexDispersion); // Constructor from a segment
29 : virtual ~AliMUONTrack(); // Destructor
30 : AliMUONTrack (const AliMUONTrack& track); // copy constructor
31 : AliMUONTrack& operator=(const AliMUONTrack& track); // assignment operator
32 :
33 : void Reset();
34 :
35 : TObjArray* GetTrackParamAtCluster() const;
36 : void AddTrackParamAtCluster(const AliMUONTrackParam &trackParam, AliMUONVCluster &cluster, Bool_t copy = kFALSE);
37 : void RemoveTrackParamAtCluster(AliMUONTrackParam *trackParam);
38 : Bool_t UpdateTrackParamAtCluster();
39 : Bool_t UpdateCovTrackParamAtCluster();
40 :
41 : Bool_t IsValid(UInt_t requestedStationMask, Bool_t request2ChInSameSt45 = kFALSE);
42 :
43 : void TagRemovableClusters(UInt_t requestedStationMask);
44 :
45 : /// return the number of clusters attached to the track
46 5616 : Int_t GetNClusters() const {return fTrackParamAtCluster ? fTrackParamAtCluster->GetEntriesFast() : 0;}
47 :
48 : /// return kTrue if the vertex must be used to constrain the fit, kFalse if not
49 0 : Bool_t FitWithVertex() const {return fFitWithVertex;}
50 : /// set the flag telling whether the vertex must be used to constrain the fit or not
51 0 : void FitWithVertex(Bool_t fitWithVertex) { fFitWithVertex = fitWithVertex; }
52 : /// return the vertex resolution square used during the tracking procedure
53 : void GetVertexErrXY2(Double_t &nonBendingErr2, Double_t &bendingErr2) const
54 0 : { nonBendingErr2 = fVertexErrXY2[0]; bendingErr2 = fVertexErrXY2[1]; }
55 : /// set the vertex resolution square used during the tracking procedure
56 : void SetVertexErrXY2(Double_t nonBendingErr2, Double_t bendingErr2)
57 0 : { fVertexErrXY2[0] = nonBendingErr2; fVertexErrXY2[1] = bendingErr2; }
58 :
59 : /// return kTrue if the multiple scattering must be accounted for in the fit, kFalse if not
60 0 : Bool_t FitWithMCS() const {return fFitWithMCS;}
61 : /// set the flag telling whether the multiple scattering must be accounted for in the fit or not
62 0 : void FitWithMCS(Bool_t fitWithMCS) {fFitWithMCS = fitWithMCS;}
63 :
64 : Bool_t ComputeClusterWeights(TMatrixD* mcsCovariances = 0);
65 : Bool_t ComputeLocalChi2(Bool_t accountForMCS);
66 : Double_t ComputeGlobalChi2(Bool_t accountForMCS);
67 :
68 : /// return the minimum value of the function minimized by the fit
69 632 : Double_t GetGlobalChi2() const {return fGlobalChi2;}
70 : /// set the minimum value of the function minimized by the fit
71 424 : void SetGlobalChi2(Double_t chi2) { fGlobalChi2 = chi2;}
72 :
73 : /// return kTRUE if the track has been improved
74 104 : Bool_t IsImproved() const {return fImproved;}
75 : /// set the flag telling whether the track has been improved or not
76 18 : void SetImproved(Bool_t improved) { fImproved = improved;}
77 :
78 : /// return 1,2,3 if track matches with trigger track, 0 if not
79 32 : Int_t GetMatchTrigger(void) const {return fMatchTrigger;}
80 : /// returns the local trigger number corresponding to the trigger track (obsolete)
81 0 : Int_t GetLoTrgNum(void) const {return LoCircuit();}
82 : /// set the flag telling whether track matches with trigger track or not
83 32 : void SetMatchTrigger(Int_t matchTrigger) {fMatchTrigger = matchTrigger;}
84 : /// return the chi2 of trigger/track matching
85 32 : Double_t GetChi2MatchTrigger(void) const {return fChi2MatchTrigger;}
86 : /// set the chi2 of trigger/track matching
87 32 : void SetChi2MatchTrigger(Double_t chi2MatchTrigger) {fChi2MatchTrigger = chi2MatchTrigger;}
88 :
89 : Int_t ClustersInCommon(AliMUONTrack* track, Int_t stMin = 0, Int_t stMax = 4) const;
90 :
91 : Int_t GetNDF() const;
92 : Double_t GetNormalizedChi2() const;
93 :
94 : Int_t FindCompatibleClusters(const AliMUONTrack &track, Double_t sigma2Cut, Bool_t compatibleCluster[10]) const;
95 : Bool_t Match(AliMUONTrack &track, Double_t sigma2Cut, Int_t &nMatchClusters) const;
96 :
97 : /// return pointer to track parameters at vertex (can be 0x0)
98 0 : AliMUONTrackParam* GetTrackParamAtVertex() const {return fTrackParamAtVertex;}
99 : void SetTrackParamAtVertex(const AliMUONTrackParam* trackParam);
100 :
101 : /// set word telling which trigger chambers where hit by track
102 32 : UShort_t GetHitsPatternInTrigCh() const {return fHitsPatternInTrigCh;}
103 : /// set word telling which trigger chambers where hit by track
104 24 : void SetHitsPatternInTrigCh(UShort_t hitsPatternInTrigCh) {fHitsPatternInTrigCh = hitsPatternInTrigCh;}
105 : /// set word telling which trigger chambers where hit by track (from tracker track extrapolation)
106 32 : UInt_t GetHitsPatternInTrigChTrk() const {return fHitsPatternInTrigChTrk;}
107 : /// set word telling which trigger chambers where hit by track (from tracker track extrapolation)
108 32 : void SetHitsPatternInTrigChTrk(UInt_t hitsPatternInTrigChTrk) {fHitsPatternInTrigChTrk = hitsPatternInTrigChTrk;}
109 :
110 : /// set local trigger information for the matched trigger track
111 : void SetLocalTrigger(Int_t loCirc, Int_t loStripX, Int_t loStripY, Int_t loDev, Int_t loLpt, Int_t loHpt, UChar_t respWithoutChamber=0);
112 : /// return local trigger information for the matched trigger track
113 36 : Int_t GetLocalTrigger(void) const { return fLocalTrigger; }
114 : /// number of triggering circuit
115 68 : Int_t LoCircuit(void) const { return fLocalTrigger & 0xFF; }
116 : /// x-strip local trigger
117 0 : Int_t LoStripX(void) const { return fLocalTrigger >> 8 & 0x1F; }
118 : /// y-strip local trigger
119 0 : Int_t LoStripY(void) const { return fLocalTrigger >> 13 & 0x0F; }
120 : /// deviation local trigger
121 0 : Int_t LoDev(void) const { return fLocalTrigger >> 17 & 0x1F; }
122 : /// low pt decision local trigger
123 0 : Int_t LoLpt(void) const { return fLocalTrigger >> 22 & 0x03; }
124 : /// high pt decision local trigger
125 0 : Int_t LoHpt(void) const { return fLocalTrigger >> 24 & 0x03; }
126 : /// Word stating if trigger would be fired without one chamber
127 0 : Int_t GetTriggerWithoutChamber(void) const { return fLocalTrigger >> 26 & 0xF; }
128 : /// Check if trigger would be fired without chamber (ich [0,3])
129 0 : Bool_t TriggerFiredWithoutChamber(Int_t ich) const { return GetTriggerWithoutChamber() >> (3 - ich) & 0x1; }
130 :
131 : void FindMCLabel();
132 : /// set the corresponding MC track number
133 0 : void SetMCLabel(Int_t label) {fTrackID = label;}
134 : /// return the corresponding MC track number
135 32 : Int_t GetMCLabel() const {return fTrackID;}
136 :
137 : void RecursiveDump(void) const; // Recursive dump (with associated clusters)
138 :
139 : virtual void Print(Option_t* opt="") const;
140 :
141 : virtual void Clear(Option_t* opt="");
142 :
143 : /// return the maximum chi2 above which the track can be considered as abnormal (due to extrapolation failure, ...)
144 796 : static Double_t MaxChi2() {return fgkMaxChi2;}
145 :
146 : /// set the flag which is kTRUE if that track shares cluster(s) with another
147 52 : void Connected(Bool_t flag = kTRUE) {fConnected = flag;}
148 : /// return the flag which is kTRUE if that track shares cluster(s) with another
149 100 : Bool_t IsConnected() const {return fConnected;}
150 :
151 :
152 : private:
153 :
154 : static const Double_t fgkMaxChi2; ///< maximum chi2 above which the track can be considered as abnormal
155 :
156 : mutable TObjArray* fTrackParamAtCluster; ///< Track parameters at cluster
157 :
158 : Bool_t fFitWithVertex; //!<! kTRUE if using the vertex to constrain the fit, kFALSE if not
159 : Double_t fVertexErrXY2[2]; //!<! Vertex resolution square used during the tracking procedure if required
160 :
161 : Bool_t fFitWithMCS; //!<! kTRUE if accounting for multiple scattering in the fit, kFALSE if not
162 :
163 : TMatrixD* fClusterWeightsNonBending; //!<! weights matrix, in non bending direction, of clusters attached to the track
164 : //!<! (accounting for multiple scattering and cluster resolution)
165 : TMatrixD* fClusterWeightsBending; //!<! weights matrix, in bending direction, of clusters attached to the track
166 : //!<! (accounting for multiple scattering and cluster resolution)
167 :
168 : Double_t fGlobalChi2; ///< Global chi2 of the track
169 :
170 : Bool_t fImproved; //!<! kTRUE if the track has been improved
171 :
172 : Int_t fMatchTrigger; ///< 0 track does not match trigger
173 : ///< 1 track match but does not pass pt cut
174 : ///< 2 track match Low pt cut
175 : ///< 3 track match High pt cut
176 : Double_t fChi2MatchTrigger; ///< chi2 of trigger/track matching
177 :
178 : Int_t fTrackID; ///< Point to the corresponding MC track
179 :
180 : AliMUONTrackParam* fTrackParamAtVertex; //!<! Track parameters at vertex
181 :
182 : UShort_t fHitsPatternInTrigCh; ///< Word containing info on the hits left in trigger chambers
183 : UInt_t fHitsPatternInTrigChTrk; ///< Word containing info on the hits left in trigger chambers (calculated from extrapolated tracker track)
184 :
185 : Int_t fLocalTrigger; ///< packed local trigger information
186 :
187 : Bool_t fConnected; ///< kTRUE if that track shares cluster(s) with another
188 :
189 : // methods
190 : Bool_t ComputeClusterWeights(TMatrixD& clusterWeightsNB, TMatrixD& clusterWeightsB,
191 : TMatrixD* mcsCovariances = 0, const AliMUONVCluster* discardedCluster = 0) const;
192 : void ComputeMCSCovariances(TMatrixD& mcsCovariances) const;
193 :
194 :
195 18 : ClassDef(AliMUONTrack, 11) // Reconstructed track in ALICE dimuon spectrometer
196 : };
197 :
198 : #endif
|