8bc7e885 |
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 | |
9 | |
10 | class TObjArray; |
11 | class TH2F; |
8bc7e885 |
12 | class TTreeSRedirector; |
13 | class AliTPCROC; |
bc331d5b |
14 | class AliTPCCalROC; |
a7dce0bc |
15 | class AliTPCRawStream; |
aa983e4f |
16 | class AliRawReader; |
bc331d5b |
17 | struct eventHeaderStruct; |
8bc7e885 |
18 | |
19 | |
20 | class AliTPCCalibPedestal : public TObject { |
21 | |
22 | public: |
23 | AliTPCCalibPedestal(); |
bc331d5b |
24 | AliTPCCalibPedestal(const AliTPCCalibPedestal &ped); |
8bc7e885 |
25 | virtual ~AliTPCCalibPedestal(); |
bc331d5b |
26 | |
27 | AliTPCCalibPedestal& operator = (const AliTPCCalibPedestal &source); |
28 | |
29 | Bool_t ProcessEvent(AliTPCRawStream *rawStream); |
30 | Bool_t ProcessEvent(AliRawReader *rawReader); |
31 | Bool_t ProcessEvent(eventHeaderStruct *event); |
32 | |
8bc7e885 |
33 | Int_t Update(const Int_t isector, const Int_t iRow, const Int_t iPad, |
34 | const Int_t iTimeBin, const Float_t signal); |
35 | void Analyse(); |
36 | // |
bc331d5b |
37 | AliTPCCalROC* GetCalRocPedestal (Int_t sector, Bool_t force=kFALSE); // get calibration object - sector |
38 | AliTPCCalROC* GetCalRocRMS(Int_t sector, Bool_t force=kFALSE); // get calibration object - sector |
39 | const TObjArray* GetCalPadPedestal (){return &fCalRocArrayPedestal;} // get calibration object |
40 | const TObjArray* GetCalPadRMS(){return &fCalRocArrayRMS;} // get calibration object |
aa983e4f |
41 | |
bc331d5b |
42 | TH2F* GetHistoPedestal (Int_t sector, Bool_t force=kFALSE); // get refernce histogram |
43 | void DumpToFile(const Char_t *filename, const Char_t *dir="", const Bool_t append=kFALSE); |
8bc7e885 |
44 | // |
aa983e4f |
45 | Int_t GetFirstTimeBin() const { return fFirstTimeBin; } |
46 | Int_t GetLastTimeBin() const { return fLastTimeBin; } |
47 | Int_t GetAdcMin() const { return fAdcMin; } |
48 | Int_t GetAdcMax() const { return fAdcMax; } |
bc331d5b |
49 | |
aa983e4f |
50 | void SetRangeTime(Int_t tMin, Int_t tMax){ fFirstTimeBin=tMin; fLastTimeBin=tMax; } // Set time bin range that is used for the pedestal calibration |
51 | void SetRangeAdc (Int_t aMin, Int_t aMax){ fAdcMin=aMin; fAdcMax=aMax; } // Set adc range for the pedestal calibration |
8bc7e885 |
52 | |
aa983e4f |
53 | void SetOldRCUformat(Bool_t format=kTRUE){ fOldRCUformat = format; } |
54 | |
55 | void Merge(AliTPCCalibPedestal *ped); |
8bc7e885 |
56 | |
57 | Bool_t TestEvent(); //test the fast approach to fill histogram - used for test purposes |
58 | |
59 | private: |
60 | Int_t fFirstTimeBin; // First Time bin needed for analysis |
61 | Int_t fLastTimeBin; // Last Time bin needed for analysis |
aa983e4f |
62 | |
8bc7e885 |
63 | Int_t fAdcMin; // min adc channel of pedestal value |
64 | Int_t fAdcMax; // max adc channel of pedestal value |
aa983e4f |
65 | |
66 | Bool_t fOldRCUformat; //! Should we use the old RCU format for data reading |
a7dce0bc |
67 | |
8bc7e885 |
68 | AliTPCROC *fROC; //! ROC information |
aa983e4f |
69 | |
8bc7e885 |
70 | TObjArray fCalRocArrayPedestal; // Array of AliTPCCalROC class for Time0 calibration |
71 | TObjArray fCalRocArrayRMS; // Array of AliTPCCalROC class for signal width calibration |
aa983e4f |
72 | |
8bc7e885 |
73 | TObjArray fHistoPedestalArray; // Calibration histograms for Pedestal distribution |
aa983e4f |
74 | |
75 | |
76 | |
bc331d5b |
77 | TH2F* GetHisto(Int_t sector, TObjArray *arr, |
8bc7e885 |
78 | Int_t nbinsY, Float_t ymin, Float_t ymax, |
79 | Char_t *type, Bool_t force); |
aa983e4f |
80 | |
8bc7e885 |
81 | AliTPCCalROC* GetCalRoc(Int_t sector, TObjArray* arr, Bool_t force); |
82 | |
83 | public: |
84 | |
85 | |
aa983e4f |
86 | ClassDef(AliTPCCalibPedestal,1) //Implementation of the TPC pedestal and noise calibration |
8bc7e885 |
87 | }; |
88 | |
89 | |
90 | |
91 | #endif |
92 | |