]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDrecoParam.h
ALIROOT-5488 Remove build/include from the include directories
[u/mrichter/AliRoot.git] / TRD / AliTRDrecoParam.h
index 35532a68eff2a1cf3fa08e438eacc5eced6f937f..d4c9ceefebeda986c12cedbeb448950389a61eb1 100644 (file)
 #ifndef ALIDETECTORRECOPARAM_H
 #include "AliDetectorRecoParam.h"
 #endif
+
 #ifndef ALITRDCALPID_H
-#include "Cal/AliTRDCalPID.h"
+#include "AliTRDCalPID.h"
+#endif
+
+#ifndef ALITRDPIDRESPONSE_H
+#include "AliTRDPIDResponse.h"
 #endif
 
+class TString;
+
 class AliTRDrecoParam : public AliDetectorRecoParam
 {
 public:
+  enum ETRDReconstructionTask{
+    kClusterizer = 0,
+    kTracker = 1,
+    kPID = 2,
+    kTRDreconstructionTasks = 3
+  };
+  enum ETRDflags {
+    kDriftGas
+    ,kVertexConstraint
+    ,kTailCancelation
+    ,kImproveTracklet
+    ,kLUT
+    ,kGAUS
+    ,kClusterSharing
+    ,kSteerPID
+    ,kEightSlices
+    ,kCheckTimeConsistency
+    ,kLQ2D
+  };
   AliTRDrecoParam();
   AliTRDrecoParam(const AliTRDrecoParam &rec);
+  AliTRDrecoParam& operator=(const AliTRDrecoParam &rec);
   ~AliTRDrecoParam() { }
 
   Double_t GetChi2Y() const                 { return fkChi2Y;    }
   Double_t GetChi2Z() const                 { return fkChi2Z;    }
-  Double_t GetChi2YCut() const              { return fkChi2YCut; }
-  Double_t GetChi2ZCut() const              { return fkChi2ZCut; }
-  Double_t GetPhiCut() const                { return fkPhiCut;   }
+  Double_t GetChi2YSlope() const            { return fkChi2YSlope; }
+  Double_t GetChi2ZSlope() const            { return fkChi2ZSlope; }
+       Double_t GetChi2Cut() const              { return fChi2Cut; }
+       Double_t GetChi2YCut() const              { return fkChi2YCut; }
+  Double_t GetPhiSlope() const              { return fkPhiSlope;   }
   Float_t  GetNClusters() const;
   Double_t GetNMeanClusters() const         { return fkNMeanClusters; }
   Double_t GetNSigmaClusters() const        { return fkNSigmaClusters; }
   Double_t GetFindableClusters() const      { return fkFindable; }
+  Int_t    GetPIDLQslices() const;
+  AliTRDPIDResponse::ETRDPIDMethod GetPIDmethod() const;
   Double_t GetMaxTheta() const              { return fkMaxTheta; }
   Double_t GetMaxPhi() const                { return fkMaxPhi;   }
   Double_t GetPlaneQualityThreshold() const { return fkPlaneQualityThreshold; }
@@ -44,65 +75,95 @@ public:
   Double_t GetRoad1z() const                { return fkRoad1z;   }
   Double_t GetRoad2y() const                { return fkRoad2y;   }
   Double_t GetRoad2z() const                { return fkRoad2z;   }
+  Double_t GetRoadzMultiplicator() const    { return fkRoadzMultiplicator; }
   Double_t GetTrackLikelihood() const       { return fkTrackLikelihood;       }
-  inline void GetSysCovMatrix(Double_t *sys) const;  
+  void GetSysCovMatrix(Double_t *sys) const;  
+  void GetTCParams(Double_t *par) const;
+  Int_t GetStreamLevel(ETRDReconstructionTask task) const;
+  const TString *GetRawStreamVersion() const{ return &fRawStreamVersion; };
   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;          };
