3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
10 #include <TObjArray.h>
11 #include "AliRecoParam.h"
15 class TTreeSRedirector;
18 class AliTPCRawStream;
19 class AliTPCRawStreamV3;
20 class AliTPCRawStreamFast;
22 class AliTPCAltroMapping;
25 struct eventHeaderStruct;
27 class AliTPCdataQA : public TH1F {
31 AliTPCdataQA(AliRecoParam::EventSpecie_t es);
32 AliTPCdataQA(const AliTPCdataQA &ped);
33 AliTPCdataQA(const TMap *config);
34 virtual ~AliTPCdataQA();
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");
41 Bool_t ProcessEventFast(AliTPCRawStreamFast *rawStreamFast);
42 Bool_t ProcessEventFast(AliRawReader *rawReader);
43 Bool_t ProcessEvent(AliTPCRawStream *rawStream);
44 Bool_t ProcessEvent(AliTPCRawStreamV3 *rawStreamV3);
45 Bool_t ProcessEvent(AliRawReader *rawReader);
46 Bool_t ProcessEventOld(AliRawReader *rawReader);
47 Bool_t ProcessEvent(eventHeaderStruct *event);
52 void SetPedestal(AliTPCCalPad *pedestalCal){ fPedestal = pedestalCal;}
53 void SetNoise(AliTPCCalPad *noiseCal){ fNoise = noiseCal;}
55 AliTPCCalPad *GetNoThreshold() const { return fNoThreshold;}
56 AliTPCCalPad *GetMaxCharge() const { return fMaxCharge;}
57 AliTPCCalPad *GetMeanCharge() const { return fMeanCharge;}
58 AliTPCCalPad *GetNLocalMaxima() const { return fNLocalMaxima;}
59 AliTPCCalPad *GetOverThreshold10() const { return fOverThreshold10;}
60 AliTPCCalPad *GetOverThreshold20() const { return fOverThreshold20;}
61 AliTPCCalPad *GetOverThreshold30() const { return fOverThreshold30;}
62 AliTPCCalPad *GetNTimeBins() const { return fNTimeBins;}
63 AliTPCCalPad *GetNPads() const { return fNPads;}
64 AliTPCCalPad *GetTimePosition() const { return fTimePosition;}
65 TProfile* GetHistQVsTimeSideA() const {return fHistQVsTimeSideA;}
66 TProfile* GetHistQVsTimeSideC() const {return fHistQVsTimeSideC;}
67 TProfile* GetHistQMaxVsTimeSideA() const {return fHistQMaxVsTimeSideA;}
68 TProfile* GetHistQMaxVsTimeSideC() const {return fHistQMaxVsTimeSideC;}
71 AliTPCAltroMapping **GetAltroMapping() { return fMapping; };
72 void SetAltroMapping(AliTPCAltroMapping **mapp) { fMapping = mapp; };
75 Int_t GetFirstTimeBin() const { return fFirstTimeBin; }
76 Int_t GetLastTimeBin() const { return fLastTimeBin; }
77 Int_t GetAdcMin() const { return fAdcMin; }
78 Int_t GetAdcMax() const { return fAdcMax; }
79 Int_t GetEventCounter() const { return fEventCounter; }
80 Bool_t GetIsAnalysed() const { return fIsAnalysed; }
81 void SetRangeTime(Int_t tMin, Int_t tMax){ fFirstTimeBin=tMin; fLastTimeBin=tMax;} // Set time bin range that is used for the pedestal calibration
82 void SetRangeAdc (Int_t aMin, Int_t aMax){ fAdcMin=aMin; fAdcMax=aMax; } // Set adc range for the pedestal calibration
87 Int_t Update(const Int_t iSector, const Int_t iRow, const Int_t iPad,
88 const Int_t iTimeBin, Float_t signal);
89 void FindLocalMaxima(const Int_t iSector);
91 void MakeArrays(); // Create arrays for random data acces
92 void CleanArrays(); // Clean arrays for random data acces
93 void SetExpandDigit(const Int_t iRow, Int_t iPad, Int_t iTimeBin,
94 const Float_t signal); // Fill arrays with signals
95 void GetPadAndTimeBin(Int_t bin, Int_t& iPad, Int_t& iTimeBin); // Get pad and time bin corresponding to the 1d bin
96 Float_t GetQ(const Float_t* adcArray, const Int_t time,
97 const Int_t pad, const Int_t maxTimeBins,
98 Int_t& timeMin,Int_t& timeMax,Int_t& padMin,Int_t& padMax);
100 Int_t fFirstTimeBin; // First Time bin needed for analysis
101 Int_t fLastTimeBin; // Last Time bin needed for analysis
102 Int_t fAdcMin; // min adc channel of pedestal value
103 Int_t fAdcMax; // max adc channel of pedestal value
105 AliTPCAltroMapping **fMapping; //! Altro Mapping object
108 AliTPCCalPad * fPedestal; //! option to set pedestal cal object
109 AliTPCCalPad * fNoise; //! option to set noise cal object
110 AliTPCCalPad * fNLocalMaxima; // local maximas found
111 AliTPCCalPad * fMaxCharge; // max charge
112 AliTPCCalPad * fMeanCharge; // mean charge
113 AliTPCCalPad * fNoThreshold; // number of digits
114 AliTPCCalPad * fNTimeBins; // timebins width of cluster
115 AliTPCCalPad * fNPads; // pads with of cluster
116 AliTPCCalPad * fTimePosition; // Time position of local maximum
117 AliTPCCalPad * fOverThreshold10; //! local maxima with qMax over threshold
118 AliTPCCalPad * fOverThreshold20; //! local maxima with qMax over threshold
119 AliTPCCalPad * fOverThreshold30; //! local maxima with qMax over threshold
121 TProfile* fHistQVsTimeSideA; // Q vs time (side A)
122 TProfile* fHistQVsTimeSideC; // Q vs time (side C)
123 TProfile* fHistQMaxVsTimeSideA; // QMax vs time (side A)
124 TProfile* fHistQMaxVsTimeSideC; // QMax vs time (side C)
126 Int_t fEventCounter; // event Counter
127 Bool_t fIsAnalysed; // Set to true after Analyse has been called
131 Float_t** fAllBins; //! array for digit using random access
132 Int_t** fAllSigBins; //! array of pointers to the indexes over threshold
133 Int_t* fAllNSigBins; //!
134 Int_t fRowsMax; //! Maximum number of time bins
135 Int_t fPadsMax; //! Maximum number of time bins
136 Int_t fTimeBinsMax; //! Maximum number of time bins
140 ClassDef(AliTPCdataQA, 4) // Implementation of the TPC pedestal and noise calibration