2 #ifndef ALITPCMONITOR_H
3 #define ALITPCMONITOR_H
5 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 * See cxx source for full Copyright notice */
11 ////////////////////////////////////////////////////////////////////////
13 //// AliTPCMonitor class
15 //// Main class for the TPC raw data Monitor.
16 //// The Monitor can handle rootified data, files and online streams in DATE format.
17 //// The monitor GUI is started by the macro TPCMonitor.C
19 //// Author: Stefan Kniege, IKF, Frankfurt
22 /////////////////////////////////////////////////////////////////////////
24 #include "AliTPCMonitorConfig.h"
33 class AliTPCMonitorMappingHandler;
34 class AliTPCMonitorDateFile;
35 class AliTPCMonitorDateFormat;
36 class AliTPCMonitorAltro;
37 class AliTPCMonitorFFT;
38 class AliTPCMonitorConfig;
39 class AliRawReaderRoot;
41 class AliTPCMonitorDateMonitor;
44 class AliTPCMonitor : public AliTPCMonitorConfig {
48 AliTPCMonitor(char* name, char* title);
49 AliTPCMonitor(const AliTPCMonitor &monitor);
50 AliTPCMonitor& operator= (const AliTPCMonitor& monitor);
52 virtual ~AliTPCMonitor();
54 Int_t CheckEqId(Int_t secid, Int_t eqid);
55 TCanvas* CreateCanvas(const char* name);
59 void DisableFit(Int_t val) { fDisableFit =val; }
60 void DrawHists(Int_t histos);
62 void DumpHeader(AliRawReaderRoot* reader ) const ;
63 void DumpHeader(AliTPCMonitorDateFormat* DateForm) const ;
70 void FillGlobal(Int_t sector);
71 void FillHistsDecode( AliTPCMonitorAltro* altro , Int_t rcupatch, Int_t secid=0);
72 void FillHistsPadPlane();
74 static double Gamma4(double* x, double* par);
75 Int_t GetChannelsProc() const { return fChannelIter ;}
76 Int_t GetEventID() const { return fEventNumber ;}
77 TH1* GetHisto(char* histname);
78 Int_t GetRCUPatch(Int_t runid, Int_t eqid) const;
80 Int_t GetPadAtX(Float_t xval, Int_t row, Int_t padmax) const ;
81 Int_t GetPadAtX(Float_t xval, Int_t row) const ;
82 void GetXY( Double_t& xval , Double_t& yval , Int_t padmax, Int_t row , Int_t pad) const ;
84 Int_t IsLastEvent() const { return fLastEv ;}
88 void SetEventID(Int_t val) { fEventNumber =val;}
89 void SetMirror(Int_t val) { fMirror=val;}
90 void SetVerbose(Int_t val) { fVerb = val;}
91 void SetMappingHandler(AliTPCMonitorMappingHandler* val ) { fMapHand = val;}
92 void ShowSel(Int_t* compval);
98 Int_t ReadData( Int_t secid);
100 Int_t ReadDataDATEFile(Int_t secid);
101 Int_t ReadDataDATEStream(Int_t secid);
102 Int_t ReadDataDATESubEventLoop(AliTPCMonitorDateFormat* DateForm, Int_t secid);
103 Int_t ReadDataROOT(Int_t secid );
106 void Write10bitChannel();
111 // stats for size of arrays and histograms /////////////////////////////////////////////////
112 Int_t** fPad; // array to store channel adc in time
113 Float_t* fPadMapHw; // array to store mapping of hardware address and channel number
114 Int_t** fPadMapRCU; // store multiple information for hardware address for debugging purpose (read out errors occur)
117 // histograms to be used ////////////////////////////////////////////////////////////////
118 TH2F* fHistIROC; // histo for max adc IROC
119 TH2F* fHistOROC; // histo for max adc OROC
120 TH2S* fHistIROCIndex; // histo for channel number in each bin IROC
121 TH2S* fHistOROCIndex; // histo for channel number in each bin OROC
122 TH2F* fHistIROCTime; // histo for peaking time in each bin IROC
123 TH2F* fHistOROCTime; // histo for peaking time in each bin OROC
124 TH2F* fHistIROCClone; // clone histo for max adc IROC (backup when selecting component)
125 TH2F* fHistOROCClone; // clone histo for max adc OROC (backup when selecting component)
126 TH2F* fHistIROCRMS; // histo for RMS IROC
127 TH2F* fHistOROCRMS; // histo for RMS OROC
128 TH2F* fHistIROCBASE; // histo for baseline IROC
129 TH2F* fHistOROCBASE; // histo for baseline OROC
130 TH2F* fHistIROCSUM; // histo for adc sum IROC
131 TH2F* fHistOROCSUM; // histo for adc sum OROC
133 TH2F* fHistChannelTime; // histo for adc(channel,time)
134 TH1F* fHistAddrMapIndex; // histo for channel(hardware address)
135 TH1F* fHistAddrMaxAdc; // histo for max-adc(hardware address)
136 TH1F* fHistAddrBaseMean; // histo for baseline(hardware address)
137 TH1F* fHistAddrMaxAdcX; // histo for max-adc-xposition(hardware address)
138 TH1F* fHistAddrAdcSum; // histo for adc-sum(hardware address)
139 TH1F* fHistAddrBaseRms; // histo for baselinr-rms(hardware address)
141 TH1F* fHistDistrSumIROC; // distribution of adc sum for all channels IROC
142 TH1F* fHistDistrMaxIROC; // distribution of adc max for all channels OROC
143 TH1F* fHistDistrSumOROC; // distribution of adc sum for all channels OROC
144 TH1F* fHistDistrMaxOROC; // distribution of adc max for all channels OROC
146 TH2F* fHistDistrBase2dIROC; // distribution of baseline vs rms for all channels IROC
147 TH2F* fHistDistrBase2dOROC; // distribution of baseline vs rms for all channels OROC
148 TH1D* fHistDistrBaseRmsIROC; // projection of fHistDistrBase2dIROC on Rms
149 TH1D* fHistDistrBaseMeanIROC; // projection of fHistDistrBase2dIROC on Mean
150 TH1D* fHistDistrBaseRmsOROC; // projection of fHistDistrBase2dOROC on Rms
151 TH1D* fHistDistrBaseMeanOROC; // projection of fHistDistrBase2dOROC on Mean
153 TH2S* fHistGlobalMaxA; // global histogramm for max adc of all sectors Side A
154 TH2S* fHistGlobalMaxC; // global histogramm for max adc of all sectors Side C
156 TObjArray* fHistList; // array to store all histogram
159 // row and pad settings
160 Int_t fkNRowsIroc; // number of rows in IROC
161 Int_t fkNRowsOroc; // number of rows in OROC
163 Int_t fkNPadsIroc; // number of pads in IROC
164 Int_t fkNPadsOroc; // number of pads in OROC
166 Int_t fkNPadMinIroc; // min for pad (y-axis) representation in 2D histogram IROC
167 Int_t fkNPadMinOroc; // min for pad (y-axis) representation in 2D histogram OROC
168 Int_t fkNPadMaxIroc; // max for pad (y-axis) representation in 2D histogram IROC
169 Int_t fkNPadMaxOroc; // max for pad (y-axis) representation in 2D histogram IROC
171 Int_t fVerb; // verbose flag
173 Int_t fLastEv; // flag for last event
175 Int_t fEventNumber; // current event number (ID)
176 Int_t fEventNumberOld; // previous event number
178 Int_t fDisableFit; // flag to disable fit of maximum peak
180 Int_t fExecGlob; // flag to add Executable to global histo
181 Int_t fExecPlaneMax; // flag to add executable for plane view ( max iroc/oroc)
182 Int_t fExecPadIrocRms; // flag to add executable for rms plane view IROC
183 Int_t fExecPadOrocRms; // flag to add executable for rms plane view OROC
185 Int_t fRunId; // current run id
186 Int_t fEqId; // currend equipment id
188 Int_t fPadUsedRoc; // last ROC canvas the mouse pointed at
189 Int_t fPadUsedHwAddr; // hwaddress for last pad the mouse pointed at
191 Int_t fGdcId; // current GDC id
192 Int_t fLdcId; // current LDC id
193 Int_t fLdcIdOld; // previous LDC id
195 Int_t** fMapEqidsSec; // mapping rcu-patch(equipmentid)
196 Int_t* fMapEqidsRcu; // mapping equipmentid(sector,rcu-patch)
198 Int_t fMirror; // mirror x position on C-side
199 Int_t fChannelIter; // counter for channels read
202 AliTPCMonitorMappingHandler* fMapHand; // mapping handler
204 AliRawReaderRoot* fReaderROOT; // reader for ROOT format
205 AliTPCMonitorDateFile* fReaderDATE; // reader for DATE files
207 AliTPCMonitorDateMonitor* fReaderDATEMon; // reader for DATE monitoring
214 ClassDef(AliTPCMonitor,1);