Line data Source code
1 : #ifndef ALITPCCALPAD_H
2 : #define ALITPCCALPAD_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 : /// \class AliTPCCalPad
9 : ///
10 : /// TPC calibration class for parameters which are saved per pad
11 :
12 : #include "TNamed.h"
13 : #include "TVectorDfwd.h"
14 : #include "TMatrixDfwd.h"
15 : #include "AliTPCCalROC.h"
16 :
17 : class AliTPCCalDet;
18 : class TObjArray;
19 : class TGraph;
20 : class TH2F;
21 : class TH1F;
22 : class TCanvas;
23 : class TTree;
24 : class TH2;
25 : class TF1;
26 :
27 : class AliTPCCalPad : public TNamed {
28 : public:
29 : enum { kNsec = 72, kNsecSplit = 108 };
30 : AliTPCCalPad();
31 : AliTPCCalPad(const Text_t* name, const Text_t* title);
32 : AliTPCCalPad(const AliTPCCalPad &c);
33 : AliTPCCalPad(TObjArray *arrayROC);
34 : virtual ~AliTPCCalPad();
35 : AliTPCCalPad &operator=(const AliTPCCalPad &c);
36 : virtual void Copy(TObject &c) const;
37 : virtual void Print(Option_t* option="") const;
38 :
39 7477752 : AliTPCCalROC *GetCalROC(Int_t sector) const {return fROC[sector]; };
40 : void SetCalROC(AliTPCCalROC* roc, Int_t sector = -1);
41 : virtual void Draw(Option_t* option = "");
42 : // TTree functions
43 : static AliTPCCalPad *MakePadFromTree(TTree * tree, const char *query, const char*name=0, Bool_t doFast=kFALSE);
44 : void AddFriend(TTree * tree, const char *friendName, const char *fname=0);
45 : //
46 : // convolution
47 : Bool_t MedianFilter(Int_t deltaRow, Int_t deltaPad, AliTPCCalPad*outlierPad=0, Bool_t doEdge=kTRUE);
48 : Bool_t LTMFilter(Int_t deltaRow, Int_t deltaPad, Float_t fraction, Int_t type, AliTPCCalPad*outlierPad=0, Bool_t doEdge=kTRUE);
49 : Bool_t Convolute(Double_t sigmaPad, Double_t sigmaRow, AliTPCCalPad*outlierPad=0, TF1 *fpad=0, TF1 *frow=0 );
50 : //
51 : // algebra
52 : void Add(Float_t c1); // add constant c1 to all channels of all ROCs
53 : void Multiply(Float_t c1); // multiply each channel of all ROCs with c1
54 : void Add(const AliTPCCalPad * roc, Double_t c1 = 1); // multiply AliTPCCalPad 'pad' by c1 and add each channel to the coresponing channel in all ROCs
55 : void Multiply(const AliTPCCalPad * pad); // multiply each channel of all ROCs with the coresponding channel of 'pad'
56 : void Divide(const AliTPCCalPad * pad); // divide each channel of all ROCs by the coresponding channel of 'pad'
57 : void Reset();
58 : //
59 : Double_t GetMeanRMS(Double_t &rms) const; // Calculates mean and RMS of all ROCs
60 : Double_t GetStats (AliTPCCalROC::EStatType statType, AliTPCCalPad *const outlierPad = 0, AliTPCCalROC::EPadType padType=AliTPCCalROC::kAll) const;//return mean of statType for padType
61 : Double_t GetMean (AliTPCCalPad* outlierPad = 0, AliTPCCalROC::EPadType padType=AliTPCCalROC::kAll) const;
62 : Double_t GetRMS (AliTPCCalPad* outlierPad = 0, AliTPCCalROC::EPadType padType=AliTPCCalROC::kAll) const;
63 : Double_t GetMedian (AliTPCCalPad* outlierPad = 0, AliTPCCalROC::EPadType padType=AliTPCCalROC::kAll) const;
64 : Double_t GetMinElement(AliTPCCalPad* outlierPad = 0, AliTPCCalROC::EPadType padType=AliTPCCalROC::kAll) const;
65 : Double_t GetMaxElement(AliTPCCalPad* outlierPad = 0, AliTPCCalROC::EPadType padType=AliTPCCalROC::kAll) const;
66 : Double_t GetLTM(Double_t *sigma=0, Double_t fraction=0.9, AliTPCCalPad* outlierPad = 0, AliTPCCalROC::EPadType epadType=AliTPCCalROC::kAll) const; // return mean of the LTM and sigma of all ROCs
67 : TGraph *MakeGraph(Int_t type=0, Float_t ratio=0.7, AliTPCCalROC::EPadType padType=AliTPCCalROC::kAll);
68 : TH2F *MakeHisto2D(Int_t side=0);
69 : TH1F *MakeHisto1D(Float_t min=4, Float_t max=-4, Int_t type=0, Int_t side=0);
70 :
71 : AliTPCCalPad* LocalFit(const char* padName, Int_t rowRadius, Int_t padRadius, AliTPCCalPad* Padoutliers = 0, Bool_t robust = kFALSE, Double_t chi2Threshold = 5, Double_t robustFraction = 0.7, Bool_t printCurrentSector = kFALSE) const;
72 : AliTPCCalPad* GlobalFit(const char* padName, AliTPCCalPad* Padoutliers = 0, Bool_t robust = kFALSE, Int_t fitType = 1, Double_t chi2Threshold = 5, Double_t robustFraction = 0.7, Double_t err=1, TObjArray *fitParArr=0x0, TObjArray *fitCovArr=0x0, AliTPCCalROC::EPadType padType=AliTPCCalROC::kAll);
73 :
74 : void GlobalSidesFit(const AliTPCCalPad* PadOutliers, const char* fitFormula, TVectorD &fitParamSideA, TVectorD &fitParamSideC, TMatrixD &covMatrixSideA, TMatrixD &covMatrixSideC, Float_t &chi2SideA, Float_t &chi2SideC, AliTPCCalPad *pointError=0, Bool_t robust = kFALSE, Double_t robustFraction = 0.7);
75 :
76 : static AliTPCCalPad* CreateCalPadFit(const char* fitFormula, const TVectorD &fitParamSideA, const TVectorD &fitParamSideC);
77 :
78 : static TObjArray *CreateFormulaArray(const char *fitFormula);
79 : static void EvalFormulaArray(const TObjArray &arrFitFormulas, TVectorD &results,
80 : const Int_t sec, const Int_t row, const Int_t pad);
81 : //
82 : // default report
83 : //
84 : static TCanvas * MakeReportPadSector(TTree *chain, const char* varName, const char*varTitle, const char *axisTitle, Float_t min, Float_t max, const char * cutUser="");
85 : static TCanvas * MakeReportPadSector2D(TTree *chain, const char* varName, const char*varTitle, const char *axisTitle, Float_t min, Float_t max, const char *cutUser="");
86 : static AliTPCCalPad *MakeCalPadFromHistoRPHI(TH2 * hisA, TH2* hisC);
87 :
88 : //
89 : // unit test
90 : //
91 : void DumpUnitTestTrees(const TString fileName="");
92 :
93 : protected:
94 : AliTPCCalROC *fROC[kNsec]; ///< Array of ROC objects which contain the values per pad
95 : /// \cond CLASSIMP
96 226 : ClassDef(AliTPCCalPad,1) // TPC calibration class for parameters which are saved per pad
97 : /// \endcond
98 : };
99 :
100 : #endif
|