]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDPreprocessorOffline.h
Update responsibles for MCH, MTR, HMP
[u/mrichter/AliRoot.git] / TRD / AliTRDPreprocessorOffline.h
index 57bef07336eba955c304ca050160d640a94edf7f..3502252ad757268d651aae42c674dba68929b8c5 100644 (file)
@@ -18,24 +18,27 @@ class AliTRDCalDet;
 class TH2I;
 class TProfile2D;
 class AliTRDCalibraVdriftLinearFit;
+class AliTRDCalibraExbAltFit;
 class TH1I;
 class TH2F;
 class TString;
-
+class AliCDBStorage;
 
 class AliTRDPreprocessorOffline:public TNamed { 
 public:
-  enum{
-    kGain = 0,
-      kVdriftPHDet = 1,
-      kVdriftPHPad = 2,
-      kT0PHDet = 3,
-      kT0PHPad = 4,
-      kVdriftLinear = 5,
-      kLorentzLinear = 6,
-      kChamberStatus = 7,
-      kPRF = 8
-      };   
+  enum{ kGain = 0,
+       kVdriftPHDet = 1,
+       kVdriftPHPad = 2,
+       kT0PHDet = 3,
+       kT0PHPad = 4,
+       kVdriftLinear = 5,
+       kLorentzLinear = 6,
+       kChamberStatus = 7,
+       kPRF = 8,
+       kExbAlt = 9,
+        kPHQ = 10,
+       kNumCalibObjs = 11
+  };
   enum { kGainNotEnoughStatsButFill = 2,
         kVdriftNotEnoughStatsButFill = 4,
         kGainNotEnoughStatsNotFill = 8,
@@ -55,7 +58,7 @@ public:
   virtual ~AliTRDPreprocessorOffline();
 
   Bool_t Init(const Char_t* fileName);
-  void Process(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage);
+  void Process(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* ocdbStorage);
 
   // settings
   void SetLinearFitForVdrift(Bool_t methodsecond) { fMethodSecond = methodsecond;};
@@ -65,15 +68,31 @@ public:
   void     SetMinStatsGain(Int_t minStatsGain)                       { fMinStatsGain = minStatsGain; }  
   void     SetMinStatsPRF(Int_t minStatsPRF)                         { fMinStatsPRF = minStatsPRF; }  
   void     SetMinStatsChamberStatus(Int_t minStatsChamberStatus)     { fMinStatsChamberStatus = minStatsChamberStatus; }
+  void     SetSingleMinStatsChamberStatus(Int_t minSingleStatsChamberStatus) { fMinSingleStatsChamberStatus = minSingleStatsChamberStatus; }
   void     SetLimitValidateNoData(Int_t nodatavalidate)              { fNoDataValidate = nodatavalidate; };
   void     SetLimitValidateBadCalib(Int_t badcalibvalidate)          { fBadCalibValidate = badcalibvalidate; };
   void     SetBackCorrectGain(Bool_t backCorrectGain)                { fBackCorrectGain = backCorrectGain; }
   void     SetBackCorrectVdrift(Bool_t backCorrectVdrift)            { fBackCorrectVdrift = backCorrectVdrift; }
   void     SetNoExBUsedInReco(Bool_t noExBUsedInReco)                { fNoExBUsedInReco    = noExBUsedInReco;   };
   void     SetSwitchOnValidation(Bool_t switchOnValidation)          { fSwitchOnValidation = switchOnValidation;};
+  void     SetSwitchOnChamberStatus(Bool_t switchOnChamberStatus)    { fSwitchOnChamberStatus = switchOnChamberStatus;};
   void     SetRMSBadCalibratedGain(Double_t rms)                     { fRMSBadCalibratedGain = rms;};
   void     SetRMSBadCalibratedVdrift(Double_t rms)                   { fRMSBadCalibratedVdrift = rms;};
   void     SetRMSBadCalibratedExB(Double_t rms)                      { fRMSBadCalibratedExB = rms;};
+  void     SetMinTimeOffsetValidate(Double_t min)                    { fMinTimeOffsetValidate = min;};
+  void     SetRobustFitDriftVelocity(Bool_t robustFitDriftVelocity)  { fRobustFitDriftVelocity = robustFitDriftVelocity;};
+  void     SetRobustFitExbAlt(Bool_t robustFitExbAlt)                { fRobustFitExbAlt = robustFitExbAlt;};
+  void     SetAlternativeDriftVelocityFit(Bool_t alt)                { fAlternativeVdrfitFit = alt;};
+  void     SetMinNbOfPointVdriftFit(Int_t minNbOfPointVdriftFit)     { fMinNbOfPointVdriftFit = minNbOfPointVdriftFit;};
+  void     SetAlternativeExbAltFit(Bool_t alt)                       { fAlternativeExbAltFit = alt;};
+  void     SetMethodeFitGain(Int_t methodeFitGain)                   { fMethodeGain = methodeFitGain;};
+  void     SetOutliersFitChargeLow(Float_t outliersFitChargeLow)     { fOutliersFitChargeLow = outliersFitChargeLow; }
+  void     SetOutliersFitChargeHigh(Float_t outliersFitChargeHigh)   { fOutliersFitChargeHigh = outliersFitChargeHigh; }
+  void     SetBeginFitCharge(Float_t beginFitCharge)                 { fBeginFitCharge = beginFitCharge;};
+  void     SetT0Shift0(Float_t t0Shift0)                             { fT0Shift0 = t0Shift0;};
+  void     SetT0Shift1(Float_t t0Shift1)                             { fT0Shift1 = t0Shift1;};
+
+
 
   Bool_t GetLinearFitForVdrift() const { return fMethodSecond;};
   TString GetNameList() const { return fNameList;}; 
@@ -133,32 +152,40 @@ public:
 
   // Internal functions
 
-  void CalibVdriftT0(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage="");
-  void CalibGain(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber,  TString  ocdbStorage="");
-  void CalibPRF(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber,  TString  ocdbStorage="");
-  void CalibChamberStatus(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage="");
+  void CalibVdriftT0(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* ocdbStorage=0x0);
+  void CalibExbAlt(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* ocdbStorage=0x0);
+  void CalibGain(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber,  AliCDBStorage* ocdbStorage=0x0);
+  void CalibPRF(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber,  AliCDBStorage* ocdbStorage=0x0);
+  void CalibChamberStatus(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* ocdbStorage=0x0);
+  void CalibPHQ(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* ocdbStorage);
 
   Bool_t ReadStatusGlobal(const Char_t* fileName="CalibObjects.root");
   Bool_t ReadGainGlobal(const Char_t* fileName="CalibObjects.root");
   Bool_t ReadVdriftT0Global(const Char_t* fileName="CalibObjects.root");
   Bool_t ReadVdriftLinearFitGlobal(const Char_t* fileName="CalibObjects.root");
+  Bool_t ReadExbAltFitGlobal(const Char_t* fileName="CalibObjects.root");
   Bool_t ReadPRFGlobal(const Char_t* fileName="CalibObjects.root");
+  Bool_t ReadPHQGlobal(const Char_t* fileName);
 
   Bool_t AnalyzeGain(); 
   Bool_t AnalyzeVdriftT0(); 
   Bool_t AnalyzeVdriftLinearFit(); 
+  Bool_t AnalyzeExbAltFit();
   Bool_t AnalyzePRF();
   Bool_t AnalyzeChamberStatus(); 
-  
+  Bool_t AnalyzePHQ(Int_t startRunNumber);
+
   void CorrectFromDetGainUsed();
   void CorrectFromDetVdriftUsed();
   
-  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);
+  void UpdateOCDBT0(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* storage);
+  void UpdateOCDBVdrift(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* storage);
+  void UpdateOCDBExB(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* storage);
+  void UpdateOCDBExBAlt(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* storage);
+  void UpdateOCDBGain(Int_t  startRunNumber, Int_t endRunNumber, AliCDBStorage* storage);
+  void UpdateOCDBPRF(Int_t  startRunNumber, Int_t endRunNumber, AliCDBStorage* storage);
+  void UpdateOCDBChamberStatus(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* storage);
+  void UpdateOCDBPHQ(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* storage);
 
   Bool_t ValidateGain();
   Bool_t ValidateVdrift();
@@ -171,8 +198,12 @@ public:
   Int_t    GetStatusPos() const                                      { return fStatusPos;              }
   Int_t    GetStatusNeg() const                                      { return fStatusNeg;              }
  
+  Bool_t IsPHQon() const { return fPHQon ;};
+  void SetPHQon(const Bool_t kphq){ fPHQon = kphq; }
+
+  Bool_t IsDebugPHQon() const { return fDebugPHQon ;};
+  void SetDebugPHQon(const Bool_t kphq){ fDebugPHQon = kphq; }
 
-  
  private:
   Bool_t fMethodSecond;                      // Second Method for drift velocity   
   TString fNameList;                         // Name of the list
@@ -184,6 +215,7 @@ public:
   TProfile2D *fPRF2d;                        // PRF
   THnSparseI *fSparse;                       // chamberstatus
   AliTRDCalibraVdriftLinearFit *fAliTRDCalibraVdriftLinearFit; // Drift velocity second method
+  AliTRDCalibraExbAltFit* fAliTRDCalibraExbAltFit; //ExB alternative method
   TH1I *fNEvents;                         // Number of events 
   TH2F *fAbsoluteGain;                    // Absolute Gain calibration
   TObjArray * fPlots;                     // array with some plots to check
@@ -199,6 +231,7 @@ public:
   Int_t    fSubVersionExBUsed;            // SubVersionExBUsed
   Bool_t   fNoExBUsedInReco;              // ExB not used yet in the reco
   Bool_t   fSwitchOnValidation;           // Validation
+  Bool_t   fSwitchOnChamberStatus;        // ChamberStatus
   Bool_t   fVdriftValidated;              // Vdrift validation
   Bool_t   fExBValidated;                 // ExB validation
   Bool_t   fT0Validated;                  // T0 validation
@@ -207,6 +240,7 @@ public:
   Int_t    fMinStatsGain;                 // MinStats Gain
   Int_t    fMinStatsPRF;                  // MinStats PRF
   Int_t    fMinStatsChamberStatus;        // MinStats ChamberStatus
+  Double_t fMinSingleStatsChamberStatus;  // MinStats per chamber in % of mean (ChamberStatus)
   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
@@ -220,6 +254,18 @@ public:
   Double_t fRMSBadCalibratedGain;         // value to decide when it is bad calibrated 
   Double_t fRMSBadCalibratedVdrift;       // value to decide when it is bad calibrated 
   Double_t fRMSBadCalibratedExB;          // value to decide when it is bad calibrated 
+  Double_t fMinTimeOffsetValidate;        // For validation of timeoffset min value  
+  Bool_t   fRobustFitDriftVelocity;       // Robust fit for the drift velocity
+  Bool_t   fRobustFitExbAlt;              // Robust fit for the exb alt 
+  Bool_t   fAlternativeVdrfitFit;         // Alternative fitting method for vdrift calibration
+  Bool_t   fAlternativeExbAltFit;         // Alternative fitting method for the alternative exb calibarion method
+  Int_t    fMinNbOfPointVdriftFit;        // Min number of points for the drift velocity calibration
+  Int_t    fMethodeGain;                  // Methode Gain Fit
+  Float_t  fOutliersFitChargeLow;         // The fit starts at fOutliersFitChargeLow procent number of entries
+  Float_t  fOutliersFitChargeHigh;        // The fit starts at fOutliersFitChargeHigh procent number of entries
+  Float_t  fBeginFitCharge;               // Fit Begin Charge starts at mean/fBeginFitCharge
+  Float_t  fT0Shift0;                    // T0 Shift with the maximum positive slope
+  Float_t  fT0Shift1;                    // T0 Shift with the maximum of the amplification region
 
   Int_t GetSubVersion(TString name) const;
   Int_t GetVersion(TString name) const;
@@ -230,7 +276,11 @@ public:
 private:
   AliTRDPreprocessorOffline& operator=(const AliTRDPreprocessorOffline&); // not implemented
   AliTRDPreprocessorOffline(const AliTRDPreprocessorOffline&); // not implemented
-  ClassDef(AliTRDPreprocessorOffline,2)
+
+  Bool_t fPHQon;                 //switch of PHQ
+  Bool_t fDebugPHQon;                 //switch of DebugPHQ
+
+  ClassDef(AliTRDPreprocessorOffline,5)
 };
 
 #endif