]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDCalibPadStatus.h
7467c568632be3db46c595dea4efacdef9b359f8
[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 AliTRDrawStreamBase;
24 class AliTRDgeometry;
25
26 class AliTRDdigitsManager;
27 class AliTRDSignalIndex;
28
29 struct eventHeaderStruct;
30
31 class AliTRDCalibPadStatus : public TObject {
32
33 public:
34
35   AliTRDCalibPadStatus();
36   AliTRDCalibPadStatus(const AliTRDCalibPadStatus &ped);
37   virtual ~AliTRDCalibPadStatus();
38
39   AliTRDCalibPadStatus& operator = (const  AliTRDCalibPadStatus &source);
40
41   Int_t ProcessEvent(AliTRDrawStreamBase *rawStream, Bool_t nocheck = kFALSE);
42   Int_t ProcessEvent(AliRawReader    *rawReader, Bool_t nocheck = kFALSE);
43   Int_t ProcessEvent(const eventHeaderStruct   *event, Bool_t nocheck = kFALSE);
44   Int_t ProcessEvent2(AliRawReader    *rawReader);
45  
46   void  Destroy();
47   Int_t UpdateHisto(const Int_t idet, const Int_t iRow, const Int_t iCol,
48                     const Int_t signal, const Int_t crowMax, const Int_t ccold, const Int_t icMcm);
49
50   Int_t UpdateHisto2(const Int_t idet, const Int_t iRow, const Int_t iCol,
51                      const Int_t signal, const Int_t crowMax, const Int_t ccold, const Int_t icMcm, const Int_t icRob);
52
53   void AnalyseHisto();
54   AliTRDCalPadStatus *CreateCalPadStatus();
55   AliTRDCalPad *CreateCalPad();
56   AliTRDCalDet *CreateCalDet() const;
57
58   void SetCalRocMean(AliTRDCalROC *mean, Int_t det);
59   void SetCalRocRMS(AliTRDCalROC *rms, Int_t det);  
60
61   void SetCalRocMeand(AliTRDCalROC *mean, Int_t det);
62   void SetCalRocRMSd(AliTRDCalROC *rms, Int_t det);  
63
64   //
65   AliTRDCalROC* GetCalRocMean(Int_t det, Bool_t force=kFALSE);    // get calibration object
66   AliTRDCalROC* GetCalRocRMS(Int_t det, Bool_t force=kFALSE);     // get calibration object
67
68   AliTRDCalROC* GetCalRocMeand(Int_t det, Bool_t force=kFALSE);   // get calibration object
69   AliTRDCalROC* GetCalRocRMSd(Int_t det, Bool_t force=kFALSE);    // get calibration object
70
71   TH2F* GetHisto  (Int_t det, Bool_t force=kFALSE);              // get refernce histogram
72   
73   void  DumpToFile(const Char_t *filename, const Char_t *dir="", Bool_t append=kFALSE);
74   //
75   Int_t   GetAdcMin()       const { return fAdcMin;       }
76   Int_t   GetAdcMax()       const { return fAdcMax;       }
77
78   void    SetRangeAdc (Int_t aMin, Int_t aMax){ fAdcMin=aMin; fAdcMax=aMax; }  // Set adc range 
79
80
81   Bool_t TestEventHisto(Int_t nevent, Int_t sm, Int_t ch);  //test the fast approach to fill histograms  
82
83  private:
84
85   // Geometry
86   AliTRDgeometry  *fGeo;            //! The TRD geometry
87
88   Int_t fAdcMin;                    //  min adc channel of pedestal value
89   Int_t fAdcMax;                    //  max adc channel of pedestal value
90   Int_t fDetector;                  //  Current detector
91   Int_t fNumberOfTimeBins;          //  Current number of time bins
92      
93   TObjArray fCalRocArrayMean;       //  Array of AliTRDCalROC class for signal width calibration
94   TObjArray fCalRocArrayRMS;        //  Array of AliTRDCalROC class for mean width calibration
95
96   TObjArray fCalRocArrayMeand;      //  Array of AliTRDCalROC class for signal width calibration doubled
97   TObjArray fCalRocArrayRMSd;       //  Array of AliTRDCalROC class for mean width calibration doubled
98
99   TObjArray fHistoArray;            //  Array of histos for mean width calibration
100   
101  
102   AliTRDCalROC* GetCalRoc(Int_t det, TObjArray* arr, Bool_t force);
103  
104   TH2F* GetHisto(Int_t det, TObjArray *arr,
105                  Int_t nbinsY, Float_t ymin, Float_t ymax,
106                  const Char_t *type, Bool_t force);
107
108   // Some basic geometry function
109   virtual Int_t    GetLayer(Int_t d) const;
110   virtual Int_t    GetStack(Int_t d) const;
111   virtual Int_t    GetSector(Int_t d) const;
112
113   ClassDef(AliTRDCalibPadStatus,1)
114
115 };
116 #endif
117
118