]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/qaRec/AliTRDclusterResolution.h
fix coding convention errors
[u/mrichter/AliRoot.git] / TRD / qaRec / AliTRDclusterResolution.h
index 6bdee71b6d2eacb4f2ffae0a0d2615fcb1e0957f..94907d859a5ec6e61e92c766efa055d3c3f9184e 100644 (file)
@@ -1,60 +1,99 @@
 #ifndef ALITRDCLUSTERRESOLUTION_H
 #define ALITRDCLUSTERRESOLUTION_H
 
+///////////////////////////////////////////////////////////////////////////////
+//                                                                           //
+//  TRD cluster error parameterization                  
+//  Authors:                                                              //
+//    Alexandru Bercuci <A.Bercuci@gsi.de>                                //
+////////////////////////////////////////////////////////////////////////////
 
 #ifndef ALITRDRECOTASK_H
 #include "AliTRDrecoTask.h"
 #endif
 
+class TCanvas;
 class TObjArray;
 class TAxis;
 class AliTRDclusterResolution : public AliTRDrecoTask
 {
 public:
-  enum { // bins in z and x direction
+  enum EAxisBinning { // bins in z and x direction
     kNTB = 24
-    ,kND = 5
-    ,kN  = kND*kNTB
+   ,kND  = 25
+   ,kN   = kND*kNTB
   };
-  enum { // results containers
-    kQRes      = 0
-    ,kYRes     = 1
-    ,kSXRes    = 2
-    ,kSYRes    = 3
+  enum EResultContainer { // results container type
+    kCenter = 0   // cluster2center pad calibration
+   ,kQRes   = 1   // resolution on charge dependence
+   ,kSigm   = 2   // sigma cluster as func of x and z
+   ,kMean   = 3   // shift cluster as func of x and z
+   ,kNtasks = 4   // total number os sub tasks
   };
-  enum { // force setting the ExB
-    kExB       = BIT(23)
+  enum ECheckBits { // force setting the ExB
+    kSaveAs    = BIT(22)
+   ,kExB       = BIT(23)
   };
-  AliTRDclusterResolution();
+  AliTRDclusterResolution(const char *name="ClErrParam", const char *title="Cluster error monitor");
   virtual ~AliTRDclusterResolution();
 
-  void    ConnectInputData(Option_t *);
-  void    CreateOutputObjects();
-  void    Exec(Option_t *);
-  Int_t   GetDetector() const { return fDet; }
+  void          ConnectInputData(Option_t *);
+  void          CreateOutputObjects();
+  void          Exec(Option_t *);
+  Int_t         GetDetector() const { return fDet; }
   inline Float_t GetExB() const;
-  Bool_t  GetRefFigure(Int_t ifig);
-  Bool_t  HasExB() const { return TestBit(kExB);}
-  TObjArray*  Histos(); 
-  
-  Bool_t  PostProcess();
-  Bool_t  SetExB(Int_t det=-1);
+  inline Float_t GetVdrift() const;
+  Bool_t        GetRefFigure(Int_t ifig);
+  Bool_t        HasProcess(EResultContainer bit) const {return TESTBIT(fStatus, bit);}
+  Bool_t        HasExB() const { return TestBit(kExB);}
+
+  TObjArray*    Histos(); 
+  TObjArray*    Results() const {return fResults;}; 
+
+  Bool_t        IsVisual() const {return Bool_t(fCanvas);}
+  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          SetVisual();
+  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();
+
   void    Terminate(Option_t *){};
 
+protected:
+  void    ProcessCharge();
+  void    ProcessCenterPad();
+  void    ProcessSigma();
+  void    ProcessMean();
+
 private:
   AliTRDclusterResolution(const AliTRDclusterResolution&);  
   AliTRDclusterResolution& operator=(const AliTRDclusterResolution&);
 
-  TObjArray  *fInfo;   // list of cluster info
+  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)
-  TAxis      *fAd;     // binning in the z direction (drift cell)
-  Float_t    fExB;     // tg of the Lorentz angle
+  TAxis      *fAt;     //! binning in the x(radial) direction (time)
+  UChar_t    fStatus;  // steer parameter of the task
   Short_t    fDet;     // detector (-1 for all)
+  Float_t    fExB;     // tg of the Lorentz angle
+  Float_t    fVdrift;  // mean drift velocity
+  static const Float_t fgkTimeBinLength;// time bin length (invers of sampling frequency)
 
-  ClassDef(AliTRDclusterResolution, 0)  // cluster resolution
+  // 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
+  
+  ClassDef(AliTRDclusterResolution, 3)  // cluster resolution
 };
 
+//___________________________________________________
 inline Float_t AliTRDclusterResolution::GetExB() const
 { 
   if(!HasExB()){
@@ -62,5 +101,24 @@ inline Float_t AliTRDclusterResolution::GetExB() const
   }
   return fExB;
 }
+
+//___________________________________________________
+inline Float_t AliTRDclusterResolution::GetVdrift() const
+{ 
+  if(!HasExB()){
+    printf("WARNING :: ExB was not set. Use B=0.\n");
+  }
+  return fVdrift;
+}
+
+//___________________________________________________
+inline void AliTRDclusterResolution::ResetProcess()
+{
+  CLRBIT(fStatus, kQRes);
+  CLRBIT(fStatus, kCenter);
+  CLRBIT(fStatus, kSigm);
+  CLRBIT(fStatus, kMean);
+}
+
 #endif