X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TRD%2FAliTRDseedV1.h;h=d0d3a3a1e5fd42c448de852a217b1aa1de95f7f1;hb=0d76e8c6989aae84f17591621a687c63b0b9bd4b;hp=0f04c34b4560cfb1ca4990dcf213c27b4b3959b1;hpb=980d5a2a11bf3be6b702291b5a14e0e58f286241;p=u%2Fmrichter%2FAliRoot.git diff --git a/TRD/AliTRDseedV1.h b/TRD/AliTRDseedV1.h index 0f04c34b456..d0d3a3a1e5f 100644 --- a/TRD/AliTRDseedV1.h +++ b/TRD/AliTRDseedV1.h @@ -29,27 +29,24 @@ #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 { @@ -68,12 +65,18 @@ public: ,kCalib = BIT(17) // calibrated tracklet ,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 }; - enum ETRDtrackletError { - kAttachClFound = 1 // not enough clusters found - ,kAttachRow // found row < 0 - ,kAttachMultipleCl // multiple clusters attached to time bin - ,kAttachClAttach // not enough clusters attached + + enum ETRDtrackletError { // up to 8 bits + kAttachClFound = 0 // not enough clusters found + ,kAttachRowGap = 1 // found gap attached rows + ,kAttachRow = 2 // found 3 rows + ,kAttachMultipleCl= 3// multiple clusters attached to time bin + ,kAttachClAttach= 4 // not enough clusters attached + ,kFitCl = 5 // not enough clusters for fit + ,kFitFailedY = 6 // fit failed in XY plane failed + ,kFitFailedZ = 7 // fit in the QZ plane failed }; AliTRDseedV1(Int_t det = -1); @@ -81,26 +84,32 @@ 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(Bool_t tilt=kFALSE, Bool_t zcorr=kFALSE); + Bool_t Fit(UChar_t opt=0); + Bool_t FitRobust(Bool_t ChgPlus=kTRUE); Bool_t Init(AliTRDtrackV1 *track); - inline void Init(const AliRieman *fit); + void Init(const AliRieman *fit); Bool_t IsEqual(const TObject *inTracklet) const; Bool_t IsCalibrated() const { return TestBit(kCalib);} Bool_t IsOwner() const { return TestBit(kOwner);} Bool_t IsKink() const { return TestBit(kKink);} + Bool_t IsPrimary() const { return TestBit(kPrimary);} Bool_t HasPID() const { return TestBit(kPID);} + Bool_t HasError(ETRDtrackletError err) const + { return TESTBIT(fErrorMsg, err);} Bool_t IsOK() const { return GetN() > 4 && GetNUsed() < 4;} Bool_t IsRowCross() const { return TestBit(kRowCross);} Bool_t IsUsable(Int_t i) const { return fClusters[i] && !fClusters[i]->IsUsed();} Bool_t IsStandAlone() const { return TestBit(kStandAlone);} - Float_t GetC() const { return fC; } + 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; @@ -108,21 +117,21 @@ public: void GetCovAt(Double_t x, Double_t *cov) const; void GetCovXY(Double_t *cov) const { memcpy(cov, &fCov[0], 3*sizeof(Double_t));} void GetCovRef(Double_t *cov) const { memcpy(cov, &fRefCov, 7*sizeof(Double_t));} - static Double_t GetCovSqrt(const Double_t * const c, Double_t *d); + static Int_t GetCovSqrt(const Double_t * const c, Double_t *d); static Double_t GetCovInv(const Double_t * const c, Double_t *d); UChar_t GetErrorMsg() const { return fErrorMsg;} Float_t GetdX() const { return fdX;} const Float_t* GetdEdx() const { return &fdEdx[0];} + 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 fZref[1]; } + 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;} 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];} - static TLinearFitter* GetFitterY(); - static TLinearFitter* GetFitterZ(); + 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; @@ -130,6 +139,7 @@ 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; Float_t GetQuality(Bool_t kZcorr) const; Float_t GetPadLength() const { return fPad[0];} Float_t GetPadWidth() const { return fPad[1];} @@ -165,18 +175,19 @@ public: inline void ResetClusterIter(Bool_t forward = kTRUE); void Reset(Option_t *opt=""); - void SetC(Float_t c) { fC = c;} + void SetC(Float_t c, Int_t typ=0) { fC[typ] = c;} void SetChi2(Float_t chi2) { fChi2 = chi2;} inline void SetCovRef(const Double_t *cov); - void SetErrorMsg(Int_t err) { fErrorMsg = err;} + void SetErrorMsg(ETRDtrackletError err) { SETBIT(fErrorMsg, err);} void SetIndexes(Int_t i, Int_t idx) { fIndexes[i] = idx; } void SetLabels(Int_t *lbls) { memcpy(fLabels, lbls, 3*sizeof(Int_t)); } void SetKink(Bool_t k = kTRUE){ SetBit(kKink, k);} + void SetPrimary(Bool_t k = kTRUE){ SetBit(kPrimary, k);} void SetPID(Bool_t k = kTRUE) { SetBit(kPID, k);} 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; } @@ -198,22 +209,24 @@ 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) const; + inline void Swap(Double_t &d1, Double_t &d2) const; const AliTRDReconstructor *fkReconstructor;//! local reconstructor AliTRDcluster **fClusterIter; //! clusters iterator Int_t fIndexes[kNclusters]; //! Indexes - Float_t fExB; //! tg(a_L) @ tracklet location - Float_t fVD; //! drift velocity @ tracklet location - Float_t fT0; //! time 0 @ tracklet location - Float_t fS2PRF; //! sigma^2 PRF for xd->0 and phi=a_L - Float_t fDiffL; //! longitudinal diffusion coefficient - Float_t fDiffT; //! transversal diffusion coefficient + Float_t fExB; // tg(a_L) @ tracklet location + Float_t fVD; // drift velocity @ tracklet location + Float_t fT0; // time 0 @ tracklet location + Float_t fS2PRF; // sigma^2 PRF for xd->0 and phi=a_L + Float_t fDiffL; // longitudinal diffusion coefficient + Float_t fDiffT; // transversal diffusion coefficient Char_t fClusterIdx; //! clusters iterator UChar_t fErrorMsg; // processing error UInt_t fN; // number of clusters attached/used/shared Short_t fDet; // TRD detector AliTRDcluster *fClusters[kNclusters]; // Clusters - Float_t fPad[3]; // local pad definition : length/width/tilt + Float_t fPad[4]; // local pad definition : length/width/tilt/anode wire offset Float_t fYref[2]; // Reference y, dydx Float_t fZref[2]; // Reference z, dz/dx Float_t fYfit[2]; // Fit y, dy/dx @@ -226,17 +239,15 @@ private: Float_t fZ; // z position of the tracklet Float_t fS2Y; // estimated resolution in the r-phi direction Float_t fS2Z; // estimated resolution in the z direction - Float_t fC; // Curvature + Float_t fC[2]; // Curvature for standalone [0] rieman [1] vertex constrained Float_t fChi2; // Global chi2 Float_t fdEdx[kNslices]; // dE/dx measurements for tracklet Float_t fProb[AliPID::kSPECIES]; // PID probabilities Int_t fLabels[3]; // most frequent MC labels and total number of different labels 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 - static TLinearFitter *fgFitterY; // Linear Fitter for tracklet fit in xy-plane - static TLinearFitter *fgFitterZ; // Linear Fitter for tracklet fit in xz-plane - ClassDef(AliTRDseedV1, 8) // The offline TRD tracklet + ClassDef(AliTRDseedV1, 12) // The offline TRD tracklet }; //____________________________________________________________ @@ -276,24 +287,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 = rieman->GetC(); - fChi2 = rieman->GetChi2(); -} - //____________________________________________________________ inline AliTRDcluster* AliTRDseedV1::NextCluster() { @@ -390,6 +383,22 @@ inline void AliTRDseedV1::SetNShared(Int_t n) n = (n<