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