New directory for the VMC tests (Ivana, Eva)
[u/mrichter/AliRoot.git] / TRD / qaRec / AliTRDcalibration.h
1 #ifndef ALITRDCALIBRATION_H
2 #define ALITRDCALIBRATION_H
3
4 // macro for extremely simple analysis
5
6 ///////////////////////////////////////////////////////////////////////////////
7 //                                                                           //
8 //  TRD calibration class                                                    //
9 //                                                                           //
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #include "AliTRDrecoTask.h"
13
14 class TList;
15 class TObject;
16 class TH1F;
17 class TProfile2D;
18 class TGraph;
19 class TH2I;
20 class TH2D;
21 class TTree;
22 class TObjArray;
23 class AliTRDtrackV1;
24 class AliTRDCalibraFillHisto;
25 class AliTRDCalibraVector;
26 class AliTRDCalibraMode;
27 class AliTRDcluster;
28 class AliTRDtrackInfo;
29
30 class AliTRDcalibration : public AliTRDrecoTask 
31 {
32  
33 public:
34
35   // Plots registered for this task
36   enum{
37     kNbTrack        =  0     // Nb tracks per event
38       ,kNbTracklet     =  1     // Nb of traklets per detector
39       ,kNbTimeBin      =  2     // Nb of clusters per timebin
40       ,kNbClusters     =  3     // Nb of clusters per tracklet
41       ,kPHSum          =  4     // All integrated PH
42       ,kCHSum          =  5     // All integrated CH
43       ,kPH2D           =  6     // PH2D
44       ,kCH2D           =  7     // CH2D
45       ,kPRF2D          =  8     // PRF2D 
46       ,kPH2DVector     =  9     // PH2D
47       ,kCH2DVector     =  10     // CH2D
48       ,kPRF2DVector    =  11     // PRF2D 
49       ,kLinearFitter   =  12    // For the one with the most stats 
50       ,kGainFactor     =  13    // Gain factor
51       ,kVdriftT0Factor   = 14   // VdriftT0 average pulse height
52       ,kVdriftLorentzAngleFactor = 15  // VdriftLorentzAngle
53       ,kPRFFactor = 16                 //PRF Factor
54       };
55   
56
57   AliTRDcalibration();
58   virtual ~AliTRDcalibration();
59   
60   virtual void    CreateOutputObjects();
61   virtual void    Exec(Option_t *option);
62   virtual void    Terminate(Option_t *);
63   virtual Bool_t  GetRefFigure(Int_t ifig);
64   virtual Bool_t  PostProcess();
65
66   Bool_t FillGraphIndex(const TObjArray *vectora, TGraph *graph) const;
67   Bool_t AddStatsPerDetector(const TH2I *ch);
68   Bool_t AddStatsPerDetector(const TProfile2D *ph, Int_t i);
69
70   Bool_t SetNrphiFromTObject(const char *name, Int_t i, AliTRDCalibraMode *calibMode) const;
71   Bool_t SetNzFromTObject(const char *name, Int_t i, AliTRDCalibraMode *calibMode) const;
72
73   Int_t  GetNumberOfGroupsPRF(const char* nametitle) const;
74   TH2I  *GetSumCH() const                                           { return fCHSum; };
75   TH2D  *GetSumDet() const                                          { return fDetSum;};
76   AliTRDCalibraVector  *GetSumDetVector() const                     { return fDetSumVector;};
77
78   
79
80   void SetHisto2d(Bool_t histo2d)                                   {fHisto2d=histo2d;};
81   void SetVector2d(Bool_t vector2d)                                 {fVector2d=vector2d;};
82   void SetVdriftLinear(Bool_t vdriftLinear)                         {fVdriftLinear = vdriftLinear;};
83   void SetLow(Int_t low)                                            {flow=low;};
84   void SetHigh(Int_t high)                                          {fhigh=high;};
85   void SetNz(Short_t nz, Int_t i)                                   {fNz[i]=nz;};
86   void SetNrphi(Short_t nrphi, Int_t i)                             {fNrphi[i]=nrphi;};
87   void SetFillZero(Bool_t fillZero)                                 {ffillZero =  fillZero;};
88   void SetNormalizeNbOfCluster(Bool_t normalizeNbOfCluster)         {fnormalizeNbOfCluster = normalizeNbOfCluster;};
89   void SetMaxCluster(Float_t maxcluster)                            {fmaxCluster =  maxcluster; }; 
90   void SetOfflineTracks()                                           {fOfflineTracks=kTRUE; fStandaloneTracks=kFALSE; };
91   void SetStandaloneTracks()                                        {fStandaloneTracks=kTRUE; fOfflineTracks=kFALSE; };
92   void SetCompressPerDetector(Bool_t compressPerDetector=kTRUE)     {fCompressPerDetector=compressPerDetector; };
93   void SetRunNumber(Int_t runNumber)                                {fRunNumber=runNumber; };
94   void SetNameDirectoryOutput(const char *nameDirectory)            {fkNameDirectory=nameDirectory; };
95   
96 private:
97   AliTRDtrackInfo  *fTrackInfo;                  //track info
98
99   AliTRDtrackV1 *ftrdTrack;                      //trdtrack
100   AliTRDcluster *fcl;                            //cluster
101   
102   AliTRDCalibraFillHisto *fTRDCalibraFillHisto;  //! calibration analyse object
103   TH1F        *fNbTRDTrack;                      //! nb ESD tracks used
104   TH1F        *fNbTRDTrackOffline;               //! nb ESD tracks offline used
105   TH1F        *fNbTRDTrackStandalone;            //! nb ESD tracks standalone used
106   TH1F        *fNbTRDTracklet;                   //! nb tracklets used
107   TH1F        *fNbTRDTrackletOffline;            //! nb tracklets offline used
108   TH1F        *fNbTRDTrackletStandalone;         //! nb tracklets standalone used
109   TH1F        *fNbTimeBin;                       //! nb Time Bin
110   TH1F        *fNbTimeBinOffline;                //! nb Time Bin offline
111   TH1F        *fNbTimeBinStandalone;             //! nb Time Bin standalone
112   TH1F        *fNbClusters;                      //! nb Clusters
113   TH1F        *fNbClustersOffline;               //! nb Clusters offline
114   TH1F        *fNbClustersStandalone;            //! nb Clusters standalone
115
116
117   TProfile2D  *fPHSum;                           //! sum PH
118   TH2I        *fCHSum;                           //! sum CH
119   TH2D        *fDetSum;                          //! sum Det
120   AliTRDCalibraVector *fDetSumVector;            //! sum Det Vect
121   
122   Bool_t      fHisto2d;                          //! histo
123   Bool_t      fVector2d;                         //! vector
124   Bool_t      fVdriftLinear;                     //! vdrift Linear
125
126   Int_t       flow;                              //! lower limit nb of clusters
127   Int_t       fhigh;                             //! higher limit nb of clusters
128   Int_t       fNbTimeBins;                       //! number of timebins 
129   Bool_t      ffillZero;                         //! fill zero
130   Short_t     fNz[3];                            //! Nz mode 
131   Short_t     fNrphi[3];                         //! Nrphi mode
132   Bool_t      fnormalizeNbOfCluster;             //! normalize with number of clusters
133   Float_t     fmaxCluster;                       //! maxcluster (noise at the end)
134   Bool_t      fOfflineTracks;                    //! Offline refited tracks
135   Bool_t      fStandaloneTracks;                 //! Take only standalone tracks
136
137   Bool_t      fCompressPerDetector;              //! Compress per detector 
138
139   Int_t       fRunNumber;                        //! Run number
140   const char *fkNameDirectory;                   //! Name output directory fit parameters
141
142   TObjArray  *fGraph;                            //! array of graphs filled in PostProcess
143   Bool_t      fPostProcess;                      //Post process 
144
145   AliTRDcalibration(const AliTRDcalibration&); 
146   AliTRDcalibration& operator=(const AliTRDcalibration&); 
147
148   ClassDef(AliTRDcalibration, 1) // calibration task
149 };
150 #endif
151