-  Int_t     GetNumberOfPresamples()  const {return fNumberOfPresamples;}
-  Int_t    GetNumberOfPostsamples() const {return fNumberOfPostsamples;}
+  Int_t    GetNumberOfPresamples()  const   { return fNumberOfPresamples;}
+  Int_t    GetNumberOfPostsamples() const   { return fNumberOfPostsamples;}
+  Int_t    GetNumberOfSeedConfigs() const   { return fNumberOfConfigs;}
+  Int_t    GetRecEveryNTB() const           { return fRecEveryNTB; }
+  // Tracklet parameters
+  Double_t GetCorrDZDXbiasRC(Bool_t dzdx) const { return fdzdxCorrRCbias[dzdx];}
+  Double_t GetCorrDZDX(Bool_t rc) const     { return fdzdxCorrFactor[rc];}
+  Double_t GetCorrDZDXxcross() const        { return fdzdxXcrossFactor;}
+  void GetYcorrTailCancel(Int_t it, Double_t par[2]) const;
+  Double_t GetS2Ycorr(Bool_t sgn) const     { return fS2Ycorr[sgn];}
 
+  Bool_t   IsArgon() const                  { return TESTBIT(fFlags, kDriftGas); }
+  Bool_t   IsCheckTimeConsistency() const   { return kCheckTimeConsistency;}
+  Bool_t   IsOverPtThreshold(Double_t pt) const {return Bool_t(pt>fkPtThreshold);}
+  Bool_t   IsXenon() const                  { return !TESTBIT(fFlags, kDriftGas); }
+  Bool_t   IsPIDNeuralNetwork() const       { return TESTBIT(fFlags, kSteerPID);}
+  Bool_t   IsVertexConstrained() const      { return TESTBIT(fFlags, kVertexConstraint); }
+  Bool_t   IsEightSlices() const            { return TESTBIT(fFlags, kEightSlices);}
+  Bool_t   HasImproveTracklets() const      { return TESTBIT(fFlags, kImproveTracklet);}
+  Bool_t   UseClusterSharing() const        { return TESTBIT(fFlags, kClusterSharing);}
+  Bool_t   UseLUT() const                   { return TESTBIT(fFlags, kLUT);}
+  Bool_t   UseGAUS() const                  { return TESTBIT(fFlags, kGAUS);}
+  Bool_t   UseTailCancelation() const       { return TESTBIT(fFlags, kTailCancelation); }
         
   static   AliTRDrecoParam *GetLowFluxParam();
+  static   AliTRDrecoParam *GetLowFluxHLTParam();
   static   AliTRDrecoParam *GetHighFluxParam();
+  static   AliTRDrecoParam *GetHighFluxHLTParam();
   static   AliTRDrecoParam *GetCosmicTestParam();
 
