From 4ba1d6aecfe3ebbe304d2ed31b7b7c8ad63aa315 Mon Sep 17 00:00:00 2001 From: cblume Date: Tue, 10 Jun 2008 13:57:04 +0000 Subject: [PATCH] Introduce an enumerator for PID methods --- TRD/AliTRDcalibDB.cxx | 10 +- TRD/AliTRDcalibDB.h | 14 ++- TRD/AliTRDgeometry.cxx | 7 +- TRD/AliTRDgtuTrack.cxx | 10 +- TRD/AliTRDpidESD.cxx | 9 +- TRD/AliTRDrecoParam.cxx | 2 +- TRD/AliTRDrecoParam.h | 201 ++++++++++++++++++++-------------------- TRD/AliTRDseedV1.cxx | 12 ++- TRD/AliTRDtrack.cxx | 2 +- 9 files changed, 151 insertions(+), 116 deletions(-) diff --git a/TRD/AliTRDcalibDB.cxx b/TRD/AliTRDcalibDB.cxx index 3e710ec9124..4eff278aed8 100644 --- a/TRD/AliTRDcalibDB.cxx +++ b/TRD/AliTRDcalibDB.cxx @@ -915,17 +915,17 @@ Bool_t AliTRDcalibDB::IsChamberMasked(Int_t det) } //_____________________________________________________________________________ -const AliTRDCalPID *AliTRDcalibDB::GetPIDObject(const Int_t method) +const AliTRDCalPID *AliTRDcalibDB::GetPIDObject(AliTRDrecoParam::AliTRDpidMethod method) { // // Returns the object storing the distributions for PID with likelihood // switch(method) { - case 0: return dynamic_cast - (GetCachedCDBObject(kIDPIDLQ)); - case 1: return dynamic_cast - (GetCachedCDBObject(kIDPIDNN)); + case AliTRDrecoParam::kLQPID: + return dynamic_cast(GetCachedCDBObject(kIDPIDLQ)); + case AliTRDrecoParam::kNNPID: + return dynamic_cast(GetCachedCDBObject(kIDPIDNN)); } return 0x0; diff --git a/TRD/AliTRDcalibDB.h b/TRD/AliTRDcalibDB.h index 0d22a03b5d1..9942ea2044f 100644 --- a/TRD/AliTRDcalibDB.h +++ b/TRD/AliTRDcalibDB.h @@ -11,7 +11,13 @@ /* $Id$ */ +#ifndef ROOT_TObject #include "TObject.h" +#endif + +#ifndef ALITRDRECOPARAM_H +#include "AliTRDrecoParam.h" +#endif class AliCDBEntry; @@ -52,10 +58,10 @@ class AliTRDcalibDB : public TObject { Float_t GetGainFactor(Int_t det, Int_t col, Int_t row); Float_t GetGainFactorAverage(Int_t det); - AliTRDCalROC *GetGainFactorROC(Int_t det); + AliTRDCalROC *GetGainFactorROC(Int_t det); const AliTRDCalDet *GetGainFactorDet(); - AliTRDCalROC *GetPRFROC(Int_t det); + AliTRDCalROC *GetPRFROC(Int_t det); Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row); Float_t* GetSampledPRF() { return fPRFsmp; }; @@ -66,7 +72,7 @@ class AliTRDcalibDB : public TObject { Int_t GetNumberOfTimeBins(); Char_t GetPadStatus(Int_t det, Int_t col, Int_t row); - AliTRDCalSingleChamberStatus *GetPadStatusROC(Int_t det); + AliTRDCalSingleChamberStatus *GetPadStatusROC(Int_t det); Char_t GetChamberStatus(Int_t det); @@ -79,7 +85,7 @@ class AliTRDcalibDB : public TObject { Bool_t IsChamberMasked(Int_t det); const AliTRDCalMonitoring *GetMonitoringObject(); - const AliTRDCalPID *GetPIDObject(const Int_t method); + const AliTRDCalPID *GetPIDObject(AliTRDrecoParam::AliTRDpidMethod method); // 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 4ed5abb7e37..a901f8d8b75 100644 --- a/TRD/AliTRDgeometry.cxx +++ b/TRD/AliTRDgeometry.cxx @@ -1942,9 +1942,12 @@ void AliTRDgeometry::CreateServices(Int_t *idtmed) // The upper most layer // Along the chambers +// xpos = fCwidth[5]/2.0 + kPWRhgt/2.0 - 1.3; +// ypos = fgkSheight/2.0 - fgkSMpltT - 0.6 - kPWRwid/2.0; +// zpos = 0.0; xpos = fCwidth[5]/2.0 + kPWRhgt/2.0 - 1.3; - ypos = fgkSheight/2.0 - fgkSMpltT - 0.6 - kPWRwid/2.0; - zpos = 0.0; + ypos = 0.0; + zpos = fgkSheight/2.0 - fgkSMpltT - 0.6 - kPWRwid/2.0; parPWR[0] = kPWRwid /2.0; parPWR[1] = fgkSlength/2.0; parPWR[2] = kPWRhgt /2.0; diff --git a/TRD/AliTRDgtuTrack.cxx b/TRD/AliTRDgtuTrack.cxx index 99fcdcd64ce..35390681e81 100644 --- a/TRD/AliTRDgtuTrack.cxx +++ b/TRD/AliTRDgtuTrack.cxx @@ -29,6 +29,7 @@ #include "AliLog.h" +#include "AliTRDReconstructor.h" #include "AliTRDgeometry.h" #include "AliTRDcalibDB.h" #include "AliTRDltuTracklet.h" @@ -390,7 +391,14 @@ void AliTRDgtuTrack::MakePID() AliError("No instance of AliTRDcalibDB."); return; } - const AliTRDCalPID *pd = calibration->GetPIDObject(1); + + AliTRDrecoParam *rec = AliTRDReconstructor::RecoParam(); + if (!rec) { + AliError("No TRD reco param."); + return; + } + + const AliTRDCalPID *pd = calibration->GetPIDObject(rec->GetPIDMethod()); AliTRDltuTracklet *trk; Int_t nTracklets = GetNtracklets(); diff --git a/TRD/AliTRDpidESD.cxx b/TRD/AliTRDpidESD.cxx index dcb38c5f87c..e607b106688 100644 --- a/TRD/AliTRDpidESD.cxx +++ b/TRD/AliTRDpidESD.cxx @@ -37,6 +37,7 @@ #include "AliTracker.h" #include "AliRun.h" +#include "AliTRDReconstructor.h" #include "AliTRDpidESD.h" #include "AliTRDgeometry.h" #include "AliTRDcalibDB.h" @@ -133,8 +134,14 @@ Int_t AliTRDpidESD::MakePID(AliESDEvent *event) 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(1); + const AliTRDCalPID *pd = calibration->GetPIDObject(rec->GetPIDMethod()); if (!pd) { AliErrorGeneral("AliTRDpidESD::MakePID()" ,"No access to AliTRDCalPID"); diff --git a/TRD/AliTRDrecoParam.cxx b/TRD/AliTRDrecoParam.cxx index e286eafd615..d8b28c263d8 100644 --- a/TRD/AliTRDrecoParam.cxx +++ b/TRD/AliTRDrecoParam.cxx @@ -34,7 +34,7 @@ ClassImp(AliTRDrecoParam) AliTRDrecoParam::AliTRDrecoParam() :AliDetectorRecoParam() ,fkClusterSharing(0) - ,fkPIDMethod(0) // LQ PID + ,fkPIDMethod(kLQPID) // LQ PID ,fkMaxTheta(1.0) ,fkMaxPhi(2.0) ,fkRoad0y(6.0) diff --git a/TRD/AliTRDrecoParam.h b/TRD/AliTRDrecoParam.h index a9bf493624f..9de90504366 100644 --- a/TRD/AliTRDrecoParam.h +++ b/TRD/AliTRDrecoParam.h @@ -1,7 +1,7 @@ #ifndef ALITRDRECOPARAM_H #define ALITRDRECOPARAM_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * - * See cxx source for full Copyright notice */ +* See cxx source for full Copyright notice */ /* $Id$ */ @@ -17,108 +17,113 @@ class AliTRDrecoParam : public AliDetectorRecoParam { - public: - enum{ - kNNslices = 8, - kLQslices = 3 - }; - - AliTRDrecoParam(); - ~AliTRDrecoParam() { } - - Double_t GetChi2Y() const { return fkChi2Y; } - Double_t GetChi2Z() const { return fkChi2Z; } - Bool_t GetClusterSharing() const { return fkClusterSharing;} - Double_t GetFindableClusters() const { return fkFindable; } - Double_t GetMaxTheta() const { return fkMaxTheta; } - Double_t GetMaxPhi() const { return fkMaxPhi; } - Int_t GetNdEdxSlices() const { return fkPIDMethod ? kNNslices : kLQslices;} - Int_t GetPIDMethod() const { return fkPIDMethod;} - Double_t GetRoad0y() const { return fkRoad0y; } - Double_t GetRoad0z() const { return fkRoad0z; } - - Double_t GetRoad1y() const { return fkRoad1y; } - Double_t GetRoad1z() const { return fkRoad1z; } - - Double_t GetRoad2y() const { return fkRoad2y; } - Double_t GetRoad2z() const { return fkRoad2z; } - - Double_t GetPlaneQualityThreshold() const { return fkPlaneQualityThreshold; } - - Double_t GetTrackLikelihood() const { return fkTrackLikelihood; } - Int_t GetStreamLevel() const { return fkStreamLevel; } - - Bool_t SeedingOn() const { return fSeedingOn; } - Bool_t IsVertexConstrained() const { return fVertexConstrained; } - - Double_t GetMinMaxCutSigma() const { return fMinMaxCutSigma; }; - Double_t GetMinLeftRightCutSigma() const { return fMinLeftRightCutSigma; }; - Double_t GetClusMaxThresh() const { return fClusMaxThresh; }; - Double_t GetClusSigThresh() const { return fClusSigThresh; }; - Int_t GetTCnexp() const { return fTCnexp; }; - Bool_t LUTOn() const { return fLUTOn; }; - Bool_t TCOn() const { return fTCOn; }; - - Int_t GetADCbaseline() const { return fADCbaseline; }; +public: + enum AliTRDpidMethod{ + kLQPID = 0, + kNNPID = 1 + }; + + AliTRDrecoParam(); + ~AliTRDrecoParam() { } + + Double_t GetChi2Y() const { return fkChi2Y; } + Double_t GetChi2Z() const { return fkChi2Z; } + Bool_t GetClusterSharing() const { return fkClusterSharing;} + Double_t GetFindableClusters() const { return fkFindable; } + Double_t GetMaxTheta() const { return fkMaxTheta; } + Double_t GetMaxPhi() const { return fkMaxPhi; } + Int_t GetNdEdxSlices() const { return fkPIDMethod == kNNPID ? kNNslices : kLQslices;} + AliTRDpidMethod GetPIDMethod() const { return fkPIDMethod;} + Double_t GetRoad0y() const { return fkRoad0y; } + Double_t GetRoad0z() const { return fkRoad0z; } + + Double_t GetRoad1y() const { return fkRoad1y; } + Double_t GetRoad1z() const { return fkRoad1z; } + + Double_t GetRoad2y() const { return fkRoad2y; } + Double_t GetRoad2z() const { return fkRoad2z; } + + Double_t GetPlaneQualityThreshold() const { return fkPlaneQualityThreshold; } + + Double_t GetTrackLikelihood() const { return fkTrackLikelihood; } + Int_t GetStreamLevel() const { return fkStreamLevel; } + + Bool_t SeedingOn() const { return fSeedingOn; } + Bool_t IsVertexConstrained() const { return fVertexConstrained; } + + Double_t GetMinMaxCutSigma() const { return fMinMaxCutSigma; }; + Double_t GetMinLeftRightCutSigma() const { return fMinLeftRightCutSigma; }; + Double_t GetClusMaxThresh() const { return fClusMaxThresh; }; + Double_t GetClusSigThresh() const { return fClusSigThresh; }; + Int_t GetTCnexp() const { return fTCnexp; }; + Bool_t LUTOn() const { return fLUTOn; }; + Bool_t TCOn() const { return fTCOn; }; + + Int_t GetADCbaseline() const { return fADCbaseline; }; - static AliTRDrecoParam *GetLowFluxParam(); - static AliTRDrecoParam *GetHighFluxParam(); - static AliTRDrecoParam *GetCosmicTestParam(); - - void SetClusterSharing(Bool_t share = kTRUE) { fkClusterSharing = share; }; - void SetPIDMethod(Int_t pid = 1) { fkPIDMethod = pid ? 1 : 0; }; - void SetSeedingOn(Bool_t seedingOn = kTRUE) { fSeedingOn = seedingOn; } - void SetVertexConstrained(Bool_t vertexConstrained = kTRUE) { fVertexConstrained = vertexConstrained; } - void SetStreamLevel(Int_t streamLevel= 1) { fkStreamLevel = streamLevel; } - void SetLUT(Int_t lutOn = 1) { fLUTOn = lutOn; }; - void SetMinMaxCutSigma(Float_t minMaxCutSigma) { fMinMaxCutSigma = minMaxCutSigma; }; - void SetMinLeftRightCutSigma(Float_t minLeftRightCutSigma) { fMinLeftRightCutSigma = minLeftRightCutSigma; }; - void SetClusMaxThresh(Float_t thresh) { fClusMaxThresh = thresh; }; - void SetClusSigThresh(Float_t thresh) { fClusSigThresh = thresh; }; - void SetTailCancelation(Int_t tcOn = 1) { fTCOn = tcOn; }; - void SetNexponential(Int_t nexp) { fTCnexp = nexp; }; - void SetADCbaseline(Int_t base) { fADCbaseline = base; }; - - private: - - // Tracking parameters - Bool_t fkClusterSharing; // Toggle cluster sharing - Int_t fkPIDMethod; // PID method selector 0(LQ) 1(NN) - Double_t fkMaxTheta; // Maximum theta - Double_t fkMaxPhi; // Maximum phi - - Double_t fkRoad0y; // Road for middle cluster - Double_t fkRoad0z; // Road for middle cluster - - Double_t fkRoad1y; // Road in y for seeded cluster - Double_t fkRoad1z; // Road in z for seeded cluster - - Double_t fkRoad2y; // Road in y for extrapolated cluster - Double_t fkRoad2z; // Road in z for extrapolated cluster - - Double_t fkPlaneQualityThreshold; // Quality threshold - Double_t fkFindable; // Ratio of clusters from a track in one chamber which are at minimum supposed to be found. - Double_t fkChi2Z; // Max chi2 on the z direction for seeding clusters fit - Double_t fkChi2Y; // Max chi2 on the y direction for seeding clusters Rieman fit - Double_t fkTrackLikelihood; // Track likelihood for tracklets Rieman fit - Int_t fkStreamLevel; // Streaming Level in TRD Reconstruction - - Bool_t fSeedingOn; // Do stand alone tracking in the TRD - Bool_t fVertexConstrained; // Perform vertex constrained fit + static AliTRDrecoParam *GetLowFluxParam(); + static AliTRDrecoParam *GetHighFluxParam(); + static AliTRDrecoParam *GetCosmicTestParam(); + + void SetClusterSharing(Bool_t share = kTRUE) { fkClusterSharing = share; }; + void SetPIDMethod(AliTRDpidMethod pid) { fkPIDMethod = pid; }; + void SetSeedingOn(Bool_t seedingOn = kTRUE) { fSeedingOn = seedingOn; } + void SetVertexConstrained(Bool_t vertexConstrained = kTRUE) { fVertexConstrained = vertexConstrained; } + void SetStreamLevel(Int_t streamLevel= 1) { fkStreamLevel = streamLevel; } + void SetLUT(Int_t lutOn = 1) { fLUTOn = lutOn; }; + void SetMinMaxCutSigma(Float_t minMaxCutSigma) { fMinMaxCutSigma = minMaxCutSigma; }; + void SetMinLeftRightCutSigma(Float_t minLeftRightCutSigma) { fMinLeftRightCutSigma = minLeftRightCutSigma; }; + void SetClusMaxThresh(Float_t thresh) { fClusMaxThresh = thresh; }; + void SetClusSigThresh(Float_t thresh) { fClusSigThresh = thresh; }; + void SetTailCancelation(Int_t tcOn = 1) { fTCOn = tcOn; }; + void SetNexponential(Int_t nexp) { fTCnexp = nexp; }; + void SetADCbaseline(Int_t base) { fADCbaseline = base; }; + +private: + enum{ + kNNslices = 8, + kLQslices = 3 + }; + + + // Tracking parameters + Bool_t fkClusterSharing; // Toggle cluster sharing + AliTRDpidMethod fkPIDMethod; // PID method selector 0(LQ) 1(NN) + Double_t fkMaxTheta; // Maximum theta + Double_t fkMaxPhi; // Maximum phi + + Double_t fkRoad0y; // Road for middle cluster + Double_t fkRoad0z; // Road for middle cluster + + Double_t fkRoad1y; // Road in y for seeded cluster + Double_t fkRoad1z; // Road in z for seeded cluster + + Double_t fkRoad2y; // Road in y for extrapolated cluster + Double_t fkRoad2z; // Road in z for extrapolated cluster + + Double_t fkPlaneQualityThreshold; // Quality threshold + Double_t fkFindable; // Ratio of clusters from a track in one chamber which are at minimum supposed to be found. + Double_t fkChi2Z; // Max chi2 on the z direction for seeding clusters fit + Double_t fkChi2Y; // Max chi2 on the y direction for seeding clusters Rieman fit + Double_t fkTrackLikelihood; // Track likelihood for tracklets Rieman fit + Int_t fkStreamLevel; // Streaming Level in TRD Reconstruction + + Bool_t fSeedingOn; // Do stand alone tracking in the TRD + Bool_t fVertexConstrained; // Perform vertex constrained fit // Clusterization parameter - Double_t fMinMaxCutSigma; // Threshold sigma noise pad middle - Double_t fMinLeftRightCutSigma; // Threshold sigma noise sum pad - Double_t fClusMaxThresh; // Threshold value for cluster maximum - Double_t fClusSigThresh; // Threshold value for cluster signal - Int_t fLUTOn; // Switch for the lookup table method - Int_t fTCOn; // Switch for the tail cancelation - Int_t fTCnexp; // Number of exponentials, digital filter + Double_t fMinMaxCutSigma; // Threshold sigma noise pad middle + Double_t fMinLeftRightCutSigma; // Threshold sigma noise sum pad + Double_t fClusMaxThresh; // Threshold value for cluster maximum + Double_t fClusSigThresh; // Threshold value for cluster signal + Int_t fLUTOn; // Switch for the lookup table method + Int_t fTCOn; // Switch for the tail cancelation + Int_t fTCnexp; // Number of exponentials, digital filter - // ADC parameter - Int_t fADCbaseline; // ADC baseline to be subtracted + // ADC parameter + Int_t fADCbaseline; // ADC baseline to be subtracted - ClassDef(AliTRDrecoParam, 3) // Reconstruction parameters for TRD detector + ClassDef(AliTRDrecoParam, 4) // Reconstruction parameters for TRD detector }; #endif diff --git a/TRD/AliTRDseedV1.cxx b/TRD/AliTRDseedV1.cxx index 3f45e8a660d..f8de9628a6a 100644 --- a/TRD/AliTRDseedV1.cxx +++ b/TRD/AliTRDseedV1.cxx @@ -221,7 +221,7 @@ void AliTRDseedV1::CookdEdx(Int_t nslices) nclusters[slice]++; } // End of loop over clusters - if(AliTRDReconstructor::RecoParam()->GetPIDMethod() == 0){ + if(AliTRDReconstructor::RecoParam()->GetPIDMethod() == AliTRDrecoParam::kLQPID){ // calculate mean charge per slice (only LQ PID) for(int is=0; isGetPIDObject(AliTRDReconstructor::RecoParam()->GetPIDMethod()); + const AliTRDCalPID *pd = calibration->GetPIDObject(rec->GetPIDMethod()); if (!pd) { AliError("No access to AliTRDCalPID object"); return 0x0; @@ -269,7 +275,7 @@ Double_t* AliTRDseedV1::GetProbability() /// TMath::Sqrt((1.0 - fSnp[iPlane]*fSnp[iPlane]) / (1.0 + fTgl[iPlane]*fTgl[iPlane])); //calculate dE/dx - CookdEdx(AliTRDReconstructor::RecoParam()->GetNdEdxSlices()); + CookdEdx(rec->GetNdEdxSlices()); // Sets the a priori probabilities for(int ispec=0; ispecGetPIDObject(fPIDmethod == kNN ? 1 : 0); + const AliTRDCalPID *pd = calibration->GetPIDObject(fPIDmethod == kNN ? AliTRDrecoParam::kNNPID : AliTRDrecoParam::kLQPID); if (!pd) { AliError("No access to AliTRDCalPID"); return kFALSE; -- 2.43.0