ROOT logo
#ifndef ALITRDCALROC_H
#define ALITRDCALROC_H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

/* $Id$ */

//////////////////////////////////////////////////
//                                              //
//  TRD calibration base class for one ROC      //
//                                              //
//////////////////////////////////////////////////

#include <TObject.h>

class TArrayI;
class TArrayF;
class TH2F;
class TH1F;
class TGraph2D;
class TH2D;

//_____________________________________________________________________________
class AliTRDCalROC : public TObject 
{

 public:

  AliTRDCalROC();
  AliTRDCalROC(Int_t p, Int_t c);
  AliTRDCalROC(const AliTRDCalROC &c);
  virtual      ~AliTRDCalROC();
  AliTRDCalROC &operator=(const AliTRDCalROC &c);
  virtual void  Copy(TObject &c) const;

  Int_t         GetNrows() const                   { return fNrows; };
  Int_t         GetNcols() const                   { return fNcols; };

  Int_t         GetChannel(Int_t c, Int_t r) const { return r+c*fNrows; };
  Int_t         GetNchannels() const               { return fNchannels; };

  Float_t       GetValue(Int_t ich) const          { return (Float_t) fData[ich] / 10000;  };
  Float_t       GetValue(Int_t col, Int_t row)     { return GetValue(GetChannel(col,row)); };

  void          SetValue(Int_t ich, Float_t value) { fData[ich] = (UShort_t) (value * 10000); };
  void          SetValue(Int_t col, Int_t row, Float_t value) 
                                                   { SetValue(GetChannel(col,row), value);    };

  // statistic
  //
  Double_t GetMean(AliTRDCalROC * const outlierROC=0) const; 
  Double_t GetRMS(AliTRDCalROC * const outlierROC=0) const;
  Double_t GetMedian(AliTRDCalROC * const outlierROC=0) const;
  Double_t GetLTM(Double_t *sigma=0, Double_t fraction=0.9, AliTRDCalROC * const outlierROC=0);

  // algebra
  Bool_t Add(Float_t c1);
  Bool_t Multiply(Float_t c1);
  Bool_t Add(const AliTRDCalROC * roc, Double_t c1 = 1);
  Bool_t Multiply(const AliTRDCalROC * roc);   
  Bool_t Divide(const AliTRDCalROC * roc);   

  // noise
  Bool_t Unfold();
  
  //Plots
  TH2F *   MakeHisto2D(Float_t min, Float_t max,Int_t type, Float_t mu = 1.0);
  TH1F *   MakeHisto1D(Float_t min, Float_t max,Int_t type, Float_t mu = 1.0);
  
 protected:

  Int_t     fPla;              //  Plane number
  Int_t     fCha;              //  Chamber number

  Int_t     fNrows;            //  Number of rows
  Int_t     fNcols;            //  Number of columns

  Int_t     fNchannels;        //  Number of channels
  UShort_t *fData;             //[fNchannels] Data

  ClassDef(AliTRDCalROC, 2)    //  TRD ROC calibration class

};

#endif
 AliTRDCalROC.h:1
 AliTRDCalROC.h:2
 AliTRDCalROC.h:3
 AliTRDCalROC.h:4
 AliTRDCalROC.h:5
 AliTRDCalROC.h:6
 AliTRDCalROC.h:7
 AliTRDCalROC.h:8
 AliTRDCalROC.h:9
 AliTRDCalROC.h:10
 AliTRDCalROC.h:11
 AliTRDCalROC.h:12
 AliTRDCalROC.h:13
 AliTRDCalROC.h:14
 AliTRDCalROC.h:15
 AliTRDCalROC.h:16
 AliTRDCalROC.h:17
 AliTRDCalROC.h:18
 AliTRDCalROC.h:19
 AliTRDCalROC.h:20
 AliTRDCalROC.h:21
 AliTRDCalROC.h:22
 AliTRDCalROC.h:23
 AliTRDCalROC.h:24
 AliTRDCalROC.h:25
 AliTRDCalROC.h:26
 AliTRDCalROC.h:27
 AliTRDCalROC.h:28
 AliTRDCalROC.h:29
 AliTRDCalROC.h:30
 AliTRDCalROC.h:31
 AliTRDCalROC.h:32
 AliTRDCalROC.h:33
 AliTRDCalROC.h:34
 AliTRDCalROC.h:35
 AliTRDCalROC.h:36
 AliTRDCalROC.h:37
 AliTRDCalROC.h:38
 AliTRDCalROC.h:39
 AliTRDCalROC.h:40
 AliTRDCalROC.h:41
 AliTRDCalROC.h:42
 AliTRDCalROC.h:43
 AliTRDCalROC.h:44
 AliTRDCalROC.h:45
 AliTRDCalROC.h:46
 AliTRDCalROC.h:47
 AliTRDCalROC.h:48
 AliTRDCalROC.h:49
 AliTRDCalROC.h:50
 AliTRDCalROC.h:51
 AliTRDCalROC.h:52
 AliTRDCalROC.h:53
 AliTRDCalROC.h:54
 AliTRDCalROC.h:55
 AliTRDCalROC.h:56
 AliTRDCalROC.h:57
 AliTRDCalROC.h:58
 AliTRDCalROC.h:59
 AliTRDCalROC.h:60
 AliTRDCalROC.h:61
 AliTRDCalROC.h:62
 AliTRDCalROC.h:63
 AliTRDCalROC.h:64
 AliTRDCalROC.h:65
 AliTRDCalROC.h:66
 AliTRDCalROC.h:67
 AliTRDCalROC.h:68
 AliTRDCalROC.h:69
 AliTRDCalROC.h:70
 AliTRDCalROC.h:71
 AliTRDCalROC.h:72
 AliTRDCalROC.h:73
 AliTRDCalROC.h:74
 AliTRDCalROC.h:75
 AliTRDCalROC.h:76
 AliTRDCalROC.h:77
 AliTRDCalROC.h:78
 AliTRDCalROC.h:79
 AliTRDCalROC.h:80
 AliTRDCalROC.h:81
 AliTRDCalROC.h:82
 AliTRDCalROC.h:83
 AliTRDCalROC.h:84
 AliTRDCalROC.h:85