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 TPC Monitor
16 // 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 /////////////////////////////////////////////////////////////////////////
41 #include "TApplication.h"
43 #include "TPaveText.h"
44 #include "TGButtonGroup.h"
46 #include "TGTextBuffer.h"
47 #include "TGTextEntry.h"
50 #include "AliTPCMonitorMappingHandler.h"
51 #include "AliTPCMonitorDateFile.h"
52 #include "AliTPCMonitorDateFormat.h"
53 #include "AliTPCMonitorAltro.h"
54 #include "AliTPCMonitorFFT.h"
55 #include "AliTPCMonitorConfig.h"
56 #include "AliSignalProcesor.h"
57 #include "AliRawReaderRoot.h"
58 #include "AliRawReader.h"
62 #include "TDirectory.h"
64 #include "RQ_OBJECT.h"
66 class AliTPCMonitorDateMonitor;
70 class AliTPCMonitor : public AliTPCMonitorConfig {
74 AliTPCMonitor(char* name, char* title);
75 virtual ~AliTPCMonitor();
77 // stats for size of arrays and histograms /////////////////////////////////////////////////
78 Int_t** fPad; // array to store channel adc in time
79 Float_t* fPadMapHw; // array to store mapping of hardware address and channel number
80 Int_t** fPadMapRCU; // store multiple information for hardware address for debugging purpose (read out errors occur)
83 // histograms to be used ////////////////////////////////////////////////////////////////
84 TH2F* fHistIROC; // histo for max adc IROC
85 TH2F* fHistOROC; // histo for max adc OROC
86 TH2S* fHistIROCIndex; // histo for channel number in each bin IROC
87 TH2S* fHistOROCIndex; // histo for channel number in each bin OROC
88 TH2F* fHistIROCTime; // histo for peaking time in each bin IROC
89 TH2F* fHistOROCTime; // histo for peaking time in each bin OROC
90 TH2F* fHistIROCClone; // clone histo for max adc IROC (backup when selecting component)
91 TH2F* fHistOROCClone; // clone histo for max adc OROC (backup when selecting component)
92 TH2F* fHistIROCRMS; // histo for RMS IROC
93 TH2F* fHistOROCRMS; // histo for RMS OROC
94 TH2F* fHistIROCBASE; // histo for baseline IROC
95 TH2F* fHistOROCBASE; // histo for baseline OROC
96 TH2F* fHistIROCSUM; // histo for adc sum IROC
97 TH2F* fHistOROCSUM; // histo for adc sum OROC
99 TH2F* fHistChannelTime; // histo for adc(channel,time)
100 TH1F* fHistAddrMapIndex; // histo for channel(hardware address)
101 TH1F* fHistAddrMaxAdc; // histo for max-adc(hardware address)
102 TH1F* fHistAddrBaseMean; // histo for baseline(hardware address)
103 TH1F* fHistAddrMaxAdcX; // histo for max-adc-xposition(hardware address)
104 TH1F* fHistAddrAdcSum; // histo for adc-sum(hardware address)
105 TH1F* fHistAddrBaseRms; // histo for baselinr-rms(hardware address)
107 TH1F* fHistDistrSumIROC; // distribution of adc sum for all channels IROC
108 TH1F* fHistDistrMaxIROC; // distribution of adc max for all channels OROC
109 TH1F* fHistDistrSumOROC; // distribution of adc sum for all channels OROC
110 TH1F* fHistDistrMaxOROC; // distribution of adc max for all channels OROC
112 TH2F* fHistDistrBase2dIROC; // distribution of baseline vs rms for all channels IROC
113 TH2F* fHistDistrBase2dOROC; // distribution of baseline vs rms for all channels OROC
114 TH1D* fHistDistrBaseRmsIROC; // projection of fHistDistrBase2dIROC on Rms
115 TH1D* fHistDistrBaseMeanIROC; // projection of fHistDistrBase2dIROC on Mean
116 TH1D* fHistDistrBaseRmsOROC; // projection of fHistDistrBase2dOROC on Rms
117 TH1D* fHistDistrBaseMeanOROC; // projection of fHistDistrBase2dOROC on Mean
119 TH2S* fHistGlobalMaxA; // global histogramm for max adc of all sectors Side A
120 TH2S* fHistGlobalMaxC; // global histogramm for max adc of all sectors Side C
122 TObjArray* fHistList; // array to store all histogram
125 // row and pad settings
126 Int_t kNRowsIroc; // number of rows in IROC
127 Int_t kNRowsOroc; // number of rows in OROC
129 Int_t kNPadsIroc; // number of pads in IROC
130 Int_t kNPadsOroc; // number of pads in OROC
132 Int_t kNPadMinIroc; // min for pad (y-axis) representation in 2D histogram IROC
133 Int_t kNPadMinOroc; // min for pad (y-axis) representation in 2D histogram OROC
134 Int_t kNPadMaxIroc; // max for pad (y-axis) representation in 2D histogram IROC
135 Int_t kNPadMaxOroc; // max for pad (y-axis) representation in 2D histogram IROC
137 Int_t fVerb; // verbose flag
139 Int_t fLastEv; // flag for last event
141 Int_t fEventNumber; // current event number (ID)
142 Int_t fEventNumberOld; // previous event number
144 Int_t fDisableFit; // flag to disable fit of maximum peak
146 Int_t fExecGlob; // flag to add Executable to global histo
147 Int_t fExecPlaneMax; // flag to add executable for plane view ( max iroc/oroc)
148 Int_t fExecPadIrocRms; // flag to add executable for rms plane view IROC
149 Int_t fExecPadOrocRms; // flag to add executable for rms plane view OROC
151 Int_t fRunId; // current run id
152 Int_t fEqId; // currend equipment id
154 Int_t fPadUsedRoc; // last ROC canvas the mouse pointed at
155 Int_t fPadUsedHwAddr; // hwaddress for last pad the mouse pointed at
157 Int_t fGdcId; // current GDC id
158 Int_t fLdcId; // current LDC id
159 Int_t fLdcIdOld; // previous LDC id
161 Int_t** fMapEqidsSec; // mapping rcu-patch(equipmentid)
162 Int_t* fMapEqidsRcu; // mapping equipmentid(sector,rcu-patch)
164 Int_t fMirror; // mirror x position on C-side
165 Int_t fChannelIter; // counter for channels read
168 AliTPCMonitorMappingHandler* fMapHand; // mapping handler
170 AliRawReaderRoot* fReaderROOT; // reader for ROOT format
171 AliTPCMonitorDateFile* fReaderDATE; // reader for DATE files
173 AliTPCMonitorDateMonitor* fReaderDATEMon; // reader for DATE monitoring
176 Int_t CheckEqId(Int_t secid, Int_t eqid);
177 TCanvas* CreateCanvas(char* name);
181 void DisableFit(Int_t val) { fDisableFit =val; }
182 void DrawHists(Int_t histos);
184 void DumpHeader(AliRawReaderRoot* reader );
185 void DumpHeader(AliTPCMonitorDateFormat* DateForm);
190 void ExecTransform();
192 void FillGlobal(Int_t sector);
193 void FillHistsDecode( AliTPCMonitorAltro* altro , Int_t rcu_patch, Int_t id=0);
194 void FillHistsPadPlane();
196 static double Gamma4(double* x, double* par);
197 Int_t GetChannelsProc() { return fChannelIter ;}
198 Int_t GetEventID() { return fEventNumber ;}
199 TH1* GetHisto(char* histname);
200 Int_t GetRCUPatch(Int_t runid, Int_t eqid);
202 Int_t GetPadAtX(Float_t xval, Int_t row, Int_t padmax);
203 Int_t GetPadAtX(Float_t xval, Int_t row);
204 void GetXY( double& xval , double& yval , Int_t rowmax, Int_t row , Int_t pad);
206 Int_t IsLastEvent() { return fLastEv ;}
208 Int_t ProcessEvent();
210 void SetEventID(Int_t val) { fEventNumber =val;}
211 void SetMirror(Int_t val) { fMirror=val;}
212 void SetVerbose(Int_t val) { fVerb = val;}
213 void SetMappingHandler(AliTPCMonitorMappingHandler* val ) { fMapHand = val;}
214 void ShowSel(Int_t* comp_val);
220 Int_t ReadData( Int_t secid);
222 Int_t ReadDataDATEFile(Int_t secid);
223 Int_t ReadDataDATEStream(Int_t secid);
224 Int_t ReadDataDATESubEventLoop(AliTPCMonitorDateFormat* DateForm, Int_t secid);
225 Int_t ReadDataROOT(Int_t secid );
228 void Write10bitChannel();
237 ClassDef(AliTPCMonitor,1);