]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCCalibPedestal.h
time range changed
[u/mrichter/AliRoot.git] / TPC / AliTPCCalibPedestal.h
1 #ifndef ALITPCCALIBPEDESTAL_H
2 #define ALITPCCALIBPEDESTAL_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6
7
8 #include <TObject.h>
9 #include <TObjArray.h>
10
11 class TArrayF;
12 class TH2F;
13 class TTreeSRedirector;
14 class AliTPCROC;
15 class AliTPCCalROC;
16 class AliTPCRawStream;
17 class AliRawReader;
18
19 struct eventHeaderStruct;
20
21 class AliTPCCalibPedestal : public TObject {
22
23 public:
24   AliTPCCalibPedestal();
25   AliTPCCalibPedestal(const AliTPCCalibPedestal &ped);
26   virtual ~AliTPCCalibPedestal();
27
28   AliTPCCalibPedestal& operator = (const  AliTPCCalibPedestal &source);
29
30   Bool_t ProcessEvent(AliTPCRawStream *rawStream);
31   Bool_t ProcessEvent(AliRawReader    *rawReader);
32   Bool_t ProcessEvent(eventHeaderStruct   *event);
33
34   Int_t  Update(const Int_t isector, const Int_t iRow, const Int_t iPad,
35                 const Int_t iTimeBin, const Float_t signal);
36   void   Analyse();
37   //
38   AliTPCCalROC* GetCalRocPedestal (Int_t sector, Bool_t force=kFALSE);  // get calibration object - sector
39   AliTPCCalROC* GetCalRocRMS(Int_t sector, Bool_t force=kFALSE);        // get calibration object - sector
40   const TObjArray* GetCalPadPedestal (){return &fCalRocArrayPedestal;}  // get calibration object
41   const TObjArray* GetCalPadRMS(){return &fCalRocArrayRMS;}             // get calibration object
42   
43   TH2F* GetHistoPedestal  (Int_t sector, Bool_t force=kFALSE);          // get refernce histogram
44   void  DumpToFile(const Char_t *filename, const Char_t *dir="", const Bool_t append=kFALSE);
45   //
46   void  SetTimeAnalysis(Bool_t time = kTRUE);                  // Use ONLY in TPCPEDESTALda on LDC for one sector!
47   void  AnalyseTime(Int_t nevents);                            // Makes sense only in TPCPEDESTALda on LDC!
48   TArrayF **GetTimePedestals()  const { return fTimeSignal; }  // Get array with time dependent pedestals (for one sector!)
49   //
50   Int_t GetFirstTimeBin() const { return fFirstTimeBin; }
51   Int_t GetLastTimeBin()  const { return fLastTimeBin;  }
52   Int_t GetAdcMin()       const { return fAdcMin;       }
53   Int_t GetAdcMax()       const { return fAdcMax;       }
54
55   void  SetRangeTime(Int_t tMin, Int_t tMax){ fFirstTimeBin=tMin; fLastTimeBin=tMax; }  // Set time bin range that is used for the pedestal calibration
56   void  SetRangeAdc (Int_t aMin, Int_t aMax){ fAdcMin=aMin; fAdcMax=aMax; }  // Set adc range for the pedestal calibration
57
58   void  SetOldRCUformat(Bool_t format=kTRUE) { fOldRCUformat = format; }
59
60   void  Merge(AliTPCCalibPedestal *ped);
61
62   Bool_t TestEvent();  // Test the fast approach to fill histogram - used for test purposes
63
64 private:
65
66   Int_t fFirstTimeBin;              //  First Time bin needed for analysis
67   Int_t fLastTimeBin;               //  Last Time bin needed for analysis
68
69   Int_t fAdcMin;                    //  min adc channel of pedestal value
70   Int_t fAdcMax;                    //  max adc channel of pedestal value
71
72   Bool_t  fOldRCUformat;            //! Should we use the old RCU format for data reading
73   Bool_t  fTimeAnalysis;            //! Should we use the time dependent analysis? ONLY ON LDC!
74
75   AliTPCROC *fROC;                  //! ROC information
76
77   TObjArray fCalRocArrayPedestal;   //  Array of AliTPCCalROC class for Time0 calibration
78   TObjArray fCalRocArrayRMS;        //  Array of AliTPCCalROC class for signal width calibration
79
80   TObjArray fHistoPedestalArray;    //  Calibration histograms for Pedestal distribution
81
82   TArrayF **fTimeSignal;            //! Arrays which hold time dependent signals
83
84   TH2F* GetHisto(Int_t sector, TObjArray *arr,
85                  Int_t nbinsY, Float_t ymin, Float_t ymax,
86                  Char_t *type, Bool_t force);
87
88   AliTPCCalROC* GetCalRoc(Int_t sector, TObjArray* arr, Bool_t force);
89
90 public:
91   ClassDef(AliTPCCalibPedestal, 2)  // Implementation of the TPC pedestal and noise calibration
92 };
93
94
95
96 #endif
97