1 #ifndef ALITPCCALIBPULSER_H
2 #define ALITPCCALIBPULSER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
6 /////////////////////////////////////////////////////////////////////////////////////////
8 // Implementation of the TPC pulser calibration //
10 /////////////////////////////////////////////////////////////////////////////////////////
14 #include <TObjArray.h>
17 class TTreeSRedirector;
23 class AliTPCRawStream;
24 class AliTPCRawStreamFast;
25 class AliTPCAltroMapping;
28 struct eventHeaderStruct;
30 class AliTPCCalibPulser : public TObject {
34 AliTPCCalibPulser(const AliTPCCalibPulser &sig);
35 AliTPCCalibPulser(const TMap *config);
36 virtual ~AliTPCCalibPulser();
40 AliTPCCalibPulser& operator = (const AliTPCCalibPulser &source);
42 Bool_t ProcessEventFast(AliTPCRawStreamFast *rawStreamFast);
43 Bool_t ProcessEventFast(AliRawReader *rawReader);
46 Bool_t ProcessEvent(AliTPCRawStream *rawStream);
47 Bool_t ProcessEvent(AliRawReader *rawReader);
48 Bool_t ProcessEvent(eventHeaderStruct *event);
50 Int_t Update(const Int_t isector, const Int_t iRow, const Int_t iPad,
51 const Int_t iTimeBin, const Float_t signal);
54 AliTPCAltroMapping **GetAltroMapping() { return fMapping; };
55 void SetAltroMapping(AliTPCAltroMapping **mapp) { fMapping = mapp; };
57 AliTPCCalROC* GetCalRocT0 (Int_t sector, Bool_t force=kFALSE); // get calibration object - sector
58 AliTPCCalROC* GetCalRocQ (Int_t sector, Bool_t force=kFALSE); // get calibration object - sector
59 AliTPCCalROC* GetCalRocRMS(Int_t sector, Bool_t force=kFALSE); // get calibration object - sector
60 AliTPCCalROC* GetCalRocOutliers(Int_t sector, Bool_t force=kFALSE); // get calibration object - sector
62 const TObjArray* GetCalPadT0() const { return &fCalRocArrayT0; } // get calibration object
63 const TObjArray* GetCalPadQ() const { return &fCalRocArrayQ; } // get calibration object
64 const TObjArray* GetCalPadRMS() const{ return &fCalRocArrayRMS;} // get calibration object
65 const TObjArray* GetCalPadOutliers() const { return &fCalRocArrayOutliers;} // get calibration object
67 TH2S* GetHistoQ (Int_t sector, Bool_t force=kFALSE); // get refernce histogram
68 TH2S* GetHistoT0 (Int_t sector, Bool_t force=kFALSE); // get refernce histogram
69 TH2S* GetHistoRMS(Int_t sector, Bool_t force=kFALSE); // get refernce histogram
71 TH2F* GetHistoTSec(); // mean abs time distribution histogram
73 Float_t GetMeanTimeSector(Int_t sector) const {return fVMeanTimeSector[sector];}
74 const TVectorF* GetMeanTimeSectorArray() const {return &fVMeanTimeSector;}
76 Short_t GetDebugLevel() const { return fDebugLevel; }
78 void SetRangeTime (Int_t firstTimeBin, Int_t lastTimeBin) { fFirstTimeBin=firstTimeBin; fLastTimeBin=lastTimeBin; } //Set range in which the pulser signal is expected
80 void SetRangeRefQ (Int_t nBins, Float_t xMin, Float_t xMax){ fNbinsQ = nBins; fXminQ = xMin; fXmaxQ = xMax; } //Set range for Q reference histograms
81 void SetRangeRefT0 (Int_t nBins, Float_t xMin, Float_t xMax){ fNbinsT0 = nBins; fXminT0 = xMin; fXmaxT0 = xMax; } //Set range for T0 reference histograms
82 void SetRangeRefRMS(Int_t nBins, Float_t xMin, Float_t xMax){ fNbinsRMS = nBins; fXminRMS = xMin; fXmaxRMS = xMax; } //Set range for T0 reference histograms
84 void SetDebugLevel(Short_t debug=1){ fDebugLevel = debug;}
86 void SetIsZeroSuppressed(Bool_t zs=kTRUE){ fIsZeroSuppressed=zs;}
88 void SetPedestalDatabase(AliTPCCalPad *pedestalTPC, AliTPCCalPad *padNoiseTPC) {fPedestalTPC = pedestalTPC; fPadNoiseTPC = padNoiseTPC;}
89 void SetOutliers(AliTPCCalPad *outliers) {fOutliers = outliers;}
91 Int_t GetFirstTimeBin() const { return fFirstTimeBin; }
92 Int_t GetLastTimeBin() const { return fLastTimeBin; }
94 Bool_t GetIsZeroSupperssed() const { return fIsZeroSuppressed; }
96 void Merge(AliTPCCalibPulser *sig);
98 void DumpToFile(const Char_t *filename, const Char_t *dir="", Bool_t append=kFALSE);
101 TObjArray* TestBinning();
104 Int_t fFirstTimeBin; // First Time bin needed for analysis
105 Int_t fLastTimeBin; // Last Time bin needed for analysis
107 // reference histogram ranges
108 Int_t fNbinsT0; // Number of bins for T0 reference histogram
109 Float_t fXminT0; // xmin of T0 reference histogram
110 Float_t fXmaxT0; // xmax of T0 reference histogram
111 Int_t fNbinsQ; // Number of bins for T0 reference histogram
112 Float_t fXminQ; // xmin of T0 reference histogram
113 Float_t fXmaxQ; // xmax of T0 reference histogram
114 Int_t fNbinsRMS; // Number of bins for T0 reference histogram
115 Float_t fXminRMS; // xmin of T0 reference histogram
116 Float_t fXmaxRMS; // xmax of T0 reference histogram
118 Bool_t fIsZeroSuppressed; // if data is zero suppressed
120 Int_t fLastSector; //! Last sector processed
123 AliTPCROC *fROC; //! ROC information
124 AliTPCAltroMapping **fMapping; //! Altro Mapping object
125 AliTPCParam *fParam; //! TPC information
127 AliTPCCalPad *fPedestalTPC; //! Pedestal Information
128 AliTPCCalPad *fPadNoiseTPC; //! Pad noise Information whole TPC
129 AliTPCCalPad *fOutliers; //! Outlier information. Those will not be used for calculating the T0
130 AliTPCCalROC *fPedestalROC; //! Pedestal Information for current ROC
131 AliTPCCalROC *fPadNoiseROC; //! Pad noise Information for current ROC
132 // Bool_t fBpedestal; //! are we running with pedestal substraction
135 TObjArray fCalRocArrayT0; // Array of AliTPCCalROC class for Time0 calibration
136 TObjArray fCalRocArrayQ; // Array of AliTPCCalROC class for Charge calibration
137 TObjArray fCalRocArrayRMS; // Array of AliTPCCalROC class for signal width calibration
138 TObjArray fCalRocArrayOutliers; // Array of AliTPCCalROC class for signal outliers
140 TObjArray fHistoQArray; // Calibration histograms for Charge distribution
141 TObjArray fHistoT0Array; // Calibration histograms for Time0 distribution
142 TObjArray fHistoRMSArray; // Calibration histograms for signal width distribution
144 TH2F *fHMeanTimeSector; // Timing distribution per sector
145 TVectorF fVMeanTimeSector; // Mean time per sector from analysis of fHMeanTimeSector
147 TObjArray fPadTimesArrayEvent; //! Pad Times for the event, before mean Time0 corrections
148 TObjArray fPadQArrayEvent; //! Charge for the event, only needed for debugging streamer
149 TObjArray fPadRMSArrayEvent; //! Signal width for the event, only needed for debugging streamer
150 TObjArray fPadPedestalArrayEvent; //! Signal width for the event, only needed for debugging streamer
152 Int_t fCurrentChannel; //! current channel processed
153 Int_t fCurrentSector; //! current sector processed
154 Int_t fCurrentRow; //! current row processed
155 Int_t fCurrentPad; //! current pad processed
156 Float_t fMaxPadSignal; //! maximum bin of current pad
157 Int_t fMaxTimeBin; //! time bin with maximum value
158 TVectorF fPadSignal; //! signal of current Pad
159 Float_t fPadPedestal; //! Pedestal Value of current pad
160 Float_t fPadNoise; //! Noise Value of current pad
162 TVectorF fVTime0Offset; //! Time0 Offset from preprocessing for each sector;
163 TVectorF fVTime0OffsetCounter; //! Time0 Offset from preprocessing for each sector;
167 // Int_t fEvent; // Number of events processed
168 TTreeSRedirector *fDebugStreamer; //! debug streamer
170 Short_t fDebugLevel; // debug Level
173 void FindPedestal(Float_t part=.6);
174 void FindPulserSignal(TVectorD ¶m, Float_t &qSum);
176 TH2S* GetHisto(Int_t sector, TObjArray *arr,
177 Int_t nbinsY, Float_t ymin, Float_t ymax,
178 Char_t *type, Bool_t force);
181 AliTPCCalROC* GetCalRoc(Int_t sector, TObjArray* arr, Bool_t force) const;
183 TVectorF* GetPadTimesEvent(Int_t sector, Bool_t force=kFALSE);
185 Bool_t IsEdgePad(Int_t sector, Int_t row, Int_t pad);
194 TVectorF* GetPadInfoEvent(Int_t sector, TObjArray *arr, Bool_t force=kFALSE);
195 TVectorF* GetPadQEvent(Int_t sector, Bool_t force=kFALSE);
196 TVectorF* GetPadRMSEvent(Int_t sector, Bool_t force=kFALSE);
197 TVectorF* GetPadPedestalEvent(Int_t sector, Bool_t force=kFALSE);
201 ClassDef(AliTPCCalibPulser,4) //Implementation of the TPC pulser calibration