X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TRD%2FAliTRDtrack.cxx;h=0205870a8e210da76f302ef619c064156ba14d6b;hb=5b1ba251b3f58d1aa0eae0bd5bd0d74178fc3ffc;hp=475083bdb565319bf04f7923decc92926a9074ba;hpb=e4f2f73dac21ac0c905f1d0b78ee86c3f87f43d0;p=u%2Fmrichter%2FAliRoot.git diff --git a/TRD/AliTRDtrack.cxx b/TRD/AliTRDtrack.cxx index 475083bdb56..0205870a8e2 100644 --- a/TRD/AliTRDtrack.cxx +++ b/TRD/AliTRDtrack.cxx @@ -18,13 +18,12 @@ #include #include "AliTracker.h" -#include "AliESDtrack.h" #include "AliTRDgeometry.h" #include "AliTRDcluster.h" #include "AliTRDtrack.h" +#include "AliTRDtracklet.h" #include "AliTRDcalibDB.h" -#include "Cal/AliTRDCalPID.h" ClassImp(AliTRDtrack) @@ -32,6 +31,7 @@ ClassImp(AliTRDtrack) // // // Represents a reconstructed TRD track // // Local TRD Kalman track // +// Part of the old TRD tracking code // // // /////////////////////////////////////////////////////////////////////////////// @@ -41,6 +41,7 @@ AliTRDtrack::AliTRDtrack() ,fSeedLab(-1) ,fdEdx(0) ,fDE(0) + ,fPIDquality(0) ,fClusterOwner(kFALSE) ,fPIDmethod(kLQ) ,fStopped(kFALSE) @@ -60,13 +61,17 @@ AliTRDtrack::AliTRDtrack() // for (Int_t i = 0; i < kNplane; i++) { - for (Int_t j = 0; j < kNslice; j++) { + for (Int_t j = 0; j < AliTRDCalPID::kNSlicesLQ; j++) { fdEdxPlane[i][j] = 0.0; } fTimBinPlane[i] = -1; fMom[i] = -1.; fSnp[i] = 0.; fTgl[i] = 0.; + fTrackletIndex[i] = -1; + } + for(int ispec=0; ispecGetQ()); @@ -170,6 +180,7 @@ AliTRDtrack::AliTRDtrack(const AliTRDtrack &t/*, const Bool_t owner*/) ,fSeedLab(t.GetSeedLabel()) ,fdEdx(t.fdEdx) ,fDE(t.fDE) + ,fPIDquality(t.fPIDquality) ,fClusterOwner(kTRUE) ,fPIDmethod(t.fPIDmethod) ,fStopped(t.fStopped) @@ -189,7 +200,7 @@ AliTRDtrack::AliTRDtrack(const AliTRDtrack &t/*, const Bool_t owner*/) // for (Int_t i = 0; i < kNplane; i++) { - for (Int_t j = 0; j < kNslice; j++) { + for (Int_t j = 0; j < AliTRDCalPID::kNSlicesLQ; j++) { fdEdxPlane[i][j] = t.fdEdxPlane[i][j]; } fTimBinPlane[i] = t.fTimBinPlane[i]; @@ -197,6 +208,7 @@ AliTRDtrack::AliTRDtrack(const AliTRDtrack &t/*, const Bool_t owner*/) fMom[i] = t.fMom[i]; fSnp[i] = t.fSnp[i]; fTgl[i] = t.fTgl[i]; + fTrackletIndex[i] = t.fTrackletIndex[i]; } Int_t n = t.GetNumberOfClusters(); @@ -225,7 +237,8 @@ AliTRDtrack::AliTRDtrack(const AliTRDtrack &t/*, const Bool_t owner*/) fBudget[i] = t.fBudget[i]; } -} + for(Int_t ispec = 0; ispecGetNumberOfTimeBins(); + Int_t ntb = AliTRDcalibDB::Instance()->GetNumberOfTimeBinsDCS(); Int_t plane; // Plane of current cluster Int_t tb; // Time bin of current cluster Int_t slice; // Current slice AliTRDcluster *cluster = 0x0; // Pointer to current cluster // Reset class and local counters/variables - for (Int_t iPlane = 0; iPlane < AliESDtrack::kNPlane; iPlane++) { + for (Int_t iPlane = 0; iPlane < kNplane; iPlane++) { fTimBinPlane[iPlane] = -1; maxcharge[iPlane] = 0.0; - for (Int_t iSlice = 0; iSlice < AliESDtrack::kNSlice; iSlice++) { + for (Int_t iSlice = 0; iSlice < AliTRDCalPID::kNSlicesLQ; iSlice++) { fdEdxPlane[iPlane][iSlice] = 0.0; nCluster[iPlane][iSlice] = 0; } @@ -495,8 +518,8 @@ void AliTRDtrack::CookdEdxTimBin(const Int_t/* tid*/) if (!cluster) continue; // Read info from current cluster - plane = AliTRDgeometry::GetPlane(cluster->GetDetector()); - if (plane < 0 || plane >= AliESDtrack::kNPlane) { + plane = AliTRDgeometry::GetLayer(cluster->GetDetector()); + if (plane < 0 || plane >= kNplane) { AliError(Form("Wrong plane %d", plane)); continue; } @@ -508,7 +531,7 @@ void AliTRDtrack::CookdEdxTimBin(const Int_t/* tid*/) continue; } - slice = tb * AliESDtrack::kNSlice / ntb; + slice = tb * AliTRDCalPID::kNSlicesLQ / ntb; fdEdxPlane[plane][slice] += fdQdl[iClus]; if (fdQdl[iClus] > maxcharge[plane]) { @@ -521,8 +544,8 @@ void AliTRDtrack::CookdEdxTimBin(const Int_t/* tid*/) } // End of loop over cluster // Normalize fdEdxPlane to number of clusters and set track segments - for (Int_t iPlane = 0; iPlane < AliESDtrack::kNPlane; iPlane++) { - for (Int_t iSlice = 0; iSlice < AliESDtrack::kNSlice; iSlice++) { + for (Int_t iPlane = 0; iPlane < kNplane; iPlane++) { + for (Int_t iSlice = 0; iSlice < AliTRDCalPID::kNSlicesLQ; iSlice++) { if (nCluster[iPlane][iSlice]) { fdEdxPlane[iPlane][iSlice] /= nCluster[iPlane][iSlice]; } @@ -540,7 +563,7 @@ void AliTRDtrack::CookdEdxNN(Float_t *dedx) // //number of time bins in chamber - Int_t ntb = AliTRDcalibDB::Instance()->GetNumberOfTimeBins(); + Int_t ntb = AliTRDcalibDB::Instance()->GetNumberOfTimeBinsDCS(); Int_t plane; // plane of current cluster Int_t tb; // time bin of current cluster @@ -549,9 +572,9 @@ void AliTRDtrack::CookdEdxNN(Float_t *dedx) const Int_t kMLPscale = 16000; // scaling of the MLP input to be smaller than 1 // Reset class and local contors/variables - for (Int_t iPlane = 0; iPlane < AliESDtrack::kNPlane; iPlane++){ - for (Int_t iSlice = 0; iSlice < kNMLPslice; iSlice++) { - *(dedx + (kNMLPslice * iPlane) + iSlice) = 0.0; + for (Int_t iPlane = 0; iPlane < kNplane; iPlane++){ + for (Int_t iSlice = 0; iSlice < AliTRDCalPID::kNSlicesNN; iSlice++) { + *(dedx + (AliTRDCalPID::kNSlicesNN * iPlane) + iSlice) = 0.0; } } @@ -564,8 +587,8 @@ void AliTRDtrack::CookdEdxNN(Float_t *dedx) } // Read info from current cluster - plane = AliTRDgeometry::GetPlane(cluster->GetDetector()); - if (plane < 0 || plane >= AliESDtrack::kNPlane) { + plane = AliTRDgeometry::GetLayer(cluster->GetDetector()); + if (plane < 0 || plane >= kNplane) { AliError(Form("Wrong plane %d",plane)); continue; } @@ -577,9 +600,9 @@ void AliTRDtrack::CookdEdxNN(Float_t *dedx) continue; } - slice = tb * kNMLPslice / ntb; + slice = tb * AliTRDCalPID::kNSlicesNN / ntb; - *(dedx+(kNMLPslice * plane) + slice) += fdQdl[iClus]/kMLPscale; + *(dedx+(AliTRDCalPID::kNSlicesNN * plane) + slice) += fdQdl[iClus]/kMLPscale; } // End of loop over cluster @@ -647,14 +670,14 @@ Bool_t AliTRDtrack::CookPID(Int_t &pidQuality) } // Retrieve the CDB container class with the probability distributions - const AliTRDCalPID *pd = calibration->GetPIDObject(fPIDmethod == kNN ? 0 : 1); + const AliTRDCalPID *pd = calibration->GetPIDObject(AliTRDpidUtil::kLQ); if (!pd) { AliError("No access to AliTRDCalPID"); return kFALSE; } // Calculate the input for the NN if fPIDmethod is kNN - Float_t ldEdxNN[AliTRDCalPID::kNPlane * kNMLPslice], *dedx = 0x0; + Float_t ldEdxNN[AliTRDgeometry::kNlayer * AliTRDCalPID::kNSlicesNN], *dedx = 0x0; if(fPIDmethod == kNN) { CookdEdxNN(&ldEdxNN[0]); } @@ -675,7 +698,7 @@ Bool_t AliTRDtrack::CookPID(Int_t &pidQuality) // Skip tracks which have no TRD signal at all if (fdEdx == 0.) return kFALSE; - for (Int_t iPlane = 0; iPlane < AliTRDgeometry::kNplan; iPlane++) { + for (Int_t iPlane = 0; iPlane < AliTRDgeometry::kNlayer; iPlane++) { length = (AliTRDgeometry::AmThick() + AliTRDgeometry::DrThick()) / TMath::Sqrt((1.0 - fSnp[iPlane]*fSnp[iPlane]) @@ -695,7 +718,7 @@ Bool_t AliTRDtrack::CookPID(Int_t &pidQuality) dedx = fdEdxPlane[iPlane]; break; case kNN: - dedx = &ldEdxNN[iPlane*kNMLPslice]; + dedx = &ldEdxNN[iPlane*AliTRDCalPID::kNSlicesNN]; break; } fPID[iSpecies] *= pd->GetProbability(iSpecies, fMom[iPlane], dedx, length, iPlane); @@ -818,7 +841,7 @@ Bool_t AliTRDtrack::PropagateTo(Double_t xk, Double_t xx0, Double_t xrho) //_____________________________________________________________________________ Bool_t AliTRDtrack::Update(const AliTRDcluster *c, Double_t chisq - , Int_t index, Double_t h01) + , Int_t index, Double_t h01) { // // Assignes the found cluster to the track and updates @@ -875,6 +898,8 @@ Int_t AliTRDtrack::UpdateMI(AliTRDcluster *c, Double_t chisq, Int_t index if (!AliExternalTrackParam::Update(p,cov)) { return kFALSE; } + + AliTracker::FillResiduals(this,p,cov,c->GetVolumeId()); // Register cluster to track Int_t n = GetNumberOfClusters(); @@ -1108,7 +1133,7 @@ Int_t AliTRDtrack::GetSector() const // return Int_t(TVector2::Phi_0_2pi(GetAlpha()) / AliTRDgeometry::GetAlpha()) - % AliTRDgeometry::kNsect; + % AliTRDgeometry::kNsector; }