-  Bool_t   IsClusterSharing() const         { return TestBit(kClusterSharing);}
-  Bool_t   IsLUT() const                    { return TestBit(kLUT);}
-  Bool_t   IsTailCancelation() const        { return TestBit(kTC);}
-  Bool_t   IsVertexConstrained() const      { return TestBit(kVertexConstrained); }
-  Bool_t   HasImproveTracklets() const       { return TestBit(kImproveTracklet); }
-
-  void     SetMaxTheta(Double_t maxTheta) {fkMaxTheta = maxTheta;}
-  void     SetMaxPhi(Double_t maxPhi) {fkMaxPhi = maxPhi;}
-  void     SetFindableClusters(Double_t r) {fkFindable = r;}
-  void     SetChi2Y(Double_t chi2) {fkChi2Y = chi2;}
-  void     SetChi2Z(Double_t chi2) {fkChi2Z = chi2;}
-  void     SetChi2YCut(Double_t chi2YCut) {fkChi2YCut = chi2YCut;}
-  void     SetChi2ZCut(Double_t chi2ZCut) {fkChi2ZCut = chi2ZCut;}
-  void     SetPhiCut(Double_t phiCut) {fkPhiCut = phiCut;}
-  void     SetNMeanClusters(Double_t meanNclusters) {fkNMeanClusters = meanNclusters;}
-  void     SetNSigmaClusters(Double_t sigmaNclusters) {fkNSigmaClusters = sigmaNclusters;} 
-  void     SetClusterSharing(Bool_t share = kTRUE)            { SetBit(kClusterSharing, share);}
-  void     SetImproveTracklets(Bool_t improve = kTRUE)         { SetBit(kImproveTracklet, improve);}
-  void     SetVertexConstrained(Bool_t vc = kTRUE)            { SetBit(kVertexConstrained, vc); }
-  void     SetLUT(Bool_t lut = kTRUE)                         { SetBit(kLUT, lut);};
+  void     SetArgon(Bool_t b = kTRUE)                         {if(b) SETBIT(fFlags, kDriftGas); else CLRBIT(fFlags, kDriftGas);}
+  void     SetCheckTimeConsistency(Bool_t b = kTRUE)          {if(b) SETBIT(fFlags, kCheckTimeConsistency); else CLRBIT(fFlags, kCheckTimeConsistency);}
+  void     SetClusterSharing(Bool_t b = kTRUE)                {if(b) SETBIT(fFlags, kClusterSharing); else CLRBIT(fFlags, kClusterSharing);}
+  void     SetEightSlices(Bool_t b = kTRUE)                   {if(b) SETBIT(fFlags, kEightSlices); else CLRBIT(fFlags, kEightSlices);}
+  void     SetImproveTracklets(Bool_t b = kTRUE)              {if(b) SETBIT(fFlags, kImproveTracklet); else CLRBIT(fFlags, kImproveTracklet);}
+  void     SetLUT(Bool_t b=kTRUE)                             {if(b) SETBIT(fFlags, kLUT); else CLRBIT(fFlags, kLUT);}
+  void     SetGAUS(Bool_t b=kTRUE)                            {if(b) SETBIT(fFlags, kGAUS); else CLRBIT(fFlags, kGAUS);}
+  void     SetPIDNeuralNetwork(Bool_t b=kTRUE)                {if(b) SETBIT(fFlags, kSteerPID); else CLRBIT(fFlags, kSteerPID);}
+  void  SetPIDmethod(AliTRDPIDResponse::ETRDPIDMethod method);
+  void     SetPIDLQslices(Int_t s);
+  void     SetTailCancelation(Bool_t b=kTRUE)                 {if(b) SETBIT(fFlags, kTailCancelation); else CLRBIT(fFlags, kTailCancelation);}
+  void     SetXenon(Bool_t b = kTRUE)                         {if(b) CLRBIT(fFlags, kDriftGas); else SETBIT(fFlags, kDriftGas);}
+  void     SetVertexConstrained()                             {SETBIT(fFlags, kVertexConstraint);}
+  void     SetMaxTheta(Double_t maxTheta)                     {fkMaxTheta = maxTheta;}
+  void     SetMaxPhi(Double_t maxPhi)                         {fkMaxPhi = maxPhi;}
+  void     SetFindableClusters(Double_t r)                    {fkFindable = r;}
+  void     SetChi2Y(Double_t chi2)                            {fkChi2Y = chi2;}
+  void     SetChi2Z(Double_t chi2)                            {fkChi2Z = chi2;}
+  void     SetChi2YSlope(Double_t chi2YSlope)                 {fkChi2YSlope = chi2YSlope;}
+  void     SetChi2ZSlope(Double_t chi2ZSlope)                 {fkChi2ZSlope = chi2ZSlope;}
+       void       SetChi2Cut(Double_t chi2Cut)                      {fChi2Cut = chi2Cut; }
+       void       SetChi2YCut(Double_t chi2Cut)                      {fkChi2YCut = chi2Cut; }
+  void     SetPhiSlope(Double_t phiSlope)                     {fkPhiSlope = phiSlope;}
+  void     SetNMeanClusters(Double_t meanNclusters)           {fkNMeanClusters = meanNclusters;}
+  void     SetNSigmaClusters(Double_t sigmaNclusters)         {fkNSigmaClusters = sigmaNclusters;} 
+  void     SetRawStreamVersion(const Char_t *version)         {fRawStreamVersion = version; }
+  void     SetRoadzMultiplicator(Double_t mult)               {fkRoadzMultiplicator = mult; } 
   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(Bool_t tc = kTRUE)              { SetBit(kTC, tc);  };
-  inline void SetPIDThreshold(Double_t *pid);
+  void     SetPIDThreshold(Double_t *pid);
+  void     SetPtThreshold(Double_t pt) {fkPtThreshold = pt;}
   void     SetNexponential(Int_t nexp)                        { fTCnexp          = nexp;   };
