]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDCalibPadStatus.h
New DAQ calibration DAs by Raphaelle
[u/mrichter/AliRoot.git] / TRD / AliTRDCalibPadStatus.h
1 #ifndef ALITPCCALIBPEDESTAL_H
2 #define ALITRDCALIBPADSTATUS_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 //  TRD calibration class for online calibration                             //
11 //                                                                           //
12 ///////////////////////////////////////////////////////////////////////////////
13
14 class TObjArray;
15 class TH2F;
16 class TTreeSRedirector;
17 class AliTRDCalROC;
18 class AliTRDCalPadStatus;
19 class AliTRDRawStream;
20 class AliTRDarrayF;
21 class AliRawReader;
22 struct eventHeaderStruct;
23
24 class AliTRDCalibPadStatus : public TObject {
25
26 public:
27
28   AliTRDCalibPadStatus();
29   AliTRDCalibPadStatus(const AliTRDCalibPadStatus &ped);
30   virtual ~AliTRDCalibPadStatus();
31
32   AliTRDCalibPadStatus& operator = (const  AliTRDCalibPadStatus &source);
33
34   Bool_t ProcessEvent(AliTRDRawStream *rawStream);
35   Bool_t ProcessEvent(AliRawReader    *rawReader);
36   Bool_t ProcessEvent(eventHeaderStruct   *event);
37
38   Int_t Update(const Int_t idet, const Int_t iRow, const Int_t iCol,
39                const Int_t signal, const Int_t rowMax);
40   Int_t UpdateHisto(const Int_t idet, const Int_t iRow, const Int_t iCol,
41                     const Int_t signal, const Int_t crowMax);
42   void Analyse();
43   void AnalyseHisto();
44   AliTRDCalPadStatus *CreateCalPadStatus();
45   //
46   AliTRDarrayF* GetCalEntries(Int_t det, Bool_t force=kFALSE);    // get calibration object
47   AliTRDarrayF* GetCalMean(Int_t det, Bool_t force=kFALSE);       // get calibration object
48   AliTRDarrayF* GetCalSquares(Int_t det, Bool_t force=kFALSE);    // get calibration object
49   AliTRDCalROC* GetCalRocMean(Int_t det, Bool_t force=kFALSE);    // get calibration object
50   AliTRDCalROC* GetCalRocRMS(Int_t det, Bool_t force=kFALSE);     // get calibration object
51
52   TH2F* GetHisto  (Int_t det, Bool_t force=kFALSE);              // get refernce histogram
53   
54   void  DumpToFile(const Char_t *filename, const Char_t *dir="", const Bool_t append=kFALSE);
55   //
56   Int_t   GetAdcMin()       const { return fAdcMin;       }
57   Int_t   GetAdcMax()       const { return fAdcMax;       }
58
59   void    SetRangeAdc (Int_t aMin, Int_t aMax){ fAdcMin=aMin; fAdcMax=aMax; }  // Set adc range 
60
61
62   Bool_t TestEvent(Int_t nevent);  //test the fast approach to fill array  - used for test purposes
63   Bool_t TestEventHisto(Int_t nevent);  //test the fast approach to fill histograms  
64
65 private:
66
67   Int_t fAdcMin;                    //  min adc channel of pedestal value
68   Int_t fAdcMax;                    //  max adc channel of pedestal value
69   Int_t fDetector;                  //  Current detector
70      
71   TObjArray fCalArrayEntries;       //  Array of AliTRDarrayF class calibration
72   TObjArray fCalArrayMean;          //  Array of AliTRDarrayF class calibration
73   TObjArray fCalArraySquares;       //  Array of AliTRDarrayF class calibration
74   TObjArray fCalRocArrayMean;       //  Array of AliTRDCalROC class for signal width calibration
75   TObjArray fCalRocArrayRMS;        //  Array of AliTRDCalROC class for mean width calibration
76
77   TObjArray fHistoArray;            //  Array of histos for mean width calibration
78   
79   AliTRDarrayF *fCalEntries;        //  Current AliTRDArrayF entries
80   AliTRDarrayF *fCalMean;           //  Current AliTRDArrayF Mean
81   AliTRDarrayF *fCalSquares;        //  Current AliTRDArrayF Squares
82
83   AliTRDarrayF* GetCalEntries(Int_t det, TObjArray* arr, Bool_t force);
84   AliTRDarrayF* GetCalMean(Int_t det, TObjArray* arr, Bool_t force);
85   AliTRDarrayF* GetCalSquares(Int_t det, TObjArray* arr, Bool_t force);
86   AliTRDCalROC* GetCalRocMean(Int_t det, TObjArray* arr, Bool_t force);
87   AliTRDCalROC* GetCalRocRMS(Int_t det, TObjArray* arr, Bool_t force);
88
89   TH2F* GetHisto(Int_t det, TObjArray *arr,
90                  Int_t nbinsY, Float_t ymin, Float_t ymax,
91                  Char_t *type, Bool_t force);
92
93   // Some basic geometry function
94   virtual Int_t    GetPlane(Int_t d) const;
95   virtual Int_t    GetChamber(Int_t d) const;
96   virtual Int_t    GetSector(Int_t d) const;
97
98 public:
99
100   ClassDef(AliTRDCalibPadStatus,1)
101
102 };
103
104
105
106 #endif
107