]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCdataQA.h
Fixed misuse of const
[u/mrichter/AliRoot.git] / TPC / AliTPCdataQA.h
1 #ifndef ALITPCDATAQA_H
2 #define ALITPCDATAQA_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6
7
8 #include <TH1F.h>
9 #include <TObjArray.h>
10
11 class TArrayF;
12 class TH2F;
13 class TTreeSRedirector;
14 class AliTPCROC;
15 class AliTPCCalROC;
16 class AliTPCRawStream;
17 class AliTPCRawStreamFast;
18 class AliRawReader;
19 class AliTPCAltroMapping;
20 class AliTPCCalPad;
21 class TMap; 
22 struct eventHeaderStruct;
23
24 class AliTPCdataQA : public TH1F {
25
26 public:
27   AliTPCdataQA();
28   AliTPCdataQA(const AliTPCdataQA &ped);
29   AliTPCdataQA(TMap *config);
30   virtual ~AliTPCdataQA();
31
32   AliTPCdataQA& operator = (const  AliTPCdataQA &source);
33  void  DumpToFile(const Char_t *filename, const Char_t *dir="", Bool_t append=kFALSE);
34  void MakeTree(const char *fname="QApad.root");
35
36   //
37   Bool_t ProcessEventFast(AliTPCRawStreamFast *rawStreamFast);
38   Bool_t ProcessEventFast(AliRawReader        *rawReader);
39   Bool_t ProcessEvent(AliTPCRawStream *rawStream);
40   Bool_t ProcessEvent(AliRawReader    *rawReader);
41   Bool_t ProcessEvent(eventHeaderStruct   *event);
42
43   void   Analyse();
44   //
45   //
46   void SetPedestal(AliTPCCalPad *pedestalCal){ fPedestal = pedestalCal;}
47   void SetNoise(AliTPCCalPad *noiseCal){ fNoise = noiseCal;}
48
49   AliTPCCalPad *GetNoThreshold() const { return fNoThreshold;}
50   AliTPCCalPad *GetMaxCharge() const { return fMaxCharge;}
51   AliTPCCalPad *GetMeanCharge() const { return fMeanCharge;}
52   AliTPCCalPad *GetNLocalMaxima() const { return fNLocalMaxima;}
53   AliTPCCalPad *GetOverThreshold10() const { return fOverThreshold10;}
54   AliTPCCalPad *GetOverThreshold20() const { return fOverThreshold20;}
55   AliTPCCalPad *GetOverThreshold30() const { return fOverThreshold30;}
56   AliTPCCalPad *GetNTimeBins() const { return fNTimeBins;}
57   AliTPCCalPad *GetNPads() const { return fNPads;}
58   AliTPCCalPad *GetTimePosition() const { return fTimePosition;}
59
60   //
61   AliTPCAltroMapping **GetAltroMapping() { return fMapping; };
62   void  SetAltroMapping(AliTPCAltroMapping **mapp) { fMapping = mapp; };
63   //
64   //
65   Int_t  GetFirstTimeBin() const { return fFirstTimeBin; }
66   Int_t  GetLastTimeBin()  const { return fLastTimeBin;  }
67   Int_t  GetAdcMin()       const { return fAdcMin;       }
68   Int_t  GetAdcMax()       const { return fAdcMax;       }
69   Int_t  GetEventCounter() const { return fEventCounter; }
70   Bool_t GetIsAnalysed()   const { return fIsAnalysed;   }
71   void  SetRangeTime(Int_t tMin, Int_t tMax){ fFirstTimeBin=tMin; fLastTimeBin=tMax;}  // Set time bin range that is used for the pedestal calibration
72   void  SetRangeAdc (Int_t aMin, Int_t aMax){ fAdcMin=aMin; fAdcMax=aMax; }  // Set adc range for the pedestal calibration
73
74
75
76 private:
77   Int_t Update(const Int_t iSector, const Int_t iRow, const Int_t iPad,
78                const Int_t iTimeBin, Float_t signal);
79   void  FindLocalMaxima(const Int_t iSector);
80
81   void MakeArrays();                // Create arrays for random data acces
82   void CleanArrays();               // Clean arrays for random data acces
83   void SetExpandDigit(const Int_t iRow, Int_t iPad, Int_t iTimeBin, 
84                       const Float_t signal); // Fill arrays with signals
85   void GetPadAndTimeBin(Int_t bin, Int_t& iPad, Int_t& iTimeBin); // Get pad and time bin corresponding to the 1d bin
86   Float_t GetQ(const Float_t* adcArray, const Int_t time,
87                const Int_t pad, const Int_t maxTimeBins, 
88                Int_t& timeMin,Int_t& timeMax,Int_t& padMin,Int_t& padMax);
89
90   Int_t fFirstTimeBin;              //  First Time bin needed for analysis
91   Int_t fLastTimeBin;               //  Last Time bin needed for analysis
92   Int_t fAdcMin;                    //  min adc channel of pedestal value
93   Int_t fAdcMax;                    //  max adc channel of pedestal value
94
95   AliTPCAltroMapping **fMapping;    //! Altro Mapping object
96   //
97   //
98   AliTPCCalPad * fPedestal;         //! option to set pedestal cal object
99   AliTPCCalPad * fNoise;            //! option to set noise cal object
100   AliTPCCalPad * fNLocalMaxima;     // local maximas found
101   AliTPCCalPad * fMaxCharge;        // max charge
102   AliTPCCalPad * fMeanCharge;       // mean charge
103   AliTPCCalPad * fNoThreshold;      // number of digits
104   AliTPCCalPad * fNTimeBins;        // timebins width of cluster
105   AliTPCCalPad * fNPads;            // pads with of cluster
106   AliTPCCalPad * fTimePosition;     // Time position of local maximum
107   AliTPCCalPad * fOverThreshold10;  //! local maxima with qMax over threshold
108   AliTPCCalPad * fOverThreshold20;  //! local maxima with qMax over threshold
109   AliTPCCalPad * fOverThreshold30;  //! local maxima with qMax over threshold
110
111   Int_t   fEventCounter;            // event Counter
112   Bool_t  fIsAnalysed;              // Set to true after Analyse has been called
113   //
114   //  Expand buffer
115   //
116   Float_t** fAllBins;              //! array for digit using random access
117   Int_t**   fAllSigBins;           //! array of pointers to the indexes over threshold
118   Int_t*    fAllNSigBins;          //! 
119   Int_t fRowsMax;                  //!  Maximum number of time bins
120   Int_t fPadsMax;                  //!  Maximum number of time bins
121   Int_t fTimeBinsMax;              //!  Maximum number of time bins
122
123
124 public:
125   ClassDef(AliTPCdataQA, 3)  // Implementation of the TPC pedestal and noise calibration
126 };
127
128
129
130 #endif
131