3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
10 #include <TProfile2D.h>
11 #include "AliRecoParam.h"
16 class TTreeSRedirector;
19 class AliTPCRawStream;
20 class AliTPCRawStreamV3;
22 class AliTPCAltroMapping;
25 struct eventHeaderStruct;
27 class AliTPCdataQA : public TH1F {
31 AliTPCdataQA(const AliTPCdataQA &ped);
32 AliTPCdataQA(const TMap *config);
33 virtual ~AliTPCdataQA();
35 AliTPCdataQA& operator = (const AliTPCdataQA &source);
36 void DumpToFile(const Char_t *filename, const Char_t *dir="", Bool_t append=kFALSE);
37 void MakeTree(const char *fname="QApad.root") const;
40 Bool_t ProcessEvent(AliTPCRawStream *const rawStream);
41 Bool_t ProcessEvent(AliTPCRawStreamV3 *const rawStreamV3);
42 Bool_t ProcessEvent(AliRawReader *const rawReader);
43 Bool_t ProcessEventOld(AliRawReader *const rawReader);
44 Bool_t ProcessEvent(eventHeaderStruct *const event);
49 void SetPedestal(AliTPCCalPad *const pedestalCal){ fPedestal = pedestalCal;}
50 void SetNoise(AliTPCCalPad *const noiseCal){ fNoise = noiseCal;}
53 void FillOccupancyProfile();
57 AliTPCCalPad *GetNoThreshold() const { return fNoThreshold;}
58 AliTPCCalPad *GetMaxCharge() const { return fMaxCharge;}
59 AliTPCCalPad *GetMeanCharge() const { return fMeanCharge;}
60 AliTPCCalPad *GetNLocalMaxima() const { return fNLocalMaxima;}
61 AliTPCCalPad *GetOverThreshold10() const { return fOverThreshold10;}
62 AliTPCCalPad *GetOverThreshold20() const { return fOverThreshold20;}
63 AliTPCCalPad *GetOverThreshold30() const { return fOverThreshold30;}
64 AliTPCCalPad *GetNTimeBins() const { return fNTimeBins;}
65 AliTPCCalPad *GetNPads() const { return fNPads;}
66 AliTPCCalPad *GetTimePosition() const { return fTimePosition;}
67 TProfile* GetHistQVsTimeSideA() const {return fHistQVsTimeSideA;}
68 TProfile* GetHistQVsTimeSideC() const {return fHistQVsTimeSideC;}
69 TProfile* GetHistQMaxVsTimeSideA() const {return fHistQMaxVsTimeSideA;}
70 TProfile* GetHistQMaxVsTimeSideC() const {return fHistQMaxVsTimeSideC;}
71 TH1F* GetHistOccupancyVsEventConst() const {return fHistOccupancyVsEvent;}
72 TH1F* GetHistNclustersVsEventConst() const {return fHistNclustersVsEvent;}
73 TH1F* GetHistOccupancyVsEvent();
74 TH1F* GetHistNclustersVsEvent();
77 TProfile* GetHistOccVsSector() const { return fHistOccVsSector; }
78 TProfile2D* GetHistOcc2dVsSector() const { return fHistOcc2dVsSector; }
79 TProfile* GetHistQVsSector() const { return fHistQVsSector; }
80 TProfile* GetHistQmaxVsSector() const { return fHistQmaxVsSector; }
83 AliTPCAltroMapping **GetAltroMapping() const { return fMapping; };
84 void SetAltroMapping(AliTPCAltroMapping **mapp) { fMapping = mapp; };
87 Int_t GetFirstTimeBin() const { return fFirstTimeBin; }
88 Int_t GetLastTimeBin() const { return fLastTimeBin; }
89 Int_t GetAdcMin() const { return fAdcMin; }
90 Int_t GetAdcMax() const { return fAdcMax; }
91 Int_t GetEventCounter() const { return fEventCounter; }
92 Bool_t GetIsAnalysed() const { return fIsAnalysed; }
93 Int_t GetMaxEvents() const { return fMaxEvents; }
94 Int_t GetEventsPerBin() const { return fEventsPerBin; }
95 Int_t GetSignalCounter() const { return fSignalCounter; }
96 Int_t GetClusterCounter() const { return fClusterCounter;}
99 Bool_t GetIsDQM() const { return fIsDQM; }
101 void SetRangeTime(Int_t tMin, Int_t tMax){ fFirstTimeBin=tMin; fLastTimeBin=tMax;} // Set time bin range that is used for the pedestal calibration
102 void SetRangeAdc (Int_t aMin, Int_t aMax){ fAdcMin=aMin; fAdcMax=aMax; } // Set adc range for the pedestal calibration
103 void SetMaxEvents (Int_t value) { fMaxEvents = value; }
104 void SetEventsPerBin(Int_t value) { fEventsPerBin = value; }
107 void SetIsDQM(Bool_t value) { fIsDQM = value; }
110 Int_t Update(const Int_t iSector, const Int_t iRow, const Int_t iPad,
111 const Int_t iTimeBin, Float_t signal,
112 const Int_t iPatch=-1, const Int_t iBranch=-1);
113 void FindLocalMaxima(const Int_t iSector);
115 void MakeArrays(); // Create arrays for random data acces
116 void CleanArrays(); // Clean arrays for random data acces
117 void SetExpandDigit(const Int_t iRow, Int_t iPad, Int_t iTimeBin,
118 const Float_t signal); // Fill arrays with signals
119 void GetPadAndTimeBin(Int_t bin, Int_t& iPad, Int_t& iTimeBin); // Get pad and time bin corresponding to the 1d bin
120 Float_t GetQ(const Float_t* adcArray, const Int_t time,
121 const Int_t pad, const Int_t maxTimeBins,
122 Int_t& timeMin,Int_t& timeMax,Int_t& padMin,Int_t& padMax) const;
123 void UpdateEventHistograms();
125 Int_t fFirstTimeBin; // First Time bin needed for analysis
126 Int_t fLastTimeBin; // Last Time bin needed for analysis
127 Int_t fAdcMin; // min adc channel of pedestal value
128 Int_t fAdcMax; // max adc channel of pedestal value
130 AliTPCAltroMapping **fMapping; //! Altro Mapping object
133 AliTPCCalPad * fPedestal; //! option to set pedestal cal object
134 AliTPCCalPad * fNoise; //! option to set noise cal object
135 AliTPCCalPad * fNLocalMaxima; // local maximas found
136 AliTPCCalPad * fMaxCharge; // max charge
137 AliTPCCalPad * fMeanCharge; // mean charge
138 AliTPCCalPad * fNoThreshold; // number of digits
139 AliTPCCalPad * fNTimeBins; // timebins width of cluster
140 AliTPCCalPad * fNPads; // pads with of cluster
141 AliTPCCalPad * fTimePosition; // Time position of local maximum
142 AliTPCCalPad * fOverThreshold10; //! local maxima with qMax over threshold
143 AliTPCCalPad * fOverThreshold20; //! local maxima with qMax over threshold
144 AliTPCCalPad * fOverThreshold30; //! local maxima with qMax over threshold
146 TProfile* fHistQVsTimeSideA; // Q vs time (side A)
147 TProfile* fHistQVsTimeSideC; // Q vs time (side C)
148 TProfile* fHistQMaxVsTimeSideA; // QMax vs time (side A)
149 TProfile* fHistQMaxVsTimeSideC; // QMax vs time (side C)
151 TH1F* fHistOccupancyVsEvent; // Occupancy vs event number (~time)
152 TH1F* fHistNclustersVsEvent; // Nclusters vs event number (~time)
154 Int_t fEventCounter; // event Counter
155 Bool_t fIsAnalysed; // Set to true after Analyse has been called
157 Int_t fMaxEvents; // Max events for event histograms
158 Int_t fEventsPerBin; // Events per bin for event histograms
159 Int_t fSignalCounter; // Signal counter
160 Int_t fClusterCounter; // Cluster counter
164 Float_t** fAllBins; //! array for digit using random access
165 Int_t** fAllSigBins; //! array of pointers to the indexes over threshold
166 Int_t* fAllNSigBins; //!
167 Int_t fRowsMax; //! Maximum number of time bins
168 Int_t fPadsMax; //! Maximum number of time bins
169 Int_t fTimeBinsMax; //! Maximum number of time bins
172 Bool_t fIsDQM; //! Is DQM -> Simple output (no 2D!)
173 TProfile* fHistOccVsSector; //! Occ vs sector (for DQM only)
174 TProfile2D* fHistOcc2dVsSector; //! Occ vs sector 2D (for DQM only)
175 TProfile* fHistQVsSector; //! Q vs sector (for DQM only)
176 TProfile* fHistQmaxVsSector; //! QMax vs sector (for DQM only)
177 TArrayD* fOccVec; //! Occupancy help counter for DQM
178 TArrayD* fOccMaxVec; //! Occupancy help normlization for DQM
179 TArrayD* fOccVecFine; //! "2D" occupancy help counter for DQM
180 TArrayD* fOccMaxVecFine; //! "2D" occupancy help normlization for DQM
183 ClassDef(AliTPCdataQA, 5) // Implementation of the TPC Raw QA