]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCCalPad.h
style modifications (Markus)
[u/mrichter/AliRoot.git] / TPC / AliTPCCalPad.h
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 ///////////////////////////////////////////////////////////////////////////////
9 //                                                                           //
10 //  TPC calibration class for parameters which are saved per pad                 //
11 //                                                                           //
12 ///////////////////////////////////////////////////////////////////////////////
13
14 #include "TNamed.h"
15 //#include <TMath.h>
16 //#include <AliTPCROC.h>
17 #include "TLinearFitter.h"
18 #include "TVectorD.h"
19 //#include <iostream>
20
21
22
23 class AliTPCCalROC;
24 class AliTPCCalDet;
25 class TObjArray;
26 class TGraph;
27 class TH2F;
28 class TH1F;
29 class TCanvas;
30 class TTree;
31
32 class AliTPCCalPad : public TNamed {
33  public:
34   enum { kNsec = 72 };
35   AliTPCCalPad();
36   AliTPCCalPad(const Text_t* name, const Text_t* title);
37   AliTPCCalPad(const AliTPCCalPad &c);   
38   AliTPCCalPad(TObjArray *arrayROC);
39   virtual ~AliTPCCalPad();
40   AliTPCCalPad &operator=(const AliTPCCalPad &c);
41   virtual void     Copy(TObject &c) const;
42   AliTPCCalROC *GetCalROC(Int_t sector) const {return fROC[sector]; };  
43   void SetCalROC(AliTPCCalROC* roc, Int_t sector = -1);  
44   virtual void  Draw(Option_t* option = "");
45   //
46   // algebra
47   void Add(Float_t c1);   // add constant c1 to all channels of all ROCs
48   void Multiply(Float_t c1);   // multiply each channel of all ROCs with c1
49   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
50   void Multiply(const AliTPCCalPad * pad);  // multiply each channel of all ROCs with the coresponding channel of 'pad'
51   void Divide(const AliTPCCalPad * pad);    // divide each channel of all ROCs by the coresponding channel of 'pad'
52   //
53   Double_t GetMeanRMS(Double_t &rms);   // Calculates mean and RMS of all ROCs
54   Double_t GetMean(AliTPCCalPad* outlierPad = 0);   // return mean of the mean of all ROCs
55   Double_t GetRMS(AliTPCCalPad* outlierPad = 0) ;   // return mean of the RMS of all ROCs
56   Double_t GetMedian(AliTPCCalPad* outlierPad = 0) ;   // return mean of the median of all ROCs
57   Double_t GetLTM(Double_t *sigma=0, Double_t fraction=0.9, AliTPCCalPad* outlierPad = 0);   // return mean of the LTM and sigma of all ROCs
58   TGraph  *MakeGraph(Int_t type=0, Float_t ratio=0.7);
59   TH2F    *MakeHisto2D(Int_t side=0);
60   TH1F    *MakeHisto1D(Float_t min=4, Float_t max=-4, Int_t type=0, Int_t side=0);  
61
62   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;
63   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);
64   
65   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);
66   
67   static AliTPCCalPad* CreateCalPadFit(const char* fitFormula, const TVectorD &fitParamSideA, const TVectorD &fitParamSideC);
68     
69   static TObjArray *CreateFormulaArray(const char *fitFormula);
70   static void EvalFormulaArray(const TObjArray &arrFitFormulas, TVectorD &results,
71                                const Int_t sec, const Int_t row, const Int_t pad);
72   //
73   // default report
74   //
75   static TCanvas * MakeReportPadSector(TTree *chain, const char* varName, const char*varTitle, const char *axisTitle, Float_t min, Float_t max, const char * cutUser="");
76   static TCanvas * MakeReportPadSector2D(TTree *chain, const char* varName, const char*varTitle, const char *axisTitle, Float_t min, Float_t max, const char *cutUser="");
77
78  protected:
79   AliTPCCalROC *fROC[kNsec];                    //  Array of ROC objects which contain the values per pad
80   ClassDef(AliTPCCalPad,1)                      //  TPC calibration class for parameters which are saved per pad
81 };
82
83 #endif