-  inline void SetSysCovMatrix(Double_t *sys);
+  void     SetTCParams(Double_t *par);
+  void     SetTrackletParams(Double_t *par=NULL);
+  void     SetStreamLevel(ETRDReconstructionTask task, Int_t level);
+  void     SetSysCovMatrix(Double_t *sys);
   void     SetNumberOfPresamples(Int_t n)                     { fNumberOfPresamples = n;}
   void     SetNumberOfPostsamples(Int_t n)                    { fNumberOfPostsamples = n;}
+  void     SetRecEveryTwoTB()                                 { fRecEveryNTB = 2; fkNMeanClusters = 10; }
 
 private:
-  enum{
-    kTC                = BIT(14) // tail cancelation
-   ,kLUT               = BIT(15) // look up table for cluster position determination 
-   ,kClusterSharing    = BIT(16) // Toggle cluster sharing
-   ,kVertexConstrained = BIT(17) // Perform vertex constrained fit
-   ,kImproveTracklet   = BIT(18) // Improve tracklet in the SA TRD track finder 
-  };
   // Physics reference values for TRD
   Double_t  fkdNchdy;                // dNch/dy
   Double_t  fkMaxTheta;              // Maximum theta
   Double_t  fkMaxPhi;                // Maximum phi - momentum cut
-
+  // Tracker params 
   Double_t  fkRoad0y;                // Road for middle cluster
   Double_t  fkRoad0z;                // Road for middle cluster
 
@@ -111,14 +172,17 @@ private:
 
   Double_t  fkRoad2y;                // Road in y for extrapolated cluster
   Double_t  fkRoad2z;                // Road in z for extrapolated cluster
-  
+  Double_t  fkPtThreshold;           // pt threshold for using TRD points for updating Kalaman track
   Double_t  fkPlaneQualityThreshold; // Quality threshold
+  Double_t  fkRoadzMultiplicator;    // Multiplicator for the Roads in z 
   Double_t  fkFindable;              // minimum ratio of clusters per tracklet supposed to be attached.
   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  fkChi2YCut;              // Cut on the Chi2 in y-direction in the likelihood filter
-  Double_t  fkChi2ZCut;              // Cut on the Chi2 in z-direction in the likelihood filter
-  Double_t  fkPhiCut;                // Cut on the deviation of the phi angles between tracklet and track fit (lik. filter)
+  Double_t  fkChi2YSlope;            // Slope of the chi2-distribution in y-direction
+  Double_t  fkChi2ZSlope;            // Slope of the chi2-distribution in z-direction
+  Double_t  fChi2Cut;               // Cut on the Chi2 track/tracklet 0 used to diecide if the kalman track should be updated
+  Double_t  fkChi2YCut;                                                         // Cut on the Chi2 in y-direction in the likelihood filter
+  Double_t  fkPhiSlope;              // Slope of the distribution of the deviation between track angle and tracklet angle
   Double_t  fkNMeanClusters;         // Mean number of clusters per tracklet
   Double_t  fkNSigmaClusters;        // Sigma of the number of clusters per tracklet
   Double_t  fkNClusterNoise;         // ratio of noisy clusters to the true one
@@ -126,20 +190,37 @@ private:
   Double_t  fkTrackLikelihood;       // Track likelihood for tracklets Rieman fit
   
   Double_t  fSysCovMatrix[5];        // Systematic uncertainty from calibration and alignment for each tracklet
-  Double_t  fPIDThreshold[AliTRDCalPID::kNMom];
+  Double_t  fPIDThreshold[AliTRDCalPID::kNMom];   // PID Thresholds for Electron candidate decision
+  Int_t     fNumberOfConfigs;        // Used number of seed configurations
+
+  // Reconstruction Options for TRD reconstruction
+  Int_t     fStreamLevel[kTRDreconstructionTasks]; // Stream Level
+  Long64_t  fFlags;                  // option Flags
+
+  // Raw Reader Params
+  TString   fRawStreamVersion;       // Raw Reader version
 
