]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCCalROC.h
Algebraic function added (Marian)
[u/mrichter/AliRoot.git] / TPC / AliTPCCalROC.h
1 #ifndef ALITPCCALROC_H
2 #define ALITPCCALROC_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id: AliTPCCalROC.h,v */
7
8 //////////////////////////////////////////////////
9 //                                              //
10 //  TPC calibration base class for one ROC      //
11 //                                              //
12 //////////////////////////////////////////////////
13
14 #include <TObject.h>
15 #include <TMath.h>
16 #include <AliTPCROC.h>
17 class TH1F;
18 class TH2F;
19 //_____________________________________________________________________________
20 class AliTPCCalROC : public TObject {
21
22  public:
23   
24   AliTPCCalROC();
25   AliTPCCalROC(UInt_t sector);
26   AliTPCCalROC(const AliTPCCalROC &c);
27  AliTPCCalROC &operator = (const AliTPCCalROC & param);
28   virtual           ~AliTPCCalROC();  
29   UInt_t        GetNrows() const               { return fNRows;};
30   UInt_t        GetNchannels()       const     { return fNChannels;};
31   UInt_t        GetNPads(UInt_t row)  const     { return (row<fNRows)? AliTPCROC::Instance()->GetNPads(fSector,row):0;};
32   Float_t      GetValue(UInt_t row, UInt_t pad) const { return ( (row<fNRows) && (fIndexes[row]+pad)<fNChannels)? fData[fIndexes[row]+pad]: 0; };
33   Float_t      GetValue(UInt_t channel) const { return  fData[channel]; };
34   void         SetValue(UInt_t row, UInt_t pad, Float_t vd) { if ( row<fNRows && (fIndexes[row]+pad)<fNChannels)fData[fIndexes[row]+pad]= vd; };
35   void         SetValue(UInt_t channel, Float_t vd) {fData[channel]= vd; };
36   virtual void Draw(Option_t* option = "");
37   //
38   // algebra
39   void Add(Float_t c1);
40   void Multiply(Float_t c1);
41   void Add(const AliTPCCalROC * roc, Double_t c1 = 1);
42   void Multiply(const AliTPCCalROC * roc);   
43   void Divide(const AliTPCCalROC * roc);   
44   // statistic
45   //
46   Double_t GetMean(){return TMath::Mean(fNChannels, fData);}
47   Double_t GetRMS() {return TMath::RMS(fNChannels, fData);}
48   Double_t GetMedian() {return TMath::Median(fNChannels, fData);}
49   Double_t GetLTM(Double_t *sigma=0, Double_t fraction=0.9);
50   TH1F * MakeHisto1D(Float_t min=4, Float_t max=-4, Int_t type=0);     
51   TH2F * MakeHisto2D(Float_t min=4, Float_t max=-4, Int_t type=0);   
52   TH2F * MakeHistoOutliers(Float_t delta=4, Float_t fraction=0.7, Int_t mode=0);
53   static void Test();
54  protected:
55   UInt_t     fSector;          // sector number
56   UInt_t     fNChannels;       // number of channels
57   UInt_t     fNRows;           // number of rows
58   const UInt_t* fIndexes;      //!indexes
59   Float_t  *fData;            //[fNChannels] Data
60   ClassDef(AliTPCCalROC,1)    //  TPC ROC calibration class
61
62 };
63
64 #endif