]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG1/TRD/AliTRDresolution.h
- new definition of cluster to track residuals
[u/mrichter/AliRoot.git] / PWG1 / TRD / AliTRDresolution.h
1 #ifndef ALITRDRESOLUTION_H
2 #define ALITRDRESOLUTION_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id: AliTRDresolution.h 27496 2008-07-22 08:35:45Z cblume $ */
7
8 ////////////////////////////////////////////////////////////////////////////
9 //                                                                        //
10 //  TRD Resolution performance                                            //
11 //                                                                        //
12 //  Authors:                                                              //
13 //    Alexandru Bercuci <A.Bercuci@gsi.de>                                //
14 //    Markus Fasel <M.Fasel@gsi.de>                                       //
15 //                                                                        //
16 ////////////////////////////////////////////////////////////////////////////
17
18 #ifndef ALITRDRECOTASK_H
19 #include "AliTRDrecoTask.h"
20 #endif
21
22 class TH1;
23 class TH2;
24 class TF1;
25 class TGraphErrors;
26 class TObjArray;
27 class TDatabasePDG;
28 class AliTRDReconstructor;
29 class AliTRDgeometry;
30 class AliTRDrecoParam;
31 class AliTRDseedV1;
32 class AliTRDtrackInfo;
33 class AliTRDresolution : public AliTRDrecoTask
34 {
35 public:
36   enum ETRDresolutionPlot {
37      kCharge     =  0 // charge resolution
38     ,kCluster    =  1 // cluster - track
39     ,kTrackTRD   =  2 // tracklet - track residuals/pulls
40     ,kTrackTPC   =  3 // tracklet - track residuals/pulls at lower TRD entrance 
41     ,kMCcluster  =  4 // cluster-mc resolution/pulls
42     ,kMCtracklet =  5 // tracklet-mc resolution/pulls
43     ,kMCtrackTPC =  6 // TPC track monitor
44     ,kMCtrackTOF =  7 // TOF/HMPID track monitor
45     ,kMCtrackTRD =  8 // TRD track monitor
46     ,kNviews     =  9 // total number of resolution views
47     ,kNprojs     = 53 // total number of projections for all views
48   };
49   enum ETRDresolutionSteer {
50     kVerbose  = 0
51     ,kVisual  = 1
52   };
53
54   AliTRDresolution();
55   virtual ~AliTRDresolution();
56   
57   void    CreateOutputObjects();
58   Bool_t  GetRefFigure(Int_t ifig);
59   TObjArray*  Histos(); 
60   TObjArray*  Results(Int_t i=0) const {return i ? fGraphS : fGraphM;} 
61   void    Exec(Option_t * opt);
62   Bool_t  IsVerbose() const {return TESTBIT(fStatus, kVerbose);}
63   Bool_t  IsVisual() const {return TESTBIT(fStatus, kVisual);}
64   Bool_t  PostProcess();
65
66   TH1*    PlotCharge(const AliTRDtrackV1 *t=0x0);
67   TH1*    PlotCluster(const AliTRDtrackV1 *t=0x0);
68   TH1*    PlotTracklet(const AliTRDtrackV1 *t=0x0);
69   TH1*    PlotTrackTPC(const AliTRDtrackV1 *t=0x0);
70   TH1*    PlotMC(const AliTRDtrackV1 *t=0x0);
71
72   void    SetRecoParam(AliTRDrecoParam *r);
73   void    SetVerbose(Bool_t v = kTRUE) {v ? SETBIT(fStatus ,kVerbose): CLRBIT(fStatus ,kVerbose);}
74   void    SetVisual(Bool_t v = kTRUE) {v ? SETBIT(fStatus, kVisual) : CLRBIT(fStatus, kVisual);}
75
76   void    Terminate(Option_t * opt);
77   Bool_t  GetGraphPlot(Float_t *bb, ETRDresolutionPlot ip, Int_t idx=-1);
78   Bool_t  GetGraphTrack(Float_t *bb, Int_t idx, Int_t ist, Int_t n=123456789, Bool_t kLEG=kFALSE);
79   Bool_t  GetGraphTrackTPC(Float_t *bb, Int_t idx, Int_t ist=0, Int_t n=123456789, Bool_t kLEG=kFALSE);
80   
81 private:
82   AliTRDresolution(const AliTRDresolution&);
83   AliTRDresolution& operator=(const AliTRDresolution&);
84   void    AdjustF1(TH1 *h, TF1 *f);
85   void    GetLandauMpvFwhm(TF1 * const f, Float_t &mpv, Float_t &xm, Float_t &xM);
86   Bool_t  Process(TH2* const h2, TF1 *f, Float_t k, TGraphErrors **g);
87   Bool_t  Process2D(ETRDresolutionPlot ip, Int_t idx=-1, TF1 *f=0x0,  Float_t scale=1., Int_t gidx=-1);
88   Bool_t  Process3D(ETRDresolutionPlot ip, Int_t idx=-1, TF1 *f=0x0,  Float_t scale=1.);
89   Bool_t  Process3Drange(ETRDresolutionPlot ip, Int_t idx=-1, Int_t gidx=-1, TF1 *f=0x0,  Float_t scale=1., Int_t zbin0=0, Int_t zbin1=0);
90   Bool_t  Process3DL(ETRDresolutionPlot ip, Int_t idx=-1, TF1 *f=0x0,  Float_t scale=1.);
91   Bool_t  Process4D(ETRDresolutionPlot ip, Int_t idx=-1, TF1 *f=0x0,  Float_t scale=1., Int_t n=-1);
92
93   UChar_t             fStatus;          // steer parameter of the task
94   UShort_t            fIdxPlot;         //! plot counter (internal)
95   UShort_t            fIdxFrame;        //! frame counter (internal)
96   static Char_t const *fgPerformanceName[kNviews]; // name of performance plot
97   static UChar_t const fgNhistos[kNviews]; // number of histos per task
98   static UChar_t const fgNproj[kNviews]; // number of projections per task
99   static UChar_t const fgNcomp[kNprojs]; // number of projections per task
100   static Char_t const *fgAxTitle[kNprojs][4]; // Title for all ref histos
101   AliTRDReconstructor *fReconstructor;  //! local reconstructor
102   AliTRDgeometry      *fGeo;            //! TRD geometry
103   TDatabasePDG        *fDBPDG;          //! PDG database
104   TObjArray           *fGraphS;         //! result holder - sigma values
105   TObjArray           *fGraphM;         //! result holder - mean values
106
107   // calibration containers
108   TObjArray           *fCl;     //! cluster2track calib
109   TObjArray           *fTrklt;  //! tracklet2track calib
110   TObjArray           *fMCcl;   //! cluster2mc calib
111   TObjArray           *fMCtrklt;//! tracklet2mc calib
112   
113   ClassDef(AliTRDresolution, 4) // TRD tracking resolution task
114 };
115 #endif