AliRoot Core  v5-06-30 (35d6c57)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliTPCCalROC.h
Go to the documentation of this file.
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 
8 
9 #include <TObject.h>
10 #include <TMath.h>
11 #include <AliTPCROC.h>
12 #include "TLinearFitter.h"
13 
14 class TH1F;
15 class TH2F;
16 class TArrayI;
17 class TF1;
18 //_____________________________________________________________________________
19 class AliTPCCalROC : public TNamed {
20 
21  public:
22 
23  AliTPCCalROC();
24  AliTPCCalROC(UInt_t sector);
25  AliTPCCalROC(const AliTPCCalROC &c);
26  AliTPCCalROC &operator = (const AliTPCCalROC & param);
27  virtual ~AliTPCCalROC();
28  UInt_t GetSector() const { return fSector;}
29  UInt_t GetNrows() const { return fNRows;};
30  UInt_t GetNchannels() const { return fNChannels;};
31  Bool_t IsInRange(UInt_t row, UInt_t pad) { return (row<fNRows)? (fkIndexes[row]+pad)<fNChannels:kFALSE;}
32  UInt_t GetNPads(UInt_t row) const { return (row<fNRows)? AliTPCROC::Instance()->GetNPads(fSector,row):0;};
33  Float_t GetValue(UInt_t row, UInt_t pad) const { return ( (row<fNRows) && (fkIndexes[row]+pad)<fNChannels)? fData[fkIndexes[row]+pad]: 0; };
34  Float_t GetValue(UInt_t channel) const { return fData[channel]; };
35  void SetValue(UInt_t row, UInt_t pad, Float_t vd) { if ( row<fNRows && (fkIndexes[row]+pad)<fNChannels)fData[fkIndexes[row]+pad]= vd; }
36  void SetValue(UInt_t channel, Float_t vd) {fData[channel]= vd; }
37  void Reset();
38  virtual void Draw(Option_t* option = "");
39  //
40  Bool_t MedianFilter(Int_t deltaRow, Int_t deltaPad, AliTPCCalROC*outlierROC=0, Bool_t doEdge=kTRUE);
41  Bool_t LTMFilter(Int_t deltaRow, Int_t deltaPad, Float_t fraction, Int_t type, AliTPCCalROC*outlierROC=0, Bool_t doEdge=kTRUE);
42  Bool_t Convolute(Double_t sigmaPad, Double_t sigmaRow, AliTPCCalROC*outlierPad=0, TF1 *fpad=0, TF1 *frow=0 );
43  //
44  // algebra
45  void Add(Float_t c1); // add c1 to each channel of the ROC
46  void Multiply(Float_t c1); // multiply each channel of the ROC with c1
47  void Add(const AliTPCCalROC * roc, Double_t c1 = 1); // multiply AliTPCCalROC roc by c1 and add each channel to the coresponing channel in the ROC
48  void Multiply(const AliTPCCalROC * roc); // multiply each channel of the ROC with the coresponding channel of 'roc'
49  void Divide(const AliTPCCalROC * roc); // divide each channel of the ROC by the coresponding value of 'roc'
50  // statistic
51  //
52  Double_t GetMean(AliTPCCalROC *const outlierROC = 0) const;
53  Double_t GetRMS(AliTPCCalROC *const outlierROC = 0) const;
54  Double_t GetMedian(AliTPCCalROC *const outlierROC = 0) const;
55  Double_t GetLTM(Double_t *const sigma=0, Double_t fraction=0.9, AliTPCCalROC *const outlierROC = 0);
56  TH1F * MakeHisto1D(Float_t min=4, Float_t max=-4, Int_t type=0);
57  TH2F * MakeHisto2D(Float_t min=4, Float_t max=-4, Int_t type=0);
58  TH2F * MakeHistoOutliers(Float_t delta=4, Float_t fraction=0.7, Int_t mode=0);
59 
60  AliTPCCalROC * LocalFit(Int_t rowRadius, Int_t padRadius, AliTPCCalROC* ROCoutliers = 0, Bool_t robust = kFALSE, Double_t chi2Threshold = 5, Double_t robustFraction = 0.7);
61  void GlobalFit(const AliTPCCalROC* ROCoutliers, Bool_t robust, TVectorD &fitParam, TMatrixD &covMatrix, Float_t & chi2, Int_t fitType = 1, Double_t chi2Threshold = 5, Double_t robustFraction = 0.7, Double_t err=1);
62 
63  static AliTPCCalROC* CreateGlobalFitCalROC(TVectorD &fitParam, Int_t sector);
64 
65  static void Test();
66  protected:
67 
68  Double_t GetNeighbourhoodValue(TLinearFitter* fitterQ, Int_t row, Int_t pad, Int_t rRadius, Int_t pRadius, AliTPCCalROC *const ROCoutliers, Bool_t robust, Double_t chi2Threshold, Double_t robustFraction);
69  void GetNeighbourhood(TArrayI* &rowArray, TArrayI* &padArray, Int_t row, Int_t pad, Int_t rRadius, Int_t pRadius);
70 
71  UInt_t fSector;
72  UInt_t fNChannels;
73  UInt_t fNRows;
74  const UInt_t* fkIndexes;
75  Float_t *fData; //[fNChannels]
77 
79  ClassDef(AliTPCCalROC,2) // TPC ROC calibration class
81 
82 };
83 
84 #endif
UInt_t fSector
sector number
Definition: AliTPCCalROC.h:71
UInt_t GetNPads(UInt_t sector, UInt_t row) const
Definition: AliTPCROC.h:29
static AliTPCCalROC * CreateGlobalFitCalROC(TVectorD &fitParam, Int_t sector)
TH1F * MakeHisto1D(Float_t min=4, Float_t max=-4, Int_t type=0)
void Add(Float_t c1)
UInt_t fNChannels
number of channels
Definition: AliTPCCalROC.h:72
virtual ~AliTPCCalROC()
TH2F * MakeHistoOutliers(Float_t delta=4, Float_t fraction=0.7, Int_t mode=0)
Float_t GetValue(UInt_t row, UInt_t pad) const
Definition: AliTPCCalROC.h:33
void Multiply(Float_t c1)
AliTPCCalROC * LocalFit(Int_t rowRadius, Int_t padRadius, AliTPCCalROC *ROCoutliers=0, Bool_t robust=kFALSE, Double_t chi2Threshold=5, Double_t robustFraction=0.7)
Double_t GetRMS(AliTPCCalROC *const outlierROC=0) const
static void Test()
void Divide(const AliTPCCalROC *roc)
TH2F * MakeHisto2D(Float_t min=4, Float_t max=-4, Int_t type=0)
void GlobalFit(const AliTPCCalROC *ROCoutliers, Bool_t robust, TVectorD &fitParam, TMatrixD &covMatrix, Float_t &chi2, Int_t fitType=1, Double_t chi2Threshold=5, Double_t robustFraction=0.7, Double_t err=1)
void SetValue(UInt_t channel, Float_t vd)
Definition: AliTPCCalROC.h:36
UInt_t GetNPads(UInt_t row) const
Definition: AliTPCCalROC.h:32
UInt_t fNRows
number of rows
Definition: AliTPCCalROC.h:73
const UInt_t * fkIndexes
Definition: AliTPCCalROC.h:74
Double_t chi2
Definition: AnalyzeLaser.C:7
Double_t GetNeighbourhoodValue(TLinearFitter *fitterQ, Int_t row, Int_t pad, Int_t rRadius, Int_t pRadius, AliTPCCalROC *const ROCoutliers, Bool_t robust, Double_t chi2Threshold, Double_t robustFraction)
Float_t GetValue(UInt_t channel) const
Definition: AliTPCCalROC.h:34
Bool_t IsInRange(UInt_t row, UInt_t pad)
Definition: AliTPCCalROC.h:31
void SetValue(UInt_t row, UInt_t pad, Float_t vd)
Definition: AliTPCCalROC.h:35
Double_t GetMedian(AliTPCCalROC *const outlierROC=0) const
Double_t GetMean(AliTPCCalROC *const outlierROC=0) const
TPC calibration base class for one ROC.
Definition: AliTPCCalROC.h:19
Float_t * fData
Data.
Definition: AliTPCCalROC.h:76
AliTPCCalROC & operator=(const AliTPCCalROC &param)
UInt_t GetNchannels() const
Definition: AliTPCCalROC.h:30
UInt_t GetSector() const
Definition: AliTPCCalROC.h:28
void GetNeighbourhood(TArrayI *&rowArray, TArrayI *&padArray, Int_t row, Int_t pad, Int_t rRadius, Int_t pRadius)
Bool_t MedianFilter(Int_t deltaRow, Int_t deltaPad, AliTPCCalROC *outlierROC=0, Bool_t doEdge=kTRUE)
virtual void Draw(Option_t *option="")
Bool_t Convolute(Double_t sigmaPad, Double_t sigmaRow, AliTPCCalROC *outlierPad=0, TF1 *fpad=0, TF1 *frow=0)
static AliTPCROC * Instance()
Definition: AliTPCROC.cxx:34
Double_t GetLTM(Double_t *const sigma=0, Double_t fraction=0.9, AliTPCCalROC *const outlierROC=0)
Bool_t LTMFilter(Int_t deltaRow, Int_t deltaPad, Float_t fraction, Int_t type, AliTPCCalROC *outlierROC=0, Bool_t doEdge=kTRUE)
UInt_t GetNrows() const
Definition: AliTPCCalROC.h:29