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