+  // Tracklet parameters
+  Double_t  fdzdxCorrFactor[2];      // correction of dzdx estimation due to z bias; [0] for !RC, [1] for RC
+  Double_t  fdzdxCorrRCbias[2];      // correction of dzdx estimation bias for RC; [0] for dz/dx>0, [1] for dz/dx<0
+  Double_t  fdzdxXcrossFactor;       // bias in dzdx of estimated xcross [RC]
+  Double_t  fYcorrTailCancel[3][2];  // y linear q/pt correction due to wrong tail cancellation. [0] opposite sign !RC, [1] same sign !RC, [2] RC
+  Double_t  fS2Ycorr[2];             // inflation factor of error parameterization in r-phi due to wrong estimation of residuals. [0] opposite sign, [1] same sign
+  
   // 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     fTCnexp;                 // Number of exponentials, digital filter
-  
+  Double_t  fTCParams[8];            // Tail Cancellation parameters for drift gases 
+  Int_t     fRecEveryNTB;            // Reconstruct each nth timebin
+
   // ADC parameter
   Int_t     fNumberOfPresamples;     // number of presamples 
   Int_t     fNumberOfPostsamples;     // number of postsamples 
 
-  ClassDef(AliTRDrecoParam, 6)       // Reconstruction parameters for TRD detector
+  ClassDef(AliTRDrecoParam, 13)       // Reconstruction parameters for TRD detector
 
 };
 
@@ -164,5 +245,74 @@ inline void AliTRDrecoParam::SetPIDThreshold(Double_t *pid)
   memcpy(fPIDThreshold, pid, AliTRDCalPID::kNMom*sizeof(Double_t));
 }
 
+//___________________________________________________
+inline void AliTRDrecoParam::SetStreamLevel(ETRDReconstructionTask task, Int_t level){
+  if(task >= kTRDreconstructionTasks) return;
+  fStreamLevel[static_cast<Int_t>(task)] = level;
+}
+
+//___________________________________________________
+inline Int_t AliTRDrecoParam::GetStreamLevel(ETRDReconstructionTask task) const{
+  if(task >= kTRDreconstructionTasks) return 0;
+  return fStreamLevel[static_cast<Int_t>(task)];
+}
+
+//___________________________________________________
+inline void AliTRDrecoParam::GetTCParams(Double_t *par) const
+{
+  if(!par) return;
+  if(IsArgon()) memcpy(par, &fTCParams[4], 4*sizeof(Double_t));
+  else memcpy(par, &fTCParams[0], 4*sizeof(Double_t));
+}
+
+//___________________________________________________
+inline void AliTRDrecoParam::SetTCParams(Double_t *par)
+{
+  if(!par) return;
+  memcpy(fTCParams, par, 8*sizeof(Double_t));
+}
+
+
+//___________________________________________________
+inline void AliTRDrecoParam::GetYcorrTailCancel(Int_t it, Double_t par[2]) const
+{
+  if(it<0||it>2) return;
+  par[0] = fYcorrTailCancel[it][0]; par[1] = fYcorrTailCancel[it][1]; 
+}
+
+//___________________________________________________
+inline Int_t AliTRDrecoParam::GetPIDLQslices() const
+{
+  if(IsPIDNeuralNetwork()) return -1;
+  return TESTBIT(fFlags, kLQ2D) ? 2 : 1;
+}
+
+//___________________________________________________
+inline AliTRDPIDResponse::ETRDPIDMethod AliTRDrecoParam::GetPIDmethod() const
+{
+  AliTRDPIDResponse::ETRDPIDMethod method = AliTRDPIDResponse::kLQ1D;
+  if(IsPIDNeuralNetwork()) method = AliTRDPIDResponse::kNN;
+  else if(TESTBIT(fFlags, kLQ2D)) method = AliTRDPIDResponse::kLQ2D;
+  return method;
+}
+
+//___________________________________________________
+inline void  AliTRDrecoParam::SetPIDmethod(AliTRDPIDResponse::ETRDPIDMethod method)
+{
+  switch(method){
+  case AliTRDPIDResponse::kLQ2D:
+    CLRBIT(fFlags, kSteerPID); 
+    SETBIT(fFlags, kLQ2D);
+    break;
+  case AliTRDPIDResponse::kNN:
+    SETBIT(fFlags, kSteerPID); 
+    break;
+  case AliTRDPIDResponse::kLQ1D:
+  default:
+    CLRBIT(fFlags, kSteerPID); 
+    CLRBIT(fFlags, kLQ2D);
+    break;
+  }
+}
 
 #endif