]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDtracker.h
Added a commented out version with new digitizers.
[u/mrichter/AliRoot.git] / TRD / AliTRDtracker.h
index 73ec38c094d7823fb04465eb5b5d5de5b6b66348..0bfae245b413e1e5c65e42769c4a0a7af8c33a0d 100644 (file)
@@ -15,8 +15,10 @@ class TParticlePDG;
 class AliTRDgeometry;
 class AliTRDparameter;
 class AliTRDtrack;
+class AliTRDtracklet;
 class AliTRDcluster;
 class AliESD;
+class TTreeSRedirector;
 
 const unsigned kMaxLayersPerSector = 1000;  
 const unsigned kMaxTimeBinIndex = 216;  // (30 drift + 6 ampl) * 6 planes  
@@ -24,22 +26,75 @@ const unsigned kMaxClusterPerTimeBin = 7000;
 const unsigned kZones = 5; 
 const Int_t    kTrackingSectors = 18; 
 
+class AliTRDseed : public TObject{
+  friend class AliTRDtracker;
+ public:
+  AliTRDseed();                 // default constructor
+  ~AliTRDseed(){};              // default constructor
+  static  void EvaluateUni(Int_t nvectors, Double_t *data, Double_t &mean, Double_t &sigma, Int_t hh);
+  static  Float_t   FitRiemanTilt(AliTRDseed * seed, Bool_t error);
+  void           UseClusters(); // use clusters
+  void           Update();      // update information - without tilt correction
+  void           CookLabels();  // cook label
+  void           UpdateUsed();
+  void           Reset();       // reset seed
+  Bool_t         isOK(){return fN2>8;}
+ private:
+  Float_t        fTilt;         // tilting angle
+  Float_t        fPadLength;    // pad length
+  Float_t        fX0;           // x0 position
+  Float_t        fX[25];        // !x position
+  Float_t        fY[25];        // !y position
+  Float_t        fZ[25];        // !z position
+  Int_t          fIndexes[25];  // !indexes
+  AliTRDcluster *fClusters[25]; // !clusters
+  Bool_t         fUsable[25];   // !indication  - usable cluster
+  Float_t        fYref[2];      // reference y
+  Float_t        fZref[2];      // reference z
+  Float_t        fYfit[2];      // y fit position +derivation
+  Float_t        fYfitR[2];      // y fit position +derivation
+  Float_t        fZfit[2];      // z fit position
+  Float_t        fZfitR[2];      // z fit position
+  Float_t        fSigmaY;        // "robust" sigma in Y - constant fit
+  Float_t        fSigmaY2;       // "robust" sigma in Y - line fit
+  Float_t        fMeanz;         // mean vaue of z
+  Float_t        fZProb;         // max probbable z
+  Int_t          fLabels[2];    // labels
+  Int_t          fN;            // number of associated clusters
+  Int_t          fN2;            // number of not crossed
+  Int_t          fNUsed;        // number of used clusters
+  Int_t          fFreq;         // freq
+  Int_t          fNChange;      // change z counter
+  Float_t        fMPads;        // mean number of pads per cluster
+  // global
+  //
+  Float_t        fC;            // curvature
+  Float_t        fCC;           // curvature with constrain
+  Float_t        fChi2;         // global chi2
+  Float_t        fChi2Z;        // global chi2
+ private:
+  ClassDef(AliTRDseed,1)  
+};
+
+
 class AliTRDtracker : public AliTracker { 
 
  public:
 
+
   AliTRDtracker();
   AliTRDtracker(const TFile *in);
   virtual ~AliTRDtracker(); 
-
+  static        Int_t  Freq(Int_t n, const Int_t *inlist, Int_t *outlist, Bool_t down);    
   Int_t         Clusters2Tracks(AliESD* event);
   Int_t         PropagateBack(AliESD* event);
   Int_t         RefitInward(AliESD* event);
-
+  
   Int_t         LoadClusters(TTree *cTree);
   void          UnloadClusters();
   AliCluster   *GetCluster(Int_t index) const { if (index >= fNclusters) return NULL; 
                                                 return (AliCluster*) fClusters->UncheckedAt(index); };
+  Bool_t        GetTrackPoint(Int_t index, AliTrackPoint& p) const;
   virtual void  CookLabel(AliKalmanTrack *t,Float_t wrong) const;
   virtual void  UseClusters(const AliKalmanTrack *t, Int_t from=0) const;  
   
@@ -50,8 +105,9 @@ class AliTRDtracker : public AliTracker {
 
   Int_t         ReadClusters(TObjArray *array, TTree *in) const;
   Int_t         CookSectorIndex(Int_t gs) const { return kTrackingSectors - 1 - gs; }
-  AliTRDcluster * GetCluster(AliTRDtrack * track, Int_t plane, Int_t timebin);
+  AliTRDcluster * GetCluster(AliTRDtrack * track, Int_t plane, Int_t timebin, UInt_t &index);
   Int_t         GetLastPlane(AliTRDtrack * track); //return last updated plane
+  Int_t FindClusters(Int_t sector, Int_t t0, Int_t t1, AliTRDtrack * track, Int_t *clusters, AliTRDtracklet& tracklet);
 
   Float_t  GetSeedGap()       const {return fgkSeedGap;}   
   Int_t    GetMaxGap()        const {return fMaxGap;}   
@@ -100,11 +156,12 @@ class AliTRDtracker : public AliTracker {
      Double_t       GetRho() const { return fRho; }
      Double_t       GetX0() const { return fX0; }
      Int_t          GetTimeBinIndex() const { return fTimeBinIndex; }     
-     void           GetPropagationParameters(Double_t y, Double_t z,
+     Bool_t         GetPropagationParameters(Double_t y, Double_t z,
                                 Double_t &dx, Double_t &rho, Double_t &x0, 
-                                Bool_t &lookForCluster) const;
+                                            Bool_t &lookForCluster) const;
      Int_t          GetZone( Double_t z) const;
-     Int_t          Find(Double_t y) const; 
+     Int_t          Find(Float_t y) const; 
+     Int_t          FindNearestCluster(Float_t y, Float_t z, Float_t maxroad, Float_t maxroadz) const;
      void           SetZmax(Int_t cham, Double_t center, Double_t w)
                       { fZc[cham] = center;  fZmax[cham] = w; }
      void           SetZ(Double_t* center, Double_t *w, Double_t *wsensitive);
@@ -180,6 +237,8 @@ class AliTRDtracker : public AliTracker {
 
  protected:
 
+  friend class AliTRDtracker::AliTRDtrackingSector;
+
   AliTRDgeometry     *fGeom;            // Pointer to TRD geometry
   AliTRDparameter    *fPar;             // Pointer to TRD parameter
 
@@ -230,6 +289,13 @@ class AliTRDtracker : public AliTracker {
   static const Double_t fgkSeedErrorSZ;    // sz parameter in MakeSeeds
   static const Float_t  fgkLabelFraction;  // min fraction of same label
   static const Float_t  fgkWideRoad;       // max road width in FindProlongation
+  //
+  static const Double_t  fgkDriftCorrection; // correction coeficients for drift velocity
+  static const Double_t  fgkOffset;         // correction coeficients 
+  static const Double_t  fgkOffsetX;         // correction coeficients offset in X 
+  static const Double_t  fgkCoef;           // correction coeficients
+  static const Double_t  fgkMean;           // correction coeficients
+  static const Double_t  fgkExB;            // correction coeficients
 
   Bool_t                fVocal;            // Whatever...
   Bool_t                fAddTRDseeds;      // Something else
@@ -246,11 +312,14 @@ class AliTRDtracker : public AliTracker {
   static const Int_t fgkLastPlane;    // Id of the last (outermost) reference plane
 
  private:
-
+  AliTRDtrack *   RegisterSeed(AliTRDseed * seeds, Double_t *params);
   virtual void  MakeSeeds(Int_t inner, Int_t outer, Int_t turn);
+  void  MakeSeedsMI(Int_t inner, Int_t outer, AliESD *esd=0);
 
   Int_t         FollowProlongation(AliTRDtrack& t, Int_t rf);
+  Int_t         FollowProlongationG(AliTRDtrack& t, Int_t rf);
   Int_t         FollowBackProlongation(AliTRDtrack& t);
+  Int_t         FollowBackProlongationG(AliTRDtrack& t);
   Int_t         Refit(AliTRDtrack& t, Int_t rf);
   void          CookdEdxTimBin(AliTRDtrack& t);  
 
@@ -261,7 +330,7 @@ class AliTRDtracker : public AliTracker {
   void          SetSZ2corr(Float_t w)    {fSZ2corr = w;}
   Double_t      ExpectedSigmaY2(Double_t r, Double_t tgl, Double_t pt) const;
   Double_t      ExpectedSigmaZ2(Double_t r, Double_t tgl) const;
-
+  TTreeSRedirector *fDebugStreamer;     //!debug streamer
   ClassDef(AliTRDtracker,2)           // manager base class  
 
 };