Split DAQ DA into two tasks
[u/mrichter/AliRoot.git] / TRD / AliTRDCalibPadStatus.h
CommitLineData
cf46274d 1#ifndef ALITRDCALIBPADSTATUS_H
170c35f1 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
14class TObjArray;
15class TH2F;
16class TTreeSRedirector;
f162af62 17
18class AliRawReader;
19
170c35f1 20class AliTRDCalROC;
21class AliTRDCalPadStatus;
22class AliTRDRawStream;
23class AliTRDarrayF;
f162af62 24class AliTRDgeometry;
25
170c35f1 26struct eventHeaderStruct;
27
28class AliTRDCalibPadStatus : public TObject {
29
30public:
31
32 AliTRDCalibPadStatus();
33 AliTRDCalibPadStatus(const AliTRDCalibPadStatus &ped);
34 virtual ~AliTRDCalibPadStatus();
35
36 AliTRDCalibPadStatus& operator = (const AliTRDCalibPadStatus &source);
37
3a0f6479 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);
170c35f1 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);
6ace5fe2 46
170c35f1 47 void Analyse();
48 void AnalyseHisto();
49 AliTRDCalPadStatus *CreateCalPadStatus();
3a0f6479 50
6ace5fe2 51 void SetCalRocMean(AliTRDCalROC *mean, Int_t det);
52 void SetCalRocRMS(AliTRDCalROC *rms, Int_t det);
53
170c35f1 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
74private:
75
f162af62 76 // Geometry
77 AliTRDgeometry *fGeo; //! The TRD geometry
78
170c35f1 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
cf46274d 82 Int_t fNumberOfTimeBins; // Current number of time bins
170c35f1 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
cf46274d 96 AliTRDarrayF* GetCal(Int_t det, TObjArray* arr, Bool_t force);
97 AliTRDCalROC* GetCalRoc(Int_t det, TObjArray* arr, Bool_t force);
98
170c35f1 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
3a0f6479 108public:
170c35f1 109
3a0f6479 110 ClassDef(AliTRDCalibPadStatus,1)
170c35f1 111
3a0f6479 112};
170c35f1 113#endif
114