]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITStrackerMI.h
Progress with factorization of the reconstruction in the ITS (AliITStrackerMI):
[u/mrichter/AliRoot.git] / ITS / AliITStrackerMI.h
index 4fcaa07cfb75e65e5954bbe958d9dadd7cd50fc1..2e5f09e7d50c5cd35f3de0e6556e54e073dd7ae1 100644 (file)
@@ -3,7 +3,6 @@
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
 
-/* $Id$ */
 
 //-------------------------------------------------------------------------
 //                          ITS tracker
@@ -13,9 +12,7 @@
 
 class TTree;
 class TTreeSRedirector;
-class AliESD;
-class AliHelix;
-class AliITSgeom;
+class AliESDEvent;
 
 #include <TObjArray.h>
 #include "AliITSRecPoint.h"
@@ -25,9 +22,9 @@ class AliITSgeom;
 //-------------------------------------------------------------------------
 class AliITStrackerMI : public AliTracker {
 public:
-  AliITStrackerMI():AliTracker(){}
-  AliITStrackerMI(const AliITSgeom *geom);
-  ~AliITStrackerMI();
+  AliITStrackerMI();
+  AliITStrackerMI(const Char_t *geom);
+  virtual ~AliITStrackerMI();
   AliCluster *GetCluster(Int_t index) const;
   virtual Bool_t GetTrackPoint(Int_t index, AliTrackPoint& p) const;
   AliITSRecPoint *GetClusterLayer(Int_t layn, Int_t ncl) const
@@ -36,9 +33,9 @@ public:
                         {return fgLayers[layn].GetNumberOfClusters();}
   Int_t LoadClusters(TTree *cf);
   void UnloadClusters();
-  Int_t Clusters2Tracks(AliESD *event);
-  Int_t PropagateBack(AliESD *event);
-  Int_t RefitInward(AliESD *event);
+  Int_t Clusters2Tracks(AliESDEvent *event);
+  Int_t PropagateBack(AliESDEvent *event);
+  Int_t RefitInward(AliESDEvent *event);
   Bool_t RefitAt(Double_t x, AliITStrackMI *seed, 
                 const AliITStrackMI *t, Bool_t extra=kFALSE);
   Bool_t RefitAt(Double_t x, AliITStrackMI *seed, const Int_t *clindex);
@@ -56,9 +53,8 @@ public:
   Int_t UpdateMI(AliITStrackMI* track, const AliITSRecPoint* cl,Double_t chi2,Int_t layer) const;
   class AliITSdetector { 
   public:
-    AliITSdetector(){}
-    AliITSdetector(Double_t r,Double_t phi) {fR=r; fPhi=phi; fSinPhi = TMath::Sin(phi); fCosPhi = TMath::Cos(phi);
-    fYmin=10000;fYmax=-1000; fZmin=10000;fZmax=-1000;}
+    AliITSdetector():fR(0),fPhi(0),fSinPhi(0),fCosPhi(0),fYmin(0),fYmax(0),fZmin(0),fZmax(0){}
+    AliITSdetector(Double_t r,Double_t phi):fR(r),fPhi(phi),fSinPhi(TMath::Sin(phi)),fCosPhi(TMath::Cos(phi)),fYmin(10000),fYmax(-1000),fZmin(10000),fZmax(-1000) {}
     inline void GetGlobalXYZ( const AliITSRecPoint *cl, Double_t xyz[3]) const;
     Double_t GetR()   const {return fR;}
     Double_t GetPhi() const {return fPhi;}
@@ -82,7 +78,6 @@ public:
   };
 
   class AliITSlayer {
-    friend class AliITStrackerMI;
   public:
     AliITSlayer();
     AliITSlayer(Double_t r, Double_t p, Double_t z, Int_t nl, Int_t nd);
@@ -98,7 +93,7 @@ public:
     Double_t GetR() const {return fR;}
     Int_t FindClusterIndex(Float_t z) const;
     AliITSRecPoint *GetCluster(Int_t i) const {return i<fN? fClusters[i]:0;} 
-    Float_t         *GetWeight(Int_t i)  {return i<fN ?&fClusterWeight[i]:0;}
+    Float_t         *GetWeight(Int_t i) {return i<fN ?&fClusterWeight[i]:0;}
     AliITSdetector &GetDetector(Int_t n) const { return fDetectors[n]; }
     Int_t FindDetectorIndex(Double_t phi, Double_t z) const;
     Double_t GetThickness(Double_t y, Double_t z, Double_t &x0) const;
@@ -110,9 +105,13 @@ public:
     void  SetSkip(Int_t skip){fSkip=skip;}
     void IncAccepted(){fAccepted++;}
     Int_t GetAccepted() const {return fAccepted;}    
+    Int_t GetClusterTracks(Int_t i, Int_t j) const {return fClusterTracks[i][j];}
+    void SetClusterTracks(Int_t i, Int_t j, Int_t c) {fClusterTracks[i][j]=c;}
   protected:
-    AliITSlayer(const AliITSlayer& /*layer*/);
-    AliITSlayer & operator=(const AliITSlayer& /*layer*/);
+    AliITSlayer(const AliITSlayer& layer);
+    AliITSlayer & operator=(const AliITSlayer& layer){
+      this->~AliITSlayer();new(this) AliITSlayer(layer);
+      return *this;}
     Double_t fR;                // mean radius of this layer
     Double_t fPhiOffset;        // offset of the first detector in Phi
     Int_t fNladders;            // number of ladders
@@ -173,9 +172,9 @@ public:
 
 protected:
   Int_t GetNearestLayer(const Double_t *xr) const;  //get nearest upper layer close to the point xr
-  void FindV02(AliESD *event);  //try to find V0
-  void RefitV02(AliESD *event);  //try to refit  V0's
-  void UpdateTPCV0(AliESD *event);  //try to update, or reject TPC  V0s
+  void FindV02(AliESDEvent *event);  //try to find V0
+  void RefitV02(AliESDEvent *event);  //try to refit  V0's
+  void UpdateTPCV0(AliESDEvent *event);  //try to update, or reject TPC  V0s
   void CookLabel(AliKalmanTrack *t,Float_t wrong) const;
   void CookLabel(AliITStrackMI *t,Float_t wrong) const;
   Double_t GetEffectiveThickness(Double_t y, Double_t z) const;
@@ -206,12 +205,12 @@ protected:
   Float_t GetNumberOfSharedClusters(AliITStrackMI* track,Int_t id, Int_t list[6], AliITSRecPoint *clist[6]);
   Int_t GetOverlapTrack(AliITStrackMI *track, Int_t trackID, Int_t &shared, Int_t clusterlist[6], Int_t overlist[6]);
   AliITStrackMI * GetBest2Tracks(Int_t trackID1, Int_t treackID2, Float_t th0, Float_t th1);
-  Float_t  * GetErrY(Int_t trackindex) const {return &fCoeficients[trackindex*48];}
-  Float_t  * GetErrZ(Int_t trackindex) const {return &fCoeficients[trackindex*48+12];}
-  Float_t  * GetNy(Int_t trackindex) const {return &fCoeficients[trackindex*48+24];}
-  Float_t  * GetNz(Int_t trackindex) const {return &fCoeficients[trackindex*48+36];}
+  Float_t  * GetErrY(Int_t trackindex) const {return &fCoefficients[trackindex*48];}
+  Float_t  * GetErrZ(Int_t trackindex) const {return &fCoefficients[trackindex*48+12];}
+  Float_t  * GetNy(Int_t trackindex) const {return &fCoefficients[trackindex*48+24];}
+  Float_t  * GetNz(Int_t trackindex) const {return &fCoefficients[trackindex*48+36];}
   void       SignDeltas( TObjArray *ClusterArray, Float_t zv);
-  void MakeCoeficients(Int_t ntracks);
+  void MakeCoefficients(Int_t ntracks);
   void UpdateESDtrack(AliITStrackMI* track, ULong_t flags) const;
   Int_t fI;                              // index of the current layer
   static AliITSlayer fgLayers[kMaxLayer];// ITS layers
@@ -228,13 +227,15 @@ protected:
   Bool_t fAfterV0;                       //indicates V0 founded
   Int_t fLayersNotToSkip[kMaxLayer];     // layer masks
   Int_t fLastLayerToTrackTo;             // the innermost layer to track to
-  Float_t * fCoeficients;                //! working array with errors and mean cluser shape
-  AliESD  * fEsd;                        //! pointer to the ESD event
+  Float_t * fCoefficients;                //! working array with errors and mean cluster shape
+  AliESDEvent  * fEsd;                   //! pointer to the ESD event
+  Double_t fSPDdetzcentre[4];            // centres of SPD modules in z
+  Bool_t fUseTGeo;                       // use TGeo to get material budget
   TTreeSRedirector *fDebugStreamer;     //!debug streamer
 private:
-  AliITStrackerMI(const AliITStrackerMI &);
-  AliITStrackerMI & operator=(const AliITStrackerMI &);
-  ClassDef(AliITStrackerMI,2)   //ITS tracker MI
+  AliITStrackerMI(const AliITStrackerMI &tracker);
+  AliITStrackerMI & operator=(const AliITStrackerMI &tracker);
+  ClassDef(AliITStrackerMI,3)   //ITS tracker MI
 };
 
 
@@ -292,11 +293,11 @@ inline Double_t AliITStrackerMI::NormalizedChi2(AliITStrackMI * track, Int_t lay
   //--------------------------------------------------------------------
   //get normalize chi2
   //--------------------------------------------------------------------
-  track->fNormChi2[layer] = 2.*track->fNSkipped+0.25*track->fNDeadZone+track->fdEdxMismatch+track->GetChi2()/
+  track->SetNormChi2(layer,2.*track->GetNSkipped()+0.25*track->GetNDeadZone()+track->GetdEdxMismatch()+track->GetChi2()/
   //track->fNormChi2[layer] = 2.*track->fNSkipped+0.25*track->fNDeadZone+track->fdEdxMismatch+track->fChi22/
-    TMath::Max(double(track->GetNumberOfClusters()-track->fNSkipped),
-              1./(1.+track->fNSkipped));
-  return track->fNormChi2[layer];
+    TMath::Max(double(track->GetNumberOfClusters()-track->GetNSkipped()),
+              1./(1.+track->GetNSkipped())));
+  return track->GetNormChi2(layer);
 }
 inline void  AliITStrackerMI::AliITSdetector::GetGlobalXYZ(const AliITSRecPoint *cl, Double_t xyz[3]) const
 {