]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITStrackerMI.h
New version of the V0 finder (M.Ivanov)
[u/mrichter/AliRoot.git] / ITS / AliITStrackerMI.h
index 43b39b8e51e611bd57ff30585aee7590a7e4b6ae..b6f3d9ad79034cdd53883419a59cbf3ef82f208a 100644 (file)
@@ -5,45 +5,25 @@
 
 //-------------------------------------------------------------------------
 //                          ITS tracker
-//     reads AliITSclusterMI clusters and creates AliITStrackV2 tracks
-//           Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch 
+//     reads AliITSclusterMI clusters and creates AliITStrackMI tracks
+//           Origin: Marian Ivanov, CERN, Marian.Ivanov@cern.ch
 //-------------------------------------------------------------------------
 
 #include <TObjArray.h>
 
 #include "AliTracker.h"
-#include "AliITSrecoV2.h"
-#include "AliITStrackV2.h"
+#include "AliITStrackMI.h"
 #include "AliITSclusterV2.h"
+#include "AliV0vertex.h"
 
-class AliITSclusterV2;
 class AliESD;
 class AliITSgeom;
 class TTree;
 class AliHelix;
 class AliV0vertex;
+class AliESDV0MI;
 
-
-
-class AliITSRecV0Info: public TObject {
-public:
-  void Update(Float_t vertex[3], Float_t mass1, Float_t mass2);
-  Double_t       fDist1;    //info about closest distance according closest MC - linear DCA
-  Double_t       fDist2;    //info about closest distance parabolic DCA
-  Double_t       fInvMass;  //reconstructed invariant mass -
-  //
-  Double_t       fPdr[3];    //momentum at vertex daughter  - according approx at DCA
-  Double_t       fXr[3];     //rec. position according helix
-  //
-  Double_t       fPm[3];    //momentum at the vertex mother
-  Double_t       fAngle[3]; //three angles
-  Double_t       fRr;       // rec position of the vertex 
-  Int_t          fLab[2];   //MC label of the partecle 
-  Float_t        fPointAngleFi; //point angle fi
-  Float_t        fPointAngleTh; //point angle theta
-  Float_t        fPointAngle;   //point angle full
-  ClassDef(AliITSRecV0Info,1)  // container for  
-};
+class TTreeSRedirector;
 
 
 
