From 0d83b3a5d7ce097c778227af6883e8867364b28b Mon Sep 17 00:00:00 2001 From: abercuci Date: Mon, 26 Jan 2009 17:12:21 +0000 Subject: [PATCH] remove dependence on the AliTRDReconstructor from the PID related code (Markus, Alex) --- TRD/AliTRDReconstructor.h | 13 +- TRD/AliTRDcalibDB.cxx | 6 +- TRD/AliTRDcalibDB.h | 7 +- TRD/AliTRDgeometry.cxx | 1 + TRD/AliTRDpidESD.cxx | 309 ++++++++++--------- TRD/AliTRDpidUtil.cxx | 35 ++- TRD/AliTRDpidUtil.h | 35 ++- TRD/AliTRDseedV1.cxx | 2 +- TRD/AliTRDtrack.cxx | 2 +- TRD/AliTRDtrackV1.cxx | 2 +- TRD/AliTRDtrackingSector.cxx | 1 + TRD/qaRec/AliTRDpidChecker.cxx | 511 +++++++------------------------- TRD/qaRec/AliTRDpidChecker.h | 42 ++- TRD/qaRec/AliTRDpidRefMaker.cxx | 14 +- 14 files changed, 371 insertions(+), 609 deletions(-) diff --git a/TRD/AliTRDReconstructor.h b/TRD/AliTRDReconstructor.h index 96e93a30df0..19b0ba7c01a 100644 --- a/TRD/AliTRDReconstructor.h +++ b/TRD/AliTRDReconstructor.h @@ -14,6 +14,7 @@ #include "AliReconstructor.h" #include "AliDetectorRecoParam.h" #include "AliTRDrecoParam.h" +#include "AliTRDpidUtil.h" class TClonesArray; class TTreeSRedirector; @@ -38,18 +39,10 @@ public: ,kTracker = 2 ,kPID = 3 }; - enum AliTRDpidMethod { - kLQPID = 0, - kNNPID = 1 - }; enum AliTRDdriftGas { kXe = 0, kAr = 1 }; - enum{ - kNNslices = 8 - ,kLQslices = 3 - }; enum{ kOwner = BIT(14) }; @@ -68,9 +61,9 @@ public: virtual void FillESD(AliRawReader *, TTree *clusterTree, AliESDEvent *esd) const { FillESD((TTree * )NULL, clusterTree, esd); } virtual void FillESD(TTree *digitsTree, TTree *clusterTree, AliESDEvent *esd) const; static TClonesArray* GetClusters() {return fgClusters;} - Int_t GetNdEdxSlices() const { return GetPIDMethod() == kNNPID ? kNNslices : kLQslices;} + Int_t GetNdEdxSlices() const { return (Int_t)AliTRDpidUtil::GetNdEdxSlices(GetPIDMethod());} AliTRDdriftGas GetDriftGas() const { return fSteerParam&kDriftGas ? kAr : kXe;} - AliTRDpidMethod GetPIDMethod() const { return fSteerParam&kSteerPID ? kNNPID : kLQPID;} + AliTRDpidUtil::ETRDPIDMethod GetPIDMethod() const { return fSteerParam&kSteerPID ? AliTRDpidUtil::kNN : AliTRDpidUtil::kLQ;} static const AliTRDrecoParam* GetRecoParam() { return dynamic_cast(AliReconstructor::GetRecoParam(2)); } Int_t GetStreamLevel(AliTRDReconstructorTask task) const { return fStreamLevel[task];} inline void GetTCParams(Double_t *par) const; diff --git a/TRD/AliTRDcalibDB.cxx b/TRD/AliTRDcalibDB.cxx index e1442252a83..fe465c9b83c 100644 --- a/TRD/AliTRDcalibDB.cxx +++ b/TRD/AliTRDcalibDB.cxx @@ -932,16 +932,16 @@ Bool_t AliTRDcalibDB::IsChamberMasked(Int_t det) } //_____________________________________________________________________________ -const AliTRDCalPID *AliTRDcalibDB::GetPIDObject(AliTRDReconstructor::AliTRDpidMethod method) +const AliTRDCalPID *AliTRDcalibDB::GetPIDObject(AliTRDpidUtil::ETRDPIDMethod method) { // // Returns the object storing the distributions for PID with likelihood // switch(method) { - case AliTRDReconstructor::kLQPID: + case AliTRDpidUtil::kLQ: return dynamic_cast(GetCachedCDBObject(kIDPIDLQ)); - case AliTRDReconstructor::kNNPID: + case AliTRDpidUtil::kNN: return dynamic_cast(GetCachedCDBObject(kIDPIDNN)); } diff --git a/TRD/AliTRDcalibDB.h b/TRD/AliTRDcalibDB.h index c720450a6fc..86c30c0f680 100644 --- a/TRD/AliTRDcalibDB.h +++ b/TRD/AliTRDcalibDB.h @@ -15,12 +15,13 @@ #include "TObject.h" #endif -#ifndef ALITRDRECONSTRUCTOR_H -#include "AliTRDReconstructor.h" +#ifndef ALITRDPIDUTIL_H +#include "AliTRDpidUtil.h" #endif class AliCDBEntry; +class AliTRDrecoParam; class AliTRDCalPID; class AliTRDCalMonitoring; class AliTRDCalROC; @@ -85,7 +86,7 @@ class AliTRDcalibDB : public TObject { Bool_t IsChamberMasked(Int_t det); const AliTRDCalMonitoring *GetMonitoringObject(); - const AliTRDCalPID *GetPIDObject(AliTRDReconstructor::AliTRDpidMethod method); + const AliTRDCalPID *GetPIDObject(AliTRDpidUtil::ETRDPIDMethod m); // Related functions, these depend on calibration data static Float_t GetOmegaTau(Float_t vdrift, Float_t bz); diff --git a/TRD/AliTRDgeometry.cxx b/TRD/AliTRDgeometry.cxx index 24ba7a0d172..3e6f645d575 100644 --- a/TRD/AliTRDgeometry.cxx +++ b/TRD/AliTRDgeometry.cxx @@ -25,6 +25,7 @@ #include #include +#include "AliLog.h" #include "AliAlignObjParams.h" #include "AliTRDcalibDB.h" diff --git a/TRD/AliTRDpidESD.cxx b/TRD/AliTRDpidESD.cxx index 5f0739763ae..a09ea31d97c 100644 --- a/TRD/AliTRDpidESD.cxx +++ b/TRD/AliTRDpidESD.cxx @@ -1,17 +1,17 @@ /************************************************************************** - * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * * - * Author: The ALICE Off-line Project. * - * Contributors are mentioned in the code where appropriate. * - * * - * Permission to use, copy, modify and distribute this software and its * - * documentation strictly for non-commercial purposes is hereby granted * - * without fee, provided that the above copyright notice appears in all * - * copies and that both the copyright notice and this permission notice * - * appear in the supporting documentation. The authors make no claims * - * about the suitability of this software for any purpose. It is * - * provided "as is" without express or implied warranty. * - **************************************************************************/ +* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * +* * +* Author: The ALICE Off-line Project. * +* Contributors are mentioned in the code where appropriate. * +* * +* Permission to use, copy, modify and distribute this software and its * +* documentation strictly for non-commercial purposes is hereby granted * +* without fee, provided that the above copyright notice appears in all * +* copies and that both the copyright notice and this permission notice * +* appear in the supporting documentation. The authors make no claims * +* about the suitability of this software for any purpose. It is * +* provided "as is" without express or implied warranty. * +**************************************************************************/ /* $Id$ */ @@ -37,7 +37,6 @@ #include "AliTracker.h" #include "AliRun.h" -#include "AliTRDReconstructor.h" #include "AliTRDpidESD.h" #include "AliTRDgeometry.h" #include "AliTRDcalibDB.h" @@ -108,7 +107,7 @@ void AliTRDpidESD::Copy(TObject &p) const ((AliTRDpidESD &) p).fgCheckKinkStatus = fgCheckKinkStatus; ((AliTRDpidESD &) p).fgMinPlane = fgMinPlane; ((AliTRDpidESD &) p).fTrack = 0x0; - + } //_____________________________________________________________________________ @@ -127,96 +126,96 @@ Int_t AliTRDpidESD::MakePID(AliESDEvent *event) // Alex Bercuci (A.Bercuci@gsi.de) 2nd May 2007 // - AliTRDcalibDB *calibration = AliTRDcalibDB::Instance(); - if (!calibration) { - AliErrorGeneral("AliTRDpidESD::MakePID()" - ,"No access to calibration data"); - return -1; - } - + AliTRDcalibDB *calibration = AliTRDcalibDB::Instance(); + if (!calibration) { + AliErrorGeneral("AliTRDpidESD::MakePID()" + ,"No access to calibration data"); + return -1; + } + // AliTRDrecoParam *rec = AliTRDReconstructor::RecoParam(); // if (!rec) { // AliErrorGeneral("AliTRDpidESD::MakePID()", "No TRD reco param."); // return 0x0; // } - // Retrieve the CDB container class with the probability distributions - const AliTRDCalPID *pd = calibration->GetPIDObject(AliTRDReconstructor::kLQPID/*rec->GetPIDMethod()*/); - if (!pd) { - AliErrorGeneral("AliTRDpidESD::MakePID()" - ,"No access to AliTRDCalPID"); - return -1; - } - - // Loop through all ESD tracks - Double_t p[10]; - AliESDtrack *t = 0x0; - Float_t dedx[AliTRDtrack::kNslice], dEdx; - Int_t timebin; - Float_t mom, length; - Int_t nPlanePID; - for (Int_t i=0; iGetNumberOfTracks(); i++) { - t = event->GetTrack(i); - - // Check track - if(!CheckTrack(t)) continue; - - - // Skip tracks which have no TRD signal at all - if (t->GetTRDsignal() == 0.) continue; - - // Loop over detector layers - mom = 0.; - length = 0.; - nPlanePID = 0; - for (Int_t iSpecies = 0; iSpecies < AliPID::kSPECIES; iSpecies++) + // Retrieve the CDB container class with the probability distributions + const AliTRDCalPID *pd = calibration->GetPIDObject(AliTRDpidUtil::kLQ); + if (!pd) { + AliErrorGeneral("AliTRDpidESD::MakePID()" + ,"No access to AliTRDCalPID"); + return -1; + } + + // Loop through all ESD tracks + Double_t p[10]; + AliESDtrack *t = 0x0; + Float_t dedx[AliTRDtrack::kNslice], dEdx; + Int_t timebin; + Float_t mom, length; + Int_t nPlanePID; + for (Int_t i=0; iGetNumberOfTracks(); i++) { + t = event->GetTrack(i); + + // Check track + if(!CheckTrack(t)) continue; + + + // Skip tracks which have no TRD signal at all + if (t->GetTRDsignal() == 0.) continue; + + // Loop over detector layers + mom = 0.; + length = 0.; + nPlanePID = 0; + for (Int_t iSpecies = 0; iSpecies < AliPID::kSPECIES; iSpecies++) p[iSpecies] = 1./AliPID::kSPECIES; - for (Int_t iLayer = 0; iLayer < AliTRDgeometry::kNlayer; iLayer++) { - // read data for track segment - for(int iSlice=0; iSliceGetTRDslice(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; iSliceGetTRDslice(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; } @@ -226,25 +225,25 @@ Bool_t AliTRDpidESD::CheckTrack(AliESDtrack *t) // // Check if track is eligible for PID calculations // - - // Check the ESD track status - if (fgCheckTrackStatus) { - if (((t->GetStatus() & AliESDtrack::kTRDout ) == 0) && - ((t->GetStatus() & AliESDtrack::kTRDrefit) == 0)) return kFALSE; - } + + // Check the ESD track status + if (fgCheckTrackStatus) { + if (((t->GetStatus() & AliESDtrack::kTRDout ) == 0) && + ((t->GetStatus() & AliESDtrack::kTRDrefit) == 0)) return kFALSE; + } - // Check for ESD kink tracks - if (fgCheckKinkStatus && (t->GetKinkIndex(0) != 0)) return kFALSE; + // Check for ESD kink tracks + if (fgCheckKinkStatus && (t->GetKinkIndex(0) != 0)) return kFALSE; - return kTRUE; + return kTRUE; } //_____________________________________________________________________________ Bool_t AliTRDpidESD::RecalculateTrackSegmentKine(AliESDtrack *esd - , Int_t layer - , Float_t &mom - , Float_t &length) + , Int_t layer + , Float_t &mom + , Float_t &length) { // // Retrive momentum "mom" and track "length" in TRD chamber from plane @@ -254,52 +253,52 @@ Bool_t AliTRDpidESD::RecalculateTrackSegmentKine(AliESDtrack *esd // Alex Bercuci (A.Bercuci@gsi.de) // - const Float_t kAmHalfWidth = AliTRDgeometry::AmThick() / 2.; + const Float_t kAmHalfWidth = AliTRDgeometry::AmThick() / 2.; const Float_t kDrWidth = AliTRDgeometry::DrThick(); - const Float_t kTime0 = AliTRDgeometry::GetTime0(layer); - - // set initial length value to chamber height - length = 2 * kAmHalfWidth + kDrWidth; - - // retrive track's outer param - const AliExternalTrackParam *op = esd->GetOuterParam(); - if(!op){ - mom = esd->GetP(); - return kFALSE; - } - - AliExternalTrackParam *param = 0x0; - if(!fTrack){ - fTrack = new AliExternalTrackParam(*op); - param = fTrack; - } else param = new(fTrack) AliExternalTrackParam(*op); - - // retrive the magnetic field - Double_t xyz0[3]; - op->GetXYZ(xyz0); - Float_t field = AliTracker::GetBz(xyz0); // Bz in kG at point xyz0 - Double_t s, t; - - // propagate to chamber entrance - if(!param->PropagateTo(kTime0-kAmHalfWidth-kDrWidth, field)){ - mom = op->GetP(); - s = op->GetSnp(); - t = op->GetTgl(); - if (s < 1.) length /= TMath::Sqrt((1. - s*s) / (1. + t*t)); - return kFALSE; - } - mom = param->GetP(); - s = param->GetSnp(); - t = param->GetTgl(); - if (s < 1.) length /= TMath::Sqrt((1. - s*s) / (1. + t*t)); - - // check if track is crossing tracking sector by propagating to chamber exit- maybe is too much :) - Double_t alpha = param->GetAlpha(); - if(!param->PropagateTo(kTime0+kAmHalfWidth, field)) return kFALSE; - - // mark track segments which are crossing SM boundaries along chamber - if(TMath::Abs(alpha-param->GetAlpha())>.01) return kFALSE; - - return kTRUE; + const Float_t kTime0 = AliTRDgeometry::GetTime0(layer); + + // set initial length value to chamber height + length = 2 * kAmHalfWidth + kDrWidth; + + // retrive track's outer param + const AliExternalTrackParam *op = esd->GetOuterParam(); + if(!op){ + mom = esd->GetP(); + return kFALSE; + } + + AliExternalTrackParam *param = 0x0; + if(!fTrack){ + fTrack = new AliExternalTrackParam(*op); + param = fTrack; + } else param = new(fTrack) AliExternalTrackParam(*op); + + // retrive the magnetic field + Double_t xyz0[3]; + op->GetXYZ(xyz0); + Float_t field = AliTracker::GetBz(xyz0); // Bz in kG at point xyz0 + Double_t s, t; + + // propagate to chamber entrance + if(!param->PropagateTo(kTime0-kAmHalfWidth-kDrWidth, field)){ + mom = op->GetP(); + s = op->GetSnp(); + t = op->GetTgl(); + if (s < 1.) length /= TMath::Sqrt((1. - s*s) / (1. + t*t)); + return kFALSE; + } + mom = param->GetP(); + s = param->GetSnp(); + t = param->GetTgl(); + if (s < 1.) length /= TMath::Sqrt((1. - s*s) / (1. + t*t)); + + // check if track is crossing tracking sector by propagating to chamber exit- maybe is too much :) + Double_t alpha = param->GetAlpha(); + if(!param->PropagateTo(kTime0+kAmHalfWidth, field)) return kFALSE; + + // mark track segments which are crossing SM boundaries along chamber + if(TMath::Abs(alpha-param->GetAlpha())>.01) return kFALSE; + + return kTRUE; } diff --git a/TRD/AliTRDpidUtil.cxx b/TRD/AliTRDpidUtil.cxx index 5f1d9f43938..fa2668fcc90 100644 --- a/TRD/AliTRDpidUtil.cxx +++ b/TRD/AliTRDpidUtil.cxx @@ -5,6 +5,7 @@ #include "TH1F.h" #include "TGraph.h" #include "TGraphErrors.h" +#include "TPDGCode.h" #include "AliLog.h" #include "Cal/AliTRDCalPID.h" @@ -144,7 +145,7 @@ Int_t AliTRDpidUtil::GetMomentumBin(Double_t p) //__________________________________________________________________________ -Bool_t AliTRDpidUtil::IsElectron(const AliESDtrack *track, PIDmethod_t method){ +Bool_t AliTRDpidUtil::IsElectron(const AliESDtrack *track, ETRDPIDMethod method){ // // Do PID decision for the TRD based on 90% Electron efficiency threshold // @@ -166,7 +167,7 @@ Bool_t AliTRDpidUtil::IsElectron(const AliESDtrack *track, PIDmethod_t method){ } //__________________________________________________________________________ -Double_t AliTRDpidUtil::GetSystematicError(const AliESDtrack *track, PIDmethod_t method){ +Double_t AliTRDpidUtil::GetSystematicError(const AliESDtrack *track, ETRDPIDMethod method){ // // Returns the pion efficiency at 90% electron efficiency from the OCDB // @@ -180,3 +181,33 @@ Double_t AliTRDpidUtil::GetSystematicError(const AliESDtrack *track, PIDmethod_t TH1 * threshold_hist = dynamic_cast(histos->FindObject(histname[method].Data())); return threshold_hist->GetBinContent(GetMomentumBin(track->P()) + 1); } + +//________________________________________________________________________ +Int_t AliTRDpidUtil::Pdg2Pid(Int_t pdg){ + // + // Private Helper function to get the paticle species (ALICE notation) + // from the Pdg code + // + Int_t species; + switch(TMath::Abs(pdg)){ + case kElectron: + species = AliPID::kElectron; + break; + case kMuonMinus: + species = AliPID::kMuon; + break; + case kPiPlus: + species = AliPID::kPion; + break; + case kKPlus: + species = AliPID::kKaon; + break; + case kProton: + species = AliPID::kProton; + break; + default: + species = -1; + } + return species; +} + diff --git a/TRD/AliTRDpidUtil.h b/TRD/AliTRDpidUtil.h index dc66f9a5b5b..3353d5b3823 100644 --- a/TRD/AliTRDpidUtil.h +++ b/TRD/AliTRDpidUtil.h @@ -13,34 +13,37 @@ class TH1; class AliESDtrack; class AliTRDpidUtil : public TObject { public: - enum { kBins = 10001 }; - typedef enum{ + enum ETRDPIDMethod { kLQ = 0 // 2D likelihood method ,kNN = 1 // Neural network method ,kESD = 2 // ESD results - check offline - } PIDmethod_t; + }; + enum{ + kNNslices = 8 + ,kLQslices = 3 + }; AliTRDpidUtil(); virtual ~AliTRDpidUtil(){;} - Bool_t CalculatePionEffi(TH1* histo1, TH1* histo2); + Bool_t CalculatePionEffi(TH1* histo1, TH1* histo2); - static Float_t ElectronEfficiency() { return fEleEffi;}; + static Float_t ElectronEfficiency() { return fEleEffi;}; - static Bool_t IsElectron(const AliESDtrack *track, PIDmethod_t method = kNN); - static Double_t GetSystematicError(const AliESDtrack *track, PIDmethod_t method = kNN); - - Double_t GetCalcElectronEfficiency() {return fCalcEleEffi;}; - Double_t GetPionEfficiency() {return fPionEffi;}; - Double_t GetError() {return fError;}; - Double_t GetThreshold() {return fThreshold;}; - - static Int_t GetMomentumBin(Double_t p); - - static void SetElectronEfficiency(Float_t eleeffi) {fEleEffi = eleeffi;}; + static Bool_t IsElectron(const AliESDtrack *track, ETRDPIDMethod method = kNN); + static Double_t GetSystematicError(const AliESDtrack *track, ETRDPIDMethod method = kNN); + static Int_t GetNdEdxSlices(ETRDPIDMethod m) { return m == kNN ? kNNslices : kLQslices;} + Double_t GetCalcElectronEfficiency() const { return fCalcEleEffi;}; + Double_t GetPionEfficiency() const { return fPionEffi;}; + Double_t GetError() const { return fError;}; + Double_t GetThreshold() const { return fThreshold;}; + + static Int_t GetMomentumBin(Double_t p); + static Int_t Pdg2Pid(Int_t pdg); + static void SetElectronEfficiency(Float_t eleeffi) {fEleEffi = eleeffi;}; private: AliTRDpidUtil(const AliTRDpidUtil&); // not implemented diff --git a/TRD/AliTRDseedV1.cxx b/TRD/AliTRDseedV1.cxx index 7db2412c9f0..3cb4333f0ba 100644 --- a/TRD/AliTRDseedV1.cxx +++ b/TRD/AliTRDseedV1.cxx @@ -263,7 +263,7 @@ void AliTRDseedV1::CookdEdx(Int_t nslices) } // End of loop over clusters //if(fReconstructor->GetPIDMethod() == AliTRDReconstructor::kLQPID){ - if(nslices == AliTRDReconstructor::kLQslices){ + if(nslices == AliTRDpidUtil::kLQslices){ // calculate mean charge per slice (only LQ PID) for(int is=0; isGetPIDObject(AliTRDReconstructor::kLQPID); + const AliTRDCalPID *pd = calibration->GetPIDObject(AliTRDpidUtil::kLQ); if (!pd) { AliError("No access to AliTRDCalPID"); return kFALSE; diff --git a/TRD/AliTRDtrackV1.cxx b/TRD/AliTRDtrackV1.cxx index 943c96fbfa6..cd91823d5e3 100644 --- a/TRD/AliTRDtrackV1.cxx +++ b/TRD/AliTRDtrackV1.cxx @@ -772,7 +772,7 @@ void AliTRDtrackV1::UpdateESDtrack(AliESDtrack *track) // Update the TRD PID information in the ESD track // - Int_t nslices = fReconstructor->IsEightSlices() ? (Int_t)AliTRDReconstructor::kNNslices : (Int_t)AliTRDReconstructor::kLQslices; + Int_t nslices = fReconstructor->IsEightSlices() ? (Int_t)AliTRDpidUtil::kNNslices : (Int_t)AliTRDpidUtil::kLQslices; track->SetNumberOfTRDslices(nslices); for (Int_t ip = 0; ip < kNplane; ip++) { diff --git a/TRD/AliTRDtrackingSector.cxx b/TRD/AliTRDtrackingSector.cxx index 5faee5f46d4..794e246a001 100644 --- a/TRD/AliTRDtrackingSector.cxx +++ b/TRD/AliTRDtrackingSector.cxx @@ -27,6 +27,7 @@ #include "AliTRDcalibDB.h" #include "AliTRDCommonParam.h" +#include "AliTRDReconstructor.h" #include "AliTRDpadPlane.h" #include "AliTRDtrackingSector.h" #include "AliTRDtrackingChamber.h" diff --git a/TRD/qaRec/AliTRDpidChecker.cxx b/TRD/qaRec/AliTRDpidChecker.cxx index 19d4bbf4e9b..bdc04fce09a 100644 --- a/TRD/qaRec/AliTRDpidChecker.cxx +++ b/TRD/qaRec/AliTRDpidChecker.cxx @@ -1,3 +1,4 @@ +#include "TAxis.h" #include "TROOT.h" #include "TPDGCode.h" #include "TCanvas.h" @@ -43,7 +44,8 @@ AliTRDpidChecker::AliTRDpidChecker() ,fUtil(0x0) ,fGraph(0x0) ,fEfficiency(0x0) -{ + ,fMomentumAxis(0x0) + { // // Default constructor // @@ -52,7 +54,6 @@ AliTRDpidChecker::AliTRDpidChecker() fReconstructor->SetRecoParam(AliTRDrecoParam::GetLowFluxParam()); fUtil = new AliTRDpidUtil(); - InitFunctorList(); } @@ -62,7 +63,7 @@ AliTRDpidChecker::~AliTRDpidChecker() { if(fGraph){fGraph->Delete(); delete fGraph;} if(fReconstructor) delete fReconstructor; - if(fUtil) delete fUtil; + if(fUtil) delete fUtil; } @@ -85,7 +86,13 @@ TObjArray * AliTRDpidChecker::Histos(){ // if(fContainer) return fContainer; - Int_t xBins = AliPID::kSPECIES*AliTRDCalPID::kNMom; + if(!fMomentumAxis){ + Double_t defaultMomenta[AliTRDCalPID::kNMom]; + for(Int_t imom = 0; imom < AliTRDCalPID::kNMom; imom++) + defaultMomenta[imom] = AliTRDCalPID::GetMomentum(imom); + SetMomentumBinning(AliTRDCalPID::kNMom - 1, defaultMomenta); + } + Int_t xBins = AliPID::kSPECIES*fMomentumAxis->GetNbins(); fContainer = new TObjArray(); fContainer->Expand(7); const Float_t epsilon = 1./(2*(AliTRDpidUtil::kBins-1)); // get nice histos with bin center at 0 and 1 @@ -100,7 +107,7 @@ TObjArray * AliTRDpidChecker::Histos(){ h = new TH2F("PID_LQ", "", xBins, -0.5, xBins - 0.5, AliTRDpidUtil::kBins, 0.-epsilon, 1.+epsilon); } else h->Reset(); - fEfficiency->AddAt(h, kLQ); + fEfficiency->AddAt(h, AliTRDpidUtil::kLQ); // histos of the electron probability of all 5 particle species and 11 momenta for the neural network method if(!(h = (TH2F*)gROOT->FindObject("PID_NN"))){ @@ -108,7 +115,7 @@ TObjArray * AliTRDpidChecker::Histos(){ xBins, -0.5, xBins - 0.5, AliTRDpidUtil::kBins, 0.-epsilon, 1.+epsilon); } else h->Reset(); - fEfficiency->AddAt(h, kNN); + fEfficiency->AddAt(h, AliTRDpidUtil::kNN); // histos of the electron probability of all 5 particle species and 11 momenta for the ESD output if(!(h = (TH2F*)gROOT->FindObject("PID_ESD"))){ @@ -116,7 +123,7 @@ TObjArray * AliTRDpidChecker::Histos(){ xBins, -0.5, xBins - 0.5, AliTRDpidUtil::kBins, 0.-epsilon, 1.+epsilon); } else h->Reset(); - fEfficiency->AddAt(h, kESD); + fEfficiency->AddAt(h, AliTRDpidUtil::kESD); // histos of the dE/dx distribution for all 5 particle species and 11 momenta if(!(h = (TH2F*)gROOT->FindObject("dEdx"))){ @@ -129,7 +136,7 @@ TObjArray * AliTRDpidChecker::Histos(){ // histos of the dE/dx slices for all 5 particle species and 11 momenta if(!(h = (TH2F*)gROOT->FindObject("dEdxSlice"))){ h = new TH2F("dEdxSlice", "", - xBins*AliTRDReconstructor::kLQslices, -0.5, xBins*AliTRDReconstructor::kLQslices - 0.5, + xBins*AliTRDpidUtil::kLQslices, -0.5, xBins*AliTRDpidUtil::kLQslices - 0.5, 200, 0, 5000); } else h->Reset(); fContainer->AddAt(h, kdEdxSlice); @@ -153,12 +160,12 @@ TObjArray * AliTRDpidChecker::Histos(){ // momentum distributions - absolute and in momentum bins if(!(h = (TH1F*)gROOT->FindObject("hMom"))){ - h = new TH1F("hMom", "momentum distribution", 100, 0., 12.); + h = new TH1F("hMom", "momentum distribution", fMomentumAxis->GetNbins(), fMomentumAxis->GetXmin(), fMomentumAxis->GetXmax()); } else h->Reset(); fContainer->AddAt(h, kMomentum); if(!(h = (TH1F*)gROOT->FindObject("hMomBin"))){ - h = new TH1F("hMomBin", "momentum distribution in momentum bins", AliTRDCalPID::kNMom, 0.5, 11.5); + h = new TH1F("hMomBin", "momentum distribution in momentum bins", fMomentumAxis->GetNbins(), fMomentumAxis->GetXmin(), fMomentumAxis->GetXmax()); } else h->Reset(); fContainer->AddAt(h, kMomentumBin); @@ -166,7 +173,6 @@ TObjArray * AliTRDpidChecker::Histos(){ return fContainer; } - //________________________________________________________________________ Bool_t AliTRDpidChecker::CheckTrackQuality(const AliTRDtrackV1* track) { @@ -181,7 +187,6 @@ Bool_t AliTRDpidChecker::CheckTrackQuality(const AliTRDtrackV1* track) return 0; } - //________________________________________________________________________ Int_t AliTRDpidChecker::CalcPDG(AliTRDtrackV1* track) { @@ -229,7 +234,7 @@ TH1 *AliTRDpidChecker::PlotLQ(const AliTRDtrackV1 *track) return 0x0; } TH2F *hPIDLQ = 0x0; - if(!(hPIDLQ = dynamic_cast(fEfficiency->At(kLQ)))){ + if(!(hPIDLQ = dynamic_cast(fEfficiency->At(AliTRDpidUtil::kLQ)))){ AliWarning("No Histogram defined."); return 0x0; } @@ -248,36 +253,13 @@ TH1 *AliTRDpidChecker::PlotLQ(const AliTRDtrackV1 *track) momentum = cTrack.GetMomentum(0); pdg = CalcPDG(&cTrack); } - if(momentum < 0.4) return 0x0;; - if(momentum > 12.) return 0x0;; + if(!IsInRange(momentum)) return 0x0; fReconstructor -> SetOption("!nn"); cTrack.CookPID(); - Int_t iMomBin = fUtil->GetMomentumBin(momentum); - - switch(pdg){ - case kElectron: - case kPositron: - hPIDLQ -> Fill(AliPID::kElectron * AliTRDCalPID::kNMom + iMomBin, cTrack.GetPID(AliPID::kElectron)); - break; - case kMuonPlus: - case kMuonMinus: - hPIDLQ -> Fill(AliPID::kMuon * AliTRDCalPID::kNMom + iMomBin, cTrack .GetPID(AliPID::kElectron)); - break; - case kPiPlus: - case kPiMinus: - hPIDLQ -> Fill(AliPID::kPion * AliTRDCalPID::kNMom + iMomBin, cTrack .GetPID(AliPID::kElectron)); - break; - case kKPlus: - case kKMinus: - hPIDLQ -> Fill(AliPID::kKaon * AliTRDCalPID::kNMom + iMomBin, cTrack .GetPID(AliPID::kElectron)); - break; - case kProton: - case kProtonBar: - hPIDLQ -> Fill(AliPID::kProton * AliTRDCalPID::kNMom + iMomBin, cTrack.GetPID(AliPID::kElectron)); - break; - } + Int_t species = AliTRDpidUtil::Pdg2Pid(pdg); + hPIDLQ -> Fill(FindBin(species, momentum), cTrack.GetPID(AliPID::kElectron)); return hPIDLQ; } @@ -302,12 +284,11 @@ TH1 *AliTRDpidChecker::PlotNN(const AliTRDtrackV1 *track) return 0x0; } TH2F *hPIDNN; - if(!(hPIDNN = dynamic_cast(fEfficiency->At(kNN)))){ + if(!(hPIDNN = dynamic_cast(fEfficiency->At(AliTRDpidUtil::kNN)))){ AliWarning("No Histogram defined."); return 0x0; } - AliTRDtrackV1 cTrack(*fTrack); cTrack.SetReconstructor(fReconstructor); @@ -321,35 +302,13 @@ TH1 *AliTRDpidChecker::PlotNN(const AliTRDtrackV1 *track) momentum = cTrack.GetMomentum(0); pdg = CalcPDG(&cTrack); } - if(momentum < 0.4) return 0x0;; - if(momentum > 12.) return 0x0;; + if(!IsInRange(momentum)) return 0x0; fReconstructor -> SetOption("nn"); cTrack.CookPID(); - Int_t iMomBin = fUtil -> GetMomentumBin(momentum); - switch(pdg){ - case kElectron: - case kPositron: - hPIDNN -> Fill(AliPID::kElectron * AliTRDCalPID::kNMom + iMomBin, cTrack.GetPID(AliPID::kElectron)); - break; - case kMuonPlus: - case kMuonMinus: - hPIDNN -> Fill(AliPID::kMuon * AliTRDCalPID::kNMom + iMomBin, cTrack.GetPID(AliPID::kElectron)); - break; - case kPiPlus: - case kPiMinus: - hPIDNN -> Fill(AliPID::kPion * AliTRDCalPID::kNMom + iMomBin, cTrack.GetPID(AliPID::kElectron)); - break; - case kKPlus: - case kKMinus: - hPIDNN -> Fill(AliPID::kKaon * AliTRDCalPID::kNMom + iMomBin, cTrack.GetPID(AliPID::kElectron)); - break; - case kProton: - case kProtonBar: - hPIDNN -> Fill(AliPID::kProton * AliTRDCalPID::kNMom + iMomBin, cTrack.GetPID(AliPID::kElectron)); - break; - } + Int_t species = AliTRDpidUtil::Pdg2Pid(pdg); + hPIDNN -> Fill(FindBin(species, momentum), cTrack.GetPID(AliPID::kElectron)); return hPIDNN; } @@ -379,7 +338,7 @@ TH1 *AliTRDpidChecker::PlotESD(const AliTRDtrackV1 *track) return 0x0; } TH2F *hPIDESD = 0x0; - if(!(hPIDESD = dynamic_cast(fEfficiency->At(kESD)))){ + if(!(hPIDESD = dynamic_cast(fEfficiency->At(AliTRDpidUtil::kESD)))){ AliWarning("No Histogram defined."); return 0x0; } @@ -397,38 +356,12 @@ TH1 *AliTRDpidChecker::PlotESD(const AliTRDtrackV1 *track) momentum = cTrack.GetMomentum(0); pdg = CalcPDG(&cTrack); } - if(momentum < 0.4) return 0x0;; - if(momentum > 12.) return 0x0;; - - - Int_t iMomBin = fUtil->GetMomentumBin(momentum); - + if(!IsInRange(momentum)) return 0x0; // Double32_t pidESD[AliPID::kSPECIES]; const Double32_t *pidESD = fESD->GetResponseIter(); - - switch(pdg){ - case kElectron: - case kPositron: - hPIDESD -> Fill(AliPID::kElectron * AliTRDCalPID::kNMom + iMomBin, pidESD[0]); - break; - case kMuonPlus: - case kMuonMinus: - hPIDESD -> Fill(AliPID::kMuon * AliTRDCalPID::kNMom + iMomBin, pidESD[0]); - break; - case kPiPlus: - case kPiMinus: - hPIDESD -> Fill(AliPID::kPion * AliTRDCalPID::kNMom + iMomBin, pidESD[0]); - break; - case kKPlus: - case kKMinus: - hPIDESD -> Fill(AliPID::kKaon * AliTRDCalPID::kNMom + iMomBin, pidESD[0]); - break; - case kProton: - case kProtonBar: - hPIDESD -> Fill(AliPID::kProton * AliTRDCalPID::kNMom + iMomBin, pidESD[0]); - break; - } + Int_t species = AliTRDpidUtil::Pdg2Pid(pdg); + hPIDESD -> Fill(FindBin(species, momentum), pidESD[0]); return hPIDESD; } @@ -454,7 +387,6 @@ TH1 *AliTRDpidChecker::PlotdEdx(const AliTRDtrackV1 *track) return 0x0; } - Int_t pdg = 0; Float_t momentum = 0.; if(fMC){ @@ -467,58 +399,16 @@ TH1 *AliTRDpidChecker::PlotdEdx(const AliTRDtrackV1 *track) momentum = cTrack.GetMomentum(0); pdg = CalcPDG(&cTrack); } - if(momentum < 0.4) return 0x0;; - if(momentum > 12.) return 0x0;; - - Int_t iMomBin = fUtil -> GetMomentumBin(momentum); - - - - Float_t SumdEdx[AliTRDgeometry::kNlayer]; - AliTRDseedV1 *TRDtracklet[AliTRDgeometry::kNlayer]; - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++) TRDtracklet[iChamb] = 0x0; - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++) TRDtracklet[iChamb] = fTrack -> GetTracklet(iChamb); - - Float_t *fdEdx; - Float_t dEdxSlice[AliTRDgeometry::kNlayer][AliTRDReconstructor::kLQslices]; - + if(!IsInRange(momentum)) return 0x0; + + Int_t species = AliTRDpidUtil::Pdg2Pid(pdg); + Float_t SumdEdx = 0; + Int_t iBin = FindBin(species, momentum); for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++){ - SumdEdx[iChamb] = 0.; - fdEdx = TRDtracklet[iChamb] -> GetdEdx(); - SumdEdx[iChamb] += fdEdx[0] + fdEdx[1] + fdEdx[2]; - for(Int_t iSlice = 0; iSlice < AliTRDReconstructor::kLQslices; iSlice++){ - dEdxSlice[iChamb][iSlice] = fdEdx[iSlice]; - } - } - - switch(pdg){ - case kElectron: - case kPositron: - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++) - hdEdx -> Fill(AliPID::kElectron * AliTRDCalPID::kNMom + iMomBin, SumdEdx[iChamb]); - break; - case kMuonPlus: - case kMuonMinus: - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++) - hdEdx -> Fill(AliPID::kMuon * AliTRDCalPID::kNMom + iMomBin, SumdEdx[iChamb]); - break; - case kPiPlus: - case kPiMinus: - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++) - hdEdx -> Fill(AliPID::kPion * AliTRDCalPID::kNMom + iMomBin, SumdEdx[iChamb]); - break; - case kKPlus: - case kKMinus: - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++) - hdEdx -> Fill(AliPID::kKaon * AliTRDCalPID::kNMom + iMomBin, SumdEdx[iChamb]); - break; - case kProton: - case kProtonBar: - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++) - hdEdx -> Fill(AliPID::kProton * AliTRDCalPID::kNMom + iMomBin, SumdEdx[iChamb]); - break; + SumdEdx = 0; + for(Int_t i = 2; i--;) SumdEdx += fTrack->GetTracklet(iChamb)->GetdEdx()[i]; + hdEdx -> Fill(iBin, SumdEdx); } - return hdEdx; } @@ -556,70 +446,19 @@ TH1 *AliTRDpidChecker::PlotdEdxSlice(const AliTRDtrackV1 *track) momentum = cTrack.GetMomentum(0); pdg = CalcPDG(&cTrack); } - if(momentum < 0.4) return 0x0; - if(momentum > 12.) return 0x0;; - - Int_t iMomBin = fUtil -> GetMomentumBin(momentum); - - - - AliTRDseedV1 *TRDtracklet[AliTRDgeometry::kNlayer]; - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++) TRDtracklet[iChamb] = 0x0; - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++) TRDtracklet[iChamb] = fTrack -> GetTracklet(iChamb); + if(!IsInRange(momentum)) return 0x0; + Int_t iMomBin = fMomentumAxis->FindBin(momentum); + Int_t species = AliTRDpidUtil::Pdg2Pid(pdg); Float_t *fdEdx; - Float_t dEdxSlice[AliTRDgeometry::kNlayer][AliTRDReconstructor::kLQslices]; - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++){ - fdEdx = TRDtracklet[iChamb] -> GetdEdx(); - for(Int_t iSlice = 0; iSlice < AliTRDReconstructor::kLQslices; iSlice++){ - dEdxSlice[iChamb][iSlice] = fdEdx[iSlice]; + fdEdx = fTrack->GetTracklet(iChamb)->GetdEdx(); + for(Int_t iSlice = 0; iSlice < AliTRDpidUtil::kLQslices; iSlice++){ + hdEdxSlice -> Fill(species * fMomentumAxis->GetNbins() * AliTRDpidUtil::kLQslices + iMomBin * AliTRDpidUtil::kLQslices + iSlice, fdEdx[iSlice]); } - } - - switch(pdg){ - case kElectron: - case kPositron: - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++){ - for(Int_t iSlice = 0; iSlice < AliTRDReconstructor::kLQslices; iSlice++){ - hdEdxSlice -> Fill(AliPID::kElectron * AliTRDCalPID::kNMom * AliTRDReconstructor::kLQslices + iMomBin * AliTRDReconstructor::kLQslices + iSlice, dEdxSlice[iChamb][iSlice]); - } - } - break; - case kMuonPlus: - case kMuonMinus: - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++){ - for(Int_t iSlice = 0; iSlice < AliTRDReconstructor::kLQslices; iSlice++){ - hdEdxSlice -> Fill(AliPID::kMuon * AliTRDCalPID::kNMom * AliTRDReconstructor::kLQslices + iMomBin * AliTRDReconstructor::kLQslices + iSlice, - dEdxSlice[iChamb][iSlice]); - } - } - break; - case kPiPlus: - case kPiMinus: - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++) - for(Int_t iSlice = 0; iSlice < AliTRDReconstructor::kLQslices; iSlice++) - hdEdxSlice -> Fill(AliPID::kPion * AliTRDCalPID::kNMom * AliTRDReconstructor::kLQslices + iMomBin * AliTRDReconstructor::kLQslices + iSlice, - dEdxSlice[iChamb][iSlice]); - break; - case kKPlus: - case kKMinus: - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++) - for(Int_t iSlice = 0; iSlice < AliTRDReconstructor::kLQslices; iSlice++) - hdEdxSlice -> Fill(AliPID::kKaon * AliTRDCalPID::kNMom * AliTRDReconstructor::kLQslices + iMomBin * AliTRDReconstructor::kLQslices + iSlice, - dEdxSlice[iChamb][iSlice]); - break; - case kProton: - case kProtonBar: - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++) - for(Int_t iSlice = 0; iSlice < AliTRDReconstructor::kLQslices; iSlice++) - hdEdxSlice -> Fill(AliPID::kProton * AliTRDCalPID::kNMom * AliTRDReconstructor::kLQslices + iMomBin * AliTRDReconstructor::kLQslices + iSlice, - dEdxSlice[iChamb][iSlice]); - break; - } + } return hdEdxSlice; - } @@ -656,70 +495,19 @@ TH1 *AliTRDpidChecker::PlotPH(const AliTRDtrackV1 *track) momentum = cTrack.GetMomentum(0); pdg = CalcPDG(&cTrack); } - if(momentum < 0.4) return 0x0;; - if(momentum > 12.) return 0x0;; - - Int_t iMomBin = fUtil -> GetMomentumBin(momentum); - - AliTRDseedV1 *TRDtracklet[AliTRDgeometry::kNlayer]; - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++) TRDtracklet[iChamb] = 0x0; - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++) TRDtracklet[iChamb] = fTrack -> GetTracklet(iChamb); + if(!IsInRange(momentum)) return 0x0;; + AliTRDseedV1 *tracklet = 0x0; AliTRDcluster *TRDcluster = 0x0; - - switch(pdg){ - case kElectron: - case kPositron: - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++){ - for(Int_t iClus = 0; iClus < AliTRDtrackerV1::GetNTimeBins(); iClus++){ - if(!(TRDcluster = (AliTRDcluster*)TRDtracklet[iChamb] -> GetClusters(iClus))) - continue; - hPH -> Fill(AliPID::kElectron * AliTRDCalPID::kNMom + iMomBin, TRDcluster -> GetLocalTimeBin(), TRDtracklet[iChamb] -> GetdQdl(iClus)); - } - } - break; - case kMuonPlus: - case kMuonMinus: - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++){ - for(Int_t iClus = 0; iClus < AliTRDtrackerV1::GetNTimeBins(); iClus++){ - if(!(TRDcluster = (AliTRDcluster*)TRDtracklet[iChamb] -> GetClusters(iClus))) - continue; - hPH -> Fill(AliPID::kMuon * AliTRDCalPID::kNMom + iMomBin, TRDcluster -> GetLocalTimeBin(), TRDtracklet[iChamb] -> GetdQdl(iClus)); - } - } - break; - case kPiPlus: - case kPiMinus: - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++){ - for(Int_t iClus = 0; iClus < AliTRDtrackerV1::GetNTimeBins(); iClus++){ - if(!(TRDcluster = (AliTRDcluster*)TRDtracklet[iChamb] -> GetClusters(iClus))) - continue; - hPH -> Fill(AliPID::kPion * AliTRDCalPID::kNMom + iMomBin, TRDcluster -> GetLocalTimeBin(), TRDtracklet[iChamb] -> GetdQdl(iClus)); - } - } - break; - case kKPlus: - case kKMinus: - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++){ - for(Int_t iClus = 0; iClus < AliTRDtrackerV1::GetNTimeBins(); iClus++){ - if(!(TRDcluster = (AliTRDcluster*)TRDtracklet[iChamb] -> GetClusters(iClus))) - continue; - hPH -> Fill(AliPID::kKaon * AliTRDCalPID::kNMom + iMomBin, TRDcluster -> GetLocalTimeBin(), TRDtracklet[iChamb] -> GetdQdl(iClus)); - } - } - break; - case kProton: - case kProtonBar: - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++){ - for(Int_t iClus = 0; iClus < AliTRDtrackerV1::GetNTimeBins(); iClus++){ - if(!(TRDcluster = (AliTRDcluster*)TRDtracklet[iChamb] -> GetClusters(iClus))) - continue; - hPH -> Fill(AliPID::kProton * AliTRDCalPID::kNMom + iMomBin, TRDcluster -> GetLocalTimeBin(), TRDtracklet[iChamb] -> GetdQdl(iClus)); - } + Int_t species = AliTRDpidUtil::Pdg2Pid(pdg); + Int_t iBin = FindBin(species, momentum); + for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++){ + tracklet = fTrack->GetTracklet(iChamb); + for(Int_t iClus = 0; iClus < AliTRDtrackerV1::GetNTimeBins(); iClus++){ + if(!(TRDcluster = tracklet->GetClusters(iClus))) continue; + hPH -> Fill(iBin, TRDcluster->GetLocalTimeBin(), tracklet->GetdQdl(iClus)); } - break; } - return hPH; } @@ -758,49 +546,12 @@ TH1 *AliTRDpidChecker::PlotNClus(const AliTRDtrackV1 *track) momentum = cTrack.GetMomentum(0); pdg = CalcPDG(&cTrack); } - if(momentum < 0.4) return 0x0;; - if(momentum > 12.) return 0x0;; + if(!IsInRange(momentum)) return 0x0; - Int_t iMomBin = fUtil -> GetMomentumBin(momentum); - - - Int_t iNClus[AliTRDgeometry::kNlayer]; - memset(iNClus, 0, sizeof(Int_t) * AliTRDgeometry::kNlayer); - - AliTRDseedV1 *TRDtracklet[AliTRDgeometry::kNlayer]; - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++) TRDtracklet[iChamb] = 0x0; - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++){ - TRDtracklet[iChamb] = fTrack -> GetTracklet(iChamb); - iNClus[iChamb] = TRDtracklet[iChamb] -> GetN(); - } - - switch(pdg){ - case kElectron: - case kPositron: - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++) - hNClus -> Fill(AliPID::kElectron * AliTRDCalPID::kNMom + iMomBin, iNClus[iChamb]); - break; - case kMuonPlus: - case kMuonMinus: - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++) - hNClus -> Fill(AliPID::kMuon * AliTRDCalPID::kNMom + iMomBin, iNClus[iChamb]); - break; - case kPiPlus: - case kPiMinus: - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++) - hNClus -> Fill(AliPID::kPion * AliTRDCalPID::kNMom + iMomBin, iNClus[iChamb]); - break; - case kKPlus: - case kKMinus: - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++) - hNClus -> Fill(AliPID::kKaon * AliTRDCalPID::kNMom + iMomBin, iNClus[iChamb]); - break; - case kProton: - case kProtonBar: - for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++) - hNClus -> Fill(AliPID::kProton * AliTRDCalPID::kNMom + iMomBin, iNClus[iChamb]); - break; - } + Int_t species = AliTRDpidUtil::AliTRDpidUtil::Pdg2Pid(pdg); + Int_t iBin = FindBin(species, momentum); + for(Int_t iChamb = 0; iChamb < AliTRDgeometry::kNlayer; iChamb++) + hNClus -> Fill(iBin, fTrack->GetTracklet(iChamb)->GetN()); return hNClus; } @@ -840,10 +591,7 @@ TH1 *AliTRDpidChecker::PlotMom(const AliTRDtrackV1 *track) momentum = cTrack.GetMomentum(0); pdg = CalcPDG(&cTrack); } - if(momentum < 0.4) return 0x0; - if(momentum > 12.) return 0x0;; - - hMom -> Fill(momentum); + if(IsInRange(momentum)) hMom -> Fill(momentum); return hMom; } @@ -881,13 +629,8 @@ TH1 *AliTRDpidChecker::PlotMomBin(const AliTRDtrackV1 *track) AliTRDtrackV1 cTrack(*fTrack); cTrack.SetReconstructor(fReconstructor); momentum = cTrack.GetMomentum(0); - pdg = CalcPDG(&cTrack); } - if(momentum < 0.4) return 0x0; - if(momentum > 12.) return 0x0;; - - Int_t iMomBin = fUtil -> GetMomentumBin(momentum); - hMomBin -> Fill(iMomBin); + if(IsInRange(momentum)) hMomBin -> Fill(fMomentumAxis->FindBin(momentum)); return hMomBin; } @@ -902,26 +645,26 @@ Bool_t AliTRDpidChecker::GetRefFigure(Int_t ifig) TAxis *ax = 0x0; TH1 *h1 = 0x0, *h=0x0; TH2 *h2 = 0x0; - TObjArray *arr = 0x0; + TList *content = 0x0; switch(ifig){ case kEfficiency: - arr = (TObjArray*)fGraph->At(ifig); - if(!(g = (TGraphErrors*)arr->At(kLQ))) break; + content = (TList *)fGraph->FindObject("Efficiencies"); + if(!(g = (TGraphErrors*)content->At(AliTRDpidUtil::kLQ))) break; if(!g->GetN()) break; leg->SetHeader("PID Method"); g->Draw("apl"); ax = g->GetHistogram()->GetXaxis(); ax->SetTitle("p [GeV/c]"); - ax->SetRangeUser(.6, 10.5); +// ax->SetRangeUser(.6, 10.5); ax->SetMoreLogLabels(); ax = g->GetHistogram()->GetYaxis(); ax->SetTitle("#epsilon_{#pi} [%]"); ax->SetRangeUser(1.e-3, 1.e-1); leg->AddEntry(g, "2D LQ", "pl"); - if(! (g = (TGraphErrors*)arr->At(kNN))) break; + if(! (g = (TGraphErrors*)content->At(AliTRDpidUtil::kNN))) break; g->Draw("pl"); leg->AddEntry(g, "NN", "pl"); - if(! (g = (TGraphErrors*)arr->At(kESD))) break; + if(! (g = (TGraphErrors*)content->At(AliTRDpidUtil::kESD))) break; g->Draw("p"); leg->AddEntry(g, "ESD", "pl"); leg->Draw(); @@ -936,7 +679,7 @@ Bool_t AliTRDpidChecker::GetRefFigure(Int_t ifig) if(!(h2 = (TH2F*)(fContainer->At(kdEdx)))) break; leg->SetHeader("Particle Species"); for(Int_t is = AliPID::kSPECIES-1; is>=0; is--){ - Int_t bin = is*AliTRDCalPID::kNMom+4; + Int_t bin = FindBin(is, 2.); h1 = h2->ProjectionY("px", bin, bin); if(!h1->GetEntries()) continue; h1->Scale(1./h1->Integral()); @@ -960,7 +703,7 @@ Bool_t AliTRDpidChecker::GetRefFigure(Int_t ifig) if(!(h2 = (TH2F*)(fContainer->At(kPH)))) break;; leg->SetHeader("Particle Species"); for(Int_t is=0; isProjectionY("py", bin, bin); if(!h1->GetEntries()) continue; h1->SetMarkerStyle(24); @@ -987,7 +730,7 @@ Bool_t AliTRDpidChecker::GetRefFigure(Int_t ifig) if(!(h2 = (TH2F*)(fContainer->At(kNClus)))) break; leg->SetHeader("Particle Species"); for(Int_t is=0; isProjectionY("py", bin, bin); if(!h1->GetEntries()) continue; //h1->SetMarkerStyle(24); @@ -1009,23 +752,23 @@ Bool_t AliTRDpidChecker::GetRefFigure(Int_t ifig) case kMomentumBin: break; case kThresh: - arr = (TObjArray*)fGraph->FindObject("Thresholds"); - if(!(g = (TGraphErrors*)arr->At(kLQ))) break; + content = (TList *)fGraph->FindObject("Thresholds"); + if(!(g = (TGraphErrors*)content->At(AliTRDpidUtil::kLQ))) break; if(!g->GetN()) break; leg->SetHeader("PID Method"); g->Draw("apl"); ax = g->GetHistogram()->GetXaxis(); ax->SetTitle("p [GeV/c]"); - ax->SetRangeUser(.6, 10.5); + //ax->SetRangeUser(.6, 10.5); ax->SetMoreLogLabels(); ax = g->GetHistogram()->GetYaxis(); ax->SetTitle("threshold"); ax->SetRangeUser(5.e-2, 1.); leg->AddEntry(g, "2D LQ", "pl"); - if(!(g = (TGraphErrors*)arr->At(kNN))) break; + if(!(g = (TGraphErrors*)content->At(AliTRDpidUtil::kNN))) break; g->Draw("pl"); leg->AddEntry(g, "NN", "pl"); - if(!(g = (TGraphErrors*)arr->At(kESD))) break; + if(!(g = (TGraphErrors*)content->At(AliTRDpidUtil::kESD))) break; g->Draw("p"); leg->AddEntry(g, "ESD", "pl"); leg->Draw(); @@ -1053,34 +796,32 @@ Bool_t AliTRDpidChecker::PostProcess() return 0x0; } if(!fGraph){ - fGraph = new TObjArray(2); + fGraph = new TObjArray(6); fGraph->SetOwner(); + EvaluatePionEfficiency(fEfficiency, fGraph, 0.9); } - EvaluatePionEfficiency(fEfficiency, fGraph, 0.9); fNRefFigures = 8; return kTRUE; } //________________________________________________________________________ -void AliTRDpidChecker::EvaluatePionEfficiency(TObjArray *histoContainer, TObjArray *results, Float_t electron_efficiency) -{ - if(!histoContainer || !results) return; - +void AliTRDpidChecker::EvaluatePionEfficiency(TObjArray *histoContainer, TObjArray *results, Float_t electron_efficiency){ TGraphErrors *g = 0x0; fUtil->SetElectronEfficiency(electron_efficiency); // efficiency graphs + TGraphErrors *gPtrEff[3], *gPtrThres[3]; TObjArray *eff = new TObjArray(3); eff->SetOwner(); eff->SetName("Efficiencies"); results->AddAt(eff, 0); - eff->AddAt(g = new TGraphErrors(), kLQ); + eff->AddAt(gPtrEff[AliTRDpidUtil::kLQ] = new TGraphErrors(), AliTRDpidUtil::kLQ); g->SetLineColor(kBlue); g->SetMarkerColor(kBlue); g->SetMarkerStyle(7); - eff->AddAt(g = new TGraphErrors(), kNN); + eff->AddAt(gPtrEff[AliTRDpidUtil::kNN] = new TGraphErrors(), AliTRDpidUtil::kNN); g->SetLineColor(kGreen); g->SetMarkerColor(kGreen); g->SetMarkerStyle(7); - eff -> AddAt(g = new TGraphErrors(), kESD); + eff -> AddAt(gPtrEff[AliTRDpidUtil::kESD] = new TGraphErrors(), AliTRDpidUtil::kESD); g->SetLineColor(kRed); g->SetMarkerColor(kRed); g->SetMarkerStyle(24); @@ -1088,15 +829,15 @@ void AliTRDpidChecker::EvaluatePionEfficiency(TObjArray *histoContainer, TObjArr // Threshold graphs TObjArray *thres = new TObjArray(3); thres->SetOwner(); thres->SetName("Thresholds"); results->AddAt(thres, 1); - thres->AddAt(g = new TGraphErrors(), kLQ); + thres->AddAt(gPtrThres[AliTRDpidUtil::kLQ] = new TGraphErrors(), AliTRDpidUtil::kLQ); g->SetLineColor(kBlue); g->SetMarkerColor(kBlue); g->SetMarkerStyle(7); - thres->AddAt(g = new TGraphErrors(), kNN); + thres->AddAt(gPtrThres[AliTRDpidUtil::kNN] = new TGraphErrors(), AliTRDpidUtil::kNN); g->SetLineColor(kGreen); g->SetMarkerColor(kGreen); g->SetMarkerStyle(7); - thres -> AddAt(g = new TGraphErrors(), kESD); + thres -> AddAt(gPtrThres[AliTRDpidUtil::kESD] = new TGraphErrors(), AliTRDpidUtil::kESD); g->SetLineColor(kRed); g->SetMarkerColor(kRed); g->SetMarkerStyle(24); @@ -1104,68 +845,32 @@ void AliTRDpidChecker::EvaluatePionEfficiency(TObjArray *histoContainer, TObjArr Float_t mom = 0.; TH1D *Histo1=0x0, *Histo2=0x0; - // calculate the pion efficiencies and the errors for 90% electron efficiency (2-dim LQ) - TH2F *hPIDLQ = (TH2F*)histoContainer->At(kLQ); - for(Int_t iMom = 0; iMom < AliTRDCalPID::kNMom; iMom++){ - mom = AliTRDCalPID::GetMomentum(iMom); - - Histo1 = hPIDLQ -> ProjectionY("LQ_ele",AliTRDCalPID::kNMom*AliPID::kElectron+iMom+1,AliTRDCalPID::kNMom*AliPID::kElectron+iMom+1); - Histo2 = hPIDLQ -> ProjectionY("LQ_pio",AliTRDCalPID::kNMom*AliPID::kPion+iMom+1,AliTRDCalPID::kNMom*AliPID::kPion+iMom+1); - - if(!fUtil->CalculatePionEffi(Histo1, Histo2)) continue; - - g = (TGraphErrors*)eff->At(kLQ); - g->SetPoint(iMom, mom, fUtil->GetPionEfficiency()); - g->SetPointError(iMom, 0., fUtil->GetError()); - g = (TGraphErrors*)thres->At(kLQ); - g->SetPoint(iMom, mom, fUtil->GetThreshold()); - g->SetPointError(iMom, 0., 0.); - - if(fDebugLevel>=2) Printf("Pion Efficiency for 2-dim LQ is : %f +/- %f\n\n", fUtil->GetPionEfficiency(), fUtil->GetError()); - } + TH2F *hPtr[3]; + hPtr[0] = (TH2F*)histoContainer->At(AliTRDpidUtil::kLQ); + hPtr[1] = (TH2F*)histoContainer->At(AliTRDpidUtil::kNN); + hPtr[2] = (TH2F*)histoContainer->At(AliTRDpidUtil::kESD); + TString MethodName[3] = {"LQ", "NN", "ESD"}; - - // calculate the pion efficiencies and the errors for 90% electron efficiency (NN) - TH2F *hPIDNN = (TH2F*)histoContainer->At(kNN); - for(Int_t iMom = 0; iMom < AliTRDCalPID::kNMom; iMom++){ - mom = AliTRDCalPID::GetMomentum(iMom); - - Histo1 = hPIDNN -> ProjectionY("NN_ele",AliTRDCalPID::kNMom*AliPID::kElectron+iMom+1,AliTRDCalPID::kNMom*AliPID::kElectron+iMom+1); - Histo2 = hPIDNN -> ProjectionY("NN_pio",AliTRDCalPID::kNMom*AliPID::kPion+iMom+1,AliTRDCalPID::kNMom*AliPID::kPion+iMom+1); - - if(!fUtil -> CalculatePionEffi(Histo1, Histo2)) continue; - - g = (TGraphErrors*)eff->At(kNN); - g->SetPoint(iMom, mom, fUtil->GetPionEfficiency()); - g->SetPointError(iMom, 0., fUtil->GetError()); - g = (TGraphErrors*)thres->At(kNN); - g->SetPoint(iMom, mom, fUtil->GetThreshold()); - g->SetPointError(iMom, 0., 0.); - - if(fDebugLevel>=2) Printf("Pion Efficiency for NN is : %f +/- %f\n\n", fUtil->GetPionEfficiency(), fUtil->GetError()); - } - - - // calculate the pion efficiencies and the errors for 90% electron efficiency (ESD) - TH2F *hPIDESD = (TH2F*)histoContainer->At(kESD); - for(Int_t iMom = 0; iMom < AliTRDCalPID::kNMom; iMom++){ - mom = AliTRDCalPID::GetMomentum(iMom); - - Histo1 = hPIDESD -> ProjectionY("NN_ele",AliTRDCalPID::kNMom*AliPID::kElectron+iMom+1,AliTRDCalPID::kNMom*AliPID::kElectron+iMom+1); - Histo2 = hPIDESD -> ProjectionY("NN_pio",AliTRDCalPID::kNMom*AliPID::kPion+iMom+1,AliTRDCalPID::kNMom*AliPID::kPion+iMom+1); - - if(!fUtil->CalculatePionEffi(Histo1, Histo2)) continue; - - g = (TGraphErrors*)eff->At(kESD); - g->SetPoint(iMom, mom, fUtil->GetPionEfficiency()); - g->SetPointError(iMom, 0., fUtil->GetError()); - g = (TGraphErrors*)thres->At(kESD); - g->SetPoint(iMom, mom, fUtil->GetThreshold()); - g->SetPointError(iMom, 0., 0.); - - if(fDebugLevel>=2) Printf("Pion Efficiency for ESD is : %f +/- %f\n\n", fUtil->GetPionEfficiency(), fUtil->GetError()); + for(Int_t iMom = 0; iMom < fMomentumAxis->GetNbins(); iMom++){ + mom = fMomentumAxis->GetBinCenter(iMom); + + Int_t binEl = fMomentumAxis->GetNbins() * AliPID::kElectron + iMom + 1, + binPi = fMomentumAxis->GetNbins() * AliPID::kPion + iMom + 1; + for(Int_t iMethod = 0; iMethod < 3; iMethod++){ + // Calculate the Pion Efficiency at 90% electron efficiency for each Method + Histo1 = hPtr[iMethod] -> ProjectionY(Form("%s_ele", MethodName[iMethod].Data()), binEl, binEl); + Histo2 = hPtr[iMethod] -> ProjectionY(Form("%s_pio", MethodName[iMethod].Data()), binPi, binPi); + + if(!fUtil->CalculatePionEffi(Histo1, Histo2)) continue; + + gPtrEff[iMethod]->SetPoint(iMom, mom, fUtil->GetPionEfficiency()); + gPtrEff[iMethod]->SetPointError(iMom, 0., fUtil->GetError()); + gPtrThres[iMethod]->SetPoint(iMom, mom, fUtil->GetThreshold()); + gPtrThres[iMethod]->SetPointError(iMom, 0., 0.); + + if(fDebugLevel>=2) Printf(Form("Pion Efficiency for 2-dim LQ is : %f +/- %f\n\n", MethodName[iMethod].Data()), fUtil->GetPionEfficiency(), fUtil->GetError()); + } } - } //________________________________________________________________________ diff --git a/TRD/qaRec/AliTRDpidChecker.h b/TRD/qaRec/AliTRDpidChecker.h index c14a65aeeaf..63d0bc5e236 100644 --- a/TRD/qaRec/AliTRDpidChecker.h +++ b/TRD/qaRec/AliTRDpidChecker.h @@ -6,9 +6,15 @@ // Task to check PID performance of the TRD // // Author : Alex Wilk +// Alex Bercuci +// Markus Fasel // /////////////////////////////////////////////////////// +#ifndef ROOT_TAxis +#include "TAxis.h" +#endif + #ifndef ALITRDRECOTASK_H #include "AliTRDrecoTask.h" #endif @@ -28,12 +34,6 @@ class AliTRDpidChecker : public AliTRDrecoTask ,kMomentumBin = 6 // momentum distribution ,kThresh = 7 // threshold in efficiency }; - // PID methods - enum { - kLQ = 0 // 2D likelihood method - ,kNN = 1 // Neural network method - ,kESD = 2 // ESD results - check offline - }; public: AliTRDpidChecker(); virtual ~AliTRDpidChecker(); @@ -56,6 +56,9 @@ public: TObjArray *GetGraphs() { return fGraph; }; virtual TObjArray *Histos(); void EvaluatePionEfficiency(TObjArray *histoContainer, TObjArray *results, Float_t electron_efficiency); + inline void SetMomentumBinning(Int_t nBins, Double_t *bins); + inline Int_t FindBin(Int_t species, Double_t momentum); + inline Bool_t IsInRange(Double_t momentum); private: AliTRDpidChecker(const AliTRDpidChecker&); // not implemented @@ -68,8 +71,33 @@ private: AliTRDpidUtil *fUtil; //! utility class for PID calculations TObjArray *fGraph; //! array of graphs filled in PostProcess TObjArray *fEfficiency; //! array of histograms with efficiency - + TAxis *fMomentumAxis; //! helper mementum binning ClassDef(AliTRDpidChecker, 1); // TRD PID checker }; +//________________________________________________________________________ +inline void AliTRDpidChecker::SetMomentumBinning(Int_t nBins, Double_t *bins){ + // + // Set the Momentum Bins + // + if(fMomentumAxis) delete fMomentumAxis; + fMomentumAxis = new TAxis(nBins, bins); +} + +//________________________________________________________________________ +inline Int_t AliTRDpidChecker::FindBin(Int_t species, Double_t momentum){ + // + // Find the Bin in the 2D Histogram + // + return species * fMomentumAxis->GetNbins() + fMomentumAxis->FindBin(momentum); +} + +//________________________________________________________________________ +inline Bool_t AliTRDpidChecker::IsInRange(Double_t momentum){ + // + // Check Whether momentum is in the defined Range + // + return (momentum >= fMomentumAxis->GetXmin() && momentum <= fMomentumAxis->GetXmax()); +} + #endif diff --git a/TRD/qaRec/AliTRDpidRefMaker.cxx b/TRD/qaRec/AliTRDpidRefMaker.cxx index de9322af0da..70d8ad345fe 100644 --- a/TRD/qaRec/AliTRDpidRefMaker.cxx +++ b/TRD/qaRec/AliTRDpidRefMaker.cxx @@ -107,7 +107,7 @@ void AliTRDpidRefMaker::CreateOutputObjects() fNN->Branch("fLayer", &fLayer, "fLayer/I"); fNN->Branch("fMom", &fMom, "fMom/F"); fNN->Branch("fv0pid", fv0pid, Form("fv0pid[%d]/F", AliPID::kSPECIES)); - fNN->Branch("fdEdx", fdEdx, Form("fdEdx[%d]/F", AliTRDReconstructor::kNNslices)); + fNN->Branch("fdEdx", fdEdx, Form("fdEdx[%d]/F", AliTRDpidUtil::kNNslices)); // open reference TTree for LQ OpenFile(2, "RECREATE"); @@ -115,7 +115,7 @@ void AliTRDpidRefMaker::CreateOutputObjects() fLQ->Branch("fLayer", &fLayer, "fLayer/I"); fLQ->Branch("fMom", &fMom, "fMom/F"); fLQ->Branch("fv0pid", fv0pid, Form("fv0pid[%d]/F", AliPID::kSPECIES)); - fLQ->Branch("fdEdx", fdEdx, Form("fdEdx[%d]/F", AliTRDReconstructor::kLQslices)); + fLQ->Branch("fdEdx", fdEdx, Form("fdEdx[%d]/F", AliTRDpidUtil::kLQslices)); } @@ -205,11 +205,11 @@ void AliTRDpidRefMaker::Exec(Option_t *) fReconstructor -> SetOption("nn"); for(Int_t ily = 0; ily < AliTRDgeometry::kNlayer; ily++){ if(!(TRDtracklet = TRDtrack -> GetTracklet(ily))) continue; - TRDtracklet->CookdEdx(AliTRDReconstructor::kNNslices); + TRDtracklet->CookdEdx(AliTRDpidUtil::kNNslices); dedx = TRDtracklet->GetdEdx(); - for(Int_t iSlice = 0; iSlice < AliTRDReconstructor::kNNslices; iSlice++) + for(Int_t iSlice = 0; iSlice < AliTRDpidUtil::kNNslices; iSlice++) dedx[iSlice] = dedx[iSlice]/AliTRDCalPIDNN::kMLPscale; - memcpy(fdEdx, dedx, AliTRDReconstructor::kNNslices*sizeof(Float_t)); + memcpy(fdEdx, dedx, AliTRDpidUtil::kNNslices*sizeof(Float_t)); if(fDebugLevel>=2) Printf("LayerNN : %d", ily); fLayer = ily; fNN->Fill(); @@ -220,9 +220,9 @@ void AliTRDpidRefMaker::Exec(Option_t *) fReconstructor -> SetOption("!nn"); for(Int_t ily = 0; ily < AliTRDgeometry::kNlayer; ily++){ if(!(TRDtracklet = TRDtrack -> GetTracklet(ily))) continue; - TRDtracklet->CookdEdx(AliTRDReconstructor::kLQslices); + TRDtracklet->CookdEdx(AliTRDpidUtil::kLQslices); dedx = TRDtracklet->GetdEdx(); - memcpy(fdEdx, dedx, AliTRDReconstructor::kLQslices*sizeof(Float_t)); + memcpy(fdEdx, dedx, AliTRDpidUtil::kLQslices*sizeof(Float_t)); if(fDebugLevel>=2) Printf("LayerLQ : %d", ily); fLayer = ily; fLQ->Fill(); -- 2.43.0