]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/Base/AliTPCCalROC.h
ATO-78 - Technical changes to compare different calibrations
[u/mrichter/AliRoot.git] / TPC / Base / AliTPCCalROC.h
CommitLineData
07627591 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
829455ad 6/* $Id: AliTPCCalROC.h -1 */
07627591 7
8//////////////////////////////////////////////////
9// //
10// TPC calibration base class for one ROC //
11// //
12//////////////////////////////////////////////////
07627591 13#include <TObject.h>
184bcc16 14#include <TMath.h>
c5bbaa2c 15#include <AliTPCROC.h>
f116e22c 16#include "TLinearFitter.h"
17
184bcc16 18class TH1F;
19class TH2F;
72fbbc82 20class TArrayI;
07627591 21//_____________________________________________________________________________
f691a5e2 22class AliTPCCalROC : public TNamed {
07627591 23
24 public:
25
26 AliTPCCalROC();
c5bbaa2c 27 AliTPCCalROC(UInt_t sector);
07627591 28 AliTPCCalROC(const AliTPCCalROC &c);
179c6296 29 AliTPCCalROC &operator = (const AliTPCCalROC & param);
07627591 30 virtual ~AliTPCCalROC();
e6c51e6e 31 UInt_t GetSector() const { return fSector;}
c5bbaa2c 32 UInt_t GetNrows() const { return fNRows;};
33 UInt_t GetNchannels() const { return fNChannels;};
34 UInt_t GetNPads(UInt_t row) const { return (row<fNRows)? AliTPCROC::Instance()->GetNPads(fSector,row):0;};
a5ade541 35 Float_t GetValue(UInt_t row, UInt_t pad) const { return ( (row<fNRows) && (fkIndexes[row]+pad)<fNChannels)? fData[fkIndexes[row]+pad]: 0; };
c5bbaa2c 36 Float_t GetValue(UInt_t channel) const { return fData[channel]; };
a5ade541 37 void SetValue(UInt_t row, UInt_t pad, Float_t vd) { if ( row<fNRows && (fkIndexes[row]+pad)<fNChannels)fData[fkIndexes[row]+pad]= vd; };
c5bbaa2c 38 void SetValue(UInt_t channel, Float_t vd) {fData[channel]= vd; };
2e9bedc9 39 virtual void Draw(Option_t* option = "");
184bcc16 40 //
0e00d630 41 Bool_t MedianFilter(Int_t deltaRow, Int_t deltaPad);
42 Bool_t LTMFilter(Int_t deltaRow, Int_t deltaPad, Float_t fraction, Int_t type);
43 //
43b569c6 44 // algebra
a6d2bd0c 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'
43b569c6 50 // statistic
51 //
a5ade541 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);
184bcc16 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);
72fbbc82 59
a6d2bd0c 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);
b233e5e9 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);
a6d2bd0c 62
f116e22c 63 static AliTPCCalROC* CreateGlobalFitCalROC(TVectorD &fitParam, Int_t sector);
72fbbc82 64
c5bbaa2c 65 static void Test();
66 protected:
72fbbc82 67
a5ade541 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);
72fbbc82 69 void GetNeighbourhood(TArrayI* &rowArray, TArrayI* &padArray, Int_t row, Int_t pad, Int_t rRadius, Int_t pRadius);
70
c5bbaa2c 71 UInt_t fSector; // sector number
72 UInt_t fNChannels; // number of channels
73 UInt_t fNRows; // number of rows
a5ade541 74 const UInt_t* fkIndexes; //!indexes
c5bbaa2c 75 Float_t *fData; //[fNChannels] Data
f691a5e2 76 ClassDef(AliTPCCalROC,2) // TPC ROC calibration class
07627591 77
78};
79
80#endif