]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDCalibPadStatus.h
cfa1cb73a3856515efba6d9d19296fdc23a55ac1
[u/mrichter/AliRoot.git] / TRD / AliTRDCalibPadStatus.h
1 #ifndef ALITRDCALIBPADSTATUS_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, Bool_t nocheck = kFALSE);
35   Bool_t ProcessEvent(AliRawReader    *rawReader, Bool_t nocheck = kFALSE);
36   Bool_t ProcessEvent(eventHeaderStruct   *event, Bool_t nocheck = kFALSE);
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   Int_t fNumberOfTimeBins;          //  Current number of time bins
71      
72   TObjArray fCalArrayEntries;       //  Array of AliTRDarrayF class calibration
73   TObjArray fCalArrayMean;          //  Array of AliTRDarrayF class calibration
74   TObjArray fCalArraySquares;       //  Array of AliTRDarrayF class calibration
75   TObjArray fCalRocArrayMean;       //  Array of AliTRDCalROC class for signal width calibration
76   TObjArray fCalRocArrayRMS;        //  Array of AliTRDCalROC class for mean width calibration
77
78   TObjArray fHistoArray;            //  Array of histos for mean width calibration
79   
80   AliTRDarrayF *fCalEntries;        //  Current AliTRDArrayF entries
81   AliTRDarrayF *fCalMean;           //  Current AliTRDArrayF Mean
82   AliTRDarrayF *fCalSquares;        //  Current AliTRDArrayF Squares
83
84   AliTRDarrayF* GetCal(Int_t det, TObjArray* arr, Bool_t force);
85   AliTRDCalROC* GetCalRoc(Int_t det, TObjArray* arr, Bool_t force);
86  
87   TH2F* GetHisto(Int_t det, TObjArray *arr,
88                  Int_t nbinsY, Float_t ymin, Float_t ymax,
89                  Char_t *type, Bool_t force);
90
91   // Some basic geometry function
92   virtual Int_t    GetPlane(Int_t d) const;
93   virtual Int_t    GetChamber(Int_t d) const;
94   virtual Int_t    GetSector(Int_t d) const;
95
96 public:
97
98   ClassDef(AliTRDCalibPadStatus,1)
99
100 };
101
102
103
104 #endif
105