]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/Base/AliTPCdataQA.h
ATO-97, ATO-78 - speed-up creation of the AliTPCCalPad objects from TTree
[u/mrichter/AliRoot.git] / TPC / Base / 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>
92ae9768 9#include <TProfile.h>
10#include <TProfile2D.h>
57acd2d2 11#include "AliRecoParam.h"
0ffacf98 12
0ab2a4cc 13#include <TArray.h>
14
0ffacf98 15class TH2F;
16class TTreeSRedirector;
17class AliTPCROC;
18class AliTPCCalROC;
0c25417d 19class AliTPCRawStreamV3;
0ffacf98 20class AliRawReader;
21class AliTPCAltroMapping;
ac940b58 22class AliTPCCalPad;
23class TMap;
0ffacf98 24struct eventHeaderStruct;
25
336156cc 26class AliTPCdataQA : public TH1F {
0ffacf98 27
28public:
29 AliTPCdataQA();
30 AliTPCdataQA(const AliTPCdataQA &ped);
8ba97cc8 31 AliTPCdataQA(const TMap *config);
0ffacf98 32 virtual ~AliTPCdataQA();
33
34 AliTPCdataQA& operator = (const AliTPCdataQA &source);
8368e0ee 35 void DumpToFile(const Char_t *filename, const Char_t *dir="", Bool_t append=kFALSE);
6a50ff96 36 void MakeTree(const char *fname="QApad.root") const;
258cd111 37
0ffacf98 38 //
6a50ff96 39 Bool_t ProcessEvent(AliTPCRawStreamV3 *const rawStreamV3);
40 Bool_t ProcessEvent(AliRawReader *const rawReader);
6a50ff96 41 Bool_t ProcessEvent(eventHeaderStruct *const event);
0ffacf98 42
0ffacf98 43 void Analyse();
44 //
45 //
6a50ff96 46 void SetPedestal(AliTPCCalPad *const pedestalCal){ fPedestal = pedestalCal;}
47 void SetNoise(AliTPCCalPad *const noiseCal){ fNoise = noiseCal;}
f11b3071 48
0ab2a4cc 49 // DQM methods
50 void FillOccupancyProfile();
51 void ResetProfiles();
52
53
266f8637 54 AliTPCCalPad *GetNoThreshold() const { return fNoThreshold;}
55 AliTPCCalPad *GetMaxCharge() const { return fMaxCharge;}
56 AliTPCCalPad *GetMeanCharge() const { return fMeanCharge;}
57 AliTPCCalPad *GetNLocalMaxima() const { return fNLocalMaxima;}
58 AliTPCCalPad *GetOverThreshold10() const { return fOverThreshold10;}
59 AliTPCCalPad *GetOverThreshold20() const { return fOverThreshold20;}
60 AliTPCCalPad *GetOverThreshold30() const { return fOverThreshold30;}
61 AliTPCCalPad *GetNTimeBins() const { return fNTimeBins;}
62 AliTPCCalPad *GetNPads() const { return fNPads;}
63 AliTPCCalPad *GetTimePosition() const { return fTimePosition;}
23c9ab21 64 TProfile* GetHistQVsTimeSideA() const {return fHistQVsTimeSideA;}
65 TProfile* GetHistQVsTimeSideC() const {return fHistQVsTimeSideC;}
66 TProfile* GetHistQMaxVsTimeSideA() const {return fHistQMaxVsTimeSideA;}
67 TProfile* GetHistQMaxVsTimeSideC() const {return fHistQMaxVsTimeSideC;}
ce0175fa 68 TH1F* GetHistOccupancyVsEventConst() const {return fHistOccupancyVsEvent;}
69 TH1F* GetHistNclustersVsEventConst() const {return fHistNclustersVsEvent;}
70 TH1F* GetHistOccupancyVsEvent();
71 TH1F* GetHistNclustersVsEvent();
0ffacf98 72
0ab2a4cc 73 // DQM output
74 TProfile* GetHistOccVsSector() const { return fHistOccVsSector; }
92ae9768 75 TProfile2D* GetHistOcc2dVsSector() const { return fHistOcc2dVsSector; }
0ab2a4cc 76 TProfile* GetHistQVsSector() const { return fHistQVsSector; }
77 TProfile* GetHistQmaxVsSector() const { return fHistQmaxVsSector; }
78
0ffacf98 79 //
6a50ff96 80 AliTPCAltroMapping **GetAltroMapping() const { return fMapping; };
0ffacf98 81 void SetAltroMapping(AliTPCAltroMapping **mapp) { fMapping = mapp; };
82 //
83 //
266f8637 84 Int_t GetFirstTimeBin() const { return fFirstTimeBin; }
85 Int_t GetLastTimeBin() const { return fLastTimeBin; }
86 Int_t GetAdcMin() const { return fAdcMin; }
87 Int_t GetAdcMax() const { return fAdcMax; }
88 Int_t GetEventCounter() const { return fEventCounter; }
266f8637 89 Bool_t GetIsAnalysed() const { return fIsAnalysed; }
ce0175fa 90 Int_t GetMaxEvents() const { return fMaxEvents; }
91 Int_t GetEventsPerBin() const { return fEventsPerBin; }
92 Int_t GetSignalCounter() const { return fSignalCounter; }
93 Int_t GetClusterCounter() const { return fClusterCounter;}
94
0ab2a4cc 95 // DQM getter
96 Bool_t GetIsDQM() const { return fIsDQM; }
97
c322f08a 98 void SetRangeTime(Int_t tMin, Int_t tMax){ fFirstTimeBin=tMin; fLastTimeBin=tMax;} // Set time bin range that is used for the pedestal calibration
0ffacf98 99 void SetRangeAdc (Int_t aMin, Int_t aMax){ fAdcMin=aMin; fAdcMax=aMax; } // Set adc range for the pedestal calibration
ce0175fa 100 void SetMaxEvents (Int_t value) { fMaxEvents = value; }
101 void SetEventsPerBin(Int_t value) { fEventsPerBin = value; }
0ab2a4cc 102
103 // DQM setter
104 void SetIsDQM(Bool_t value) { fIsDQM = value; }
c322f08a 105
0ffacf98 106private:
266f8637 107 Int_t Update(const Int_t iSector, const Int_t iRow, const Int_t iPad,
92ae9768 108 const Int_t iTimeBin, Float_t signal,
109 const Int_t iPatch=-1, const Int_t iBranch=-1);
266f8637 110 void FindLocalMaxima(const Int_t iSector);
111
112 void MakeArrays(); // Create arrays for random data acces
113 void CleanArrays(); // Clean arrays for random data acces
114 void SetExpandDigit(const Int_t iRow, Int_t iPad, Int_t iTimeBin,
115 const Float_t signal); // Fill arrays with signals
116 void GetPadAndTimeBin(Int_t bin, Int_t& iPad, Int_t& iTimeBin); // Get pad and time bin corresponding to the 1d bin
117 Float_t GetQ(const Float_t* adcArray, const Int_t time,
118 const Int_t pad, const Int_t maxTimeBins,
6a50ff96 119 Int_t& timeMin,Int_t& timeMax,Int_t& padMin,Int_t& padMax) const;
ce0175fa 120 void UpdateEventHistograms();
266f8637 121
0ffacf98 122 Int_t fFirstTimeBin; // First Time bin needed for analysis
123 Int_t fLastTimeBin; // Last Time bin needed for analysis
124 Int_t fAdcMin; // min adc channel of pedestal value
125 Int_t fAdcMax; // max adc channel of pedestal value
0ffacf98 126
0ffacf98 127 AliTPCAltroMapping **fMapping; //! Altro Mapping object
128 //
129 //
336156cc 130 AliTPCCalPad * fPedestal; //! option to set pedestal cal object
131 AliTPCCalPad * fNoise; //! option to set noise cal object
266f8637 132 AliTPCCalPad * fNLocalMaxima; // local maximas found
f11b3071 133 AliTPCCalPad * fMaxCharge; // max charge
134 AliTPCCalPad * fMeanCharge; // mean charge
135 AliTPCCalPad * fNoThreshold; // number of digits
266f8637 136 AliTPCCalPad * fNTimeBins; // timebins width of cluster
137 AliTPCCalPad * fNPads; // pads with of cluster
138 AliTPCCalPad * fTimePosition; // Time position of local maximum
139 AliTPCCalPad * fOverThreshold10; //! local maxima with qMax over threshold
140 AliTPCCalPad * fOverThreshold20; //! local maxima with qMax over threshold
141 AliTPCCalPad * fOverThreshold30; //! local maxima with qMax over threshold
f11b3071 142
23c9ab21 143 TProfile* fHistQVsTimeSideA; // Q vs time (side A)
144 TProfile* fHistQVsTimeSideC; // Q vs time (side C)
145 TProfile* fHistQMaxVsTimeSideA; // QMax vs time (side A)
146 TProfile* fHistQMaxVsTimeSideC; // QMax vs time (side C)
147
ce0175fa 148 TH1F* fHistOccupancyVsEvent; // Occupancy vs event number (~time)
149 TH1F* fHistNclustersVsEvent; // Nclusters vs event number (~time)
150
f11b3071 151 Int_t fEventCounter; // event Counter
266f8637 152 Bool_t fIsAnalysed; // Set to true after Analyse has been called
ce0175fa 153
154 Int_t fMaxEvents; // Max events for event histograms
155 Int_t fEventsPerBin; // Events per bin for event histograms
156 Int_t fSignalCounter; // Signal counter
157 Int_t fClusterCounter; // Cluster counter
c322f08a 158 //
159 // Expand buffer
160 //
161 Float_t** fAllBins; //! array for digit using random access
162 Int_t** fAllSigBins; //! array of pointers to the indexes over threshold
163 Int_t* fAllNSigBins; //!
266f8637 164 Int_t fRowsMax; //! Maximum number of time bins
165 Int_t fPadsMax; //! Maximum number of time bins
166 Int_t fTimeBinsMax; //! Maximum number of time bins
c322f08a 167
0ab2a4cc 168 // DQM variables
169 Bool_t fIsDQM; //! Is DQM -> Simple output (no 2D!)
170 TProfile* fHistOccVsSector; //! Occ vs sector (for DQM only)
92ae9768 171 TProfile2D* fHistOcc2dVsSector; //! Occ vs sector 2D (for DQM only)
0ab2a4cc 172 TProfile* fHistQVsSector; //! Q vs sector (for DQM only)
173 TProfile* fHistQmaxVsSector; //! QMax vs sector (for DQM only)
174 TArrayD* fOccVec; //! Occupancy help counter for DQM
175 TArrayD* fOccMaxVec; //! Occupancy help normlization for DQM
92ae9768 176 TArrayD* fOccVecFine; //! "2D" occupancy help counter for DQM
177 TArrayD* fOccMaxVecFine; //! "2D" occupancy help normlization for DQM
0ab2a4cc 178
179
ce0175fa 180 ClassDef(AliTPCdataQA, 5) // Implementation of the TPC Raw QA
0ffacf98 181};
182
183
184
185#endif
186