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=
20 //// Jens Wiechula, Uni Tuebingen (Jens.Wiechula@cern.ch)
22 /////////////////////////////////////////////////////////////////////////
24 #include "AliTPCMonitorConfig.h"
34 class AliTPCMonitorMappingHandler;
35 class AliTPCMonitorFFT;
36 class AliTPCMonitorConfig;
38 class AliAltroRawStreamV3;
40 class AliTPCMonitor : public AliTPCMonitorConfig {
44 AliTPCMonitor(const char* name, const char* title);
45 AliTPCMonitor(const AliTPCMonitor &monitor);
46 AliTPCMonitor& operator= (const AliTPCMonitor& monitor);
48 virtual ~AliTPCMonitor();
50 Int_t CheckEqId(Int_t secid, Int_t eqid);
51 TCanvas* CreateCanvas(const char* name);
55 void DisableFit(Int_t val) { fDisableFit =val; }
56 void DrawHists(Int_t histos);
58 void DumpHeader(AliRawReader* reader ) const ;
65 void FillGlobal(Int_t sector);
66 void FillHistsPadPlane();
68 static double Gamma4(const double* x, const double* par);
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;
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 ;
78 Int_t IsLastEvent() const { return fLastEv ;}
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;}
86 void ShowSel(const Int_t* compval);
92 Int_t ReadDataNew( Int_t secid);
95 void Write10bitChannel();
97 void SetupMonitoringTable(const char* table);
101 // stats for size of arrays and histograms /////////////////////////////////////////////////
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)
107 // histograms to be used ////////////////////////////////////////////////////////////////
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
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)
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
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
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
146 TObjArray* fHistList; // array to store all histogram
149 // row and pad settings
150 Int_t fkNRowsIroc; // number of rows in IROC
151 Int_t fkNRowsOroc; // number of rows in OROC
153 Int_t fkNPadsIroc; // number of pads in IROC
154 Int_t fkNPadsOroc; // number of pads in OROC
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
161 Int_t fVerb; // verbose flag
163 Int_t fLastEv; // flag for last event
165 Int_t fEventNumber; // current event number (ID)
166 Int_t fEventNumberOld; // previous event number
168 Int_t fDisableFit; // flag to disable fit of maximum peak
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
175 Int_t fRunId; // current run id
176 Int_t fEqId; // currend equipment id
178 Int_t fPadUsedRoc; // last ROC canvas the mouse pointed at
179 Int_t fPadUsedHwAddr; // hwaddress for last pad the mouse pointed at
181 Int_t fGdcId; // current GDC id
182 Int_t fLdcId; // current LDC id
183 Int_t fLdcIdOld; // previous LDC id
185 Int_t** fMapEqidsSec; // mapping rcu-patch(equipmentid)
186 Int_t* fMapEqidsRcu; // mapping equipmentid(sector,rcu-patch)
188 Int_t fMirror; // mirror x position on C-side
189 Int_t fChannelIter; // counter for channels read
192 AliTPCMonitorMappingHandler* fMapHand; // mapping handler
194 AliRawReader* fRawReader; // reader for ROOT format
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.
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
210 ClassDef(AliTPCMonitor,1);