]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG1/TRD/AliTRDclusterResolution.h
fix warnings
[u/mrichter/AliRoot.git] / PWG1 / TRD / AliTRDclusterResolution.h
index 76138a26847a870a80f0f1f1a3428b9db919a348..de4ef9c616624bc80d065bd1545988f257184263 100644 (file)
 #ifndef ALITRDRECOTASK_H
 #include "AliTRDrecoTask.h"
 #endif
+#ifndef ALILOG_H
+#include "AliLog.h"
+#endif
 
 class TCanvas;
 class TObjArray;
-class TAxis;
 class AliTRDclusterResolution : public AliTRDrecoTask
 {
 public:
   enum EAxisBinning { // bins in z and x direction
-    kNTB = 24
-   ,kND  = 25
-   ,kN   = kND*kNTB
+    kND  = 25
   };
   enum EResultContainer { // results container type
     kCenter = 0   // cluster2center pad calibration
@@ -30,23 +30,26 @@ public:
    ,kMean   = 3   // shift cluster as func of x and z
    ,kNtasks = 4   // total number os sub tasks
   };
-  enum ECheckBits { // force setting the ExB
-    kSaveAs    = BIT(22)
-   ,kExB       = BIT(23)
+  enum ECheckBits { 
+    kSaveAs     = BIT(22) // save intermediary results
+   ,kCalibrated = BIT(23) // load calibration
   };
   AliTRDclusterResolution();
   AliTRDclusterResolution(const char *name);
   virtual ~AliTRDclusterResolution();
 
-  void          ConnectInputData(Option_t *);
   void          UserCreateOutputObjects();
   void          UserExec(Option_t *);
   Int_t         GetDetector() const { return fDet; }
+  void          GetPad(Int_t &c, Int_t &r) const { c=fCol, r=fRow; return;}
   inline Float_t GetExB() const;
   inline Float_t GetVdrift() const;
+  inline Float_t GetT0() const;
+  inline Float_t GetGain() const;
+  Float_t       GetDyRange() const {return fDyRange;}
   Bool_t        GetRefFigure(Int_t ifig);
   Bool_t        HasProcess(EResultContainer bit) const {return TESTBIT(fStatus, bit);}
-  Bool_t        HasExB() const { return TestBit(kExB);}
+  Bool_t        IsCalibrated() const { return TestBit(kCalibrated);}
 
   TObjArray*    Histos(); 
   TObjArray*    Results() const {return fResults;}; 
@@ -55,11 +58,12 @@ public:
   Bool_t        IsSaveAs() const {return TestBit(kSaveAs);}
 
   Bool_t        PostProcess();
-  Bool_t        SetExB(Int_t det=-1, Int_t c = 70, Int_t r = 7);
+  void          SetCalibrationRegion(Int_t det, Int_t col=-1, Int_t row=-1);
   void          SetVisual();
+  void          SetDyRange(Float_t dy) {if(dy>0) fDyRange = dy;}
   void          SetProcess(EResultContainer bit, Bool_t v = kTRUE) {v ? SETBIT(fStatus, bit) : CLRBIT(fStatus, bit);}
   void          SetSaveAs(Bool_t v = kTRUE) {SetBit(kSaveAs, v);}
-  inline void   ResetProcess();
+  inline void   ResetProcesses();
 
 protected:
   void    ProcessCharge();
@@ -70,48 +74,64 @@ protected:
 private:
   AliTRDclusterResolution(const AliTRDclusterResolution&);  
   AliTRDclusterResolution& operator=(const AliTRDclusterResolution&);
+  Bool_t        LoadCalibration();
 
   TCanvas    *fCanvas; //! visualization canvas 
   TObjArray  *fInfo;   //! list of cluster info
-  TObjArray  *fResults;// list of result graphs/histos
-  TAxis      *fAt;     //! binning in the x(radial) direction (time)
+  TObjArray  *fResults;// list of result graphs/histos/trees
   UChar_t    fStatus;  // steer parameter of the task
   Short_t    fDet;     // detector (-1 for all)
+  Char_t     fCol;     // pad column (-1 for all)
+  Char_t     fRow;     // pad row (-1 for all)
   Float_t    fExB;     // tg of the Lorentz angle
   Float_t    fVdrift;  // mean drift velocity
+  Float_t    fT0;      // time 0
+  Float_t    fGain;    // gain
   static const Float_t fgkTimeBinLength;// time bin length (invers of sampling frequency)
 
   // working named variables
-  UChar_t    fLy;      //! TRD plane 
-  Float_t    fX;       //! local drift length 
-  Float_t    fY;       //! local rphi offset 
-  Float_t    fZ;       //! local anode wire offset 
-  Float_t    fR[4];    //! mean/sgm resolution
-  Float_t    fP[4];    //! mean/sgm pulls
+  Float_t    fDyRange; // min/max dy
+  UChar_t    fLy;      // TRD plane 
+  Float_t    fT;       // calibrated time 
+  Float_t    fX;       // local drift length 
+  Float_t    fY;       // local rphi offset 
+  Float_t    fZ;       // local anode wire offset 
+  Float_t    fR[4];    // mean/sgm resolution
+  Float_t    fP[4];    // mean/sgm pulls
   
-  ClassDef(AliTRDclusterResolution, 3)  // cluster resolution
+  ClassDef(AliTRDclusterResolution, 4)  // cluster resolution
 };
 
 //___________________________________________________
 inline Float_t AliTRDclusterResolution::GetExB() const
 { 
-  if(!HasExB()){
-    printf("WARNING :: ExB was not set. Use B=0.\n");
-  }
+  if(!IsCalibrated()) AliWarning("Instance not calibrated.");
   return fExB;
 }
 
 //___________________________________________________
 inline Float_t AliTRDclusterResolution::GetVdrift() const
 { 
-  if(!HasExB()){
-    printf("WARNING :: ExB was not set. Use B=0.\n");
-  }
+  if(!IsCalibrated()) AliWarning("Instance not calibrated.");
   return fVdrift;
 }
 
 //___________________________________________________
-inline void AliTRDclusterResolution::ResetProcess()
+inline Float_t AliTRDclusterResolution::GetT0() const
+{
+  if(!IsCalibrated()) AliWarning("Instance not calibrated.");
+  return fT0;
+}
+
+//___________________________________________________
+inline Float_t AliTRDclusterResolution::GetGain() const
+{
+  if(!IsCalibrated()) AliWarning("Instance not calibrated.");
+  return fGain;
+}
+
+//___________________________________________________
+inline void AliTRDclusterResolution::ResetProcesses()
 {
   CLRBIT(fStatus, kQRes);
   CLRBIT(fStatus, kCenter);