]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCCalibCE.h
Calibration using Laser Central electrode (Jens, Marian)
[u/mrichter/AliRoot.git] / TPC / AliTPCCalibCE.h
CommitLineData
75d8233f 1#ifndef ALITPCCALIBCE_H
2#define ALITPCCALIBCE_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6#include <TVectorT.h>
7class TObjArray;
8class TH1S;
9class TH2S;
10class TH1F;
11class TTreeSRedirector;
12class AliTPCCalPad;
13class AliTPCROC;
14class AliTPCCalROC;
15class AliTPCParam;
16class AliRawReader;
17class AliTPCRawStream;
18class TGraph;
19struct eventHeaderStruct;
20
21class AliTPCCalibCE : public TObject {
22
23public:
24 AliTPCCalibCE();
25 AliTPCCalibCE(const AliTPCCalibCE &sig);
26 virtual ~AliTPCCalibCE();
27
28 AliTPCCalibCE& operator = (const AliTPCCalibCE &source);
29
30
31 Bool_t ProcessEvent(AliTPCRawStream *rawStream);
32 Bool_t ProcessEvent(AliRawReader *rawReader);
33 Bool_t ProcessEvent(eventHeaderStruct *event);
34
35 Int_t Update(const Int_t isector, const Int_t iRow, const Int_t iPad,
36 const Int_t iTimeBin, const Float_t signal);
37 void Analyse();
38 //
39 AliTPCCalROC* GetCalRocT0 (Int_t sector, Bool_t force=kFALSE); // get calibration object - sector
40 AliTPCCalROC* GetCalRocQ (Int_t sector, Bool_t force=kFALSE); // get calibration object - sector
41 AliTPCCalROC* GetCalRocRMS(Int_t sector, Bool_t force=kFALSE); // get calibration object - sector
42 AliTPCCalROC* GetCalRocOutliers(Int_t sector, Bool_t force=kFALSE); // get calibration object - sector
43
44 const TObjArray* GetCalPadT0() { return &fCalRocArrayT0; } // get calibration object
45 const TObjArray* GetCalPadQ() { return &fCalRocArrayQ; } // get calibration object
46 const TObjArray* GetCalPadRMS(){ return &fCalRocArrayRMS;} // get calibration object
47 const TObjArray* GetCalPadOutliers(){ return &fCalRocArrayOutliers;} // get calibration object
48
49 TH2S* GetHistoQ (Int_t sector, Bool_t force=kFALSE); // get refernce histogram
50 TH2S* GetHistoT0 (Int_t sector, Bool_t force=kFALSE); // get refernce histogram
51 TH2S* GetHistoRMS(Int_t sector, Bool_t force=kFALSE); // get refernce histogram
52
53 TH1S* GetHistoTmean(Int_t sector, Bool_t force=kFALSE); // get refernce histogram
54
55 Short_t GetDebugLevel() const { return fDebugLevel; }
56 //
57 void SetRangeTime (Int_t firstTimeBin, Int_t lastTimeBin) { fFirstTimeBin=firstTimeBin; fLastTimeBin=lastTimeBin; } //Set range in which the pulser signal is expected
58 //
59 void SetRangeRefQ (Int_t nBins, Float_t xMin, Float_t xMax){ fNbinsQ = nBins; fXminQ = xMin; fXmaxQ = xMax; } //Set range for Q reference histograms
60 void SetRangeRefT0 (Int_t nBins, Float_t xMin, Float_t xMax){ fNbinsT0 = nBins; fXminT0 = xMin; fXmaxT0 = xMax; } //Set range for T0 reference histograms
61 void SetRangeRefRMS(Int_t nBins, Float_t xMin, Float_t xMax){ fNbinsRMS = nBins; fXminRMS = xMin; fXmaxRMS = xMax; } //Set range for T0 reference histograms
62 //
63 void SetTimeStampEvent(Float_t timestamp){ fTimeStamp = timestamp; }
64 void SetRunNumber(Float_t eventnumber){ fRunNumber = eventnumber; }
65
66 void SetOldRCUformat(Bool_t format=kTRUE){ fOldRCUformat = format; }
67
68 void SetDebugLevel(Short_t debug=1){ fDebugLevel = debug;}
69
70 Int_t GetFirstTimeBin() const { return fFirstTimeBin; }
71 Int_t GetLastTimeBin() const { return fLastTimeBin; }
72
73 Int_t GetNeventsProcessed() { return fNevents; }
74
75 TGraph *MakeGraphTimeCE(Int_t sector, Int_t xVariable=0, Int_t fitType=0, Int_t fitParameter=0);
76
77 void DumpToFile(const Char_t *filename, const Char_t *dir="", Bool_t append=kFALSE);
78
79//private:
80 Int_t fFirstTimeBin; // First Time bin needed for analysis
81 Int_t fLastTimeBin; // Last Time bin needed for analysis
82
83 // reference histogram ranges
84 Int_t fNbinsT0; // Number of bins for T0 reference histogram
85 Float_t fXminT0; // xmin of T0 reference histogram
86 Float_t fXmaxT0; // xmax of T0 reference histogram
87 Int_t fNbinsQ; // Number of bins for T0 reference histogram
88 Float_t fXminQ; // xmin of T0 reference histogram
89 Float_t fXmaxQ; // xmax of T0 reference histogram
90 Int_t fNbinsRMS; // Number of bins for T0 reference histogram
91 Float_t fXminRMS; // xmin of T0 reference histogram
92 Float_t fXmaxRMS; // xmax of T0 reference histogram
93
94 Int_t fLastSector; //! Last sector processed
95
96 Bool_t fOldRCUformat; //! Should we use the old RCU format for data reading
97
98 AliTPCROC *fROC; //! ROC information
99 AliTPCParam *fParam; //! TPC information
100
101 AliTPCCalPad *fPedestalTPC; //! Pedestal Information whole TPC
102 AliTPCCalPad *fPadNoiseTPC; //! Pad noise Information whole TPC
103 AliTPCCalROC *fPedestalROC; //! Pedestal Information for current ROC
104 AliTPCCalROC *fPadNoiseROC; //! Pad noise Information for current ROC
105 Bool_t fBpedestal; //! are we running with pedestal substraction
106
107 TObjArray fCalRocArrayT0; // Array of AliTPCCalROC class for Time0 calibration
108 TObjArray fCalRocArrayQ; // Array of AliTPCCalROC class for Charge calibration
109 TObjArray fCalRocArrayRMS; // Array of AliTPCCalROC class for signal width calibration
110 TObjArray fCalRocArrayOutliers; // Array of AliTPCCalROC class for signal outliers
111
112 TObjArray fHistoQArray; // Calibration histograms for Charge distribution
113 TObjArray fHistoT0Array; // Calibration histograms for Time0 distribution
114 TObjArray fHistoRMSArray; // Calibration histograms for signal width distribution
115
116 TObjArray fHistoTmean; //! Calibration histograms of the mean CE position for all sectors
117
118 TObjArray fParamArrayEvent; // Store mean arrival time parameters for each event
119 TObjArray fParamArrayEventPol1; // Store mean arrival time parameters for each sector event by event from global plane fit
120 TObjArray fParamArrayEventPol2; // Store mean arrival time parameters for each sector event by event from global parabola fit
121 TObjArray fTMeanArrayEvent; // Store mean arrival time parameters for each sector event by event
122 TVectorD fVEventTime; // Timestamps of the events
123 TVectorD fVEventNumber; // Eventnumbers of the events
124 Int_t fNevents; // Event counter
125 Double_t fTimeStamp; //! Timestamp of the current event
126 Double_t fRunNumber; //! Run Number of the current event
127 Double_t fOldRunNumber; //! Old Run Number
128
129 TObjArray fPadTimesArrayEvent; //! Pad Times for the event, before mean Time0 corrections
130 TObjArray fPadQArrayEvent; //! Charge for the event, only needed for debugging streamer
131 TObjArray fPadRMSArrayEvent; //! Signal width for the event, only needed for debugging streamer
132 TObjArray fPadPedestalArrayEvent; //! Signal width for the event, only needed for debugging streamer
133
134 Int_t fCurrentChannel; //! current channel processed
135 Int_t fCurrentSector; //! current sector processed
136 Int_t fCurrentRow; //! current row processed
137 Float_t fMaxPadSignal; //! maximum bin of current pad
138 Int_t fMaxTimeBin; //! time bin with maximum value
139 TVectorF fPadSignal; //! signal of current Pad
140 Float_t fPadPedestal; //! Pedestal Value of current pad
141 Float_t fPadNoise; //! Noise Value of current pad
142
143 TVectorD fVTime0Offset; //! Time0 Offset for each sector;
144 TVectorD fVTime0OffsetCounter; //! Time0 Offset counter for each sector;
145// TH1F *fHTime0; //! Time0 Offset ( mean Time0 ) ???????????????????????????
146 //debugging
147 Int_t fEvent;
148 TTreeSRedirector *fDebugStreamer; //! debug streamer
149
150 Short_t fDebugLevel;
151 //! debugging
152
153 void FindPedestal(Float_t part=.6);
154 void FindCESignal(TVectorD &param, Float_t &qSum, const TVectorF maxima);
155 void FindLocalMaxima(TVectorF &maxima);
156 Bool_t IsPeak(Int_t pos, Int_t tminus, Int_t tplus);
157
158 TH2S* GetHisto(Int_t sector, TObjArray *arr,
159 Int_t nbinsY, Float_t ymin, Float_t ymax,
160 Char_t *type, Bool_t force);
161 TH1S* GetHisto(Int_t sector, TObjArray *arr,
162 Char_t *type, Bool_t force);
163
164 AliTPCCalROC* GetCalRoc(Int_t sector, TObjArray* arr, Bool_t force);
165
166 TVectorF* GetPadTimesEvent(Int_t sector, Bool_t force=kFALSE);
167
168 TObjArray* GetParamArray(Int_t sector, TObjArray *arr, Bool_t force=kFALSE);
169 TObjArray* GetParamArrayPol1(Int_t sector, Bool_t force=kFALSE);
170 TObjArray* GetParamArrayPol2(Int_t sector, Bool_t force=kFALSE);
171
172 void ResetEvent();
173 void ResetPad();
174 void ProcessPad();
175 void EndEvent();
176
177
178 //debug
179 TVectorF* GetPadInfoEvent(Int_t sector, TObjArray *arr, Bool_t force=kFALSE);
180 TVectorF* GetPadQEvent(Int_t sector, Bool_t force=kFALSE);
181 TVectorF* GetPadRMSEvent(Int_t sector, Bool_t force=kFALSE);
182 TVectorF* GetPadPedestalEvent(Int_t sector, Bool_t force=kFALSE);
183
184
185public:
186
187
188 ClassDef(AliTPCCalibCE,1)
189};
190
191
192
193#endif
194