]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/TPCbase/AliTPCCalROC.h
doxy: TPC/TPCbase converted
[u/mrichter/AliRoot.git] / TPC / TPCbase / 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
7d855b04 8/// \class AliTPCCalROC
9///
10/// TPC calibration base class for one ROC
11
07627591 12#include <TObject.h>
184bcc16 13#include <TMath.h>
c5bbaa2c 14#include <AliTPCROC.h>
f116e22c 15#include "TLinearFitter.h"
16
184bcc16 17class TH1F;
18class TH2F;
72fbbc82 19class TArrayI;
0a0c96eb 20class TF1;
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;};
92e31745 34 Bool_t IsInRange(UInt_t row, UInt_t pad) { return (row<fNRows)? (fkIndexes[row]+pad)<fNChannels:kFALSE;}
c5bbaa2c 35 UInt_t GetNPads(UInt_t row) const { return (row<fNRows)? AliTPCROC::Instance()->GetNPads(fSector,row):0;};
a5ade541 36 Float_t GetValue(UInt_t row, UInt_t pad) const { return ( (row<fNRows) && (fkIndexes[row]+pad)<fNChannels)? fData[fkIndexes[row]+pad]: 0; };
c5bbaa2c 37 Float_t GetValue(UInt_t channel) const { return fData[channel]; };
909e332a 38 void SetValue(UInt_t row, UInt_t pad, Float_t vd) { if ( row<fNRows && (fkIndexes[row]+pad)<fNChannels)fData[fkIndexes[row]+pad]= vd; }
39 void SetValue(UInt_t channel, Float_t vd) {fData[channel]= vd; }
40 void Reset();
2e9bedc9 41 virtual void Draw(Option_t* option = "");
184bcc16 42 //
5e24c3ce 43 Bool_t MedianFilter(Int_t deltaRow, Int_t deltaPad, AliTPCCalROC*outlierROC=0, Bool_t doEdge=kTRUE);
44 Bool_t LTMFilter(Int_t deltaRow, Int_t deltaPad, Float_t fraction, Int_t type, AliTPCCalROC*outlierROC=0, Bool_t doEdge=kTRUE);
0a0c96eb 45 Bool_t Convolute(Double_t sigmaPad, Double_t sigmaRow, AliTPCCalROC*outlierPad=0, TF1 *fpad=0, TF1 *frow=0 );
7b83b139 46 //
43b569c6 47 // algebra
a6d2bd0c 48 void Add(Float_t c1); // add c1 to each channel of the ROC
49 void Multiply(Float_t c1); // multiply each channel of the ROC with c1
50 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
51 void Multiply(const AliTPCCalROC * roc); // multiply each channel of the ROC with the coresponding channel of 'roc'
52 void Divide(const AliTPCCalROC * roc); // divide each channel of the ROC by the coresponding value of 'roc'
43b569c6 53 // statistic
54 //
a5ade541 55 Double_t GetMean(AliTPCCalROC *const outlierROC = 0) const;
56 Double_t GetRMS(AliTPCCalROC *const outlierROC = 0) const;
57 Double_t GetMedian(AliTPCCalROC *const outlierROC = 0) const;
58 Double_t GetLTM(Double_t *const sigma=0, Double_t fraction=0.9, AliTPCCalROC *const outlierROC = 0);
184bcc16 59 TH1F * MakeHisto1D(Float_t min=4, Float_t max=-4, Int_t type=0);
60 TH2F * MakeHisto2D(Float_t min=4, Float_t max=-4, Int_t type=0);
61 TH2F * MakeHistoOutliers(Float_t delta=4, Float_t fraction=0.7, Int_t mode=0);
72fbbc82 62
a6d2bd0c 63 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 64 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 65
f116e22c 66 static AliTPCCalROC* CreateGlobalFitCalROC(TVectorD &fitParam, Int_t sector);
72fbbc82 67
c5bbaa2c 68 static void Test();
69 protected:
72fbbc82 70
a5ade541 71 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 72 void GetNeighbourhood(TArrayI* &rowArray, TArrayI* &padArray, Int_t row, Int_t pad, Int_t rRadius, Int_t pRadius);
73
7d855b04 74 UInt_t fSector; ///< sector number
75 UInt_t fNChannels; ///< number of channels
76 UInt_t fNRows; ///< number of rows
77 const UInt_t* fkIndexes; //!< indexes
78 Float_t *fData; ///< [fNChannels] Data
79 /// \cond CLASSIMP
f691a5e2 80 ClassDef(AliTPCCalROC,2) // TPC ROC calibration class
7d855b04 81 /// \endcond
07627591 82
83};
84
85#endif