]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONTrack.h
Adding FindPCBIndexByMotifPositionID method (Laurent)
[u/mrichter/AliRoot.git] / MUON / AliMUONTrack.h
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 "AliMUONTrackParam.h" // object belongs to the class
18 #include <TClonesArray.h>
19
20 class AliMUONHitForRec;
21 class AliMUONObjectPair;
22
23 class AliMUONTrack : public TObject 
24 {
25  public:
26   AliMUONTrack(); // Default constructor
27   AliMUONTrack(AliMUONObjectPair *segment); // Constructor from a segment
28   virtual ~AliMUONTrack(); // Destructor
29   AliMUONTrack (const AliMUONTrack& track); // copy constructor
30   AliMUONTrack& operator=(const AliMUONTrack& track); // assignment operator
31
32
33         /// return pointeur to track parameters at vertex
34   AliMUONTrackParam*         GetTrackParamAtVertex() {return &fTrackParamAtVertex;}
35         /// set track parameters at vertex
36   void                       SetTrackParamAtVertex(const AliMUONTrackParam* trackParam) {fTrackParamAtVertex = *trackParam;}
37
38         /// return array of track parameters at hit
39   TClonesArray*              GetTrackParamAtHit() const {return fTrackParamAtHit;}
40         /// reset array of track parameters at hit
41   void                       ResetTrackParamAtHit() { fTrackParamAtHit->Delete(); }
42   void                       AddTrackParamAtHit(const AliMUONTrackParam *trackParam, AliMUONHitForRec *hitForRec); 
43   void                       RemoveTrackParamAtHit(AliMUONTrackParam *trackParam);
44   void                       UpdateTrackParamAtHit();
45   void                       UpdateCovTrackParamAtHit();
46   
47         /// return array of hitForRec at hit
48   TClonesArray*              GetHitForRecAtHit() const {return fHitForRecAtHit;}
49         /// reset array of hitForRec at hit
50   void                       ResetHitForRecAtHit() { fHitForRecAtHit->Delete(); }
51   void                       AddHitForRecAtHit(const AliMUONHitForRec *hitForRec); 
52
53         /// return the number of hits attached to the track
54   Int_t                      GetNTrackHits() const {return fNTrackHits;}
55         /// set the number of hits attached to the track
56   void                       SetNTrackHits(Int_t nTrackHits) {fNTrackHits = nTrackHits;}
57
58         /// return kTrue if the vertex must be used to constrain the fit, kFalse if not
59   Bool_t                     GetFitWithVertex() const {return fFitWithVertex;}
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
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);
74
75         /// return the minimum value of the function minimized by the fit
76   Double_t                   GetFitFMin() const {return fGlobalChi2;}
77         /// set the minimum value of the function minimized by the fit
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   
85         /// return 1,2,3 if track matches with trigger track, 0 if not
86   Int_t                      GetMatchTrigger(void) const {return fMatchTrigger;}
87   /// returns the local trigger number corresponding to the trigger track 
88   Int_t                      GetLoTrgNum(void) const {return floTrgNum;}
89         /// set the flag telling whether track matches with trigger track or not
90    void                      SetMatchTrigger(Int_t matchTrigger) {fMatchTrigger = matchTrigger;}
91    /// set the local trigger number corresponding to the trigger track
92    void                      SetLoTrgNum(Int_t loTrgNum) {floTrgNum = loTrgNum;}
93         /// return the chi2 of trigger/track matching 
94   Double_t                   GetChi2MatchTrigger(void) const {return fChi2MatchTrigger;}
95         /// set the chi2 of trigger/track matching 
96   void                       SetChi2MatchTrigger(Double_t chi2MatchTrigger) {fChi2MatchTrigger = chi2MatchTrigger;}
97
98   Int_t                      HitsInCommon(AliMUONTrack* track) const;
99
100   Double_t                   GetNormalizedChi2() const;
101
102   Bool_t*                    CompatibleTrack(AliMUONTrack* track, Double_t sigma2Cut) const; // return array of compatible chamber
103   
104         /// return track number in TrackRefs
105   Int_t                      GetTrackID() const {return fTrackID;}
106         /// set track number in TrackRefs
107   void                       SetTrackID(Int_t trackID) {fTrackID = trackID;}
108
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
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;              }
118   /// number of triggering circuit
119   Int_t LoCircuit(void) const { return fLocalTrigger & 0xFF;       }
120   /// x-strip local trigger 
121   Int_t LoStripX(void) const  { return fLocalTrigger >>  8 & 0x1F; }
122   /// y-strip local trigger 
123   Int_t LoStripY(void) const  { return fLocalTrigger >> 13 & 0x0F; }
124   /// deviation local trigger 
125   Int_t LoDev(void)    const  { return fLocalTrigger >> 17 & 0x1F; }
126   /// low pt decision local trigger 
127   Int_t LoLpt(void)    const  { return fLocalTrigger >> 22 & 0x03; }
128   /// high pt decision local trigger 
129   Int_t LoHpt(void)    const  { return fLocalTrigger >> 24 & 0x03; }
130
131   void                       RecursiveDump(void) const; // Recursive dump (with track hits)
132
133   virtual void               Print(Option_t* opt="") const;
134
135   virtual void Clear(Option_t* opt="");
136
137
138  private:
139  
140   AliMUONTrackParam fTrackParamAtVertex; //!< Track parameters at vertex
141   TClonesArray *fTrackParamAtHit; ///< Track parameters at hit
142   TClonesArray *fHitForRecAtHit; ///< Cluster parameters at hit
143   Int_t fNTrackHits; ///< Number of hits attached to the track
144   
145   Bool_t fFitWithVertex; //!< kTRUE if using the vertex to constrain the fit, kFALSE if not
146   AliMUONHitForRec *fVertex; //!< Vertex used during the tracking procedure if required
147   
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   
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
163   Int_t floTrgNum; ///< the number of the corresponding loTrg, -1 if no matching
164   Double_t fChi2MatchTrigger; ///< chi2 of trigger/track matching 
165   
166   Int_t fTrackID; ///< track ID = track number in TrackRefs
167   UShort_t fHitsPatternInTrigCh; ///< Word containing info on the hits left in trigger chambers
168
169   Int_t fLocalTrigger;    ///< packed local trigger information
170   
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
178 };
179         
180 #endif