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