@@ -53,6 +33,7 @@ class AliITStrackerMI : public AliTracker {
 public:
   AliITStrackerMI():AliTracker(){}
   AliITStrackerMI(const AliITSgeom *geom);
+  ~AliITStrackerMI();
   AliCluster *GetCluster(Int_t index) const;
   AliITSclusterV2 *GetClusterLayer(Int_t layn, Int_t ncl) const
                         {return fgLayers[layn].GetCluster(ncl);}
@@ -60,11 +41,10 @@ public:
                         {return fgLayers[layn].GetNumberOfClusters();}
   Int_t LoadClusters(TTree *cf);
   void UnloadClusters();
-  Int_t Clusters2Tracks(TTree *in, TTree *out);
   Int_t Clusters2Tracks(AliESD *event);
   Int_t PropagateBack(AliESD *event);
   Int_t RefitInward(AliESD *event);
-  Bool_t RefitAt(Double_t x, AliITStrackV2 *seed, const AliITStrackV2 *t);
+  Bool_t RefitAt(Double_t x, AliITStrackMI *seed, const AliITStrackMI *t);
   void SetupFirstPass(Int_t *flags, Double_t *cuts=0);
   void SetupSecondPass(Int_t *flags, Double_t *cuts=0);
 
@@ -73,8 +53,10 @@ public:
   void UseClusters(const AliKalmanTrack *t, Int_t from=0) const;
   void GetNTeor(Int_t layer, const AliITSclusterV2* cl, Float_t theta, Float_t phi, Float_t &ny, Float_t &nz);
   Int_t  GetError(Int_t layer, const AliITSclusterV2*cl, Float_t theta, Float_t phi, Float_t expQ, Float_t &erry, Float_t &errz);
-  Double_t GetPredictedChi2MI(AliITStrackV2* track, const AliITSclusterV2 *cluster,Int_t layer);
-  Int_t UpdateMI(AliITStrackV2* track, const AliITSclusterV2* cl,Double_t chi2,Int_t layer);
+
+  void  GetDCASigma(AliITStrackMI* track, Float_t & sigmarfi, Float_t &sigmaz);
+  Double_t GetPredictedChi2MI(AliITStrackMI* track, const AliITSclusterV2 *cluster,Int_t layer);
+  Int_t UpdateMI(AliITStrackMI* track, const AliITSclusterV2* cl,Double_t chi2,Int_t layer) const;
   class AliITSdetector { 
   public:
     AliITSdetector(){}
@@ -119,7 +101,7 @@ public:
     Double_t GetR() const {return fR;}
     Int_t FindClusterIndex(Float_t z) const;
     AliITSclusterV2 *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;
@@ -130,8 +112,9 @@ public:
     Int_t GetSkip() const {return fSkip;}
     void  SetSkip(Int_t skip){fSkip=skip;}
     void IncAccepted(){fAccepted++;}
-    Int_t GetAccepted() const {return fAccepted;}
+    Int_t GetAccepted() const {return fAccepted;}    
   protected:
+    AliITSlayer(const AliITSlayer& /*layer*/){;}
     Double_t fR;                // mean radius of this layer
     Double_t fPhiOffset;        // offset of the first detector in Phi
     Int_t fNladders;            // number of ladders
@@ -158,16 +141,16 @@ public:
     Float_t fY10[11][kMaxClusterPerLayer10];                // y position of the clusters  slice in y    
     Float_t fZ10[11][kMaxClusterPerLayer10];                // z position of the clusters  slice in y 
     Int_t fN10[11];                                       // number of cluster in slice
-    Float_t fDy10;
-    Float_t fBy10[11][2];                  
+    Float_t fDy10;                                        // delta y
+    Float_t fBy10[11][2];                                 // slice borders
     //
     AliITSclusterV2 *fClusters20[21][kMaxClusterPerLayer20]; // pointers to clusters -     slice in y
     Int_t        fClusterIndex20[21][kMaxClusterPerLayer20]; // pointers to clusters -     slice in y    
     Float_t fY20[21][kMaxClusterPerLayer20];                // y position of the clusters  slice in y    
     Float_t fZ20[21][kMaxClusterPerLayer20];                // z position of the clusters  slice in y 
     Int_t fN20[21];                                       // number of cluster in slice
-    Float_t fDy20;
-    Float_t fBy20[21][2];
+    Float_t fDy20;                                        //delta y 
+    Float_t fBy20[21][2];                                 //slice borders
     //
     AliITSclusterV2** fClustersCs;                         //clusters table in current slice
     Int_t   *fClusterIndexCs;                             //cluster index in current slice 
@@ -184,68 +167,74 @@ public:
     Int_t fI;            // index of the current cluster within the "window"
     Int_t fImax;            // index of the last cluster within the "window"    
     Int_t fSkip;     // indicates possibility to skip cluster
-    Int_t fAccepted;
+    Int_t fAccepted;     // accept indicator 
     Double_t fRoad;      // road defined by the cluster density
   };
   AliITStrackerMI::AliITSlayer    & GetLayer(Int_t layer) const;
   AliITStrackerMI::AliITSdetector & GetDetector(Int_t layer, Int_t n) const {return GetLayer(layer).GetDetector(n); }
 
 protected:
-  void FindV0(AliESD *event);  //try to find V0
-  Double_t  TestV0(AliHelix *h1, AliHelix *h2, AliITSRecV0Info *vertex);  //try to find V0 - return DCA
-  Double_t  FindBestPair(Int_t esdtrack0, Int_t esdtrack1,AliITSRecV0Info *vertex);  // try to find best pair from the tree of track hyp.
+  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 UpdateTPCV0(AliESD *event);  //try to update, or reject TPC  V0s
   void CookLabel(AliKalmanTrack *t,Float_t wrong) const;
-  void CookLabel(AliITStrackV2 *t,Float_t wrong) const;
+  void CookLabel(AliITStrackMI *t,Float_t wrong) const;
   Double_t GetEffectiveThickness(Double_t y, Double_t z) const;
-  void FollowProlongationTree(AliITStrackV2 * otrack, Int_t esdindex);
+  void FollowProlongationTree(AliITStrackMI * otrack, Int_t esdindex, Bool_t constrain);
   void ResetBestTrack() {
-     fBestTrack.~AliITStrackV2();
-     new(&fBestTrack) AliITStrackV2(fTrackToFollow);
+     fBestTrack.~AliITStrackMI();
+     new(&fBestTrack) AliITStrackMI(fTrackToFollow);
   }
-  void ResetTrackToFollow(const AliITStrackV2 &t) {
-     fTrackToFollow.~AliITStrackV2();
-     new(&fTrackToFollow) AliITStrackV2(t);
+  void ResetTrackToFollow(const AliITStrackMI &t) {
+     fTrackToFollow.~AliITStrackMI();
+     new(&fTrackToFollow) AliITStrackMI(t);
   }
-  void CookdEdx(AliITStrackV2* track);
-  Double_t GetNormalizedChi2(AliITStrackV2 * track, Int_t mode);
-  Double_t GetTruncatedChi2(AliITStrackV2 * track, Float_t fac);
-  Double_t NormalizedChi2(AliITStrackV2 * track, Int_t layer);
-  Double_t GetInterpolatedChi2(AliITStrackV2 * forwardtrack, AliITStrackV2 * backtrack);  
-  Double_t GetMatchingChi2(AliITStrackV2 * track1, AliITStrackV2 * track2);
+  void CookdEdx(AliITStrackMI* track);
+  Double_t GetNormalizedChi2(AliITStrackMI * track, Int_t mode);
+  Double_t GetTruncatedChi2(AliITStrackMI * track, Float_t fac);
+  Double_t NormalizedChi2(AliITStrackMI * track, Int_t layer);
+  Double_t GetInterpolatedChi2(AliITStrackMI * forwardtrack, AliITStrackMI * backtrack);  
+  Double_t GetMatchingChi2(AliITStrackMI * track1, AliITStrackMI * track2);
   Double_t GetDeadZoneProbability(Double_t zpos, Double_t zerr);
 
   Float_t    *GetWeight(Int_t index);
-  void AddTrackHypothesys(AliITStrackV2 * track, Int_t esdindex);
+  void AddTrackHypothesys(AliITStrackMI * track, Int_t esdindex);
   void SortTrackHypothesys(Int_t esdindex, Int_t maxcut, Int_t mode);
-  AliITStrackV2 * GetBestHypothesys(Int_t esdindex, AliITStrackV2 * original, Int_t checkmax); 
+  AliITStrackMI * GetBestHypothesys(Int_t esdindex, AliITStrackMI * original, Int_t checkmax); 
   void  GetBestHypothesysMIP(TObjArray &itsTracks); 
-  void RegisterClusterTracks(AliITStrackV2* track, Int_t id);
-  void UnRegisterClusterTracks(AliITStrackV2* track, Int_t id);
-  Float_t GetNumberOfSharedClusters(AliITStrackV2* track,Int_t id, Int_t list[6], AliITSclusterV2 *clist[6]);
-  Int_t GetOverlapTrack(AliITStrackV2 *track, Int_t trackID, Int_t &shared, Int_t clusterlist[6], Int_t overlist[6]);
-  AliITStrackV2 * GetBest2Tracks(Int_t trackID1, Int_t treackID2, Float_t th0, Float_t th1);
+  void RegisterClusterTracks(AliITStrackMI* track, Int_t id);
+  void UnRegisterClusterTracks(AliITStrackMI* track, Int_t id);
+  Float_t GetNumberOfSharedClusters(AliITStrackMI* track,Int_t id, Int_t list[6], AliITSclusterV2 *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];}
   void       SignDeltas( TObjArray *ClusterArray, Float_t zv);
   void MakeCoeficients(Int_t ntracks);
-  void UpdateESDtrack(AliITStrackV2* track, ULong_t flags);
+  void UpdateESDtrack(AliITStrackMI* track, ULong_t flags) const;
   Int_t fI;                              // index of the current layer
   static AliITSlayer fgLayers[kMaxLayer];// ITS layers
-  AliITStrackV2 fTracks[kMaxLayer];      // track estimations at the ITS layers
-  AliITStrackV2 fBestTrack;              // "best" track 
-  AliITStrackV2 fTrackToFollow;          // followed track
+  AliITStrackMI fTracks[kMaxLayer];      // track estimations at the ITS layers
+  AliITStrackMI fBestTrack;              // "best" track 
+  AliITStrackMI fTrackToFollow;          // followed track
   TObjArray     fTrackHypothesys;        // ! array with track hypothesys- ARRAY is the owner of tracks- MI
+  TObjArray     fBestHypothesys;         // ! array with track hypothesys- ARRAY is the owner of tracks- MI
+  TObjArray     fOriginal;               // ! array with seeds from the TPC
   Int_t         fBestTrackIndex[100000]; // ! index of the best track
   Int_t         fCurrentEsdTrack;        // ! current esd track           - MI
   Int_t fPass;                           // current pass through the data 
   Int_t fConstraint[2];                  // constraint flags
-
+  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
-  ClassDef(AliITStrackerMI,1)   //ITS tracker V2
+  AliESD  * fEsd;                        //! pointer to the ESD event
+  TTreeSRedirector *fDebugStreamer;     //!debug streamer
+ private:
+  AliITStrackerMI(const AliITStrackerMI * /*tracker*/){;}
+  ClassDef(AliITStrackerMI,2)   //ITS tracker MI
 };
 
 
@@ -298,7 +287,7 @@ inline void AliITStrackerMI::CookLabel(AliKalmanTrack *t,Float_t wrong) const {
    }
 }
 
-inline Double_t AliITStrackerMI::NormalizedChi2(AliITStrackV2 * track, Int_t layer)
+inline Double_t AliITStrackerMI::NormalizedChi2(AliITStrackMI * track, Int_t layer)
 {
   //--------------------------------------------------------------------
   //get normalize chi2