]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG1/TRD/AliTRDclusterResolution.h
36a0e816426ca6a8dd031b07fb2df340c444364c
[u/mrichter/AliRoot.git] / PWG1 / TRD / AliTRDclusterResolution.h
1 #ifndef ALITRDCLUSTERRESOLUTION_H
2 #define ALITRDCLUSTERRESOLUTION_H
3
4 ///////////////////////////////////////////////////////////////////////////////
5 //                                                                           //
6 //  TRD cluster error parameterization                  
7 //  Authors:                                                              //
8 //    Alexandru Bercuci <A.Bercuci@gsi.de>                                //
9 ////////////////////////////////////////////////////////////////////////////
10
11 #ifndef ALITRDRECOTASK_H
12 #include "AliTRDrecoTask.h"
13 #endif
14
15 class TCanvas;
16 class TObjArray;
17 class AliTRDclusterResolution : public AliTRDrecoTask
18 {
19 public:
20   enum EAxisBinning { // bins in z and x direction
21     kND  = 25
22   };
23   enum EResultContainer { // results container type
24     kCenter = 0   // cluster2center pad calibration
25    ,kQRes   = 1   // resolution on charge dependence
26    ,kSigm   = 2   // sigma cluster as func of x and z
27    ,kMean   = 3   // shift cluster as func of x and z
28    ,kNtasks = 4   // total number os sub tasks
29   };
30   enum ECheckBits { // force setting the ExB
31     kSaveAs    = BIT(22)
32    ,kExB       = BIT(23)
33   };
34   AliTRDclusterResolution();
35   AliTRDclusterResolution(const char *name);
36   virtual ~AliTRDclusterResolution();
37
38   void          UserCreateOutputObjects();
39   void          UserExec(Option_t *);
40   Int_t         GetDetector() const { return fDet; }
41   inline Float_t GetExB() const;
42   inline Float_t GetVdrift() const;
43   Bool_t        GetRefFigure(Int_t ifig);
44   Bool_t        HasProcess(EResultContainer bit) const {return TESTBIT(fStatus, bit);}
45   Bool_t        HasExB() const { return TestBit(kExB);}
46
47   TObjArray*    Histos(); 
48   TObjArray*    Results() const {return fResults;}; 
49
50   Bool_t        IsVisual() const {return Bool_t(fCanvas);}
51   Bool_t        IsSaveAs() const {return TestBit(kSaveAs);}
52
53   Bool_t        PostProcess();
54   Bool_t        SetExB(Int_t det=-1, Int_t c = 70, Int_t r = 7);
55   void          SetVisual();
56   void          SetProcess(EResultContainer bit, Bool_t v = kTRUE) {v ? SETBIT(fStatus, bit) : CLRBIT(fStatus, bit);}
57   void          SetSaveAs(Bool_t v = kTRUE) {SetBit(kSaveAs, v);}
58   inline void   ResetProcesses();
59
60 protected:
61   void    ProcessCharge();
62   void    ProcessCenterPad();
63   void    ProcessSigma();
64   void    ProcessMean();
65
66 private:
67   AliTRDclusterResolution(const AliTRDclusterResolution&);  
68   AliTRDclusterResolution& operator=(const AliTRDclusterResolution&);
69
70   TCanvas    *fCanvas; //! visualization canvas 
71   TObjArray  *fInfo;   //! list of cluster info
72   TObjArray  *fResults;// list of result graphs/histos/trees
73   UChar_t    fStatus;  // steer parameter of the task
74   Short_t    fDet;     // detector (-1 for all)
75   Float_t    fExB;     // tg of the Lorentz angle
76   Float_t    fVdrift;  // mean drift velocity
77   Float_t    fT0;      // time 0
78   static const Float_t fgkTimeBinLength;// time bin length (invers of sampling frequency)
79
80   // working named variables
81   UChar_t    fLy;      // TRD plane 
82   Float_t    fT;       // calibrated time 
83   Float_t    fX;       // local drift length 
84   Float_t    fY;       // local rphi offset 
85   Float_t    fZ;       // local anode wire offset 
86   Float_t    fR[4];    // mean/sgm resolution
87   Float_t    fP[4];    // mean/sgm pulls
88   
89   ClassDef(AliTRDclusterResolution, 3)  // cluster resolution
90 };
91
92 //___________________________________________________
93 inline Float_t AliTRDclusterResolution::GetExB() const
94
95   if(!HasExB()){
96     printf("WARNING :: ExB was not set. Use B=0.\n");
97   }
98   return fExB;
99 }
100
101 //___________________________________________________
102 inline Float_t AliTRDclusterResolution::GetVdrift() const
103
104   if(!HasExB()){
105     printf("WARNING :: ExB was not set. Use B=0.\n");
106   }
107   return fVdrift;
108 }
109
110 //___________________________________________________
111 inline void AliTRDclusterResolution::ResetProcesses()
112 {
113   CLRBIT(fStatus, kQRes);
114   CLRBIT(fStatus, kCenter);
115   CLRBIT(fStatus, kSigm);
116   CLRBIT(fStatus, kMean);
117 }
118
119 #endif
120