]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/Cal/AliTRDCalROC.h
Add the calibration object algebra by Raphaelle
[u/mrichter/AliRoot.git] / TRD / Cal / AliTRDCalROC.h
1 #ifndef ALITRDCALROC_H
2 #define ALITRDCALROC_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 base class for one ROC      //
11 //                                              //
12 //////////////////////////////////////////////////
13
14 #include <TObject.h>
15 #include <TMath.h>
16 #include <TLinearFitter.h>
17
18 class TArrayI;
19 class TArrayF;
20 class TH2F;
21 class TH1F;
22 class TGraph2D;
23 class TH2D;
24
25 //_____________________________________________________________________________
26 class AliTRDCalROC : public TObject 
27 {
28
29  public:
30
31   AliTRDCalROC();
32   AliTRDCalROC(Int_t p, Int_t c);
33   AliTRDCalROC(const AliTRDCalROC &c);
34   virtual      ~AliTRDCalROC();
35   AliTRDCalROC &operator=(const AliTRDCalROC &c);
36   virtual void  Copy(TObject &c) const;
37
38   Int_t         GetNrows() const                { return fNrows; };
39   Int_t         GetNcols() const                { return fNcols; };
40
41   Int_t         GetChannel(Int_t c, Int_t r)    { return r+c*fNrows; };
42   Int_t         GetNchannels() const            { return fNchannels; };
43
44   Float_t       GetValue(Int_t ich) const       { return (Float_t) fData[ich] / 10000;  };
45   Float_t       GetValue(Int_t col, Int_t row)  { return GetValue(GetChannel(col,row)); };
46
47   void          SetValue(Int_t ich, Float_t value) 
48                                                 { fData[ich] = (UShort_t) (value * 10000); };
49   void          SetValue(Int_t col, Int_t row, Float_t value) 
50                                                 { SetValue(GetChannel(col,row), value);    };
51
52   // statistic
53   //
54   Double_t GetMean(AliTRDCalROC *outlierROC=0); 
55   Double_t GetRMS(AliTRDCalROC *outlierROC=0);
56   Double_t GetMedian(AliTRDCalROC *outlierROC=0);
57   Double_t GetLTM(Double_t *sigma=0, Double_t fraction=0.9, AliTRDCalROC *outlierROC=0);
58
59   // algebra
60   Bool_t Add(Float_t c1);
61   Bool_t Multiply(Float_t c1);
62   Bool_t Add(const AliTRDCalROC * roc, Double_t c1 = 1);
63   Bool_t Multiply(const AliTRDCalROC * roc);   
64   Bool_t Divide(const AliTRDCalROC * roc);   
65   
66   //Plots
67   TH2F *   MakeHisto2D(Float_t min, Float_t max,Int_t type);
68   TH1F *   MakeHisto1D(Float_t min, Float_t max,Int_t type);
69   
70  protected:
71
72   Int_t     fPla;              //  Plane number
73   Int_t     fCha;              //  Chamber number
74
75   Int_t     fNrows;            //  Number of rows
76   Int_t     fNcols;            //  Number of columns
77
78   Int_t     fNchannels;        //  Number of channels
79   UShort_t *fData;             //[fNchannels] Data
80
81   ClassDef(AliTRDCalROC, 2)    //  TRD ROC calibration class
82
83 };
84
85 #endif