Introduce an enumerator for PID methods
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 10 Jun 2008 13:57:04 +0000 (13:57 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 10 Jun 2008 13:57:04 +0000 (13:57 +0000)
TRD/AliTRDcalibDB.cxx
TRD/AliTRDcalibDB.h
TRD/AliTRDgeometry.cxx
TRD/AliTRDgtuTrack.cxx
TRD/AliTRDpidESD.cxx
TRD/AliTRDrecoParam.cxx
TRD/AliTRDrecoParam.h
TRD/AliTRDseedV1.cxx
TRD/AliTRDtrack.cxx

index 3e710ec..4eff278 100644 (file)
@@ -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<const AliTRDCalPID *> 
-                              (GetCachedCDBObject(kIDPIDLQ));
-    case 1: return dynamic_cast<const AliTRDCalPID *>
-                              (GetCachedCDBObject(kIDPIDNN));
+  case AliTRDrecoParam::kLQPID: 
+    return dynamic_cast<const AliTRDCalPID *>(GetCachedCDBObject(kIDPIDLQ));
+  case AliTRDrecoParam::kNNPID: 
+    return dynamic_cast<const AliTRDCalPID *>(GetCachedCDBObject(kIDPIDNN));
   }
 
   return 0x0;
index 0d22a03..9942ea2 100644 (file)
 
 /* $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);
index 4ed5abb..a901f8d 100644 (file)
@@ -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;
index 99fcdcd..3539068 100644 (file)
@@ -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();
index dcb38c5..e607b10 100644 (file)
@@ -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");
index e286eaf..d8b28c2 100644 (file)
@@ -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)
index a9bf493..9de9050 100644 (file)
@@ -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$ */
 
 
 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
index 3f45e8a..f8de962 100644 (file)
@@ -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; is<nslices; is++){ 
            if(nclusters[is]) fdEdx[is] /= nclusters[is];
@@ -256,8 +256,14 @@ Double_t* AliTRDseedV1::GetProbability()
     return 0x0;
   }
 
+  AliTRDrecoParam *rec = AliTRDReconstructor::RecoParam();
+  if (!rec) {
+    AliError("No TRD reco param.");
+    return 0x0;
+  }
+
   // Retrieve the CDB container class with the parametric detector response
-  const AliTRDCalPID *pd = calibration->GetPIDObject(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; ispec<AliPID::kSPECIES; ispec++) {
index 9556d9b..7d0bfa1 100644 (file)
@@ -669,7 +669,7 @@ Bool_t AliTRDtrack::CookPID(Int_t &pidQuality)
   }
        
   // Retrieve the CDB container class with the probability distributions
-  const AliTRDCalPID *pd = calibration->GetPIDObject(fPIDmethod == kNN ? 1 : 0);
+  const AliTRDCalPID *pd = calibration->GetPIDObject(fPIDmethod == kNN ? AliTRDrecoParam::kNNPID : AliTRDrecoParam::kLQPID);
   if (!pd) {
     AliError("No access to AliTRDCalPID");
     return kFALSE;