]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDCalibraVector.h
QA update by Sylwester
[u/mrichter/AliRoot.git] / TRD / AliTRDCalibraVector.h
1 #ifndef ALITRDCALIBRAVECTOR_H
2 #define ALITRDCALIBRAVECTOR_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 ///////////////////////////////////////////////////////////////////////////////
9 //                                                                           //
10 //  TRD calibration class                                                    //
11 //                                                                           //
12 ///////////////////////////////////////////////////////////////////////////////
13
14 #ifndef ROOT_TObject
15 #  include <TObject.h>
16 #endif
17
18 class TGraphErrors;
19 class TH1F;
20 class TObjArray;
21
22 class AliTRDarrayF;
23 class AliTRDarrayI;
24
25 class AliTRDCalibraVector : public TObject {
26
27  public: 
28
29   AliTRDCalibraVector();
30   AliTRDCalibraVector(const AliTRDCalibraVector &c);
31   virtual ~AliTRDCalibraVector();
32
33   AliTRDCalibraVector& operator = (const  AliTRDCalibraVector &source);
34
35   // Fill
36   Int_t          SearchBin(Float_t value, Int_t i) const;  
37   Bool_t         UpdateVectorCH(Int_t det, Int_t group, Float_t value);
38   Bool_t         UpdateVectorPRF(Int_t det, Int_t group, Float_t x, Float_t y);
39   Bool_t         UpdateVectorPH(Int_t det, Int_t group, Int_t time, Float_t value);
40
41   // Add
42   Bool_t         Add(AliTRDCalibraVector *calvector);
43   
44   // Fit
45   TGraphErrors  *ConvertVectorPHTGraphErrors(Int_t det, Int_t group, const Char_t *name);
46   TGraphErrors  *ConvertVectorPRFTGraphErrors(Int_t det, Int_t group, const Char_t *name);
47   TH1F          *ConvertVectorCHHisto(Int_t det, Int_t group, const Char_t *name);
48
49   //
50   // Set and Get methods
51   //
52
53   void           SetNumberBinCharge(Short_t numberbincharge)   { fNumberBinCharge = numberbincharge;            } 
54   void           SetNumberBinPRF(Short_t numberbinprf)         { fNumberBinPRF    = numberbinprf;               } 
55   void           SetTimeMax(Int_t timemax)                     { fTimeMax         = timemax;                    } 
56   void           SetPRFRange(Float_t prfrange)                 { fPRFRange        = prfrange;                   }  
57   void           SetDetCha0(Int_t i, Short_t total)            { fDetCha0[i]      = total;                      } 
58   void           SetDetCha2(Int_t i, Short_t total)            { fDetCha2[i]      = total;                      } 
59   void           SetNamePH(const char* name)                   { fVectorPHEntries.SetName(name);                } 
60   void           SetNamePRF(const char* name)                  { fVectorPRFEntries.SetName(name);               } 
61   void           SetNameCH(const char* name)                   { fVectorCHEntries.SetName(name);                } 
62
63   Short_t        GetNumberBinCharge()const                     { return fNumberBinCharge;                       }
64   Short_t        GetNumberBinPRF()const                        { return fNumberBinPRF;                          }
65   Int_t          GetTimeMax()const                             { return fTimeMax;                               } 
66   Float_t        GetPRFRange()const                            { return fPRFRange;                              } 
67   Short_t        GetDetCha0(Int_t i) const                     { return fDetCha0[i];                            }
68   Short_t        GetDetCha2(Int_t i) const                     { return fDetCha2[i];                            }
69   const char*    GetNamePH()                                   { return fVectorPHEntries.GetName();             }
70   const char*    GetNamePRF()                                  { return fVectorPRFEntries.GetName();            }
71   const char*    GetNameCH()                                   { return fVectorCHEntries.GetName();             }
72
73   AliTRDarrayI  *GetPHEntries(Int_t det,Bool_t force = kFALSE);
74   AliTRDarrayF  *GetPHMean(Int_t det,Bool_t force = kFALSE);
75   AliTRDarrayF  *GetPHSquares(Int_t det,Bool_t force = kFALSE);
76
77   AliTRDarrayI  *GetPRFEntries(Int_t det,Bool_t force = kFALSE);
78   AliTRDarrayF  *GetPRFMean(Int_t det,Bool_t force = kFALSE);
79   AliTRDarrayF  *GetPRFSquares(Int_t det,Bool_t force = kFALSE);
80
81   AliTRDarrayI  *GetCHEntries(Int_t det,Bool_t force = kFALSE);
82
83  protected:
84
85   // Current data
86
87          AliTRDarrayI     *fPHEntries;                //  Current AliTRDArrayI PH entries
88          AliTRDarrayF     *fPHMean;                   //  Current AliTRDArrayF PH Mean
89          AliTRDarrayF     *fPHSquares;                //  Current AliTRDArrayF PH Squares
90
91          AliTRDarrayI     *fPRFEntries;               //  Current AliTRDArrayI PH entries
92          AliTRDarrayF     *fPRFMean;                  //  Current AliTRDArrayF PH Mean
93          AliTRDarrayF     *fPRFSquares;               //  Current AliTRDArrayF PH Squares
94
95          AliTRDarrayI     *fCHEntries;                //  Current AliTRDArrayI PH entries
96
97          Int_t            fDetectorPH;                //  Current detector
98          Int_t            fDetectorCH;                //  Current detector
99          Int_t            fDetectorPRF;               //  Current detector
100          
101   // Arrays of these objects 
102           
103           TObjArray       fVectorPHMean;              // array of AliTRDarrayF of mean
104           TObjArray       fVectorPHSquares;           // array of AliTRDarrayF of squares
105           TObjArray       fVectorPHEntries;           // array of AliTRDarrayI of entries
106           TObjArray       fVectorCHEntries;           // array of AliTRDarrayI of entries
107           TObjArray       fVectorPRFMean;             // array of AliTRDarrayF of mean
108           TObjArray       fVectorPRFSquares;          // array of AliTRDarrayF of squares
109           TObjArray       fVectorPRFEntries;          // array of AliTRDarrayI of entries
110          
111   // Size of the infos
112
113           Short_t          fNumberBinCharge;          // Number of bins for the gain factor
114           Short_t          fNumberBinPRF;             // Number of bin for the PRF
115           Int_t            fTimeMax;                  // Number of time bins
116           Float_t          fPRFRange;                 // Range PRF
117           Short_t          fDetCha0[3];               // Number of XBins for chamber != 2
118           Short_t          fDetCha2[3];               // Number of Xbins for chamber 2
119
120   // Some functions
121
122
123           AliTRDarrayI  *GetEntriesPH(Int_t det, TObjArray *array, Bool_t force);
124           AliTRDarrayF  *GetMeanSquaresPH(Int_t det, TObjArray *array, Bool_t force);
125
126           AliTRDarrayI  *GetEntriesPRF(Int_t det, TObjArray *array, Bool_t force);
127           AliTRDarrayF  *GetMeanSquaresPRF(Int_t det, TObjArray *array, Bool_t force);
128           
129           AliTRDarrayI  *GetEntriesCH(Int_t det, TObjArray *array, Bool_t force);
130
131   // Some basic geometry function
132           virtual Int_t    GetStack(Int_t d) const;
133   
134   ClassDef(AliTRDCalibraVector,1)                   // TRD Calibration class
135
136 };
137   
138 #endif
139
140