]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTrack.h
Coding conventions
[u/mrichter/AliRoot.git] / MUON / AliMUONTrack.h
index 4177be119ba80472aeb5b467e520d830575d9f5c..6b0d313164f32beb4d5f4da770c3e18383bcc8d5 100644 (file)
 ////////////////////////////////////////////////////
 
 #include <TClonesArray.h>
+#include <TMatrixD.h>
 
-#include "AliMUONTrackParam.h" // object belongs to the class
-#include "AliMUONHitForRec.h"  // object belongs to the class
-
-//const Int_t kMaxTrackingChamber=10;
-        // not used
-
-class TObjArray;
-class TVirtualFitter;
-class AliMUONTrackReconstructor;
-class AliMUONHitForRec;
-class AliMUONSegment;
+class AliMUONVCluster;
+class AliMUONObjectPair;
+class AliMUONTrackParam;
 
 class AliMUONTrack : public TObject 
 {
  public:
   AliMUONTrack(); // Default constructor
+  AliMUONTrack(AliMUONObjectPair *segment, Double_t bendingVertexDispersion); // Constructor from a segment
   virtual ~AliMUONTrack(); // Destructor
-  AliMUONTrack (const AliMUONTrack& AliMUONTrack); // copy constructor
-  AliMUONTrack& operator=(const AliMUONTrack& AliMUONTrack); // assignment operator
-
-  AliMUONTrack(AliMUONSegment* BegSegment, AliMUONSegment* EndSegment, AliMUONTrackReconstructor* TrackReconstructor); // Constructor from two Segment's
-  AliMUONTrack(AliMUONSegment* Segment, AliMUONHitForRec* HitForRec, AliMUONTrackReconstructor* TrackReconstructor); // Constructor from one Segment and one HitForRec
-  void Remove(void);
-
-  AliMUONTrackReconstructor* GetTrackReconstructor(void) const {return fTrackReconstructor;}
-  AliMUONTrackParam* GetTrackParamAtVertex(void) {return &fTrackParamAtVertex;}
-  void SetTrackParamAtVertex(void); // Set track parameters at vertex from last stations 4 & 5
-  void SetTrackParamAtVertex(AliMUONTrackParam* TrackParam) {fTrackParamAtVertex = *TrackParam;}
-  TClonesArray *GetTrackParamAtHit(void) const {return fTrackParamAtHit;}
-  TClonesArray *GetHitForRecAtHit(void) const {return fHitForRecAtHit;}
-  void ResetTrackParamAtHit(void) { fTrackParamAtHit->Delete(); }
-  void ResetHitForRecAtHit(void) { fHitForRecAtHit->Delete(); }
-  void AddTrackParamAtHit(const AliMUONTrackParam *trackParam); 
-  void AddHitForRecAtHit(const AliMUONHitForRec *hitForRec); 
-
-  TObjArray* GetTrackHitsPtr(void) const {return fTrackHitsPtr;}
-  Int_t GetNTrackHits(void) const {return fNTrackHits;}
-  void SetNTrackHits(Int_t nTrackHits) {fNTrackHits = nTrackHits;}
-  Int_t GetFitMCS(void) const {return fFitMCS;}
-  Int_t GetFitNParam(void) const {return fFitNParam;}
-  Int_t GetFitStart(void) const {return fFitStart;}
-  Double_t GetFitFMin(void) const {return fFitFMin;}
-  Bool_t GetMatchTrigger(void) const {return fMatchTrigger;}
+  AliMUONTrack (const AliMUONTrack& track); // copy constructor
+  AliMUONTrack& operator=(const AliMUONTrack& track); // assignment operator
+
+  void Reset();
+  
+  TClonesArray* GetTrackParamAtCluster() const;
+  void          AddTrackParamAtCluster(const AliMUONTrackParam &trackParam, AliMUONVCluster &cluster, Bool_t copy = kFALSE); 
+  void          RemoveTrackParamAtCluster(AliMUONTrackParam *trackParam);
+  void          UpdateTrackParamAtCluster();
+  void          UpdateCovTrackParamAtCluster();
+  
+  Bool_t IsValid(UInt_t requestedStationMask);
+  
+  void TagRemovableClusters(UInt_t requestedStationMask);
+  
+  /// return the number of clusters attached to the track
+  Int_t GetNClusters() const {return fTrackParamAtCluster ? fTrackParamAtCluster->GetEntriesFast() : 0;}
+
+  /// return kTrue if the vertex must be used to constrain the fit, kFalse if not
+  Bool_t FitWithVertex() const {return fFitWithVertex;}
+  /// set the flag telling whether the vertex must be used to constrain the fit or not
+  void   FitWithVertex(Bool_t fitWithVertex) { fFitWithVertex = fitWithVertex; }
+  /// return the vertex resolution square used during the tracking procedure
+  void   GetVertexErrXY2(Double_t &nonBendingErr2, Double_t &bendingErr2) const
+         { nonBendingErr2 = fVertexErrXY2[0]; bendingErr2 = fVertexErrXY2[1]; }
+  /// set the vertex resolution square used during the tracking procedure
+  void   SetVertexErrXY2(Double_t nonBendingErr2, Double_t bendingErr2)
+        { fVertexErrXY2[0] = nonBendingErr2; fVertexErrXY2[1] = bendingErr2; }
+
+  /// return kTrue if the multiple scattering must be accounted for in the fit, kFalse if not
+  Bool_t FitWithMCS() const {return fFitWithMCS;}
+  /// set the flag telling whether the multiple scattering must be accounted for in the fit or not
+  void   FitWithMCS(Bool_t fitWithMCS) {fFitWithMCS = fitWithMCS;}
+  
+  Bool_t   ComputeClusterWeights(TMatrixD* mcsCovariances = 0);
+  Bool_t   ComputeLocalChi2(Bool_t accountForMCS);
+  Double_t ComputeGlobalChi2(Bool_t accountForMCS);
+
+  /// return the minimum value of the function minimized by the fit
+  Double_t GetGlobalChi2() const {return fGlobalChi2;}
+  /// set the minimum value of the function minimized by the fit
+  void     SetGlobalChi2(Double_t chi2) { fGlobalChi2 = chi2;}
+  
+  /// return kTRUE if the track has been improved
+  Bool_t IsImproved() const {return fImproved;}
+  /// set the flag telling whether the track has been improved or not
+  void   SetImproved(Bool_t improved) { fImproved = improved;}
+  
+  /// return 1,2,3 if track matches with trigger track, 0 if not
+  Int_t    GetMatchTrigger(void) const {return fMatchTrigger;}
+  /// returns the local trigger number corresponding to the trigger track 
+  Int_t    GetLoTrgNum(void) const {return floTrgNum;}
+  /// set the flag telling whether track matches with trigger track or not
+  void    SetMatchTrigger(Int_t matchTrigger) {fMatchTrigger = matchTrigger;}
+  /// set the local trigger number corresponding to the trigger track
+  void    SetLoTrgNum(Int_t loTrgNum) {floTrgNum = loTrgNum;}
+  /// return the chi2 of trigger/track matching 
   Double_t GetChi2MatchTrigger(void) const {return fChi2MatchTrigger;}
-  void SetFitMCS(Int_t FitMCS);
-  void SetFitNParam(Int_t FitNParam);
-  void SetFitStart(Int_t FitStart);
-  void SetFitFMin(Double_t chi2) { fFitFMin = chi2; } // set Chi2
-
-  AliMUONTrackParam* GetTrackParamAtFirstHit(void) const;
-
-  void RecursiveDump(void) const; // Recursive dump (with track hits)
-  void Fit(); // Fit
-  void AddSegment(AliMUONSegment* Segment); // Add Segment
-  void AddHitForRec(AliMUONHitForRec* HitForRec); // Add HitForRec
-  void SetTrackParamAtHit(Int_t indexHit, AliMUONTrackParam *TrackParam) const;
-  Int_t HitsInCommon(AliMUONTrack* Track) const;
-  void MatchTriggerTrack(TClonesArray* TriggerTrackArray);
-  Bool_t* CompatibleTrack(AliMUONTrack* Track, Double_t Sigma2Cut) const; // return array of compatible chamber
+  /// set the chi2 of trigger/track matching 
+  void     SetChi2MatchTrigger(Double_t chi2MatchTrigger) {fChi2MatchTrigger = chi2MatchTrigger;}
+
+  Int_t ClustersInCommon(AliMUONTrack* track, Bool_t inSt345 = kFALSE) const;
+
+  Int_t    GetNDF() const;
+  Double_t GetNormalizedChi2() const;
+
+  Int_t CompatibleTrack(AliMUONTrack* track, Double_t sigma2Cut, Bool_t compatibleCluster[10]) const;
   
+  /// return track number in TrackRefs
   Int_t GetTrackID() const {return fTrackID;}
-  void SetTrackID(Int_t trackID) {fTrackID = trackID;}
+  /// set track number in TrackRefs
+  void  SetTrackID(Int_t trackID) {fTrackID = trackID;}
+
+  /// return pointer to track parameters at vertex (can be 0x0)
+  AliMUONTrackParam* GetTrackParamAtVertex() {return fTrackParamAtVertex;}
+  void               SetTrackParamAtVertex(const AliMUONTrackParam* trackParam);
+
+  /// set word telling which trigger chambers where hit by track
+  UShort_t GetHitsPatternInTrigCh() const {return fHitsPatternInTrigCh;}
+  /// set word telling which trigger chambers where hit by track
+  void     SetHitsPatternInTrigCh(UShort_t hitsPatternInTrigCh) {fHitsPatternInTrigCh = hitsPatternInTrigCh;}
+
+  /// set local trigger information for the matched trigger track
+  void  SetLocalTrigger(Int_t loCirc, Int_t loStripX, Int_t loStripY, Int_t loDev, Int_t loLpt, Int_t loHpt);
+  /// return local trigger information for the matched trigger track
+  Int_t GetLocalTrigger(void) const { return fLocalTrigger;        }
+  /// number of triggering circuit
+  Int_t LoCircuit(void) const { return fLocalTrigger & 0xFF;       }
+  /// x-strip local trigger 
+  Int_t LoStripX(void) const  { return fLocalTrigger >>  8 & 0x1F; }
+  /// y-strip local trigger 
+  Int_t LoStripY(void) const  { return fLocalTrigger >> 13 & 0x0F; }
+  /// deviation local trigger 
+  Int_t LoDev(void)    const  { return fLocalTrigger >> 17 & 0x1F; }
+  /// low pt decision local trigger 
+  Int_t LoLpt(void)    const  { return fLocalTrigger >> 22 & 0x03; }
+  /// high pt decision local trigger 
+  Int_t LoHpt(void)    const  { return fLocalTrigger >> 24 & 0x03; }
+
+  void RecursiveDump(void) const; // Recursive dump (with associated clusters)
+
+  virtual void Print(Option_t* opt="") const;
+
+  virtual void Clear(Option_t* opt="");
 
-  static TVirtualFitter* Fitter(void) {return fgFitter;}
 
- protected:
  private:
-  static TVirtualFitter* fgFitter; //!< Pointer to track fitter
-  AliMUONTrackReconstructor* fTrackReconstructor; //!< Pointer to TrackReconstructor
-  AliMUONTrackParam fTrackParamAtVertex; ///< Track parameters at vertex
-  TClonesArray *fTrackParamAtHit; ///< Track parameters at hit
-  TClonesArray *fHitForRecAtHit; ///< Cluster parameters at hit
-  TObjArray *fTrackHitsPtr; //!<  Pointer to array of pointers to TrackHit's
-  Int_t fNTrackHits; ///< Number of TrackHit's
-  Int_t fFitMCS; ///< 0(1) for fit without(with) multiple Coulomb scattering
-  Int_t fFitNParam; ///< 3(5) for fit with 3(5) parameters
-  Int_t fFitStart; ///< 0 or 1 for fit starting from parameters at vertex (0) or at first TrackHit(1)
-  Double_t fFitFMin; ///< minimum value of the function minimized by the fit
-  Bool_t fMatchTrigger; ///< 1 if track matches with trigger track, 0 if not
-  Double_t fChi2MatchTrigger; ///< chi2 of trigger/track matching 
  
+  mutable TClonesArray* fTrackParamAtCluster; ///< Track parameters at cluster
+  
+  Bool_t   fFitWithVertex;   //!< kTRUE if using the vertex to constrain the fit, kFALSE if not
+  Double_t fVertexErrXY2[2]; //!< Vertex resolution square used during the tracking procedure if required
+  
+  Bool_t fFitWithMCS; //!< kTRUE if accounting for multiple scattering in the fit, kFALSE if not
+  
+  TMatrixD* fClusterWeightsNonBending; //!< weights matrix, in non bending direction, of clusters attached to the track
+                                      //!< (accounting for multiple scattering and cluster resolution)
+  TMatrixD* fClusterWeightsBending;    //!< weights matrix, in bending direction, of clusters attached to the track
+                                      //!< (accounting for multiple scattering and cluster resolution)
+  
+  Double_t fGlobalChi2; ///< Global chi2 of the track
+  
+  Bool_t fImproved; //!< kTRUE if the track has been improved
+  
+  Int_t fMatchTrigger;  ///<  0 track does not match trigger
+                        ///<  1 track match but does not pass pt cut
+                        ///<  2 track match Low pt cut
+                        ///<  3 track match High pt cut
+  Int_t floTrgNum; ///< the number of the corresponding loTrg, -1 if no matching
+  Double_t fChi2MatchTrigger; ///< chi2 of trigger/track matching 
+  
   Int_t fTrackID; ///< track ID = track number in TrackRefs
+  
+  AliMUONTrackParam* fTrackParamAtVertex; //!< Track parameters at vertex
+  
+  UShort_t fHitsPatternInTrigCh; ///< Word containing info on the hits left in trigger chambers
 
-  ClassDef(AliMUONTrack, 2) // Reconstructed track in ALICE dimuon spectrometer
-    };
+  Int_t fLocalTrigger;    ///< packed local trigger information
+  
+  
+  // methods
+  Bool_t ComputeClusterWeights(TMatrixD& clusterWeightsNB, TMatrixD& clusterWeightsB,
+                              TMatrixD* mcsCovariances = 0, AliMUONVCluster* discardedCluster = 0) const;
+  void   ComputeMCSCovariances(TMatrixD& mcsCovariances) const;
+  
+  
+  ClassDef(AliMUONTrack, 8) // Reconstructed track in ALICE dimuon spectrometer
+};
        
 #endif