3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
10 #include "AliRecoParam.h"
14 class TTreeSRedirector;
17 class AliTPCRawStream;
18 class AliTPCRawStreamV3;
19 class AliTPCRawStreamFast;
21 class AliTPCAltroMapping;
24 struct eventHeaderStruct;
26 class AliTPCdataQA : public TH1F {
30 AliTPCdataQA(AliRecoParam::EventSpecie_t es);
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");
40 Bool_t ProcessEventFast(AliTPCRawStreamFast *rawStreamFast);
41 Bool_t ProcessEventFast(AliRawReader *rawReader);
42 Bool_t ProcessEvent(AliTPCRawStream *rawStream);
43 Bool_t ProcessEvent(AliTPCRawStreamV3 *rawStreamV3);
44 Bool_t ProcessEvent(AliRawReader *rawReader);
45 Bool_t ProcessEventOld(AliRawReader *rawReader);
46 Bool_t ProcessEvent(eventHeaderStruct *event);
51 void SetPedestal(AliTPCCalPad *pedestalCal){ fPedestal = pedestalCal;}
52 void SetNoise(AliTPCCalPad *noiseCal){ fNoise = noiseCal;}
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;}
66 AliTPCAltroMapping **GetAltroMapping() { return fMapping; };
67 void SetAltroMapping(AliTPCAltroMapping **mapp) { fMapping = mapp; };
70 Int_t GetFirstTimeBin() const { return fFirstTimeBin; }
71 Int_t GetLastTimeBin() const { return fLastTimeBin; }
72 Int_t GetAdcMin() const { return fAdcMin; }
73 Int_t GetAdcMax() const { return fAdcMax; }
74 Int_t GetEventCounter() const { return fEventCounter; }
75 Bool_t GetIsAnalysed() const { return fIsAnalysed; }
76 void SetRangeTime(Int_t tMin, Int_t tMax){ fFirstTimeBin=tMin; fLastTimeBin=tMax;} // Set time bin range that is used for the pedestal calibration
77 void SetRangeAdc (Int_t aMin, Int_t aMax){ fAdcMin=aMin; fAdcMax=aMax; } // Set adc range for the pedestal calibration
82 Int_t Update(const Int_t iSector, const Int_t iRow, const Int_t iPad,
83 const Int_t iTimeBin, Float_t signal);
84 void FindLocalMaxima(const Int_t iSector);
86 void MakeArrays(); // Create arrays for random data acces
87 void CleanArrays(); // Clean arrays for random data acces
88 void SetExpandDigit(const Int_t iRow, Int_t iPad, Int_t iTimeBin,
89 const Float_t signal); // Fill arrays with signals
90 void GetPadAndTimeBin(Int_t bin, Int_t& iPad, Int_t& iTimeBin); // Get pad and time bin corresponding to the 1d bin
91 Float_t GetQ(const Float_t* adcArray, const Int_t time,
92 const Int_t pad, const Int_t maxTimeBins,
93 Int_t& timeMin,Int_t& timeMax,Int_t& padMin,Int_t& padMax);
95 Int_t fFirstTimeBin; // First Time bin needed for analysis
96 Int_t fLastTimeBin; // Last Time bin needed for analysis
97 Int_t fAdcMin; // min adc channel of pedestal value
98 Int_t fAdcMax; // max adc channel of pedestal value
100 AliTPCAltroMapping **fMapping; //! Altro Mapping object
103 AliTPCCalPad * fPedestal; //! option to set pedestal cal object
104 AliTPCCalPad * fNoise; //! option to set noise cal object
105 AliTPCCalPad * fNLocalMaxima; // local maximas found
106 AliTPCCalPad * fMaxCharge; // max charge
107 AliTPCCalPad * fMeanCharge; // mean charge
108 AliTPCCalPad * fNoThreshold; // number of digits
109 AliTPCCalPad * fNTimeBins; // timebins width of cluster
110 AliTPCCalPad * fNPads; // pads with of cluster
111 AliTPCCalPad * fTimePosition; // Time position of local maximum
112 AliTPCCalPad * fOverThreshold10; //! local maxima with qMax over threshold
113 AliTPCCalPad * fOverThreshold20; //! local maxima with qMax over threshold
114 AliTPCCalPad * fOverThreshold30; //! local maxima with qMax over threshold
116 Int_t fEventCounter; // event Counter
117 Bool_t fIsAnalysed; // Set to true after Analyse has been called
121 Float_t** fAllBins; //! array for digit using random access
122 Int_t** fAllSigBins; //! array of pointers to the indexes over threshold
123 Int_t* fAllNSigBins; //!
124 Int_t fRowsMax; //! Maximum number of time bins
125 Int_t fPadsMax; //! Maximum number of time bins
126 Int_t fTimeBinsMax; //! Maximum number of time bins
130 ClassDef(AliTPCdataQA, 3) // Implementation of the TPC pedestal and noise calibration