]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDCalibPadStatus.h
fix for bug 79155. To be ported to release v4-20-Release
[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
17 class AliRawReader;
18
19 class AliTRDCalDet;
20 class AliTRDCalPad;
21 class AliTRDCalROC;
22 class AliTRDCalPadStatus;
23 class AliTRDgeometry;
24
25 class AliTRDdigitsManager;
26 class AliTRDSignalIndex;
27
28 struct eventHeaderStruct;
29
30 class AliTRDCalibPadStatus : public TObject {
31
32 public:
33
34   AliTRDCalibPadStatus();
35   AliTRDCalibPadStatus(const AliTRDCalibPadStatus &ped);
36   virtual ~AliTRDCalibPadStatus();
37
38   AliTRDCalibPadStatus& operator = (const  AliTRDCalibPadStatus &source);
39
40   Int_t ProcessEvent(AliRawReader    *rawReader);
41  
42   void  Destroy();
43   Int_t UpdateHisto(const Int_t idet, const Int_t iRow, const Int_t iCol,
44                      const Int_t signal, const Int_t crowMax, const Int_t ccold, const Int_t icMcm, const Int_t icRob);
45
46   void AnalyseHisto();
47   AliTRDCalPadStatus *CreateCalPadStatus();
48   AliTRDCalPad *CreateCalPad();
49   AliTRDCalDet *CreateCalDet() const;
50
51   void SetCalRocMean(AliTRDCalROC *mean, Int_t det);
52   void SetCalRocRMS(AliTRDCalROC *rms, Int_t det);  
53
54   void SetCalRocMeand(AliTRDCalROC *mean, Int_t det);
55   void SetCalRocRMSd(AliTRDCalROC *rms, Int_t det);  
56
57   //
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   AliTRDCalROC* GetCalRocMeand(Int_t det, Bool_t force=kFALSE);   // get calibration object
62   AliTRDCalROC* GetCalRocRMSd(Int_t det, Bool_t force=kFALSE);    // get calibration object
63
64   TH2F* GetHisto  (Int_t det, Bool_t force=kFALSE);              // get refernce histogram
65   
66   void  DumpToFile(const Char_t *filename, const Char_t *dir="", Bool_t append=kFALSE);
67   //
68   Int_t   GetAdcMin()       const { return fAdcMin;       }
69   Int_t   GetAdcMax()       const { return fAdcMax;       }
70
71   void    SetRangeAdc (Int_t aMin, Int_t aMax){ fAdcMin=aMin; fAdcMax=aMax; }  // Set adc range 
72
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 fCalRocArrayMean;       //  Array of AliTRDCalROC class for signal width calibration
85   TObjArray fCalRocArrayRMS;        //  Array of AliTRDCalROC class for mean width calibration
86
87   TObjArray fCalRocArrayMeand;      //  Array of AliTRDCalROC class for signal width calibration doubled
88   TObjArray fCalRocArrayRMSd;       //  Array of AliTRDCalROC class for mean width calibration doubled
89
90   TObjArray fHistoArray;            //  Array of histos for mean width calibration
91   
92  
93   AliTRDCalROC* GetCalRoc(Int_t det, TObjArray* arr, Bool_t force);
94  
95   TH2F* GetHisto(Int_t det, TObjArray *arr,
96                  Int_t nbinsY, Float_t ymin, Float_t ymax,
97                  const Char_t *type, Bool_t force);
98
99   // Some basic geometry function
100   virtual Int_t    GetLayer(Int_t d) const;
101   virtual Int_t    GetStack(Int_t d) const;
102   virtual Int_t    GetSector(Int_t d) const;
103
104   ClassDef(AliTRDCalibPadStatus,1)
105
106 };
107 #endif
108
109