]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDPreprocessorOffline.h
Fix for savannah bug report 87728 (Laurent) + fix invalid read found with valgrind...
[u/mrichter/AliRoot.git] / TRD / AliTRDPreprocessorOffline.h
index 4a2370c0accf18da379a2eae74e6fd98b748dfdd..6ce41bdc58f19e074e7d7d0441df992a770ec416 100644 (file)
@@ -35,10 +35,41 @@ public:
       kChamberStatus = 7,
       kPRF = 8
       };   
-  
+  enum { kGainNotEnoughStatsButFill = 2, kVdriftNotEnoughStatsButFill = 4, kGainNotEnoughStatsNotFill = 8, kVdriftNotEnoughStatsNotFill = 16, kTimeOffsetNotEnoughStatsNotFill = 32};  
+  enum { kGainErrorOld = 2, kVdriftErrorOld = 4, kGainErrorRange = 8, kVdriftErrorRange = 16, kTimeOffsetErrorRange = 32, kChamberStatusErrorRange = 64};  
+
+
   AliTRDPreprocessorOffline();
   virtual ~AliTRDPreprocessorOffline();
 
+  Bool_t      IsGainNotEnoughStatsButFill() const 
+    { return CheckStatus(fStatusNeg, kGainNotEnoughStatsButFill);  };
+  Bool_t      IsGainNotEnoughStatsNotFill() const 
+    { return CheckStatus(fStatusNeg, kGainNotEnoughStatsNotFill);  };
+  Bool_t      IsVdriftNotEnoughStatsButFill() const 
+    { return CheckStatus(fStatusNeg, kVdriftNotEnoughStatsButFill);  };
+  Bool_t      IsVdriftNotEnoughStatsNotFill() const 
+    { return CheckStatus(fStatusNeg, kVdriftNotEnoughStatsNotFill);  };
+  Bool_t      IsTimeOffsetNotEnoughStatsNotFill() const 
+    { return CheckStatus(fStatusNeg, kVdriftNotEnoughStatsNotFill);  };
+  
+  Bool_t      IsGainErrorOld() const 
+    { return CheckStatus(fStatusPos, kGainErrorOld);  };
+  Bool_t      IsVdriftErrorOld() const 
+    { return CheckStatus(fStatusPos, kVdriftErrorOld);  };
+  Bool_t      IsGainErrorRange() const 
+    { return CheckStatus(fStatusPos, kGainErrorRange);  };
+  Bool_t      IsVdriftErrorRange() const 
+    { return CheckStatus(fStatusPos, kVdriftErrorRange);  };
+  Bool_t      IsTimeOffsetErrorRange() const 
+    { return CheckStatus(fStatusPos, kTimeOffsetErrorRange);  };
+  Bool_t      IsChamberStatusErrorRange() const 
+    { return CheckStatus(fStatusPos, kChamberStatusErrorRange);  };
+  
+  Bool_t      CheckStatus(Int_t status, Int_t bitMask) const;
+  void PrintStatus() const;
+
+
   void SetLinearFitForVdrift(Bool_t methodsecond) { fMethodSecond = methodsecond;};
   Bool_t GetLinearFitForVdrift() const { return fMethodSecond;};
   void SetNameList(TString nameList) { fNameList = nameList;};
@@ -72,18 +103,23 @@ public:
   
   void UpdateOCDBT0(Int_t startRunNumber, Int_t endRunNumber, const char* storagePath);
   void UpdateOCDBVdrift(Int_t startRunNumber, Int_t endRunNumber, const char* storagePath);
+  void UpdateOCDBExB(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath);
   void UpdateOCDBGain(Int_t  startRunNumber, Int_t endRunNumber, const char* storagePath);
   void UpdateOCDBPRF(Int_t  startRunNumber, Int_t endRunNumber, const char* storagePath);
   void UpdateOCDBChamberStatus(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath);
 
-  Bool_t ValidateGain() const;
+  Bool_t ValidateGain();
   Bool_t ValidateVdrift();
   Bool_t ValidateT0();
   Bool_t ValidatePRF() const;
-  Bool_t ValidateChamberStatus() const;
+  Bool_t ValidateChamberStatus();
 
+  Int_t    GetStatus() const;
+  Int_t    GetStatusPos() const                                      { return fStatusPos;              }
+  Int_t    GetStatusNeg() const                                      { return fStatusNeg;              }
   Int_t    GetVersionGainUsed() const                                { return fVersionGainUsed;        }
   Int_t    GetSubVersionGainUsed() const                             { return fSubVersionGainUsed;     }
+  Int_t    GetFirstRunVdriftUsed() const                             { return fFirstRunVdriftUsed;     }
   Int_t    GetVersionVdriftUsed() const                              { return fVersionVdriftUsed;      }
   Int_t    GetSubVersionVdriftUsed() const                           { return fSubVersionVdriftUsed;   }
 
@@ -91,6 +127,8 @@ public:
   void     SetMinStatsVdriftLinear(Int_t minStatsVdriftLinear)       { fMinStatsVdriftLinear = minStatsVdriftLinear; }  
   void     SetMinStatsGain(Int_t minStatsGain)                       { fMinStatsGain = minStatsGain; }  
   void     SetMinStatsPRF(Int_t minStatsPRF)                         { fMinStatsPRF = minStatsPRF; }  
+  void     SetBackCorrectGain(Bool_t backCorrectGain)                { fBackCorrectGain = backCorrectGain; }
+  void     SetBackCorrectVdrift(Bool_t backCorrectVdrift)            { fBackCorrectVdrift = backCorrectVdrift; }
 
  
   
@@ -109,6 +147,7 @@ public:
   TObjArray * fCalibObjects;              // array with calibration objects 
   Int_t    fVersionGainUsed;              // VersionGainUsed 
   Int_t    fSubVersionGainUsed;           // SubVersionGainUsed
+  Int_t    fFirstRunVdriftUsed;           // FirstRunVdrift 
   Int_t    fVersionVdriftUsed;            // VersionVdriftUsed 
   Int_t    fSubVersionVdriftUsed;         // SubVersionVdriftUsed
   Bool_t   fSwitchOnValidation;           // Validation
@@ -118,17 +157,24 @@ public:
   Int_t    fMinStatsVdriftLinear;         // MinStats Vdrift Linear
   Int_t    fMinStatsGain;                 // MinStats Gain
   Int_t    fMinStatsPRF;                  // MinStats PRF
+  Bool_t   fBackCorrectGain;              // Back correction afterwards gain  
+  Bool_t   fBackCorrectVdrift;            // Back correction afterwards vdrift
+  Bool_t   fNotEnoughStatisticsForTheGain;// Take the chamber per chamber distribution from the default distribution
+  Bool_t   fNotEnoughStatisticsForTheVdriftLinear;// Take the chamber per chamber distribution from the default distribution
+  Int_t    fStatusNeg;                    // Info but ok
+  Int_t    fStatusPos;                    // Problems
 
 
   Int_t GetSubVersion(TString name) const;
   Int_t GetVersion(TString name) const;
+  Int_t GetFirstRun(TString name) const;
 
   
 
 private:
   AliTRDPreprocessorOffline& operator=(const AliTRDPreprocessorOffline&); // not implemented
   AliTRDPreprocessorOffline(const AliTRDPreprocessorOffline&); // not implemented
-  ClassDef(AliTRDPreprocessorOffline,1)
+  ClassDef(AliTRDPreprocessorOffline,2)
 };
 
 #endif