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