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 AliTPCMonitorFFT;
35 class AliTPCMonitorConfig;
37 class AliAltroRawStreamV3;
39 class AliTPCMonitor : public AliTPCMonitorConfig {
43 AliTPCMonitor(char* name, char* title);
44 AliTPCMonitor(const AliTPCMonitor &monitor);
45 AliTPCMonitor& operator= (const AliTPCMonitor& monitor);
47 virtual ~AliTPCMonitor();
49 Int_t CheckEqId(Int_t secid, Int_t eqid);
50 TCanvas* CreateCanvas(const char* name);
54 void DisableFit(Int_t val) { fDisableFit =val; }
55 void DrawHists(Int_t histos);
57 void DumpHeader(AliRawReader* reader ) const ;
64 void FillGlobal(Int_t sector);
65 void FillHistsPadPlane();
67 static double Gamma4(double* x, double* par);
68 Int_t GetChannelsProc() const { return fChannelIter ;}
69 Int_t GetEventID() const { return fEventNumber ;}
70 TH1* GetHisto(char* histname);
71 Int_t GetRCUPatch(Int_t runid, Int_t eqid) const;
73 Int_t GetPadAtX(Float_t xval, Int_t row, Int_t padmax) const ;
74 Int_t GetPadAtX(Float_t xval, Int_t row) const ;
75 void GetXY( Double_t& xval , Double_t& yval , Int_t padmax, Int_t row , Int_t pad) const ;
77 Int_t IsLastEvent() const { return fLastEv ;}
81 void SetEventID(Int_t val) { fEventNumber =val;}
82 void SetMirror(Int_t val) { fMirror=val;}
83 void SetVerbose(Int_t val) { fVerb = val;}
84 void SetMappingHandler(AliTPCMonitorMappingHandler* val ) { fMapHand = val;}
85 void ShowSel(Int_t* compval);
91 Int_t ReadDataNew( Int_t secid);
94 void Write10bitChannel();
99 // stats for size of arrays and histograms /////////////////////////////////////////////////
100 Int_t** fPad; // array to store channel adc in time
101 Float_t* fPadMapHw; // array to store mapping of hardware address and channel number
102 Int_t** fPadMapRCU; // store multiple information for hardware address for debugging purpose (read out errors occur)
105 // histograms to be used ////////////////////////////////////////////////////////////////
106 TH2F* fHistIROC; // histo for max adc IROC
107 TH2F* fHistOROC; // histo for max adc OROC
108 TH2S* fHistIROCIndex; // histo for channel number in each bin IROC
109 TH2S* fHistOROCIndex; // histo for channel number in each bin OROC
110 TH2F* fHistIROCTime; // histo for peaking time in each bin IROC
111 TH2F* fHistOROCTime; // histo for peaking time in each bin OROC
112 TH2F* fHistIROCClone; // clone histo for max adc IROC (backup when selecting component)
113 TH2F* fHistOROCClone; // clone histo for max adc OROC (backup when selecting component)
114 TH2F* fHistIROCRMS; // histo for RMS IROC
115 TH2F* fHistOROCRMS; // histo for RMS OROC
116 TH2F* fHistIROCBASE; // histo for baseline IROC
117 TH2F* fHistOROCBASE; // histo for baseline OROC
118 TH2F* fHistIROCSUM; // histo for adc sum IROC
119 TH2F* fHistOROCSUM; // histo for adc sum OROC
121 TH2F* fHistChannelTime; // histo for adc(channel,time)
122 TH1F* fHistAddrMapIndex; // histo for channel(hardware address)
123 TH1F* fHistAddrMaxAdc; // histo for max-adc(hardware address)
124 TH1F* fHistAddrBaseMean; // histo for baseline(hardware address)
125 TH1F* fHistAddrMaxAdcX; // histo for max-adc-xposition(hardware address)
126 TH1F* fHistAddrAdcSum; // histo for adc-sum(hardware address)
127 TH1F* fHistAddrBaseRms; // histo for baselinr-rms(hardware address)
129 TH1F* fHistDistrSumIROC; // distribution of adc sum for all channels IROC
130 TH1F* fHistDistrMaxIROC; // distribution of adc max for all channels OROC
131 TH1F* fHistDistrSumOROC; // distribution of adc sum for all channels OROC
132 TH1F* fHistDistrMaxOROC; // distribution of adc max for all channels OROC
134 TH2F* fHistDistrBase2dIROC; // distribution of baseline vs rms for all channels IROC
135 TH2F* fHistDistrBase2dOROC; // distribution of baseline vs rms for all channels OROC
136 TH1D* fHistDistrBaseRmsIROC; // projection of fHistDistrBase2dIROC on Rms
137 TH1D* fHistDistrBaseMeanIROC; // projection of fHistDistrBase2dIROC on Mean
138 TH1D* fHistDistrBaseRmsOROC; // projection of fHistDistrBase2dOROC on Rms
139 TH1D* fHistDistrBaseMeanOROC; // projection of fHistDistrBase2dOROC on Mean
141 TH2S* fHistGlobalMaxA; // global histogramm for max adc of all sectors Side A
142 TH2S* fHistGlobalMaxC; // global histogramm for max adc of all sectors Side C
144 TObjArray* fHistList; // array to store all histogram
147 // row and pad settings
148 Int_t fkNRowsIroc; // number of rows in IROC
149 Int_t fkNRowsOroc; // number of rows in OROC
151 Int_t fkNPadsIroc; // number of pads in IROC
152 Int_t fkNPadsOroc; // number of pads in OROC
154 Int_t fkNPadMinIroc; // min for pad (y-axis) representation in 2D histogram IROC
155 Int_t fkNPadMinOroc; // min for pad (y-axis) representation in 2D histogram OROC
156 Int_t fkNPadMaxIroc; // max for pad (y-axis) representation in 2D histogram IROC
157 Int_t fkNPadMaxOroc; // max for pad (y-axis) representation in 2D histogram IROC
159 Int_t fVerb; // verbose flag
161 Int_t fLastEv; // flag for last event
163 Int_t fEventNumber; // current event number (ID)
164 Int_t fEventNumberOld; // previous event number
166 Int_t fDisableFit; // flag to disable fit of maximum peak
168 Int_t fExecGlob; // flag to add Executable to global histo
169 Int_t fExecPlaneMax; // flag to add executable for plane view ( max iroc/oroc)
170 Int_t fExecPadIrocRms; // flag to add executable for rms plane view IROC
171 Int_t fExecPadOrocRms; // flag to add executable for rms plane view OROC
173 Int_t fRunId; // current run id
174 Int_t fEqId; // currend equipment id
176 Int_t fPadUsedRoc; // last ROC canvas the mouse pointed at
177 Int_t fPadUsedHwAddr; // hwaddress for last pad the mouse pointed at
179 Int_t fGdcId; // current GDC id
180 Int_t fLdcId; // current LDC id
181 Int_t fLdcIdOld; // previous LDC id
183 Int_t** fMapEqidsSec; // mapping rcu-patch(equipmentid)
184 Int_t* fMapEqidsRcu; // mapping equipmentid(sector,rcu-patch)
186 Int_t fMirror; // mirror x position on C-side
187 Int_t fChannelIter; // counter for channels read
190 AliTPCMonitorMappingHandler* fMapHand; // mapping handler
192 AliRawReader* fRawReader; // reader for ROOT format
196 static const Int_t fgkHwMaskFEC ; // mask for fec in hardware address
197 static const Int_t fgkHwMaskBranch ; // mask for branch in hardware address
198 static const Int_t fgkHwMaskFECChannel ; // mask for fec channel in hardware address
199 static const Int_t fgkHwMaskAltroChannel ; // mask for altro channel in hardware address
200 static const Int_t fgkHwMaskAltroChip ; // mask for altro chip in hardware address
201 static const Int_t fgkHwMaskRCU ; // not part of the trailer added afterwards
204 ClassDef(AliTPCMonitor,1);