- for (Int_t iLayer = 0; iLayer < AliTRDgeometry::kNlayer; iLayer++) {
- // read data for track segment
- for(int iSlice=0; iSlice<AliTRDtrack::kNslice; iSlice++)
- dedx[iSlice] = t->GetTRDslice(iLayer, iSlice);
- dEdx = t->GetTRDslice(iLayer, -1);
- timebin = t->GetTRDTimBin(iLayer);
-
- // check data
- if ((dEdx <= 0.) || (timebin <= -1.)) continue;
-
- // retrive kinematic info for this track segment
- if(!RecalculateTrackSegmentKine(t, iLayer, mom, length)){
- // information is not fully reliable especialy for length
- // estimation. To be used in the future.
- }
-
- // this track segment has fulfilled all requierments
- nPlanePID++;
-
- // Get the probabilities for the different particle species
- for (Int_t iSpecies = 0; iSpecies < AliPID::kSPECIES; iSpecies++) {
- p[iSpecies] *= pd->GetProbability(iSpecies, mom, dedx, length, iLayer);
- //p[iSpecies] *= pd->GetProbabilityT(iSpecies, mom, timebin);
- }
- }
- if(nPlanePID == 0) continue;
-
- // normalize probabilities
- Double_t probTotal = 0.;
- for (Int_t iSpecies = 0; iSpecies < AliPID::kSPECIES; iSpecies++) probTotal += p[iSpecies];
- if(probTotal <= 0.){
- AliWarning(Form("The total probability (%e) over all species <= 0 in ESD track %d."
- , probTotal, i));
- AliWarning("This may be caused by some error in reference data.");
- AliWarning("Calculation continues but results might be corrupted.");
- continue;
- }
- for(Int_t iSpecies = 0; iSpecies < AliPID::kSPECIES; iSpecies++) p[iSpecies] /= probTotal;
-
- // book PID to the track
- t->SetTRDpid(p);
- t->SetTRDpidQuality(nPlanePID);
- }
-
- return 0;
+ for (Int_t iLayer = 0; iLayer < AliTRDgeometry::kNlayer; iLayer++) {
+ // read data for track segment
+ for(int iSlice=0; iSlice<AliTRDCalPID::kNSlicesLQ; iSlice++)
+ dedx[iSlice] = t->GetTRDslice(iLayer, iSlice);
+ dEdx = t->GetTRDslice(iLayer, -1);
+ timebin = t->GetTRDTimBin(iLayer);
+
+ // check data
+ if ((dEdx <= 0.) || (timebin <= -1.)) continue;
+
+ // retrive kinematic info for this track segment
+ if(!RecalculateTrackSegmentKine(t, iLayer, mom, length)){
+ // information is not fully reliable especialy for length
+ // estimation. To be used in the future.
+ }
+
+ // this track segment has fulfilled all requierments
+ nPlanePID++;
+
+ // Get the probabilities for the different particle species
+ for (Int_t iSpecies = 0; iSpecies < AliPID::kSPECIES; iSpecies++) {
+ p[iSpecies] *= pd->GetProbability(iSpecies, mom, dedx, length, iLayer);
+ //p[iSpecies] *= pd->GetProbabilityT(iSpecies, mom, timebin);
+ }
+ }
+ if(nPlanePID == 0) continue;
+
+ // normalize probabilities
+ Double_t probTotal = 0.;
+ for (Int_t iSpecies = 0; iSpecies < AliPID::kSPECIES; iSpecies++) probTotal += p[iSpecies];
+ if(probTotal <= 0.){
+ AliWarning(Form("The total probability (%e) over all species <= 0 in ESD track %d."
+ , probTotal, i));
+ AliWarning("This may be caused by some error in reference data.");
+ AliWarning("Calculation continues but results might be corrupted.");
+ continue;
+ }
+ for(Int_t iSpecies = 0; iSpecies < AliPID::kSPECIES; iSpecies++) p[iSpecies] /= probTotal;
+
+ // book PID to the track
+ t->SetTRDpid(p);
+ t->SetTRDntracklets(nPlanePID<<3);
+ }
+
+ return 0;