]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCdataQA.h
halloWorld.sh - print the system information
[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 <TProfile.h>
10 #include <TObjArray.h>
11 #include "AliRecoParam.h"
12
13 class TArrayF;
14 class TH2F;
15 class TTreeSRedirector;
16 class AliTPCROC;
17 class AliTPCCalROC;
18 class AliTPCRawStream;
19 class AliTPCRawStreamV3;
20 class AliTPCRawStreamFast;
21 class AliRawReader;
22 class AliTPCAltroMapping;
23 class AliTPCCalPad;
24 class TMap; 
25 struct eventHeaderStruct;
26
27 class AliTPCdataQA : public TH1F {
28
29 public:
30   AliTPCdataQA();
31   AliTPCdataQA(AliRecoParam::EventSpecie_t es);
32   AliTPCdataQA(const AliTPCdataQA &ped);
33   AliTPCdataQA(const TMap *config);
34   virtual ~AliTPCdataQA();
35
36   AliTPCdataQA& operator = (const  AliTPCdataQA &source);
37  void  DumpToFile(const Char_t *filename, const Char_t *dir="", Bool_t append=kFALSE);
38  void MakeTree(const char *fname="QApad.root");
39
40   //
41   Bool_t ProcessEventFast(AliTPCRawStreamFast *rawStreamFast);
42   Bool_t ProcessEventFast(AliRawReader        *rawReader);
43   Bool_t ProcessEvent(AliTPCRawStream *rawStream);
44   Bool_t ProcessEvent(AliTPCRawStreamV3 *rawStreamV3);
45   Bool_t ProcessEvent(AliRawReader    *rawReader);
46   Bool_t ProcessEventOld(AliRawReader    *rawReader);
47   Bool_t ProcessEvent(eventHeaderStruct   *event);
48
49   void   Analyse();
50   //
51   //
52   void SetPedestal(AliTPCCalPad *pedestalCal){ fPedestal = pedestalCal;}
53   void SetNoise(AliTPCCalPad *noiseCal){ fNoise = noiseCal;}
54
55   AliTPCCalPad *GetNoThreshold() const { return fNoThreshold;}
56   AliTPCCalPad *GetMaxCharge() const { return fMaxCharge;}
57   AliTPCCalPad *GetMeanCharge() const { return fMeanCharge;}
58   AliTPCCalPad *GetNLocalMaxima() const { return fNLocalMaxima;}
59   AliTPCCalPad *GetOverThreshold10() const { return fOverThreshold10;}
60   AliTPCCalPad *GetOverThreshold20() const { return fOverThreshold20;}
61   AliTPCCalPad *GetOverThreshold30() const { return fOverThreshold30;}
62   AliTPCCalPad *GetNTimeBins() const { return fNTimeBins;}
63   AliTPCCalPad *GetNPads() const { return fNPads;}
64   AliTPCCalPad *GetTimePosition() const { return fTimePosition;}
65   TProfile* GetHistQVsTimeSideA()    const {return fHistQVsTimeSideA;}
66   TProfile* GetHistQVsTimeSideC()    const {return fHistQVsTimeSideC;}
67   TProfile* GetHistQMaxVsTimeSideA() const {return fHistQMaxVsTimeSideA;}
68   TProfile* GetHistQMaxVsTimeSideC() const {return fHistQMaxVsTimeSideC;}
69   TH1F*     GetHistOccupancyVsEventConst() const {return fHistOccupancyVsEvent;}
70   TH1F*     GetHistNclustersVsEventConst() const {return fHistNclustersVsEvent;}
71   TH1F*     GetHistOccupancyVsEvent();
72   TH1F*     GetHistNclustersVsEvent();
73
74   //
75   AliTPCAltroMapping **GetAltroMapping() { return fMapping; };
76   void  SetAltroMapping(AliTPCAltroMapping **mapp) { fMapping = mapp; };
77   //
78   //
79   Int_t  GetFirstTimeBin() const { return fFirstTimeBin; }
80   Int_t  GetLastTimeBin()  const { return fLastTimeBin;  }
81   Int_t  GetAdcMin()       const { return fAdcMin;       }
82   Int_t  GetAdcMax()       const { return fAdcMax;       }
83   Int_t  GetEventCounter() const { return fEventCounter; }
84   Bool_t GetIsAnalysed()   const { return fIsAnalysed;   }
85   Int_t  GetMaxEvents()      const { return fMaxEvents;     }
86   Int_t  GetEventsPerBin()   const { return fEventsPerBin;  }
87   Int_t  GetSignalCounter()  const { return fSignalCounter; }
88   Int_t  GetClusterCounter() const { return fClusterCounter;}
89
90   void  SetRangeTime(Int_t tMin, Int_t tMax){ fFirstTimeBin=tMin; fLastTimeBin=tMax;}  // Set time bin range that is used for the pedestal calibration
91   void  SetRangeAdc (Int_t aMin, Int_t aMax){ fAdcMin=aMin; fAdcMax=aMax; }  // Set adc range for the pedestal calibration
92   void  SetMaxEvents   (Int_t value) { fMaxEvents = value; }
93   void  SetEventsPerBin(Int_t value) { fEventsPerBin = value; }
94
95 private:
96   Int_t Update(const Int_t iSector, const Int_t iRow, const Int_t iPad,
97                const Int_t iTimeBin, Float_t signal);
98   void  FindLocalMaxima(const Int_t iSector);
99
100   void MakeArrays();                // Create arrays for random data acces
101   void CleanArrays();               // Clean arrays for random data acces
102   void SetExpandDigit(const Int_t iRow, Int_t iPad, Int_t iTimeBin, 
103                       const Float_t signal); // Fill arrays with signals
104   void GetPadAndTimeBin(Int_t bin, Int_t& iPad, Int_t& iTimeBin); // Get pad and time bin corresponding to the 1d bin
105   Float_t GetQ(const Float_t* adcArray, const Int_t time,
106                const Int_t pad, const Int_t maxTimeBins, 
107                Int_t& timeMin,Int_t& timeMax,Int_t& padMin,Int_t& padMax);
108   void UpdateEventHistograms();
109   void UpdateEventHisto(TH1F* hist, Float_t average);
110
111   Int_t fFirstTimeBin;              //  First Time bin needed for analysis
112   Int_t fLastTimeBin;               //  Last Time bin needed for analysis
113   Int_t fAdcMin;                    //  min adc channel of pedestal value
114   Int_t fAdcMax;                    //  max adc channel of pedestal value
115
116   AliTPCAltroMapping **fMapping;    //! Altro Mapping object
117   //
118   //
119   AliTPCCalPad * fPedestal;         //! option to set pedestal cal object
120   AliTPCCalPad * fNoise;            //! option to set noise cal object
121   AliTPCCalPad * fNLocalMaxima;     // local maximas found
122   AliTPCCalPad * fMaxCharge;        // max charge
123   AliTPCCalPad * fMeanCharge;       // mean charge
124   AliTPCCalPad * fNoThreshold;      // number of digits
125   AliTPCCalPad * fNTimeBins;        // timebins width of cluster
126   AliTPCCalPad * fNPads;            // pads with of cluster
127   AliTPCCalPad * fTimePosition;     // Time position of local maximum
128   AliTPCCalPad * fOverThreshold10;  //! local maxima with qMax over threshold
129   AliTPCCalPad * fOverThreshold20;  //! local maxima with qMax over threshold
130   AliTPCCalPad * fOverThreshold30;  //! local maxima with qMax over threshold
131
132   TProfile* fHistQVsTimeSideA;      // Q vs time (side A)
133   TProfile* fHistQVsTimeSideC;      // Q vs time (side C)
134   TProfile* fHistQMaxVsTimeSideA;   // QMax vs time (side A)
135   TProfile* fHistQMaxVsTimeSideC;   // QMax vs time (side C)
136
137   TH1F* fHistOccupancyVsEvent;      // Occupancy vs event number (~time)
138   TH1F* fHistNclustersVsEvent;      // Nclusters vs event number (~time)
139
140   Int_t   fEventCounter;            // event Counter
141   Bool_t  fIsAnalysed;              // Set to true after Analyse has been called
142
143   Int_t fMaxEvents;                 // Max events for event histograms
144   Int_t fEventsPerBin;              // Events per bin for event histograms
145   Int_t fSignalCounter;             // Signal counter
146   Int_t fClusterCounter;            // Cluster counter
147   //
148   //  Expand buffer
149   //
150   Float_t** fAllBins;              //! array for digit using random access
151   Int_t**   fAllSigBins;           //! array of pointers to the indexes over threshold
152   Int_t*    fAllNSigBins;          //! 
153   Int_t fRowsMax;                  //!  Maximum number of time bins
154   Int_t fPadsMax;                  //!  Maximum number of time bins
155   Int_t fTimeBinsMax;              //!  Maximum number of time bins
156
157
158 public:
159   ClassDef(AliTPCdataQA, 5)  // Implementation of the TPC Raw QA
160 };
161
162
163
164 #endif
165