Line data Source code
1 : /// \class AliTPCdataQA
2 :
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 :
8 : #include <TBits.h>
9 : #include <TH1F.h>
10 : #include <TProfile.h>
11 : #include <TProfile2D.h>
12 : #include "AliRecoParam.h"
13 :
14 : #include <TArray.h>
15 :
16 : class TH2F;
17 : class TTreeSRedirector;
18 : class AliTPCROC;
19 : class AliTPCCalROC;
20 : class AliTPCRawStreamV3;
21 : class AliRawReader;
22 : class AliTPCAltroMapping;
23 : class AliTPCCalPad;
24 : class TMap;
25 : class TObjArray;
26 : struct eventHeaderStruct;
27 :
28 : class AliTPCdataQA : public TH1F {
29 :
30 : public:
31 : AliTPCdataQA();
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") const;
39 :
40 : //
41 : Bool_t ProcessEvent(AliTPCRawStreamV3 *const rawStreamV3);
42 : Bool_t ProcessEvent(AliRawReader *const rawReader);
43 : Bool_t ProcessEvent(eventHeaderStruct *const event);
44 :
45 : void Analyse();
46 : //
47 : //
48 0 : void SetPedestal(AliTPCCalPad *const pedestalCal){ fPedestal = pedestalCal;}
49 0 : void SetNoise(AliTPCCalPad *const noiseCal){ fNoise = noiseCal;}
50 :
51 0 : void SetMinQMax (Float_t minQmax ) { fMinQMax = minQmax; }
52 0 : void SetRequireNeighbouringPad(Bool_t req=kTRUE) { fRequireNeighbouringPad = req; }
53 :
54 : // DQM methods
55 : void FillOccupancyProfile();
56 : void ResetProfiles();
57 :
58 :
59 0 : AliTPCCalPad *GetNoThreshold() const { return fNoThreshold;}
60 0 : AliTPCCalPad *GetMaxCharge() const { return fMaxCharge;}
61 0 : AliTPCCalPad *GetMeanCharge() const { return fMeanCharge;}
62 0 : AliTPCCalPad *GetNLocalMaxima() const { return fNLocalMaxima;}
63 0 : AliTPCCalPad *GetOverThreshold10() const { return fOverThreshold10;}
64 0 : AliTPCCalPad *GetOverThreshold20() const { return fOverThreshold20;}
65 0 : AliTPCCalPad *GetOverThreshold30() const { return fOverThreshold30;}
66 0 : AliTPCCalPad *GetNTimeBins() const { return fNTimeBins;}
67 0 : AliTPCCalPad *GetNPads() const { return fNPads;}
68 0 : AliTPCCalPad *GetTimePosition() const { return fTimePosition;}
69 0 : TProfile* GetHistQVsTimeSideA() const {return fHistQVsTimeSideA;}
70 0 : TProfile* GetHistQVsTimeSideC() const {return fHistQVsTimeSideC;}
71 0 : TProfile* GetHistQMaxVsTimeSideA() const {return fHistQMaxVsTimeSideA;}
72 0 : TProfile* GetHistQMaxVsTimeSideC() const {return fHistQMaxVsTimeSideC;}
73 0 : TH1F* GetHistOccupancyVsEventConst() const {return fHistOccupancyVsEvent;}
74 0 : TH1F* GetHistNclustersVsEventConst() const {return fHistNclustersVsEvent;}
75 : TH1F* GetHistOccupancyVsEvent();
76 : TH1F* GetHistNclustersVsEvent();
77 :
78 : // DQM output
79 0 : TProfile* GetHistOccVsSector() const { return fHistOccVsSector; }
80 0 : TProfile2D* GetHistOcc2dVsSector() const { return fHistOcc2dVsSector; }
81 0 : TProfile* GetHistQVsSector() const { return fHistQVsSector; }
82 0 : TProfile* GetHistQmaxVsSector() const { return fHistQmaxVsSector; }
83 :
84 : //
85 0 : AliTPCAltroMapping **GetAltroMapping() const { return fMapping; };
86 0 : void SetAltroMapping(AliTPCAltroMapping **mapp) { fMapping = mapp; };
87 : //
88 : //
89 0 : Int_t GetFirstTimeBin() const { return fFirstTimeBin; }
90 0 : Int_t GetLastTimeBin() const { return fLastTimeBin; }
91 0 : Int_t GetAdcMin() const { return fAdcMin; }
92 0 : Int_t GetAdcMax() const { return fAdcMax; }
93 0 : Int_t GetEventCounter() const { return fEventCounter; }
94 0 : Bool_t GetIsAnalysed() const { return fIsAnalysed; }
95 0 : Int_t GetMaxEvents() const { return fMaxEvents; }
96 0 : Int_t GetEventsPerBin() const { return fEventsPerBin; }
97 0 : Int_t GetSignalCounter() const { return fSignalCounter; }
98 0 : Int_t GetClusterCounter() const { return fClusterCounter;}
99 :
100 0 : Float_t GetMinQMax() const { return fMinQMax; }
101 0 : Bool_t GetRequireNeighbouringPad() const { return fRequireNeighbouringPad; }
102 :
103 : // DQM getter
104 0 : Bool_t GetIsDQM() const { return fIsDQM; }
105 :
106 0 : void SetRangeTime(Int_t tMin, Int_t tMax){ fFirstTimeBin=tMin; fLastTimeBin=tMax;} // Set time bin range that is used for the pedestal calibration
107 0 : void SetRangeAdc (Int_t aMin, Int_t aMax){ fAdcMin=aMin; fAdcMax=aMax; } // Set adc range for the pedestal calibration
108 0 : void SetMaxEvents (Int_t value) { fMaxEvents = value; }
109 0 : void SetEventsPerBin(Int_t value) { fEventsPerBin = value; }
110 :
111 : // DQM setter
112 0 : void SetIsDQM(Bool_t value) { fIsDQM = value; }
113 :
114 : void ResetData();
115 :
116 0 : void SetChamberStatus(UInt_t roc, Bool_t status) { fActiveChambers.SetBitNumber(roc,status); }
117 0 : Bool_t GetChamberStatus(UInt_t roc) {return fActiveChambers.TestBitNumber(roc);}
118 : private:
119 : Int_t Update(const Int_t iSector, const Int_t iRow, const Int_t iPad,
120 : const Int_t iTimeBin, Float_t signal,
121 : const Int_t iPatch=-1, const Int_t iBranch=-1);
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
126 : void SetExpandDigit(const Int_t iRow, Int_t iPad, Int_t iTimeBin,
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,
130 : const Int_t pad, const Int_t maxTimeBins,
131 : Int_t& timeMin,Int_t& timeMax,Int_t& padMin,Int_t& padMax) const;
132 : void UpdateEventHistograms();
133 :
134 : void Init();
135 :
136 : TObjArray *ConfigArrRocs(TObjArray *arr, const Text_t* name);
137 :
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 :
145 :
146 : AliTPCAltroMapping **fMapping; //!<! Altro Mapping object
147 : //
148 : //
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
179 :
180 : //
181 : // Expand buffer
182 : //
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
189 :
190 : // DQM variables
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
203 44 : ClassDef(AliTPCdataQA, 6) // Implementation of the TPC Raw QA
204 : /// \endcond
205 : };
206 :
207 :
208 :
209 : #endif
210 :
|