support for first 7 tev runs
[u/mrichter/AliRoot.git] / TPC / AliTPCdataQA.h
CommitLineData
0ffacf98 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
336156cc 8#include <TH1F.h>
23c9ab21 9#include <TProfile.h>
0ffacf98 10#include <TObjArray.h>
57acd2d2 11#include "AliRecoParam.h"
0ffacf98 12
13class TArrayF;
14class TH2F;
15class TTreeSRedirector;
16class AliTPCROC;
17class AliTPCCalROC;
18class AliTPCRawStream;
0c25417d 19class AliTPCRawStreamV3;
0ffacf98 20class AliTPCRawStreamFast;
21class AliRawReader;
22class AliTPCAltroMapping;
ac940b58 23class AliTPCCalPad;
24class TMap;
0ffacf98 25struct eventHeaderStruct;
26
336156cc 27class AliTPCdataQA : public TH1F {
0ffacf98 28
29public:
30 AliTPCdataQA();
57acd2d2 31 AliTPCdataQA(AliRecoParam::EventSpecie_t es);
0ffacf98 32 AliTPCdataQA(const AliTPCdataQA &ped);
8ba97cc8 33 AliTPCdataQA(const TMap *config);
0ffacf98 34 virtual ~AliTPCdataQA();
35
36 AliTPCdataQA& operator = (const AliTPCdataQA &source);
8368e0ee 37 void DumpToFile(const Char_t *filename, const Char_t *dir="", Bool_t append=kFALSE);
258cd111 38 void MakeTree(const char *fname="QApad.root");
39
0ffacf98 40 //
41 Bool_t ProcessEventFast(AliTPCRawStreamFast *rawStreamFast);
42 Bool_t ProcessEventFast(AliRawReader *rawReader);
43 Bool_t ProcessEvent(AliTPCRawStream *rawStream);
0c25417d 44 Bool_t ProcessEvent(AliTPCRawStreamV3 *rawStreamV3);
0ffacf98 45 Bool_t ProcessEvent(AliRawReader *rawReader);
0c25417d 46 Bool_t ProcessEventOld(AliRawReader *rawReader);
0ffacf98 47 Bool_t ProcessEvent(eventHeaderStruct *event);
48
0ffacf98 49 void Analyse();
50 //
51 //
f11b3071 52 void SetPedestal(AliTPCCalPad *pedestalCal){ fPedestal = pedestalCal;}
53 void SetNoise(AliTPCCalPad *noiseCal){ fNoise = noiseCal;}
54
266f8637 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;}
23c9ab21 65 TProfile* GetHistQVsTimeSideA() const {return fHistQVsTimeSideA;}
66 TProfile* GetHistQVsTimeSideC() const {return fHistQVsTimeSideC;}
67 TProfile* GetHistQMaxVsTimeSideA() const {return fHistQMaxVsTimeSideA;}
68 TProfile* GetHistQMaxVsTimeSideC() const {return fHistQMaxVsTimeSideC;}
ce0175fa 69 TH1F* GetHistOccupancyVsEventConst() const {return fHistOccupancyVsEvent;}
70 TH1F* GetHistNclustersVsEventConst() const {return fHistNclustersVsEvent;}
71 TH1F* GetHistOccupancyVsEvent();
72 TH1F* GetHistNclustersVsEvent();
0ffacf98 73
74 //
75 AliTPCAltroMapping **GetAltroMapping() { return fMapping; };
76 void SetAltroMapping(AliTPCAltroMapping **mapp) { fMapping = mapp; };
77 //
78 //
266f8637 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; }
266f8637 84 Bool_t GetIsAnalysed() const { return fIsAnalysed; }
ce0175fa 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
c322f08a 90 void SetRangeTime(Int_t tMin, Int_t tMax){ fFirstTimeBin=tMin; fLastTimeBin=tMax;} // Set time bin range that is used for the pedestal calibration
0ffacf98 91 void SetRangeAdc (Int_t aMin, Int_t aMax){ fAdcMin=aMin; fAdcMax=aMax; } // Set adc range for the pedestal calibration
ce0175fa 92 void SetMaxEvents (Int_t value) { fMaxEvents = value; }
93 void SetEventsPerBin(Int_t value) { fEventsPerBin = value; }
c322f08a 94
0ffacf98 95private:
266f8637 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);
ce0175fa 108 void UpdateEventHistograms();
109 void UpdateEventHisto(TH1F* hist, Float_t average);
266f8637 110
0ffacf98 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
0ffacf98 115
0ffacf98 116 AliTPCAltroMapping **fMapping; //! Altro Mapping object
117 //
118 //
336156cc 119 AliTPCCalPad * fPedestal; //! option to set pedestal cal object
120 AliTPCCalPad * fNoise; //! option to set noise cal object
266f8637 121 AliTPCCalPad * fNLocalMaxima; // local maximas found
f11b3071 122 AliTPCCalPad * fMaxCharge; // max charge
123 AliTPCCalPad * fMeanCharge; // mean charge
124 AliTPCCalPad * fNoThreshold; // number of digits
266f8637 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
f11b3071 131
23c9ab21 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
ce0175fa 137 TH1F* fHistOccupancyVsEvent; // Occupancy vs event number (~time)
138 TH1F* fHistNclustersVsEvent; // Nclusters vs event number (~time)
139
f11b3071 140 Int_t fEventCounter; // event Counter
266f8637 141 Bool_t fIsAnalysed; // Set to true after Analyse has been called
ce0175fa 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
c322f08a 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; //!
266f8637 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
c322f08a 156
0ffacf98 157
158public:
ce0175fa 159 ClassDef(AliTPCdataQA, 5) // Implementation of the TPC Raw QA
0ffacf98 160};
161
162
163
164#endif
165