]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDseedV1.h
do not keep digits with null energy, speed up in case of 2 maxima clusters with...
[u/mrichter/AliRoot.git] / TRD / AliTRDseedV1.h
index f428dbff11db324104c5dea6610208c39316b807..3cdeabc0763d60b036af214c689280df415dfca9 100644 (file)
 #include "AliPID.h"
 #endif
 
-#ifndef ALIRIEMAN_H
-#include "AliRieman.h"
-#endif
 
 #ifndef ALITRDCLUSTER_H 
 #include "AliTRDcluster.h"
 #endif
 
-#include "AliTRDReconstructor.h"
 
 class TTreeSRedirector;
 class TLinearFitter;
 
 class AliRieman;
 
+class AliTRDReconstructor;
 class AliTRDtrackingChamber;
 class AliTRDtrackV1;
 class AliTRDpadPlane;
 class AliTRDseedV1 : public AliTRDtrackletBase
 {
-  friend class AliHLTTRDTracklet;
+  friend class AliHLTTRDTracklet; // wrapper for HLT
 
 public:
   enum ETRDtrackletBuffers {    
@@ -69,6 +66,7 @@ public:
    ,kKink       = BIT(18) // kink prolongation tracklet
    ,kStandAlone = BIT(19) // tracklet build during stand alone track finding
    ,kPrimary    = BIT(20) // tracklet from a primary track candidate
+   ,kChmbGood   = BIT(21) // status of the detector from calibration view point
   };
 
   enum ETRDtrackletError { // up to 8 bits
@@ -87,17 +85,19 @@ public:
   AliTRDseedV1(const AliTRDseedV1 &ref);
   AliTRDseedV1& operator=(const AliTRDseedV1 &ref);
 
-  Bool_t    AttachClusters(AliTRDtrackingChamber *const chamber, Bool_t tilt = kFALSE);
+  Bool_t    AttachClusters(AliTRDtrackingChamber *const chamber, Bool_t tilt = kFALSE, Bool_t ChgPlus=kTRUE, Int_t ev=-1);
   void      Bootstrap(const AliTRDReconstructor *rec);
   void      Calibrate();
   void      CookdEdx(Int_t nslices);
   void      CookLabels();
   Bool_t    CookPID();
   Bool_t    Fit(UChar_t opt=0);
-  Bool_t    Init(AliTRDtrackV1 *track);
-  inline void      Init(const AliRieman *fit);
+  Bool_t    FitRobust(Bool_t ChgPlus=kTRUE);
+  Bool_t    Init(const AliTRDtrackV1 *track);
+  void      Init(const AliRieman *fit);
   Bool_t    IsEqual(const TObject *inTracklet) const;
   Bool_t    IsCalibrated() const     { return TestBit(kCalib);}
+  Bool_t    IsChmbGood() const       { return TestBit(kChmbGood);}
   Bool_t    IsOwner() const          { return TestBit(kOwner);}
   Bool_t    IsKink() const           { return TestBit(kKink);}
   Bool_t    IsPrimary() const        { return TestBit(kPrimary);}
@@ -111,6 +111,7 @@ public:
 
   Float_t   GetAnodeWireOffset(Float_t zt);
   Float_t   GetC(Int_t typ=0) const    { return fC[typ]; }
+  Float_t   GetCharge(Bool_t useOutliers=kFALSE) const;
   Float_t   GetChi2() const          { return fChi2; }
   inline Float_t   GetChi2Z() const;
   inline Float_t   GetChi2Y() const;
@@ -123,14 +124,18 @@ public:
   UChar_t   GetErrorMsg() const      { return fErrorMsg;}
   Float_t   GetdX() const            { return fdX;}
   const Float_t*  GetdEdx() const    { return &fdEdx[0];}
+  Float_t   GetQperTB(Int_t tb) const;
+  Float_t   GetdQdl() const;
   Float_t   GetdQdl(Int_t ic, Float_t *dx=NULL) const;
   Float_t   GetdYdX() const          { return fYfit[1];}
   Float_t   GetdZdX() const          { return fZfit[1];}
   Int_t     GetdY() const            { return Int_t(GetY()/0.014);}
   Int_t     GetDetector() const      { return fDet;}
+  Int_t     GetChargeGaps(Float_t sz[kNtb], Float_t pos[kNtb], Int_t ntb[kNtb]) const;
   void      GetCalibParam(Float_t &exb, Float_t &vd, Float_t &t0, Float_t &s2, Float_t &dl, Float_t &dt) const    { 
               exb = fExB; vd = fVD; t0 = fT0; s2 = fS2PRF; dl = fDiffL; dt = fDiffT;}
   AliTRDcluster*  GetClusters(Int_t i) const               { return i<0 || i>=kNclusters ? NULL: fClusters[i];}
+  Bool_t    GetEstimatedCrossPoint(Float_t &x, Float_t &z) const;
   Int_t     GetIndexes(Int_t i) const{ return i<0 || i>=kNclusters ? -1 : fIndexes[i];}
   Int_t     GetLabels(Int_t i) const { return fLabels[i];}  
   Float_t   GetMomentum(Float_t *err = NULL) const;
@@ -138,7 +143,8 @@ public:
   Int_t     GetN2() const            { return GetN();}
   Int_t     GetNUsed() const         { return Int_t((fN>>kNbits)&kMask);}
   Int_t     GetNShared() const       { return Int_t(((fN>>kNbits)>>kNbits)&kMask);}
-  Float_t   GetOccupancyTB() const;
+  Int_t     GetTBoccupancy() const;
+  Int_t     GetTBcross() const;
   Float_t   GetQuality(Bool_t kZcorr) const;
   Float_t   GetPadLength() const     { return fPad[0];}
   Float_t   GetPadWidth() const      { return fPad[1];}
@@ -175,6 +181,7 @@ public:
   void      Reset(Option_t *opt="");
 
   void      SetC(Float_t c, Int_t typ=0) { fC[typ] = c;}
+  void      SetChmbGood(Bool_t k = kTRUE){ SetBit(kChmbGood, k);}
   void      SetChi2(Float_t chi2)    { fChi2 = chi2;}
   inline void SetCovRef(const Double_t *cov);
   void      SetErrorMsg(ETRDtrackletError err)  { SETBIT(fErrorMsg, err);}
@@ -186,7 +193,7 @@ public:
   void      SetStandAlone(Bool_t st) { SetBit(kStandAlone, st); }
   void      SetPt(Double_t pt)       { fPt = pt;}
   void      SetOwner();
-  void      SetPadPlane(AliTRDpadPlane *p);
+  void      SetPadPlane(AliTRDpadPlane * const p);
   void      SetPadLength(Float_t l)  { fPad[0] = l;}
   void      SetPadWidth(Float_t w)   { fPad[1] = w;}
   void      SetTilt(Float_t tilt)    { fPad[2] = tilt; }
@@ -208,8 +215,8 @@ private:
   inline void SetN(Int_t n);
   inline void SetNUsed(Int_t n);
   inline void SetNShared(Int_t n);
-  inline void Swap(Int_t &n1, Int_t &n2);
-  inline void Swap(Double_t &d1, Double_t &d2);
+  inline void Swap(Int_t &n1, Int_t &n2) const;
+  inline void Swap(Double_t &d1, Double_t &d2) const;
 
   const AliTRDReconstructor *fkReconstructor;//! local reconstructor
   AliTRDcluster  **fClusterIter;            //! clusters iterator
@@ -246,7 +253,7 @@ private:
   Double_t         fRefCov[7];              // covariance matrix of the track in the yz plane + the rest of the diagonal elements
   Double_t         fCov[3];                 // covariance matrix of the tracklet in the xy plane
 
-  ClassDef(AliTRDseedV1, 11)                 // The offline TRD tracklet 
+  ClassDef(AliTRDseedV1, 12)                 // The offline TRD tracklet 
 };
 
 //____________________________________________________________
@@ -286,24 +293,6 @@ inline Double_t AliTRDseedV1::GetPID(Int_t is) const
   return 0.;
 }
 
