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 /////////////////////////////////////////////////////////////////////////////////////////
15 class TTreeSRedirector;
21 class AliTPCRawStream;
22 class AliTPCRawStreamFast;
23 struct eventHeaderStruct;
25 class AliTPCCalibPulser : public TObject {
29 AliTPCCalibPulser(const AliTPCCalibPulser &sig);
30 virtual ~AliTPCCalibPulser();
32 AliTPCCalibPulser& operator = (const AliTPCCalibPulser &source);
34 Bool_t ProcessEventFast(AliTPCRawStreamFast *rawStreamFast);
35 Bool_t ProcessEventFast(AliRawReader *rawReader);
38 Bool_t ProcessEvent(AliTPCRawStream *rawStream);
39 Bool_t ProcessEvent(AliRawReader *rawReader);
40 Bool_t ProcessEvent(eventHeaderStruct *event);
42 Int_t Update(const Int_t isector, const Int_t iRow, const Int_t iPad,
43 const Int_t iTimeBin, const Float_t signal);
46 AliTPCCalROC* GetCalRocT0 (Int_t sector, Bool_t force=kFALSE); // get calibration object - sector
47 AliTPCCalROC* GetCalRocQ (Int_t sector, Bool_t force=kFALSE); // get calibration object - sector
48 AliTPCCalROC* GetCalRocRMS(Int_t sector, Bool_t force=kFALSE); // get calibration object - sector
49 AliTPCCalROC* GetCalRocOutliers(Int_t sector, Bool_t force=kFALSE); // get calibration object - sector
51 const TObjArray* GetCalPadT0() const { return &fCalRocArrayT0; } // get calibration object
52 const TObjArray* GetCalPadQ() const { return &fCalRocArrayQ; } // get calibration object
53 const TObjArray* GetCalPadRMS() const{ return &fCalRocArrayRMS;} // get calibration object
54 const TObjArray* GetCalPadOutliers() const { return &fCalRocArrayOutliers;} // get calibration object
56 TH2S* GetHistoQ (Int_t sector, Bool_t force=kFALSE); // get refernce histogram
57 TH2S* GetHistoT0 (Int_t sector, Bool_t force=kFALSE); // get refernce histogram
58 TH2S* GetHistoRMS(Int_t sector, Bool_t force=kFALSE); // get refernce histogram
60 Short_t GetDebugLevel() const { return fDebugLevel; }
62 void SetRangeTime (Int_t firstTimeBin, Int_t lastTimeBin) { fFirstTimeBin=firstTimeBin; fLastTimeBin=lastTimeBin; } //Set range in which the pulser signal is expected
64 void SetRangeRefQ (Int_t nBins, Float_t xMin, Float_t xMax){ fNbinsQ = nBins; fXminQ = xMin; fXmaxQ = xMax; } //Set range for Q reference histograms
65 void SetRangeRefT0 (Int_t nBins, Float_t xMin, Float_t xMax){ fNbinsT0 = nBins; fXminT0 = xMin; fXmaxT0 = xMax; } //Set range for T0 reference histograms
66 void SetRangeRefRMS(Int_t nBins, Float_t xMin, Float_t xMax){ fNbinsRMS = nBins; fXminRMS = xMin; fXmaxRMS = xMax; } //Set range for T0 reference histograms
68 void SetOldRCUformat(Bool_t format=kTRUE){ fOldRCUformat = format; }
70 void SetDebugLevel(Short_t debug=1){ fDebugLevel = debug;}
72 void SetPedestalDatabase(AliTPCCalPad *pedestalTPC, AliTPCCalPad *padNoiseTPC) {fPedestalTPC = pedestalTPC; fPadNoiseTPC = padNoiseTPC;}
74 Int_t GetFirstTimeBin() const { return fFirstTimeBin; }
75 Int_t GetLastTimeBin() const { return fLastTimeBin; }
77 void Merge(AliTPCCalibPulser *sig);
79 void DumpToFile(const Char_t *filename, const Char_t *dir="", Bool_t append=kFALSE);
82 TObjArray* TestBinning();
85 Int_t fFirstTimeBin; // First Time bin needed for analysis
86 Int_t fLastTimeBin; // Last Time bin needed for analysis
88 // reference histogram ranges
89 Int_t fNbinsT0; // Number of bins for T0 reference histogram
90 Float_t fXminT0; // xmin of T0 reference histogram
91 Float_t fXmaxT0; // xmax of T0 reference histogram
92 Int_t fNbinsQ; // Number of bins for T0 reference histogram
93 Float_t fXminQ; // xmin of T0 reference histogram
94 Float_t fXmaxQ; // xmax of T0 reference histogram
95 Int_t fNbinsRMS; // Number of bins for T0 reference histogram
96 Float_t fXminRMS; // xmin of T0 reference histogram
97 Float_t fXmaxRMS; // xmax of T0 reference histogram
99 Int_t fLastSector; //! Last sector processed
101 Bool_t fOldRCUformat; //! Should we use the old RCU format for data reading
103 AliTPCROC *fROC; //! ROC information
104 AliTPCParam *fParam; //! TPC information
106 AliTPCCalPad *fPedestalTPC; //! Pedestal Information
107 AliTPCCalPad *fPadNoiseTPC; //! Pad noise Information whole TPC
108 AliTPCCalROC *fPedestalROC; //! Pedestal Information for current ROC
109 AliTPCCalROC *fPadNoiseROC; //! Pad noise Information for current ROC
110 // Bool_t fBpedestal; //! are we running with pedestal substraction
113 TObjArray fCalRocArrayT0; // Array of AliTPCCalROC class for Time0 calibration
114 TObjArray fCalRocArrayQ; // Array of AliTPCCalROC class for Charge calibration
115 TObjArray fCalRocArrayRMS; // Array of AliTPCCalROC class for signal width calibration
116 TObjArray fCalRocArrayOutliers; // Array of AliTPCCalROC class for signal outliers
118 TObjArray fHistoQArray; // Calibration histograms for Charge distribution
119 TObjArray fHistoT0Array; // Calibration histograms for Time0 distribution
120 TObjArray fHistoRMSArray; // Calibration histograms for signal width distribution
122 TObjArray fPadTimesArrayEvent; //! Pad Times for the event, before mean Time0 corrections
123 TObjArray fPadQArrayEvent; //! Charge for the event, only needed for debugging streamer
124 TObjArray fPadRMSArrayEvent; //! Signal width for the event, only needed for debugging streamer
125 TObjArray fPadPedestalArrayEvent; //! Signal width for the event, only needed for debugging streamer
127 Int_t fCurrentChannel; //! current channel processed
128 Int_t fCurrentSector; //! current sector processed
129 Int_t fCurrentRow; //! current row processed
130 Float_t fMaxPadSignal; //! maximum bin of current pad
131 Int_t fMaxTimeBin; //! time bin with maximum value
132 TVectorF fPadSignal; //! signal of current Pad
133 Float_t fPadPedestal; //! Pedestal Value of current pad
134 Float_t fPadNoise; //! Noise Value of current pad
136 TVectorF fVTime0Offset; //! Time0 Offset from preprocessing for each sector;
137 TVectorF fVTime0OffsetCounter; //! Time0 Offset from preprocessing for each sector;
140 // Int_t fEvent; // Number of events processed
141 TTreeSRedirector *fDebugStreamer; //! debug streamer
143 Short_t fDebugLevel; // debug Level
146 void FindPedestal(Float_t part=.6);
147 void FindPulserSignal(TVectorD ¶m, Float_t &qSum);
149 TH2S* GetHisto(Int_t sector, TObjArray *arr,
150 Int_t nbinsY, Float_t ymin, Float_t ymax,
151 Char_t *type, Bool_t force);
154 AliTPCCalROC* GetCalRoc(Int_t sector, TObjArray* arr, Bool_t force) const;
156 TVectorF* GetPadTimesEvent(Int_t sector, Bool_t force=kFALSE);
165 TVectorF* GetPadInfoEvent(Int_t sector, TObjArray *arr, Bool_t force=kFALSE);
166 TVectorF* GetPadQEvent(Int_t sector, Bool_t force=kFALSE);
167 TVectorF* GetPadRMSEvent(Int_t sector, Bool_t force=kFALSE);
168 TVectorF* GetPadPedestalEvent(Int_t sector, Bool_t force=kFALSE);
171 ClassDef(AliTPCCalibPulser,1) //Implementation of the TPC pulser calibration