TPC module
[u/mrichter/AliRoot.git] / TPC / TPCmon / AliTPCMonitor.h
CommitLineData
48265b32 1
2#ifndef ALITPCMONITOR_H
3#define ALITPCMONITOR_H
4
5/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6 * See cxx source for full Copyright notice */
7
8/* $Id$ */
9
10
11////////////////////////////////////////////////////////////////////////
fb3305d1 12////
13//// AliTPCMonitor class
14////
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
18////
37a4e693 19//// Author: Stefan Kniege, IKF, Frankfurt=
20//// Jens Wiechula, Uni Tuebingen (Jens.Wiechula@cern.ch)
fb3305d1 21////
48265b32 22/////////////////////////////////////////////////////////////////////////
23
48265b32 24#include "AliTPCMonitorConfig.h"
37a4e693 25#include "TString.h"
48265b32 26
ca7b8371 27class TH1F;
28class TH1D;
29class TH1;
30class TH2F;
31class TH2S;
32class TCanvas;
33class TH3S;
34class AliTPCMonitorMappingHandler;
ca7b8371 35class AliTPCMonitorFFT;
36class AliTPCMonitorConfig;
ca7b8371 37class AliRawReader;
5312f439 38class AliAltroRawStreamV3;
48265b32 39
40class AliTPCMonitor : public AliTPCMonitorConfig {
5312f439 41
42public:
43
37a4e693 44 AliTPCMonitor(const char* name, const char* title);
5312f439 45 AliTPCMonitor(const AliTPCMonitor &monitor);
46 AliTPCMonitor& operator= (const AliTPCMonitor& monitor);
47
48 virtual ~AliTPCMonitor();
49
50 Int_t CheckEqId(Int_t secid, Int_t eqid);
51 TCanvas* CreateCanvas(const char* name);
52 void CreateHistos();
53
54 void DeleteHistos();
55 void DisableFit(Int_t val) { fDisableFit =val; }
56 void DrawHists(Int_t histos);
57 void DrawRMSMap();
58 void DumpHeader(AliRawReader* reader ) const ;
59
60 void ExecPad() ;
61 void ExecRow() ;
62 Int_t ExecProcess();
63 void ExecTransform();
64
65 void FillGlobal(Int_t sector);
66 void FillHistsPadPlane();
67
37a4e693 68 static double Gamma4(const double* x, const double* par);
5312f439 69 Int_t GetChannelsProc() const { return fChannelIter ;}
70 Int_t GetEventID() const { return fEventNumber ;}
71 TH1* GetHisto(char* histname);
72 Int_t GetRCUPatch(Int_t runid, Int_t eqid) const;
73
74 Int_t GetPadAtX(Float_t xval, Int_t row, Int_t padmax) const ;
75 Int_t GetPadAtX(Float_t xval, Int_t row) const ;
76 void GetXY( Double_t& xval , Double_t& yval , Int_t padmax, Int_t row , Int_t pad) const ;
77
78 Int_t IsLastEvent() const { return fLastEv ;}
79
80 Int_t ProcessEvent();
81
82 void SetEventID(Int_t val) { fEventNumber =val;}
83 void SetMirror(Int_t val) { fMirror=val;}
84 void SetVerbose(Int_t val) { fVerb = val;}
85 void SetMappingHandler(AliTPCMonitorMappingHandler* val ) { fMapHand = val;}
37a4e693 86 void ShowSel(const Int_t* compval);
5312f439 87 void SetEqIds();
88
89 void ResizeCanv();
90 void ResetHistos();
91 void ResetArrays();
92 Int_t ReadDataNew( Int_t secid);
48265b32 93
5312f439 94 void WriteHistos() ;
95 void Write10bitChannel();
37a4e693 96
97 void SetupMonitoringTable(const char* table);
5312f439 98
37a4e693 99 private:
5312f439 100
48265b32 101 // stats for size of arrays and histograms /////////////////////////////////////////////////
5312f439 102 Int_t** fPad; // array to store channel adc in time
103 Float_t* fPadMapHw; // array to store mapping of hardware address and channel number
104 Int_t** fPadMapRCU; // store multiple information for hardware address for debugging purpose (read out errors occur)
105
106
48265b32 107 // histograms to be used ////////////////////////////////////////////////////////////////
5312f439 108 TH2F* fHistIROC; // histo for max adc IROC
109 TH2F* fHistOROC; // histo for max adc OROC
110 TH2S* fHistIROCIndex; // histo for channel number in each bin IROC
111 TH2S* fHistOROCIndex; // histo for channel number in each bin OROC
112 TH2F* fHistIROCTime; // histo for peaking time in each bin IROC
113 TH2F* fHistOROCTime; // histo for peaking time in each bin OROC
114 TH2F* fHistIROCClone; // clone histo for max adc IROC (backup when selecting component)
115 TH2F* fHistOROCClone; // clone histo for max adc OROC (backup when selecting component)
116 TH2F* fHistIROCRMS; // histo for RMS IROC
117 TH2F* fHistOROCRMS; // histo for RMS OROC
118 TH2F* fHistIROCBASE; // histo for baseline IROC
119 TH2F* fHistOROCBASE; // histo for baseline OROC
120 TH2F* fHistIROCSUM; // histo for adc sum IROC
121 TH2F* fHistOROCSUM; // histo for adc sum OROC
122
123 TH2F* fHistChannelTime; // histo for adc(channel,time)
124 TH1F* fHistAddrMapIndex; // histo for channel(hardware address)
125 TH1F* fHistAddrMaxAdc; // histo for max-adc(hardware address)
126 TH1F* fHistAddrBaseMean; // histo for baseline(hardware address)
127 TH1F* fHistAddrMaxAdcX; // histo for max-adc-xposition(hardware address)
128 TH1F* fHistAddrAdcSum; // histo for adc-sum(hardware address)
129 TH1F* fHistAddrBaseRms; // histo for baselinr-rms(hardware address)
130
131 TH1F* fHistDistrSumIROC; // distribution of adc sum for all channels IROC
132 TH1F* fHistDistrMaxIROC; // distribution of adc max for all channels OROC
133 TH1F* fHistDistrSumOROC; // distribution of adc sum for all channels OROC
134 TH1F* fHistDistrMaxOROC; // distribution of adc max for all channels OROC
135
136 TH2F* fHistDistrBase2dIROC; // distribution of baseline vs rms for all channels IROC
137 TH2F* fHistDistrBase2dOROC; // distribution of baseline vs rms for all channels OROC
138 TH1D* fHistDistrBaseRmsIROC; // projection of fHistDistrBase2dIROC on Rms
139 TH1D* fHistDistrBaseMeanIROC; // projection of fHistDistrBase2dIROC on Mean
140 TH1D* fHistDistrBaseRmsOROC; // projection of fHistDistrBase2dOROC on Rms
141 TH1D* fHistDistrBaseMeanOROC; // projection of fHistDistrBase2dOROC on Mean
142
143 TH2S* fHistGlobalMaxA; // global histogramm for max adc of all sectors Side A
144 TH2S* fHistGlobalMaxC; // global histogramm for max adc of all sectors Side C
145
146 TObjArray* fHistList; // array to store all histogram
147
148
149 // row and pad settings
150 Int_t fkNRowsIroc; // number of rows in IROC
151 Int_t fkNRowsOroc; // number of rows in OROC
152
153 Int_t fkNPadsIroc; // number of pads in IROC
154 Int_t fkNPadsOroc; // number of pads in OROC
155
156 Int_t fkNPadMinIroc; // min for pad (y-axis) representation in 2D histogram IROC
157 Int_t fkNPadMinOroc; // min for pad (y-axis) representation in 2D histogram OROC
158 Int_t fkNPadMaxIroc; // max for pad (y-axis) representation in 2D histogram IROC
159 Int_t fkNPadMaxOroc; // max for pad (y-axis) representation in 2D histogram IROC
160
161 Int_t fVerb; // verbose flag
162
163 Int_t fLastEv; // flag for last event
164
165 Int_t fEventNumber; // current event number (ID)
166 Int_t fEventNumberOld; // previous event number
167
168 Int_t fDisableFit; // flag to disable fit of maximum peak
169
170 Int_t fExecGlob; // flag to add Executable to global histo
171 Int_t fExecPlaneMax; // flag to add executable for plane view ( max iroc/oroc)
172 Int_t fExecPadIrocRms; // flag to add executable for rms plane view IROC
173 Int_t fExecPadOrocRms; // flag to add executable for rms plane view OROC
174
175 Int_t fRunId; // current run id
176 Int_t fEqId; // currend equipment id
177
178 Int_t fPadUsedRoc; // last ROC canvas the mouse pointed at
179 Int_t fPadUsedHwAddr; // hwaddress for last pad the mouse pointed at
180
181 Int_t fGdcId; // current GDC id
182 Int_t fLdcId; // current LDC id
183 Int_t fLdcIdOld; // previous LDC id
184
185 Int_t** fMapEqidsSec; // mapping rcu-patch(equipmentid)
186 Int_t* fMapEqidsRcu; // mapping equipmentid(sector,rcu-patch)
187
188 Int_t fMirror; // mirror x position on C-side
189 Int_t fChannelIter; // counter for channels read
190
191
192 AliTPCMonitorMappingHandler* fMapHand; // mapping handler
193
194 AliRawReader* fRawReader; // reader for ROOT format
195
37a4e693 196 //for monitoring table
197 const Char_t **fkMonTable; //! table to pass to the raw reader
198 TString fMonTableString; //! string that keep the table definition
199 TObjArray *fMonTableArray; //! tokenized array of the table string
200 Bool_t fMonTableChanged; //! indicates that the table changed and a new raw reader instance is needed.
5312f439 201
202 static const Int_t fgkHwMaskFEC ; // mask for fec in hardware address
203 static const Int_t fgkHwMaskBranch ; // mask for branch in hardware address
204 static const Int_t fgkHwMaskFECChannel ; // mask for fec channel in hardware address
205 static const Int_t fgkHwMaskAltroChannel ; // mask for altro channel in hardware address
206 static const Int_t fgkHwMaskAltroChip ; // mask for altro chip in hardware address
207 static const Int_t fgkHwMaskRCU ; // not part of the trailer added afterwards
208
209
210 ClassDef(AliTPCMonitor,1);
48265b32 211};
212
213#endif