-//____________________________________________________________
-inline void AliTRDseedV1::Init(const AliRieman *rieman)
-{
-  fZref[0] = rieman->GetZat(fX0);
-  fZref[1] = rieman->GetDZat(fX0);
-  fYref[0] = rieman->GetYat(fX0);
-  fYref[1] = rieman->GetDYat(fX0);
-  if(fkReconstructor && fkReconstructor->IsHLT()){
-    fRefCov[0] = 1;
-    fRefCov[2] = 10;
-  }else{
-    fRefCov[0] = rieman->GetErrY(fX0);
-    fRefCov[2] = rieman->GetErrZ(fX0);
-  }
-  fC[0]    = rieman->GetC(); 
-  fChi2    = rieman->GetChi2();
-}
-
 //____________________________________________________________
 inline AliTRDcluster* AliTRDseedV1::NextCluster()
 {
@@ -401,7 +390,7 @@ inline void AliTRDseedV1::SetNShared(Int_t n)
 }
 
 //____________________________________________________________
-inline void AliTRDseedV1::Swap(Int_t &n1, Int_t &n2)
+inline void AliTRDseedV1::Swap(Int_t &n1, Int_t &n2) const
 {
 // swap values of n1 with n2
   Int_t tmp(n1);
@@ -409,7 +398,7 @@ inline void AliTRDseedV1::Swap(Int_t &n1, Int_t &n2)
 }
 
 //____________________________________________________________
-inline void AliTRDseedV1::Swap(Double_t &d1, Double_t &d2)
+inline void AliTRDseedV1::Swap(Double_t &d1, Double_t &d2) const
 {
 // swap values of d1 with d2
   Double_t tmp(d1);