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 AliTPCRawStreamV3;
21 class AliTPCAltroMapping;
24 struct eventHeaderStruct;
26 class AliTPCdataQA : public TH1F {
30 AliTPCdataQA(const AliTPCdataQA &ped);
31 AliTPCdataQA(const TMap *config);
32 virtual ~AliTPCdataQA();
34 AliTPCdataQA& operator = (const AliTPCdataQA &source);
35 void DumpToFile(const Char_t *filename, const Char_t *dir="", Bool_t append=kFALSE);
36 void MakeTree(const char *fname="QApad.root") const;
39 Bool_t ProcessEvent(AliTPCRawStreamV3 *const rawStreamV3);
40 Bool_t ProcessEvent(AliRawReader *const rawReader);
41 Bool_t ProcessEvent(eventHeaderStruct *const event);
46 void SetPedestal(AliTPCCalPad *const pedestalCal){ fPedestal = pedestalCal;}
47 void SetNoise(AliTPCCalPad *const noiseCal){ fNoise = noiseCal;}
50 void FillOccupancyProfile();
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;}
64 TProfile* GetHistQVsTimeSideA() const {return fHistQVsTimeSideA;}
65 TProfile* GetHistQVsTimeSideC() const {return fHistQVsTimeSideC;}
66 TProfile* GetHistQMaxVsTimeSideA() const {return fHistQMaxVsTimeSideA;}
67 TProfile* GetHistQMaxVsTimeSideC() const {return fHistQMaxVsTimeSideC;}
68 TH1F* GetHistOccupancyVsEventConst() const {return fHistOccupancyVsEvent;}
69 TH1F* GetHistNclustersVsEventConst() const {return fHistNclustersVsEvent;}
70 TH1F* GetHistOccupancyVsEvent();
71 TH1F* GetHistNclustersVsEvent();
74 TProfile* GetHistOccVsSector() const { return fHistOccVsSector; }
75 TProfile2D* GetHistOcc2dVsSector() const { return fHistOcc2dVsSector; }
76 TProfile* GetHistQVsSector() const { return fHistQVsSector; }
77 TProfile* GetHistQmaxVsSector() const { return fHistQmaxVsSector; }
80 AliTPCAltroMapping **GetAltroMapping() const { return fMapping; };
81 void SetAltroMapping(AliTPCAltroMapping **mapp) { fMapping = mapp; };
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; }
89 Bool_t GetIsAnalysed() const { return fIsAnalysed; }
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;}
96 Bool_t GetIsDQM() const { return fIsDQM; }
98 void SetRangeTime(Int_t tMin, Int_t tMax){ fFirstTimeBin=tMin; fLastTimeBin=tMax;} // Set time bin range that is used for the pedestal calibration
99 void SetRangeAdc (Int_t aMin, Int_t aMax){ fAdcMin=aMin; fAdcMax=aMax; } // Set adc range for the pedestal calibration
100 void SetMaxEvents (Int_t value) { fMaxEvents = value; }
101 void SetEventsPerBin(Int_t value) { fEventsPerBin = value; }
104 void SetIsDQM(Bool_t value) { fIsDQM = value; }
107 Int_t Update(const Int_t iSector, const Int_t iRow, const Int_t iPad,
108 const Int_t iTimeBin, Float_t signal,
109 const Int_t iPatch=-1, const Int_t iBranch=-1);
110 void FindLocalMaxima(const Int_t iSector);
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,
119 Int_t& timeMin,Int_t& timeMax,Int_t& padMin,Int_t& padMax) const;
120 void UpdateEventHistograms();
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
127 AliTPCAltroMapping **fMapping; //! Altro Mapping object
130 AliTPCCalPad * fPedestal; //! option to set pedestal cal object
131 AliTPCCalPad * fNoise; //! option to set noise cal object
132 AliTPCCalPad * fNLocalMaxima; // local maximas found
133 AliTPCCalPad * fMaxCharge; // max charge
134 AliTPCCalPad * fMeanCharge; // mean charge
135 AliTPCCalPad * fNoThreshold; // number of digits
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
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)
148 TH1F* fHistOccupancyVsEvent; // Occupancy vs event number (~time)
149 TH1F* fHistNclustersVsEvent; // Nclusters vs event number (~time)
151 Int_t fEventCounter; // event Counter
152 Bool_t fIsAnalysed; // Set to true after Analyse has been called
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
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; //!
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
169 Bool_t fIsDQM; //! Is DQM -> Simple output (no 2D!)
170 TProfile* fHistOccVsSector; //! Occ vs sector (for DQM only)
171 TProfile2D* fHistOcc2dVsSector; //! Occ vs sector 2D (for DQM only)
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
176 TArrayD* fOccVecFine; //! "2D" occupancy help counter for DQM
177 TArrayD* fOccMaxVecFine; //! "2D" occupancy help normlization for DQM
180 ClassDef(AliTPCdataQA, 5) // Implementation of the TPC Raw QA