1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 Revision 1.3 2007/10/12 13:36:27 cvetan
19 Coding convention fixes from Stefan
21 Revision 1.2 2007/09/18 09:44:45 cvetan
22 Sorting out some issues concerning the compilation with and without DATE support
24 Revision 1.1 2007/09/17 10:23:31 cvetan
25 New TPC monitoring package from Stefan Kniege. The monitoring package can be started by running TPCMonitor.C macro located in macros folder.
29 ////////////////////////////////////////////////////////////////////////
31 //// AliTPCMonitor class
33 //// Main class for TPC Monitor
34 //// Monitor can handle rootified data, files and online streams in DATE format.
35 //// The monitor GUI is started by the macro TPCMonitor.C
37 //// In the The data are read in in two read cycles.
38 //// If no sector is specified (sectorid==-1) all sectors are read and only the max value
39 //// for each channel is stored in a global histogram for Side A and C.
40 //// In this way the whole TPC can be read in at once.
42 //// If the sector is specified only one sector is read in and additional quantities
43 //// e.g baseline and baseline rms are calculated and stored.
45 //// Author: Stefan Kniege, IKF, Frankfurt
48 /////////////////////////////////////////////////////////////////////////
53 #include "AliTPCMonitor.h"
54 #include "AliTPCMonitorMappingHandler.h"
55 #include "AliTPCMonitorFFT.h"
56 #include "AliRawReader.h"
57 #include "AliRawReaderRoot.h"
58 #include "AliRawEventHeaderBase.h"
59 #include "AliAltroRawStreamV3.h"
67 #include "TDirectory.h"
70 #include "TPaveText.h"
72 #include <Riostream.h>
74 ClassImp(AliTPCMonitor)
76 const Int_t AliTPCMonitor::fgkHwMaskFEC = 0x0780;
77 const Int_t AliTPCMonitor::fgkHwMaskBranch = 0x0800;
78 const Int_t AliTPCMonitor::fgkHwMaskFECChannel = 0x007f;
79 const Int_t AliTPCMonitor::fgkHwMaskAltroChannel = 0x000f;
80 const Int_t AliTPCMonitor::fgkHwMaskAltroChip = 0x0070;
81 const Int_t AliTPCMonitor::fgkHwMaskRCU = 0x7000;
83 //____________________________________________________________________________
84 AliTPCMonitor::AliTPCMonitor(char* name, char* title) :
85 AliTPCMonitorConfig(name,title),
86 fPad(new Int_t*[GetMaxHwAddr()]),
87 fPadMapHw(new Float_t[GetMaxHwAddr()]),
88 fPadMapRCU(new Int_t*[GetMaxHwAddr()]),
104 fHistAddrMapIndex(0),
106 fHistAddrBaseMean(0),
110 fHistDistrSumIROC(0),
111 fHistDistrMaxIROC(0),
112 fHistDistrSumOROC(0),
113 fHistDistrMaxOROC(0),
114 fHistDistrBase2dIROC(0),
115 fHistDistrBase2dOROC(0),
116 fHistDistrBaseRmsIROC(0),
117 fHistDistrBaseMeanIROC(0),
118 fHistDistrBaseRmsOROC(0),
119 fHistDistrBaseMeanOROC(0),
122 fHistList(new TObjArray()),
149 fMapEqidsSec(new Int_t*[36]),
150 fMapEqidsRcu(new Int_t[1000]),
158 for(Int_t i = 0; i<GetMaxHwAddr(); i++) { fPad[i] = new Int_t[GetTimeBins()];}
159 for(Int_t i = 0; i<GetMaxHwAddr(); i++) { fPadMapRCU[i] = new Int_t[6];}
160 for(Int_t i = 0; i<36; i++) { fMapEqidsSec[i] = new Int_t[6];}
164 if (!gDirectory->GetList())
166 Warning("Build","Current directory is not a valid directory");
169 AliTPCMonitor *hold = (AliTPCMonitor*)gDirectory->GetList()->FindObject(GetName());
172 Warning("Build","Replacing existing histogram: %s (Potential memory leak).",GetName());
173 gDirectory->GetList()->Remove(hold);
175 gDirectory->Append(this);
182 //____________________________________________________________________________
183 AliTPCMonitor::AliTPCMonitor(const AliTPCMonitor &monitor):
184 AliTPCMonitorConfig(monitor.GetName(),monitor.GetTitle()),
185 fPad(new Int_t*[GetMaxHwAddr()]),
186 fPadMapHw(new Float_t[GetMaxHwAddr()]),
187 fPadMapRCU(new Int_t*[GetMaxHwAddr()]),
203 fHistAddrMapIndex(0),
205 fHistAddrBaseMean(0),
209 fHistDistrSumIROC(0),
210 fHistDistrMaxIROC(0),
211 fHistDistrSumOROC(0),
212 fHistDistrMaxOROC(0),
213 fHistDistrBase2dIROC(0),
214 fHistDistrBase2dOROC(0),
215 fHistDistrBaseRmsIROC(0),
216 fHistDistrBaseMeanIROC(0),
217 fHistDistrBaseRmsOROC(0),
218 fHistDistrBaseMeanOROC(0),
221 fHistList(new TObjArray()),
222 fkNRowsIroc(monitor.fkNRowsIroc),
223 fkNRowsOroc(monitor.fkNRowsOroc),
224 fkNPadsIroc(monitor.fkNPadsIroc),
225 fkNPadsOroc(monitor.fkNPadsOroc),
226 fkNPadMinIroc(monitor.fkNPadMinIroc),
227 fkNPadMinOroc(monitor.fkNPadMinOroc),
228 fkNPadMaxIroc(monitor.fkNPadMaxIroc),
229 fkNPadMaxOroc(monitor.fkNPadMaxOroc),
230 fVerb(monitor.fVerb),
231 fLastEv(monitor.fLastEv),
232 fEventNumber(monitor.fEventNumber),
233 fEventNumberOld(monitor.fEventNumberOld),
234 fDisableFit(monitor.fDisableFit),
235 fExecGlob(monitor.fExecGlob),
236 fExecPlaneMax(monitor.fExecPlaneMax),
237 fExecPadIrocRms(monitor.fExecPadIrocRms),
238 fExecPadOrocRms(monitor.fExecPadOrocRms),
239 fRunId(monitor.fRunId),
240 fEqId(monitor.fEqId),
241 fPadUsedRoc(monitor.fPadUsedRoc),
242 fPadUsedHwAddr(monitor.fPadUsedHwAddr),
243 fGdcId(monitor.fGdcId),
244 fLdcId(monitor.fLdcId),
245 fLdcIdOld(monitor.fLdcIdOld),
246 fMapEqidsSec(new Int_t*[36]),
247 fMapEqidsRcu(new Int_t[1000]),
248 fMirror(monitor.fMirror),
249 fChannelIter(monitor.fChannelIter),
250 fMapHand(monitor.fMapHand),
251 fRawReader(monitor.fRawReader)
255 fHistIROC=(TH2F*)monitor.fHistIROC->Clone(); fHistList->Add(fHistIROC);
256 fHistOROC=(TH2F*)monitor.fHistOROC->Clone(); fHistList->Add(fHistOROC);
257 fHistIROCIndex=(TH2S*)monitor.fHistIROCIndex->Clone(); fHistList->Add(fHistIROCIndex);
258 fHistOROCIndex=(TH2S*)monitor.fHistOROCIndex->Clone(); fHistList->Add(fHistOROCIndex);
259 fHistIROCTime=(TH2F*)monitor.fHistIROCTime->Clone(); fHistList->Add(fHistIROCTime);
260 fHistOROCTime=(TH2F*)monitor.fHistOROCTime->Clone(); fHistList->Add(fHistOROCTime);
261 fHistIROCClone=(TH2F*)monitor.fHistIROCClone->Clone(); fHistList->Add(fHistIROCClone);
262 fHistOROCClone=(TH2F*)monitor.fHistOROCClone->Clone(); fHistList->Add(fHistOROCClone);
263 fHistIROCRMS=(TH2F*)monitor.fHistIROCRMS->Clone(); fHistList->Add(fHistIROCRMS);
264 fHistOROCRMS=(TH2F*)monitor.fHistOROCRMS->Clone(); fHistList->Add(fHistOROCRMS);
265 fHistIROCBASE=(TH2F*)monitor.fHistIROCBASE->Clone(); fHistList->Add(fHistIROCBASE);
266 fHistOROCBASE=(TH2F*)monitor.fHistOROCBASE->Clone(); fHistList->Add(fHistOROCBASE);
267 fHistIROCSUM=(TH2F*)monitor.fHistIROCSUM->Clone(); fHistList->Add(fHistIROCSUM);
268 fHistOROCSUM=(TH2F*)monitor.fHistOROCSUM->Clone(); fHistList->Add(fHistOROCSUM);
270 fHistChannelTime=(TH2F*)monitor.fHistChannelTime->Clone(); fHistList->Add(fHistChannelTime);
272 fHistAddrMapIndex=(TH1F*)monitor.fHistAddrMapIndex->Clone(); fHistList->Add(fHistAddrMapIndex);
273 fHistAddrMaxAdc=(TH1F*)monitor.fHistAddrMaxAdc->Clone(); fHistList->Add(fHistAddrMaxAdc);
274 fHistAddrBaseMean=(TH1F*)monitor.fHistAddrBaseMean->Clone(); fHistList->Add(fHistAddrBaseMean);
275 fHistAddrMaxAdcX=(TH1F*)monitor.fHistAddrMaxAdcX->Clone(); fHistList->Add(fHistAddrMaxAdcX);
276 fHistAddrAdcSum=(TH1F*)monitor.fHistAddrAdcSum->Clone(); fHistList->Add(fHistAddrAdcSum);
277 fHistAddrBaseRms=(TH1F*)monitor.fHistAddrBaseRms->Clone(); fHistList->Add(fHistAddrBaseRms);
280 fHistDistrSumIROC=(TH1F*)monitor.fHistDistrSumIROC->Clone(); fHistList->Add(fHistDistrSumIROC);
281 fHistDistrMaxIROC=(TH1F*)monitor.fHistDistrMaxIROC->Clone(); fHistList->Add(fHistDistrMaxIROC);
282 fHistDistrSumOROC=(TH1F*)monitor.fHistDistrSumOROC->Clone(); fHistList->Add(fHistDistrSumOROC);
283 fHistDistrMaxOROC=(TH1F*)monitor.fHistDistrMaxOROC->Clone(); fHistList->Add(fHistDistrMaxOROC);
285 fHistDistrBase2dIROC=(TH2F*)monitor.fHistDistrBase2dIROC->Clone(); fHistList->Add(fHistDistrBase2dIROC);
286 fHistDistrBase2dOROC=(TH2F*)monitor.fHistDistrBase2dOROC->Clone(); fHistList->Add(fHistDistrBase2dOROC);
287 fHistDistrBaseRmsIROC=(TH1D*)monitor.fHistDistrBaseRmsIROC->Clone(); fHistList->Add(fHistDistrBaseRmsIROC);
288 fHistDistrBaseMeanIROC=(TH1D*)monitor.fHistDistrBaseMeanIROC->Clone(); fHistList->Add(fHistDistrBaseMeanIROC);
289 fHistDistrBaseRmsOROC=(TH1D*)monitor.fHistDistrBaseRmsOROC->Clone(); fHistList->Add(fHistDistrBaseRmsOROC);
290 fHistDistrBaseMeanOROC=(TH1D*)monitor.fHistDistrBaseMeanOROC->Clone(); fHistList->Add(fHistDistrBaseMeanOROC);
292 fHistGlobalMaxA=(TH2S*)monitor.fHistGlobalMaxA->Clone(); fHistList->Add(fHistGlobalMaxA);
293 fHistGlobalMaxC=(TH2S*)monitor.fHistGlobalMaxC->Clone(); fHistList->Add(fHistGlobalMaxC);
295 // fPad = new Int_t*[monitor.GetMaxHwAddr()];
296 for(Int_t i = 0; i<GetMaxHwAddr(); i++) { fPad[i] = new Int_t[monitor.GetTimeBins()];}
298 //fPadMapRCU = new Int_t*[monitor.GetMaxHwAddr()];
299 for(Int_t i = 0; i<monitor.GetMaxHwAddr(); i++) { fPadMapRCU[i] = new Int_t[6];}
301 //fPadMapHw = new Float_t[monitor.GetMaxHwAddr()];
303 //fMapEqidsRcu = new Int_t[1000];
304 //fMapEqidsSec = new Int_t*[36];
305 for(Int_t i = 0; i<36; i++) { fMapEqidsSec[i] = new Int_t[6];}
310 if (!gDirectory->GetList())
312 Warning("Build","Current directory is not a valid directory");
317 AliTPCMonitor *hold = (AliTPCMonitor*)gDirectory->GetList()->FindObject(monitor.GetName());
320 Warning("Build","Replacing existing histogram: %s (Potential memory leak).",monitor.GetName());
321 gDirectory->GetList()->Remove(hold);
323 gDirectory->Append(this);
329 //____________________________________________________________________________
331 AliTPCMonitor &AliTPCMonitor:: operator= (const AliTPCMonitor& monitor)
333 // assigment operator
336 ((AliTPCMonitorConfig *)this)->operator=(monitor);
337 fkNRowsIroc=monitor.fkNRowsIroc;
338 fkNRowsOroc=monitor.fkNRowsOroc;
339 fkNPadsIroc=monitor.fkNPadsIroc;
340 fkNPadsOroc=monitor.fkNPadsOroc;
341 fkNPadMinIroc=monitor.fkNPadMinIroc;
342 fkNPadMinOroc=monitor.fkNPadMinOroc;
343 fkNPadMaxIroc=monitor.fkNPadMaxIroc;
344 fkNPadMaxOroc=monitor.fkNPadMaxOroc;
346 fLastEv=monitor.fLastEv;
347 fEventNumber=monitor.fEventNumber;
348 fEventNumberOld=monitor.fEventNumberOld;
349 fDisableFit=monitor.fDisableFit;
350 fExecGlob=monitor.fExecGlob;
351 fExecPlaneMax=monitor.fExecPlaneMax;
352 fExecPadIrocRms=monitor.fExecPadIrocRms;
353 fExecPadOrocRms=monitor.fExecPadOrocRms;
354 fRunId=monitor.fRunId;
356 fPadUsedRoc=monitor.fPadUsedRoc;
357 fPadUsedHwAddr=monitor.fPadUsedHwAddr;
358 fGdcId=monitor.fGdcId;
359 fLdcId=monitor.fLdcId;
360 fLdcIdOld=monitor.fLdcIdOld;
361 fMapHand=monitor.fMapHand;
362 fRawReader=monitor.fRawReader;
365 fHistList = new TObjArray();
366 fHistIROC=(TH2F*)monitor.fHistIROC->Clone(); fHistList->Add(fHistIROC);
367 fHistOROC=(TH2F*)monitor.fHistOROC->Clone(); fHistList->Add(fHistOROC);
368 fHistIROCIndex=(TH2S*)monitor.fHistIROCIndex->Clone(); fHistList->Add(fHistIROCIndex);
369 fHistOROCIndex=(TH2S*)monitor.fHistOROCIndex->Clone(); fHistList->Add(fHistOROCIndex);
370 fHistIROCTime=(TH2F*)monitor.fHistIROCTime->Clone(); fHistList->Add(fHistIROCTime);
371 fHistOROCTime=(TH2F*)monitor.fHistOROCTime->Clone(); fHistList->Add(fHistOROCTime);
372 fHistIROCClone=(TH2F*)monitor.fHistIROCClone->Clone(); fHistList->Add(fHistIROCClone);
373 fHistOROCClone=(TH2F*)monitor.fHistOROCClone->Clone(); fHistList->Add(fHistOROCClone);
374 fHistIROCRMS=(TH2F*)monitor.fHistIROCRMS->Clone(); fHistList->Add(fHistIROCRMS);
375 fHistOROCRMS=(TH2F*)monitor.fHistOROCRMS->Clone(); fHistList->Add(fHistOROCRMS);
376 fHistIROCBASE=(TH2F*)monitor.fHistIROCBASE->Clone(); fHistList->Add(fHistIROCBASE);
377 fHistOROCBASE=(TH2F*)monitor.fHistOROCBASE->Clone(); fHistList->Add(fHistOROCBASE);
378 fHistIROCSUM=(TH2F*)monitor.fHistIROCSUM->Clone(); fHistList->Add(fHistIROCSUM);
379 fHistOROCSUM=(TH2F*)monitor.fHistOROCSUM->Clone(); fHistList->Add(fHistOROCSUM);
381 fHistChannelTime=(TH2F*)monitor.fHistChannelTime->Clone(); fHistList->Add(fHistChannelTime);
383 fHistAddrMapIndex=(TH1F*)monitor.fHistAddrMapIndex->Clone(); fHistList->Add(fHistAddrMapIndex);
384 fHistAddrMaxAdc=(TH1F*)monitor.fHistAddrMaxAdc->Clone(); fHistList->Add(fHistAddrMaxAdc);
385 fHistAddrBaseMean=(TH1F*)monitor.fHistAddrBaseMean->Clone(); fHistList->Add(fHistAddrBaseMean);
386 fHistAddrMaxAdcX=(TH1F*)monitor.fHistAddrMaxAdcX->Clone(); fHistList->Add(fHistAddrMaxAdcX);
387 fHistAddrAdcSum=(TH1F*)monitor.fHistAddrAdcSum->Clone(); fHistList->Add(fHistAddrAdcSum);
388 fHistAddrBaseRms=(TH1F*)monitor.fHistAddrBaseRms->Clone(); fHistList->Add(fHistAddrBaseRms);
391 fHistDistrSumIROC=(TH1F*)monitor.fHistDistrSumIROC->Clone(); fHistList->Add(fHistDistrSumIROC);
392 fHistDistrMaxIROC=(TH1F*)monitor.fHistDistrMaxIROC->Clone(); fHistList->Add(fHistDistrMaxIROC);
393 fHistDistrSumOROC=(TH1F*)monitor.fHistDistrSumOROC->Clone(); fHistList->Add(fHistDistrSumOROC);
394 fHistDistrMaxOROC=(TH1F*)monitor.fHistDistrMaxOROC->Clone(); fHistList->Add(fHistDistrMaxOROC);
396 fHistDistrBase2dIROC=(TH2F*)monitor.fHistDistrBase2dIROC->Clone(); fHistList->Add(fHistDistrBase2dIROC);
397 fHistDistrBase2dOROC=(TH2F*)monitor.fHistDistrBase2dOROC->Clone(); fHistList->Add(fHistDistrBase2dOROC);
398 fHistDistrBaseRmsIROC=(TH1D*)monitor.fHistDistrBaseRmsIROC->Clone(); fHistList->Add(fHistDistrBaseRmsIROC);
399 fHistDistrBaseMeanIROC=(TH1D*)monitor.fHistDistrBaseMeanIROC->Clone(); fHistList->Add(fHistDistrBaseMeanIROC);
400 fHistDistrBaseRmsOROC=(TH1D*)monitor.fHistDistrBaseRmsOROC->Clone(); fHistList->Add(fHistDistrBaseRmsOROC);
401 fHistDistrBaseMeanOROC=(TH1D*)monitor.fHistDistrBaseMeanOROC->Clone(); fHistList->Add(fHistDistrBaseMeanOROC);
403 fHistGlobalMaxA=(TH2S*)monitor.fHistGlobalMaxA->Clone(); fHistList->Add(fHistGlobalMaxA);
404 fHistGlobalMaxC=(TH2S*)monitor.fHistGlobalMaxC->Clone(); fHistList->Add(fHistGlobalMaxC);
406 fPad = new Int_t*[monitor.GetMaxHwAddr()];
407 for(Int_t i = 0; i<GetMaxHwAddr(); i++) { fPad[i] = new Int_t[monitor.GetTimeBins()];}
409 fPadMapRCU = new Int_t*[monitor.GetMaxHwAddr()];
410 for(Int_t i = 0; i<monitor.GetMaxHwAddr(); i++) { fPadMapRCU[i] = new Int_t[6];}
412 fPadMapHw = new Float_t[monitor.GetMaxHwAddr()];
414 fMapEqidsRcu = new Int_t[1000];
415 fMapEqidsSec = new Int_t*[36];
416 for(Int_t i = 0; i<36; i++) { fMapEqidsSec[i] = new Int_t[6];}
421 if (!gDirectory->GetList())
423 Warning("Build","Current directory is not a valid directory");
426 AliTPCMonitor *hold = (AliTPCMonitor*)gDirectory->GetList()->FindObject(monitor.GetName());
429 Warning("Build","Replacing existing histogram: %s (Potential memory leak).",monitor.GetName());
430 gDirectory->GetList()->Remove(hold);
432 gDirectory->Append(this);
439 //____________________________________________________________________________
440 AliTPCMonitor::~AliTPCMonitor()
444 for(Int_t i = 0; i<GetMaxHwAddr(); i++) { delete[] fPad[i] ;}
445 for(Int_t i = 0; i<GetMaxHwAddr(); i++) { delete[] fPadMapRCU[i];}
450 //____________________________________________________________________________
451 void AliTPCMonitor::CreateHistos()
453 // Create histograms to be displayed
455 if(fVerb) cout << " create new ones " << endl;
456 fHistIROC = new TH2F("fHistIROC" ,"fHistIROC" ,fkNRowsIroc,0,fkNRowsIroc,fkNPadsIroc, fkNPadMinIroc, fkNPadMaxIroc); fHistList->Add(fHistIROC);
457 fHistOROC = new TH2F("fHistOROC" ,"fHistOROC" ,fkNRowsOroc,0,fkNRowsOroc,fkNPadsOroc, fkNPadMinOroc, fkNPadMaxOroc); fHistList->Add(fHistOROC);
459 fHistIROCIndex = new TH2S("fHistIROCIndex" ,"fHistIROCIndex" ,fkNRowsIroc,0,fkNRowsIroc,fkNPadsIroc, fkNPadMinIroc, fkNPadMaxIroc); fHistList->Add(fHistIROCIndex);
460 fHistOROCIndex = new TH2S("fHistOROCIndex" ,"fHistOROCIndex" ,fkNRowsOroc,0,fkNRowsOroc,fkNPadsOroc, fkNPadMinOroc, fkNPadMaxOroc); fHistList->Add(fHistOROCIndex);
462 fHistIROCTime = new TH2F("fHistIROCTime" ,"fHistIROCTime" ,fkNRowsIroc,0,fkNRowsIroc,fkNPadsIroc, fkNPadMinIroc, fkNPadMaxIroc); fHistList->Add(fHistIROCTime);
463 fHistOROCTime = new TH2F("fHistOROCTime" ,"fHistOROCTime" ,fkNRowsOroc,0,fkNRowsOroc,fkNPadsOroc, fkNPadMinOroc, fkNPadMaxOroc); fHistList->Add(fHistOROCTime);
465 fHistIROCRMS = new TH2F("fHistIROCRMS" ,"fHistIROCRMS" ,fkNRowsIroc,0,fkNRowsIroc,fkNPadsIroc, fkNPadMinIroc, fkNPadMaxIroc); fHistList->Add(fHistIROCRMS);
466 fHistOROCRMS = new TH2F("fHistOROCRMS" ,"fHistOROCRMS" ,fkNRowsOroc,0,fkNRowsOroc,fkNPadsOroc, fkNPadMinOroc, fkNPadMaxOroc); fHistList->Add(fHistOROCRMS);
468 fHistIROCSUM = new TH2F("fHistIROCSUM" ,"fHistIROCSUM" ,fkNRowsIroc,0,fkNRowsIroc,fkNPadsIroc, fkNPadMinIroc, fkNPadMaxIroc); fHistList->Add(fHistIROCSUM);
469 fHistOROCSUM = new TH2F("fHistOROCSUM" ,"fHistOROCSUM" ,fkNRowsOroc,0,fkNRowsOroc,fkNPadsOroc, fkNPadMinOroc, fkNPadMaxOroc); fHistList->Add(fHistOROCSUM);
471 fHistIROCBASE = new TH2F("fHistIROCBASE" ,"fHistIROCBASE" ,fkNRowsIroc,0,fkNRowsIroc,fkNPadsIroc, fkNPadMinIroc, fkNPadMaxIroc); fHistList->Add(fHistIROCBASE);
472 fHistOROCBASE = new TH2F("fHistOROCBASE" ,"fHistOROCBASE" ,fkNRowsOroc,0,fkNRowsOroc,fkNPadsOroc, fkNPadMinOroc, fkNPadMaxOroc); fHistList->Add(fHistOROCBASE);
475 fHistChannelTime = new TH2F("fHistChannelTime" ,"fHistChannelTime" ,GetNumOfChannels(),0,GetNumOfChannels(),GetTimeBins(),0,GetTimeBins());fHistList->Add(fHistChannelTime);
476 fHistAddrMapIndex = new TH1F("fHistAddrMapIndex" ,"fHistAddrMapIndex" ,GetMaxHwAddr() ,0,GetMaxHwAddr()); fHistList->Add(fHistAddrMapIndex);
477 fHistAddrMaxAdc = new TH1F("fHistAddrMaxAdc" ,"fHistAddrMaxAdc" ,GetMaxHwAddr(),0,GetMaxHwAddr()); fHistList->Add(fHistAddrMaxAdc);
478 fHistAddrMaxAdcX = new TH1F("fHistAddrMaxAdcX" ,"fHistAddrMaxAdcX" ,GetMaxHwAddr(),0,GetMaxHwAddr()); fHistList->Add(fHistAddrMaxAdcX);
479 fHistAddrBaseMean = new TH1F("fHistAddrBaseMean" ,"fHistAddrBaseMean" ,GetMaxHwAddr(),0,GetMaxHwAddr()); fHistList->Add(fHistAddrBaseMean);
480 fHistAddrAdcSum = new TH1F("fHistAddrAdcSum" ,"fHistAddrAdcSum" ,GetMaxHwAddr(),0,GetMaxHwAddr()); fHistList->Add(fHistAddrAdcSum);
481 fHistAddrBaseRms = new TH1F("fHistAddrBaseRms" ,"fHistAddrBaseRms" ,GetMaxHwAddr(),0,GetMaxHwAddr()); fHistList->Add(fHistAddrBaseRms);
482 fHistDistrSumIROC = new TH1F("fHistDistrSumIROC" ,"fHistDistrSumIROC" ,400,0.0,4000.0); fHistList->Add(fHistDistrSumIROC);
483 fHistDistrMaxIROC = new TH1F("fHistDistrMaxIROC" ,"fHistDistrMaxIROC" ,500,0.0,1000.0); fHistList->Add(fHistDistrMaxIROC);
484 fHistDistrSumOROC = new TH1F("fHistDistrSumOROC" ,"fHistDistrSumOROC" ,400,0.0,4000.0); fHistList->Add(fHistDistrSumOROC);
485 fHistDistrMaxOROC = new TH1F("fHistDistrMaxOROC" ,"fHistDistrMaxOROC" ,500,0.0,1000.0); fHistList->Add(fHistDistrMaxOROC);
487 fHistDistrBase2dIROC = new TH2F("fHistDistrBase2dIROC" ,"fHistDistrBase2dIROC",100,0.0,100.0,100,0.0,10.0); fHistList->Add(fHistDistrBase2dIROC);
488 fHistDistrBase2dOROC = new TH2F("fHistDistrBase2dOROC" ,"fHistDistrBase2dOROC",100,0.0,100.0,100,0.0,10.0); fHistList->Add(fHistDistrBase2dOROC);
490 fHistGlobalMaxA = new TH2S("SIDE A" ,"SIDE A" ,500,-3000,3000,500,-3000,3000); fHistList->Add(fHistGlobalMaxA);
491 fHistGlobalMaxC = new TH2S("SIDE C" ,"SIDE C" ,500,-3000,3000,500,-3000,3000); fHistList->Add(fHistGlobalMaxC);
495 //____________________________________________________________________________
496 Int_t AliTPCMonitor::ProcessEvent()
499 // Depending on the value of the sector id all sectors (sectorid == -1) are processed.
501 // In this case only the maximum values are calculated per pad and filled to the global histograms
502 // In a second loop the last processed(displayed) sector will be processed (sectorid!=-1)
503 // again and the baseline rms and further quantities are calculated
505 // If only one sector should be processed SetProcOneSector(1) should be set.
506 // In this case only the specified (last/last displayed) sector will be processed.
508 // If GetProcNextEvent()==0 the same event will be processed again
512 Int_t retflag = 0; // id of last sector + 1000, or error flag
513 if(GetProcNextEvent()==1 && fLastEv) { AliInfo("Last event already processed"); }
514 if(GetProcNextEvent()==1) ResetSectorArray();
517 if(GetProcNextEvent()==0 || GetProcOneSector()==1 ) sectorid = GetLastSector();
521 retflag = ReadDataNew(sectorid);
523 SetLastProcFile(GetFile());
525 if(retflag>=10 && retflag<1000){ AliError("Could not read event properly: Check file name and format or try next event"); return 0 ;}
530 if(sectorid==-1 && retflag >1000)
532 AliInfo("Second read cycle");
534 if(GetLastSectorDisplayed()==-1) {sectorid = GetLastSector() ; }
535 else {sectorid = GetLastSectorDisplayed(); SetLastSector(sectorid) ; }
536 retflag = ReadDataNew(sectorid);
539 SetLastSectorDisplayed(sectorid) ;
540 fMapHand->ReadfecHwMap(GetLastSector());
543 SetEventProcessed(1);
546 //__________________________________________________________________
547 Int_t AliTPCMonitor::ReadDataNew(Int_t secid)
549 // Read Data File/Stream for specified Format.
550 // Payload will be extracted from either ROOT or DATE format
551 // and passed to FillHistsDecode for decoding of the adc information
554 fRawReader = AliRawReader::Create(GetFile());
555 SetLastProcFile(GetFile());
556 } else if (TString(GetLastProcFile())!=GetFile()) {
558 fRawReader = AliRawReader::Create(GetFile());
559 // printf("New file!!!\n");
560 SetLastProcFile(GetFile());
564 AliWarning("Coult not initialize raw reader");
569 while(skip && GetProcNextEvent())
571 if(fVerb) cout << "AliTPCMonitor::ReadDataNew get event " << endl;
572 if(fRawReader->IsA()==AliRawReaderRoot::Class()){
573 AliInfo(Form("Root, NextEvent: %d\n",GetEventID()));
574 if (!fRawReader->GotoEvent(GetEventID())){AliError("Could not get next Event"); return 11 ;}
575 } else if(!fRawReader->NextEvent()) { AliError("Could not get next Event"); return 11 ;}
576 // skip all events but physics, calibration and software trigger events!
577 UInt_t eventType=fRawReader->GetType();
578 if ( !(eventType==AliRawEventHeaderBase::kPhysicsEvent ||
579 eventType==AliRawEventHeaderBase::kCalibrationEvent ||
580 eventType==AliRawEventHeaderBase::kSystemSoftwareTriggerEvent ||
581 eventType==AliRawEventHeaderBase::kDetectorSoftwareTriggerEvent) ) {
582 if (fVerb) cout<< "Skipping event! Its neither of 'physics, calibration and software trigger event'" << endl;
583 if(fRawReader->IsA()==AliRawReaderRoot::Class()){
584 if (fEventNumber<fRawReader->GetNumberOfEvents()-1) ++fEventNumber;
585 else {AliError("No more events");return 11;}
590 //test if the TPC has data
592 fRawReader->Select("TPC");
593 Int_t eventNr=fRawReader->GetEventIndex();
594 if (!fRawReader->ReadNextData(data)) {
596 AliInfo(Form("%d / %d",fEventNumber,fRawReader->GetNumberOfEvents()));
597 if(fRawReader->IsA()==AliRawReaderRoot::Class()){
598 if (fEventNumber<fRawReader->GetNumberOfEvents()-1){
600 // printf("inc conter\n");
603 AliError("No more events");
608 fEventNumber = eventNr;
609 fEventNumberOld = eventNr;
612 AliInfo(Form("secid: %d",secid));
614 //========================== Histogram filling ======================
616 AliAltroRawStreamV3 *altro=new AliAltroRawStreamV3(fRawReader);
617 altro->SelectRawData("TPC");
622 Int_t nextHwAddress = 0;
630 while ( altro->NextDDL() ){
631 fGdcId = fRawReader->GetGDCId() ;
632 fLdcId = fRawReader->GetLDCId() ;
633 fRunId = fRawReader->GetRunNumber() ;
634 fEqId = fRawReader->GetEquipmentId();
635 rcupatch = GetRCUPatch(fRunId, fEqId);
636 Int_t rcupatchSector=rcupatch%6;
637 lastrcuid = (rcupatch+1000);
639 Int_t currentSector=rcupatch/6;
641 if(fLdcIdOld!=fLdcId && fChannelIter!=0) {
644 FillGlobal(GetLastSector());
646 if (fVerb) printf("filled sector: %d\n",GetLastSector());
651 // printf("RET: filled sector: %d\n",GetLastSector());
653 // if (rcupatch/6!=secid) continue;
658 if (!CheckEqId(secid,fEqId)) continue;
659 if (fVerb) printf("Sector: %d, RCU patch: %d, LDC: %d, EqId: %d\n",currentSector,rcupatch, fLdcId, fEqId);
661 while ( altro->NextChannel() ){
662 hw=altro->GetHWAddress();
663 nextHwAddress = ( hw + (rcupatchSector<<12) );
664 fPad[fChannelIter][0] = nextHwAddress ;
665 fPadMapHw[nextHwAddress] = fChannelIter ;
667 while ( altro->NextBunch() ){
668 Int_t startTbin = (Int_t)altro->GetStartTimeBin();
669 Int_t bunchlength = (Int_t)altro->GetBunchLength();
670 const UShort_t *sig = altro->GetSignals();
671 for (Int_t iTimeBin = 0; iTimeBin<bunchlength; iTimeBin++){
672 Int_t adc=(Int_t)sig[iTimeBin];
673 Int_t ntime=startTbin-iTimeBin;
674 //fill channel information
675 fPad[fChannelIter][ntime] = adc;
676 if( (adc>maxADC) && (ntime>=GetRangeMaxAdcMin()) && (ntime<GetRangeMaxAdcMax() )) {maxADC = adc;maxx = ntime ;}
677 if( (ntime>=GetRangeSumMin()) && (ntime<GetRangeSumMax() )) {sum+=adc; sumn++;}
681 //get pedestal, noise
682 Float_t pedestal=TMath::Mean(GetRangeBaseMax()-GetRangeBaseMin(),fPad[fChannelIter]+GetRangeBaseMin());
683 Float_t noise =TMath::RMS(GetRangeBaseMax()-GetRangeBaseMin(),fPad[fChannelIter]+GetRangeBaseMin());
684 fHistAddrMaxAdc->SetBinContent(nextHwAddress,maxADC-GetPedestals()*pedestal);
690 fHistDistrBase2dIROC->Fill(pedestal,noise);
691 fHistDistrSumIROC->Fill(sum);
692 fHistDistrMaxIROC->Fill(maxADC-pedestal*GetPedestals());
693 fHistDistrSumIROC->Fill(sum -sumn*pedestal*GetPedestals());
697 fHistDistrBase2dOROC->Fill(pedestal,noise);
698 fHistDistrSumOROC->Fill(sum);
699 fHistDistrMaxOROC->Fill(maxADC-pedestal*GetPedestals());
700 fHistDistrSumOROC->Fill(sum -sumn*pedestal*GetPedestals());
703 fHistAddrAdcSum->SetBinContent( nextHwAddress,sum);
704 fHistAddrMapIndex->SetBinContent(nextHwAddress,fChannelIter);
705 fHistAddrBaseMean->SetBinContent(nextHwAddress,pedestal);
706 fHistAddrMaxAdcX->SetBinContent( nextHwAddress,maxx);
707 fHistAddrBaseRms->SetBinContent( nextHwAddress,noise);
712 SetLastSector(rcupatch/6);
713 if(fChannelIter!=0 && secid==-1 ) SetSectorFilled(rcupatch/6);
717 if(fChannelIter!=0 && secid==-1) { FillGlobal(GetLastSector());}
731 //____________________________________________________________________________
732 void AliTPCMonitor::FillHistsPadPlane()
734 // Fill 2Dim histograms for IROC and OROC (max , rms and sum)
736 if(fVerb)cout << "AliTPCMonitor::FillHistsPadPlane() Start " << endl;
737 if(fVerb)PrintConfig();
744 for(Int_t ch = 0; ch<fChannelIter; ch++)
747 fHistChannelTime->SetCellContent(ch,0,hwadd);
749 for(Int_t bin = 1; bin <GetTimeBins(); bin++)
751 if( fHistChannelTime->GetCellContent(ch,bin)!=0) cout << " cellcontent already set " << endl;
752 if( GetPedestals()==1 ) fHistChannelTime->SetCellContent(ch,bin,(fPad[ch][bin]- fHistAddrBaseMean->GetBinContent(hwadd)));
753 else fHistChannelTime->SetCellContent(ch,bin,(fPad[ch][bin]));
756 pad = fMapHand->GetPad( hwadd);
757 row = fMapHand->GetPadRow(hwadd);
758 padmax = fMapHand->GetNumofPads(row);
762 fHistIROC->SetCellContent( row +1 ,pad +55 -padmax/2 +1,fHistAddrMaxAdc->GetBinContent( hwadd));
763 fHistIROCIndex->SetCellContent(row +1 ,pad +55 -padmax/2 +1,ch);
764 fHistIROCRMS->SetCellContent( row +1 ,pad +55 -padmax/2 +1,fHistAddrBaseRms->GetBinContent( hwadd));
765 fHistIROCBASE->SetCellContent( row +1 ,pad +55 -padmax/2 +1,fHistAddrBaseMean->GetBinContent(hwadd));
766 fHistIROCSUM->SetCellContent( row +1 ,pad +55 -padmax/2 +1,fHistAddrAdcSum->GetBinContent( hwadd));
770 fHistOROC->SetCellContent( row-63 +1 ,pad +70 -padmax/2 +1,fHistAddrMaxAdc->GetBinContent( hwadd));
771 fHistOROCIndex->SetCellContent(row-63 +1 ,pad +70 -padmax/2 +1,ch);
772 fHistOROCRMS->SetCellContent( row-63 +1 ,pad +70 -padmax/2 +1,fHistAddrBaseRms->GetBinContent( hwadd));
773 fHistOROCBASE->SetCellContent( row-63 +1 ,pad +70 -padmax/2 +1,fHistAddrBaseMean->GetBinContent(hwadd));
774 fHistOROCSUM->SetCellContent( row-63 +1 ,pad +70 -padmax/2 +1,fHistAddrAdcSum->GetBinContent( hwadd));
778 fHistChannelTime->GetXaxis()->SetRange(0,fChannelIter);
779 fHistChannelTime->GetYaxis()->SetRange(0,GetTimeBins());
784 //____________________________________________________________________________
785 void AliTPCMonitor::ResetArrays()
788 for(Int_t row = 0 ; row < fkNRowsIroc; row++)
790 for(Int_t pad = 0 ; pad < fkNPadsIroc ; pad++)
792 fHistIROCIndex->SetCellContent(row+1,pad+1,-1);
795 for(Int_t row = 0 ; row < fkNRowsOroc; row++)
797 for(Int_t pad = 0 ; pad < fkNPadsOroc ; pad++)
799 fHistOROCIndex->SetCellContent(row+1,pad+1,-1);
803 for(Int_t ch= 0; ch<GetMaxHwAddr(); ch++)
805 fHistAddrMaxAdcX->SetBinContent(ch,-1);
806 fHistAddrMapIndex->SetBinContent(ch,-1);
807 fHistAddrMaxAdc->SetBinContent( ch, 0);
808 fHistAddrBaseMean->SetBinContent( ch, 0);
809 fHistAddrAdcSum->SetBinContent( ch, 0);
810 fHistAddrBaseRms->SetBinContent(ch, 0);
813 for(Int_t ch = 0; ch< GetNumOfChannels(); ch++)
815 for(Int_t bin = 0; bin< GetTimeBins(); bin++)
820 for(Int_t ch = 0; ch< GetMaxHwAddr(); ch++)
823 fPadMapRCU[ch][0]=-1;
824 fPadMapRCU[ch][1]=-1;
825 fPadMapRCU[ch][2]=-1;
826 fPadMapRCU[ch][3]=-1;
827 fPadMapRCU[ch][4]=-1;
828 fPadMapRCU[ch][5]=-1;
834 //____________________________________________________________________________
835 void AliTPCMonitor::ResetHistos()
838 for(Int_t i =0; i<fHistList->GetEntries(); i++)
840 TString name=fHistList->At(i)->GetName();
841 if(GetProcNextEvent()==0 && (name=="SIDE A" || name=="SIDE C")) continue;
842 ((TH1*)fHistList->At(i))->Reset();
847 //____________________________________________________________________________
848 void AliTPCMonitor::DeleteHistos()
851 for(Int_t i =0; i<fHistList->GetEntries(); i++)
853 delete (TH1*)fHistList->At(i);
858 //__________________________________________________________________
859 Int_t AliTPCMonitor::CheckEqId(Int_t secid,Int_t eqid)
861 // Check if equipment id corresponds to any rcu patch in sector
862 // Equipment ids changed during commisioning in 2006 (starting from run 704)
863 // However Runids started from 0 again in 2007
864 // Now only runids from commissioning in 2006 after runid 704 and all new ones are supported.
865 // Comment in equipment check for runids < 704 if old runs should be processed
867 if(fVerb) cout << "AliTPCMonitor::CheckEqId : SectorId " << secid << " EquipmentId " << eqid << " runid " << fRunId << endl;
869 //skip all eqids which do not belong to the TPC
870 if ( eqid<768||eqid>983 ) return 0;
872 // if(fRunId<704 && 0) // commented out --> runs with runid < 704 in 2006 are not recognized anymore
874 // if( (secid>-1) && (secid<36) ) // if ( secid is in range) { take only specific eqids} else { take all }
876 // if( (secid==13) && ( eqid!=408 && eqid!=409 && eqid!=509 && eqid!=512 && eqid!=513 && eqid!=517 )) {passed=0;}
877 // else if( (secid==4) && ( eqid!=404 && eqid!=504 && eqid!=407 && eqid!=503 && eqid!=508 && eqid!=506 )) {passed=0;}
879 // else {if(fVerb) cout << "passed check "<< endl; }
883 if( (secid>-1) && (secid<36) ) // if ( secid is in range) { take only specific eqids} else { take all }
885 if(eqid!=fMapEqidsSec[secid][0] && eqid!= fMapEqidsSec[secid][1] && eqid!=fMapEqidsSec[secid][2] &&
886 eqid!=fMapEqidsSec[secid][3] && eqid!= fMapEqidsSec[secid][4] && eqid!=fMapEqidsSec[secid][5] ) {passed=0;}
888 else {if(fVerb) cout << "passed check "<< endl;}
894 //__________________________________________________________________
895 void AliTPCMonitor::SetEqIds()
897 // Set mapping for equipment ids
898 for(Int_t i = 0; i<36 ; i++)
900 for(Int_t j = 0; j<6; j++)
902 if(j<2) fMapEqidsSec[i][j]= 768+i*2+j;
903 else fMapEqidsSec[i][j]= 840+i*4+j-2;
907 for(Int_t i = 0; i<36 ; i++)
909 for(Int_t j = 0; j<6; j++)
911 if(j<2) fMapEqidsRcu[768+i*2+j] = i*6 +j;
912 else fMapEqidsRcu[840+i*4+j-2] = i*6 +j;
917 //__________________________________________________________________
918 void AliTPCMonitor::FillGlobal(Int_t sector)
921 // Fill global histograms with max adc for each channel
924 if((sector/18) ==0) hglob = fHistGlobalMaxA;
925 else hglob = fHistGlobalMaxC;
927 Float_t rotsec = (2*TMath::Pi()/18.0);
928 Float_t rot = (-rotsec*(sector%18) +4*rotsec);
930 Float_t m11 = TMath::Cos(rot);
931 Float_t m12 = TMath::Sin(rot);
932 Float_t m21 = -1*TMath::Sin(rot);
933 Float_t m22 = TMath::Cos(rot);
935 Int_t max = 0; // use integer for global view
947 for(Int_t hw = 0; hw<fHistAddrMaxAdc->GetNbinsX(); hw++)
949 max = (Int_t)fHistAddrMaxAdc->GetBinContent(hw);
952 pad = fMapHand->GetPad( hw);
953 row = fMapHand->GetPadRow(hw);
954 padmax = fMapHand->GetNumofPads(row);
955 if (sector%36>17) fMirror=-1;
957 GetXY(xval ,yval , padmax,row ,pad);
958 xdr = xval*m11 +yval*m12;
959 ydr = xval*m21 +yval*m22;
960 if(hglob->GetBinContent(hglob->GetXaxis()->FindBin(xdr),hglob->GetYaxis()->FindBin(ydr))==0) hglob->Fill(xdr,ydr,(Int_t)max);
966 //__________________________________________________________________
967 void AliTPCMonitor::GetXY( Double_t& xval , Double_t& yval , Int_t padmax, Int_t row , Int_t pad) const
969 // Get x and y position of pad
973 xval = fMirror*( 2*padmax -4*pad -2);
974 yval = 852.25 +7.5*row;
978 xval = fMirror*( 3*padmax -6*pad -3);
979 if((row-63)<63) { yval = 10*(row-63) +1351; }
980 else { yval = 15*(row-63-64)+1993.5; }
985 //__________________________________________________________________
986 Int_t AliTPCMonitor::GetPadAtX(Float_t xval, Int_t row, Int_t padmax) const
988 // Get pad number at given position in x
991 if(row<63) {pad = (Int_t)( ( (xval/fMirror) +2 -2*padmax)/-4);}
992 else {pad = (Int_t)( ( (xval/fMirror) +3 -3*padmax)/-6);}
994 if(pad>=padmax) return -1;
999 //__________________________________________________________________
1000 Int_t AliTPCMonitor::GetPadAtX(Float_t xval, Int_t row) const
1003 // Get pad number at given position in x
1005 Int_t padmax = fMapHand->GetNumofPads(row);
1008 if(row<63) {pad = (Int_t)( ( (xval/fMirror) +2 -2*padmax)/-4);}
1009 else {pad = (Int_t)( ( (xval/fMirror) +3 -3*padmax)/-6);}
1011 if(pad>=padmax) return -1;
1016 //__________________________________________________________________
1017 void AliTPCMonitor::DrawHists(Int_t histos)
1020 // Draw sets of histograms
1021 // histos==1 : 2Dim histos for MAX adc and add executables
1022 // histos==2 : distributions max/rms/sum
1023 // histos==3 : global max adc for specified SideA/C
1026 if(fVerb) cout << " Draw histos " << endl;
1028 if(GetLastSector()/18==0 ) cside="A";
1031 TString titleSEC = Form("Sector %i Side %s Run : %05i EventID %i " ,GetLastSector()%18,cside.Data(),fRunId, fEventNumber);
1032 TString titleEvent= Form("Time <-> Channles %s" ,titleSEC.Data());
1033 TString titleIROC = Form("IROC %s" ,titleSEC.Data());
1034 TString titleOROC = Form("OROC %s" ,titleSEC.Data());
1036 TString titleMAX = Form("Max (timebin: %i,%i) %s" ,GetRangeMaxAdcMin(),GetRangeMaxAdcMax(),titleSEC.Data());
1037 TString titleSUM = Form("Sum (timebin: %i,%i) %s" ,GetRangeSumMin() ,GetRangeSumMax() ,titleSEC.Data());
1038 TString titleBASE = Form("Baseline RMS<->Mean (timebin: %i-%i) %s" ,GetRangeBaseMin() ,GetRangeBaseMax() ,titleSEC.Data());
1039 TString titleMEAN = Form("Baseline Mean (timebin: %i-%i) %s" ,GetRangeBaseMin() ,GetRangeBaseMax() ,titleSEC.Data());
1040 TString titleRMS = Form("Baseline RMS (timebin: %i-%i) %s" ,GetRangeBaseMin() ,GetRangeBaseMax() ,titleSEC.Data());
1044 // IROC _______________________________________________________________
1046 ciroc = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("ciroc");
1049 ciroc = CreateCanvas("ciroc");
1054 fHistIROC->SetXTitle("row");
1055 fHistIROC->SetYTitle("pad");
1056 if(GetPedestals()) fHistIROC->SetZTitle("max ADC (baseline sub)");
1057 else fHistIROC->SetZTitle("max ADC ");
1058 fHistIROC->SetTitle(titleIROC.Data());
1059 fHistIROC->SetMinimum(0.01);
1060 fHistIROC->Draw("COLZ");
1061 ciroc->UseCurrentStyle();
1064 fHistIROCTime->SetXTitle("row"); fHistIROCTime->SetZTitle("peak time (fit)"); fHistIROCTime->SetYTitle("pad"); fHistIROCTime->SetTitle(titleIROC.Data());
1065 fHistIROCRMS->SetXTitle("row"); fHistIROCRMS->SetZTitle( "baseline rms (ADC)"); fHistIROCRMS->SetYTitle("pad"); fHistIROCRMS->SetTitle(titleIROC.Data());
1069 coroc =(TCanvas*)gROOT->GetListOfCanvases()->FindObject("coroc");
1071 coroc = CreateCanvas("coroc");
1076 fHistOROC->SetXTitle("row");
1077 fHistOROC->SetYTitle("pad");
1078 if(GetPedestals()) fHistOROC->SetZTitle("max ADC (baseline sub)");
1079 else fHistOROC->SetZTitle("max ADC ");
1080 fHistOROC->SetTitle(titleOROC.Data());
1081 fHistOROC->SetMinimum(0.01);
1082 fHistOROC->Draw("COLZ");
1083 coroc->UseCurrentStyle();
1086 fHistOROCTime->SetXTitle("row"); fHistOROCTime->SetZTitle("peak time (fit) (timebins)"); fHistOROCTime->SetYTitle("pad"); fHistOROCTime->SetTitle(titleOROC.Data());
1087 fHistOROCRMS->SetXTitle("row"); fHistOROCRMS->SetZTitle("baseline rms (ADC)"); fHistOROCRMS->SetYTitle("pad"); fHistOROCRMS->SetTitle(titleOROC.Data());
1090 TString namesum=Form("ADC sum (bins: %i, %i)",GetRangeSumMin() ,GetRangeSumMax() );
1091 fHistIROCSUM->SetXTitle("row");
1092 fHistIROCSUM->SetZTitle(namesum.Data());
1093 fHistIROCSUM->SetYTitle("pad");
1094 fHistIROCSUM->SetTitle(titleIROC.Data());
1096 fHistOROCSUM->SetXTitle("row");
1097 fHistOROCSUM->SetZTitle(namesum);
1098 fHistOROCSUM->SetYTitle("pad");
1099 fHistOROCSUM->SetTitle(titleOROC.Data());
1102 TString namebase=Form("base mean (timbebin: %i, %i )",GetRangeBaseMin(),GetRangeBaseMax());
1103 fHistIROCBASE->SetXTitle("row");
1104 fHistIROCBASE->SetZTitle(namebase.Data());
1105 fHistIROCBASE->SetYTitle("pad");
1106 fHistIROCBASE->SetTitle(titleIROC.Data());
1108 fHistOROCBASE->SetXTitle("row");
1109 fHistOROCBASE->SetZTitle(namebase);
1110 fHistOROCBASE->SetYTitle("pad");
1111 fHistOROCBASE->SetTitle(titleOROC.Data());
1113 if(fHistIROCClone) fHistIROCClone->Delete();
1114 if(fHistOROCClone) fHistOROCClone->Delete();
1115 fHistIROCClone = (TH2F*)fHistIROC->Clone("fHistIROCClone");
1116 fHistOROCClone = (TH2F*)fHistOROC->Clone("fHistOROCClone");
1119 if(fExecPlaneMax==0)
1121 TString carry1=Form(".x %s/TPC/AliTPCMonitorExec.C(1)",gSystem->Getenv("ALICE_ROOT"));
1122 ciroc->AddExec("pad",carry1.Data());
1123 coroc->AddExec("pad",carry1.Data());
1125 TString carry2=Form(".x %s/TPC/AliTPCMonitorExec.C(2)",gSystem->Getenv("ALICE_ROOT"));
1126 ciroc->AddExec("row",carry2.Data());
1127 coroc->AddExec("row",carry2.Data());
1135 // MAX ADC distribution ____________________________________________
1137 cmax = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("cmax");
1138 if(!cmax) cmax = CreateCanvas("cmax");
1141 fHistDistrMaxIROC->GetXaxis()->SetRangeUser(0.0,1000.0);
1142 fHistDistrMaxIROC->SetXTitle("max ADC (ADC)");
1143 fHistDistrMaxIROC->SetYTitle("counts");
1144 fHistDistrMaxIROC->SetTitle(titleMAX.Data());
1145 fHistDistrMaxIROC->Draw("");
1146 fHistDistrMaxOROC->SetLineColor(2);
1147 fHistDistrMaxOROC->Draw("same");
1149 if(fHistDistrMaxOROC->GetMaximum()> fHistDistrMaxIROC->GetMaximum()) fHistDistrMaxIROC->SetMaximum(fHistDistrMaxOROC->GetMaximum()*1.1);
1151 TLegend* legio = new TLegend(0.6,0.6,0.8,0.8);
1152 legio->SetFillColor(0);
1153 legio->AddEntry(fHistDistrMaxIROC,"IROC","l");
1154 legio->AddEntry(fHistDistrMaxOROC,"OROC","l");
1155 legio->Draw("same");
1157 // ADC sum distribution
1159 csum = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("csum");
1160 if(!csum) csum = CreateCanvas("csum") ;
1163 fHistDistrSumIROC->SetXTitle("sum ADC (ADC)");
1164 fHistDistrSumIROC->SetYTitle("counts");
1165 fHistDistrSumIROC->SetTitle(titleSUM.Data());
1166 fHistDistrSumIROC->Draw("");
1167 fHistDistrSumOROC->SetLineColor(2);
1168 fHistDistrSumOROC->Draw("same");
1169 if(fHistDistrSumOROC->GetMaximum()> fHistDistrSumIROC->GetMaximum()) fHistDistrSumIROC->SetMaximum(fHistDistrSumOROC->GetMaximum()*1.1);
1170 legio->Draw("same");
1172 // BASELINE MEAN distribution
1173 TCanvas* cbasemean = 0;
1174 cbasemean = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("cbasemean");
1175 if(!cbasemean) cbasemean = CreateCanvas("cbasemean");
1178 fHistDistrBaseMeanIROC = fHistDistrBase2dIROC->ProjectionX("fHistDistrBaseMeanIROC");
1179 fHistDistrBaseMeanIROC->SetXTitle("base mean (ADC)");
1180 fHistDistrBaseMeanIROC->SetYTitle("counts");
1181 fHistDistrBaseMeanIROC->SetTitle(titleMEAN.Data());
1182 fHistDistrBaseMeanIROC->Draw("");
1184 fHistDistrBaseMeanOROC = fHistDistrBase2dOROC->ProjectionX("fHistDistrBaseMeanOROC");
1185 fHistDistrBaseMeanOROC->SetLineColor(2);
1186 fHistDistrBaseMeanOROC->Draw("same");
1187 if(fHistDistrBaseMeanOROC->GetMaximum()>fHistDistrBaseMeanIROC->GetMaximum()) fHistDistrBaseMeanIROC->SetMaximum(fHistDistrBaseMeanOROC->GetMaximum()*1.1);
1188 legio->Draw("same");
1190 TCanvas* cbaserms = 0;
1191 cbaserms = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("cbaserms");
1192 if(!cbaserms) cbaserms = CreateCanvas("cbaserms") ;
1195 // BASELINE RMS distribution
1196 fHistDistrBaseRmsIROC = fHistDistrBase2dIROC->ProjectionY("fHistDistrBaseRmsIROC");
1197 fHistDistrBaseRmsIROC->SetXTitle("base rms (ADC)");
1198 fHistDistrBaseRmsIROC->SetYTitle("counts");
1199 fHistDistrBaseRmsIROC->SetTitle(titleRMS.Data());
1200 fHistDistrBaseRmsIROC->Draw("");
1202 fHistDistrBaseRmsOROC = fHistDistrBase2dOROC->ProjectionY("fHistDistrBaseRmsOROC");
1203 fHistDistrBaseRmsOROC->SetLineColor(2);
1204 fHistDistrBaseRmsOROC->Draw("same");
1205 if(fHistDistrBaseRmsOROC->GetMaximum()>fHistDistrBaseRmsIROC->GetMaximum()) fHistDistrBaseRmsIROC->SetMaximum(fHistDistrBaseRmsOROC->GetMaximum()*1.1);
1206 legio->Draw("same");
1210 cbasemean->Update();
1215 // GLOBAL MAX ADC _________________________________
1216 if(GetProcNextEvent()==1)
1221 if(!(cglobC=(TCanvas*)gROOT->GetListOfCanvases()->FindObject("SIDE C all"))) cglobC = CreateCanvas("SIDE C all");
1222 if(!(cglobA=(TCanvas*)gROOT->GetListOfCanvases()->FindObject("SIDE A all"))) cglobA = CreateCanvas("SIDE A all");
1224 TString globtitle1=Form("SIDE A Run %05i (EventID %i)",fRunId,fEventNumber);
1225 TString globtitle2=Form("SIDE C Run %05i (EventID %i)",fRunId,fEventNumber);
1227 fHistGlobalMaxA->SetTitle(globtitle1.Data());
1228 fHistGlobalMaxC->SetTitle(globtitle2.Data());
1229 fHistGlobalMaxA->SetXTitle("x/mm");
1230 fHistGlobalMaxA->SetYTitle("y/mm");
1231 fHistGlobalMaxC->SetXTitle("x/mm");
1232 fHistGlobalMaxC->SetYTitle("y/mm");
1234 if(GetPedestals()==0) { fHistGlobalMaxA->SetZTitle("max adc (not baseline sub)"); fHistGlobalMaxC->SetZTitle("max adc (not baseline sub)"); }
1235 else { fHistGlobalMaxA->SetZTitle("max adc "); fHistGlobalMaxC->SetZTitle("max adc "); }
1237 fHistGlobalMaxA->SetMinimum(0.01);
1238 fHistGlobalMaxC->SetMinimum(0.01);
1240 cglobC->cd() ; fHistGlobalMaxC->Draw("COLZ");
1241 cglobA->cd() ; fHistGlobalMaxA->Draw("COLZ");
1243 TString nameom=Form(".x %s/TPC/AliTPCMonitorExec.C(3)",gSystem->Getenv("ALICE_ROOT"));
1247 if(fVerb)cout << " set exec " << nameom.Data() << endl;
1248 cglobC->AddExec("glob",nameom.Data());
1249 cglobA->AddExec("glob",nameom.Data());
1254 cglobC->DeleteExec("glob");
1255 cglobA->DeleteExec("glob");
1257 if(fVerb) cout << " set exec " << nameom.Data() << endl;
1258 cglobC->AddExec("glob",nameom.Data());
1259 cglobA->AddExec("glob",nameom.Data());
1271 //__________________________________________________________________
1272 void AliTPCMonitor::DrawRMSMap()
1274 // Draw 2Dim rms histos for IROC and OROC
1275 // and set executables for canvases
1277 TCanvas* crmsoroc =0;
1278 TCanvas* crmsiroc =0;
1279 if(!(crmsoroc = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("crmsoroc"))) crmsoroc = CreateCanvas("crmsoroc");
1280 if(!(crmsiroc = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("crmsiroc"))) crmsiroc = CreateCanvas("crmsiroc");
1282 crmsiroc->cd(); fHistIROCRMS->Draw("COLZ");
1283 crmsoroc->cd(); fHistOROCRMS->Draw("COLZ");
1285 TString carry1=Form(".x %s/TPC/AliTPCMonitorExec.C(1)",gSystem->Getenv("ALICE_ROOT"));
1286 TString carry2=Form(".x %s/TPC/AliTPCMonitorExec.C(2)",gSystem->Getenv("ALICE_ROOT"));
1288 if(fExecPadIrocRms==0)
1290 crmsiroc->AddExec("pad",carry1.Data());
1291 crmsiroc->AddExec("row",carry2.Data());
1295 if(fExecPadOrocRms==0)
1297 crmsoroc->AddExec("pad",carry1.Data());
1298 crmsoroc->AddExec("row",carry2.Data());
1309 //__________________________________________________________________
1310 void AliTPCMonitor::ExecPad()
1313 // Executable for Pad
1314 // Show time profile for channel the mouse is pointing at
1316 Int_t event = gPad->GetEvent();
1317 if (event != 51) return;
1319 TObject *select = gPad->GetSelected();
1321 if(!select->InheritsFrom("TH2")) { return; }
1322 gPad->GetCanvas()->FeedbackMode(kTRUE);
1325 Int_t px = gPad->GetEventX();
1326 Int_t py = gPad->GetEventY();
1327 Float_t upy = gPad->AbsPixeltoY(py);
1328 Float_t upx = gPad->AbsPixeltoX(px);
1329 Float_t y = gPad->PadtoY(upy);
1330 Float_t x = gPad->PadtoX(upx);
1335 // Char_t namehist[50];
1342 Float_t ybinmin = 0;
1343 Float_t ybinmax = 0;
1345 // Check wich Canvas executed the event
1347 namesel=select->GetName();
1348 if(namesel=="fHistOROC" || namesel=="fHistOROCRMS" || namesel=="fHistOROCTime" )
1352 projhist=Form("ProjectionOROC");
1353 namecanv=Form("coroc_ch");
1354 fHistIndex = fHistOROCIndex;
1356 if(namesel=="fHistIROC" || namesel=="fHistIROCRMS" || namesel=="fHistIROCTime" )
1360 projhist=Form("ProjectionIROC");
1361 namecanv=Form("ciroc_ch");
1362 fHistIndex = fHistIROCIndex;
1365 // Check if Canvas already existed and get Ranges from former Prjection histogram
1366 if((cpad=(TCanvas*)gROOT->GetListOfCanvases()->FindObject(namecanv)))
1369 if(gROOT->Get(projhist))
1372 xbinmin = ((TH1D*)gROOT->Get(projhist))->GetXaxis()->GetFirst();
1373 xbinmax = ((TH1D*)gROOT->Get(projhist))->GetXaxis()->GetLast();
1374 ybinmin = ((TH1D*)gROOT->Get(projhist))->GetMinimum();
1375 ybinmax = ((TH1D*)gROOT->Get(projhist))->GetMaximum();
1376 delete gROOT->Get("legfit");
1377 delete gROOT->Get("fg");
1382 cpad = CreateCanvas(namecanv); cpad->cd();
1386 if (!fHistIndex) return;
1387 Int_t testy = fHistIndex->GetYaxis()->FindBin(y);
1388 Int_t testx = fHistIndex->GetXaxis()->FindBin(x);
1389 Int_t binchannel = (Int_t)fHistIndex->GetCellContent(testx,testy);
1390 if(binchannel>30000 || binchannel<0) return;
1392 TH1D *hp=(TH1D*)gROOT->Get(projhist);
1393 if(!hp) hp=new TH1D(projhist,projhist,GetTimeBins(),0,GetTimeBins());//delete gROOT->Get(projhist);
1395 // TH1D *hp = (TH1D*)(((TH1D*)fHistChannelTime->ProjectionY("hp",binchannel,binchannel))->Clone(projhist));
1396 // TH1D *hp = fHistChannelTime->ProjectionY(projhist,binchannel,binchannel);
1398 Int_t nbinsx=fHistChannelTime->GetNbinsX();
1399 for (Int_t itb=0;itb<GetTimeBins();++itb){
1400 hp->GetArray()[itb]=fHistChannelTime->GetArray()[binchannel+itb*(nbinsx+2)];
1405 // Make title and Pave for channel Info
1406 Int_t npadRow , npad , nhw , nmax , hwadd;
1408 hwadd = (Int_t)fHistChannelTime->GetCellContent(binchannel,0);
1409 fPadUsedHwAddr = hwadd;
1411 if(rocid==0)npadRow = fMapHand->GetPadRow(hwadd);
1412 else npadRow = fMapHand->GetPadRow(hwadd)-63;
1413 npad = fMapHand->GetPad(hwadd);
1415 nmax = (Int_t)hp->GetMaximum();
1418 TPaveText* legstat = new TPaveText(0.18,0.65,0.3,0.8,"NDC");
1420 Int_t connector = fMapHand->GetFECconnector(hwadd);
1421 Int_t fecnr = fMapHand->GetFECfromHw(hwadd);
1422 Int_t fecch = fMapHand->GetFECchannel(hwadd);
1423 Int_t altrochip = fMapHand->GetAltro(hwadd);
1424 Int_t altrochannel= (fMapHand->GetAltroChannel(hwadd))%16;
1425 Int_t fecloc = fMapHand->U2fGetFECinRCU(fecnr) ;
1426 Int_t feclocbran = fMapHand->U2fGetFECinBranch(fecnr);
1427 Int_t branch = fMapHand->U2fGetBranch(fecnr);
1430 Short_t fecget = (hwadd & fgkHwMaskFEC) >> 7;
1431 Short_t branchget = (hwadd & fgkHwMaskBranch)>> 11;
1433 legstat->AddText(Form("Branch (map) \t %i (%i) \n",branchget,branch));
1434 legstat->AddText(Form("Fec in patch \t %i \n",fecloc));
1435 legstat->AddText(Form("Fec in branch (map)\t %i (%i)\n",fecget,feclocbran));
1436 legstat->AddText(Form("Connector \t %i \n",connector));
1437 legstat->AddText(Form("Fec No. \t %i \n",fecnr));
1438 legstat->AddText(Form("Fec chan \t %i \n",fecch));
1439 legstat->AddText(Form("Altro chip\t %i \n",altrochip));
1440 legstat->AddText(Form("Altro chan\t %i \n",altrochannel));
1442 TString title=Form("Row=%d Pad=%d Hw =%d maxADC =%d count =%d",npadRow,npad,nhw,nmax,binchannel);
1444 // hp->SetName(projhist);
1445 hp->SetTitleSize(0.04);
1446 hp->SetTitle(title.Data());
1447 hp->SetYTitle("ADC");
1448 hp->SetXTitle("Timebin");
1449 hp->GetXaxis()->SetTitleColor(1);
1453 hp->GetXaxis()->SetRange(xbinmin,xbinmax);
1454 hp->SetMinimum(ybinmin);
1455 hp->SetMaximum(ybinmax);
1459 hp->SetMinimum(0.0);
1460 hp->SetMaximum(1000.0);
1467 if(GetPedestals() && fDisableFit==0)
1469 Int_t maxx = (Int_t)fHistAddrMaxAdcX->GetBinContent(hwadd);
1470 Float_t max = (Float_t)fHistAddrMaxAdc->GetBinContent(hwadd);
1471 Float_t base = (Float_t)fHistAddrBaseMean->GetBinContent(hwadd);
1474 if( ((max+base)/base)>1.2)
1476 TF1* fg = new TF1("fg",AliTPCMonitor::Gamma4,maxx-5,maxx+5,4);
1477 fg->SetParName(0,"Normalisation");
1478 fg->SetParName(1,"Minimum");
1479 fg->SetParName(2,"Width");
1480 fg->SetParName(3,"Base");
1481 fg->SetParameter(0,max);
1482 fg->SetParameter(1,maxx-2);
1483 fg->SetParameter(2,1.5);
1484 fg->FixParameter(3,0);
1485 fg->SetLineColor(4);
1486 fg->SetLineWidth(1);
1489 TLegend* legfit = new TLegend(0.6,0.7,0.7,0.8);
1490 legfit->AddEntry("fg","#Gamma 4 fit","l");
1491 legfit->SetFillColor(0);
1492 legfit->SetName("legfit");
1493 legfit->Draw("same");
1497 legstat->SetFillColor(0);
1498 legstat->Draw("same");
1503 //__________________________________________________________________
1504 void AliTPCMonitor::ExecRow()
1507 // Executable for Pad
1508 // Show profile of max adc over given pad row
1509 // and 2dim histo adc(pad-in-row,time bin)
1511 Int_t event = gPad->GetEvent();
1512 if (event != 61) return;
1514 TObject *select = gPad->GetSelected();
1516 if(!select->InheritsFrom("TH2")) { return; }
1520 const Char_t *rowhist="hrowtime";
1521 const Char_t *rowhistxmax="hxmax";
1522 const Char_t *rowhistmax="hrowmax";
1525 Int_t px = gPad->GetEventX();
1526 Int_t py = gPad->GetEventY();
1527 Float_t upy = gPad->AbsPixeltoY(py);
1528 Float_t upx = gPad->AbsPixeltoX(px);
1529 Float_t y = gPad->PadtoY(upy);
1530 Float_t x = gPad->PadtoX(upx);
1532 TCanvas*crowtime = 0;
1533 TCanvas*crowmax = 0;
1536 TH2S* fHistIndex = 0;
1538 // ranges from already existing histos
1539 Int_t rowtimexmin = 0;
1540 Int_t rowtimexmax = 0;
1541 Int_t rowtimeymin = 0;
1542 Int_t rowtimeymax = 0;
1543 Float_t rowtimezmin = 0;
1544 Float_t rowtimezmax = 0;
1546 Int_t profrowxmin = 0;
1547 Int_t profrowxmax = 0;
1548 Double_t profrowymin = 0;
1549 Double_t profrowymax = 0;
1551 Int_t profxxmin = 0;
1552 Int_t profxxmax = 0;
1553 Double_t profxymin = 0;
1554 Double_t profxymax = 0;
1559 TString name=select->GetName();
1560 if( name=="fHistIROC" || name=="fHistIROCRMS" ) { fHistIndex = fHistIROCIndex; rocid =1; }
1561 else if(name=="fHistOROC" || name=="fHistOROCRMS" ) { fHistIndex = fHistOROCIndex; rocid =2; }
1562 else { cout << " not implemented for this histo " << endl; return; }
1564 gPad->GetCanvas()->FeedbackMode(kTRUE);
1568 // check if canvases exist //
1569 crowtime = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("crowtime");
1570 crowmax = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("crowmax");
1571 cxmax = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("cxmax");
1573 if(!crowtime) crowtime = CreateCanvas("crowtime") ;
1574 if(!crowmax) crowmax = CreateCanvas("crowmax") ;
1575 if(!cxmax ) cxmax = CreateCanvas("cxmax") ;
1577 // check ranges of already existing histos
1578 if(gROOT->Get(rowhist))
1580 rowtimexmin = ((TH2F*)gROOT->Get(rowhist))->GetXaxis()->GetFirst();
1581 rowtimexmax = ((TH2F*)gROOT->Get(rowhist))->GetXaxis()->GetLast();
1582 rowtimeymin = ((TH2F*)gROOT->Get(rowhist))->GetYaxis()->GetFirst();
1583 rowtimeymax = ((TH2F*)gROOT->Get(rowhist))->GetYaxis()->GetLast();
1584 rowtimezmin = ((TH2F*)gROOT->Get(rowhist))->GetMinimum();
1585 rowtimezmax = ((TH2F*)gROOT->Get(rowhist))->GetMaximum();
1587 profrowxmin = ((TH1F*)gROOT->Get(rowhistmax))->GetXaxis()->GetFirst();
1588 profrowxmax = ((TH1F*)gROOT->Get(rowhistmax))->GetXaxis()->GetLast();
1589 profrowymin = ((TH1F*)gROOT->Get(rowhistmax))->GetMinimum();
1590 profrowymax = ((TH1F*)gROOT->Get(rowhistmax))->GetMaximum();
1592 profxxmin = ((TH1F*)gROOT->Get(rowhistxmax))->GetXaxis()->GetFirst();
1593 profxxmax = ((TH1F*)gROOT->Get(rowhistxmax))->GetXaxis()->GetLast();
1594 profxymin = ((TH1F*)gROOT->Get(rowhistxmax))->GetMinimum();
1595 profxymax = ((TH1F*)gROOT->Get(rowhistxmax))->GetMaximum();
1599 delete gROOT->Get(rowhist);
1600 delete gROOT->Get(rowhistmax);
1601 delete gROOT->Get("hxmax");
1602 delete gROOT->Get("legrow");
1605 // get channel for xy bin -> getRow -> getNrows -> getHw for each Pad in Row -> get channel for each hw -> make proj
1606 Int_t testy = fHistIndex->GetYaxis()->FindBin(y);
1607 Int_t testx = fHistIndex->GetXaxis()->FindBin(x);
1608 Int_t binchannel = (Int_t)fHistIndex->GetCellContent(testx,testy);
1610 if(binchannel>30000) return;
1611 if(binchannel<=0 ) { crowtime->Update() ; crowmax->Update() ; return ; }
1614 Int_t hwadd = (Int_t)fHistChannelTime->GetCellContent(binchannel,0);
1615 Int_t row = fMapHand->GetPadRow(hwadd);
1616 Int_t pad = fMapHand->GetPad(hwadd) ;
1617 Int_t numofpads = fMapHand->GetNumofPads(row);
1620 TH2F *hrowtime = new TH2F(rowhist , "" ,numofpads,0,numofpads,GetTimeBins(),0.0,GetTimeBins());
1621 TH1F *hrowmax = new TH1F(rowhistmax , "" ,numofpads,0,numofpads);
1622 TH1F *hxmax = new TH1F(rowhistxmax, "" ,159,0,159 );
1624 // Row profile ///////////
1625 if(fVerb) cout << " Number of pads " << numofpads << endl;
1626 for(Int_t padnr = 0; padnr<numofpads;padnr++)
1628 Int_t addrinrow = fMapHand->GetPadAddInRow(row,padnr );
1629 Int_t channel = (Int_t)fHistAddrMapIndex->GetBinContent(addrinrow);
1630 if(channel==-1) continue;
1632 hrowmax->SetBinContent(padnr+1,fHistAddrMaxAdc->GetBinContent(addrinrow));
1633 TH1D *hp = fHistChannelTime->ProjectionY("hp",channel,channel);
1634 for(Int_t time = 0;time<GetTimeBins();time++) {
1636 Float_t val = hp->GetBinContent(time);
1637 hrowtime->SetCellContent(padnr+1,time+1,val);
1641 // X profile /////////////
1642 Double_t xval = 0.0;
1643 Double_t yval = 0.0;
1644 GetXY(xval,yval,numofpads,row,pad);
1648 for(Int_t nrow = 0; nrow<159; nrow++)
1650 padnr = GetPadAtX(xval,nrow);
1653 hw = fMapHand->GetPadAddInRow(nrow,padnr);
1654 if(fPadMapHw[hw]==-1){ continue ; }
1655 else { hxmax->SetBinContent(nrow+1,fHistAddrMaxAdc->GetBinContent(hw)) ; }
1660 hxmax->SetTitle(Form("max adc in pads at x=%5.1f mm",xval));
1661 hxmax->SetXTitle("row");
1662 if(!GetPedestals()) hxmax->SetYTitle("max adc (baseline sub.)");
1663 else hxmax->SetYTitle("max adc ");
1664 hxmax->SetMinimum(0.01);
1669 hxmax->GetXaxis()->SetRange(profxxmin,profxxmax);
1670 hxmax->SetMinimum(profxymin);
1671 hxmax->SetMaximum(profxymax);
1680 title.Form("%s Row=%d",((TH2*)select)->GetTitle(),row) ;
1681 titlemax.Form("IROC max/sum Row=%d",row );
1683 title.Form("%s Row=%d",((TH2*)select)->GetTitle(),row-63);
1684 titlemax.Form("OROC max/sum Row=%d",row-63);
1687 if(fVerb) cout << " set name " << endl;
1692 hrowtime->SetTitleSize(0.04);
1693 hrowtime->SetTitle(title.Data());
1694 hrowtime->SetYTitle("timbin");
1695 hrowtime->SetXTitle("pad in row");
1696 hrowtime->SetZTitle("signal (ADC)");
1698 hrowtime->GetXaxis()->SetTitleColor(1);
1699 hrowtime->SetMaximum(1000.0);
1700 hrowtime->SetMinimum(0.0);
1704 hrowtime->GetXaxis()->SetRange(rowtimexmin,rowtimexmax);
1705 hrowtime->GetYaxis()->SetRange(rowtimeymin,rowtimeymax);
1706 hrowtime->SetMinimum(rowtimezmin);
1707 hrowtime->SetMaximum(rowtimezmax);
1710 hrowtime->Draw("COLZ");
1711 crowtime->UseCurrentStyle();
1714 // max and sum /////////////////////////
1717 hrowmax->GetXaxis()->SetRange(profrowxmin,profrowxmax);
1718 hrowmax->SetMinimum(profrowymin);
1719 hrowmax->SetMaximum(profrowymax);
1721 hrowmax->SetTitleSize(0.04);
1722 hrowmax->SetTitle(title.Data());
1723 hrowmax->SetYTitle("max adc");
1724 hrowmax->SetXTitle("pad in row");
1725 hrowmax->GetXaxis()->SetTitleColor(1);
1727 hrowmax->SetLineColor(2);
1734 //__________________________________________________________________
1735 void AliTPCMonitor::Write10bitChannel()
1738 // Write 10 bit words form histogram for active(last pointed) channel
1740 if(fPadUsedHwAddr==-1){ AliWarning(" No active pad "); return ;}
1742 Int_t pad = (Int_t)fMapHand->GetPad( fPadUsedHwAddr);
1743 Int_t row = (Int_t)fMapHand->GetPadRow(fPadUsedHwAddr);
1744 Int_t channel = (Int_t)fPadMapHw[fPadUsedHwAddr];
1746 TString filenameroot;
1747 TString filenamedat;
1750 if(fPadUsedRoc==1) { projhist.Form("ProjectionOROC"); }
1751 if(fPadUsedRoc==0) { projhist.Form("ProjectionIROC"); }
1753 filenamedat.Form("Channel_Run%05i_EventID_%i_Pad_%i_Row_%i.dat" ,fRunId,fEventNumber,pad,row);
1754 filenameroot.Form("Channel_Run%05i_EventID_%i_Pad_%i_Row_%i.root" ,fRunId,fEventNumber,pad,row);
1757 if((hpr=(TH1D*)gROOT->Get(projhist)))
1760 TFile f(filenameroot.Data(),"recreate");
1765 ofstream datout(filenamedat.Data(),ios::out);
1766 datout <<"Timebin \t ADC value " << endl;
1767 for(Int_t i = 1; i <GetTimeBins(); i++)
1769 datout << i << " \t \t " << fPad[channel][i] << endl;
1775 AliWarning("No projection histo found ");
1779 //__________________________________________________________________
1780 void AliTPCMonitor::ExecTransform()
1783 // Make Fast Fourier Transformation for active pad
1784 // fft is only performed for a data sample of size 2^n
1785 // reduce window according to largest power of 2 which is smaller than the viewing range
1790 TString namehtrimag;
1791 TString namehtrreal;
1794 if(fPadUsedRoc==1) { namecanv="coroc_ch_trans"; namecanv2="coroc_ch_trans2"; projhist="ProjectionOROC"; }
1795 if(fPadUsedRoc==0) { namecanv="ciroc_ch_trans"; namecanv2="ciroc_ch_trans2"; projhist="ProjectionIROC"; }
1799 if((TH1D*)gROOT->Get(projhist)==0){AliWarning("Proj histo does not exist \n Move mouse over 2d histo choose channel \n and drag mouse form histo again!"); return ;}
1800 else hproj = (TH1D*)gROOT->Get(projhist.Data()) ;
1803 if(fPadUsedRoc==1) { namehtrimag="htransimagfreq_oroc"; namehtrreal="htransrealfreq_oroc"; namehtrmag="htransmagfreq_oroc"; }
1804 else { namehtrimag="htransimagfreq_iroc"; namehtrreal="htransrealfreq_iroc"; namehtrmag="htransmagfreq_iroc"; }
1806 if( gROOT->Get(namehtrimag.Data())) delete gROOT->Get(namehtrimag.Data());
1807 if( gROOT->Get(namehtrreal.Data())) delete gROOT->Get(namehtrreal.Data());
1808 if( gROOT->Get(namehtrmag.Data())) delete gROOT->Get(namehtrmag.Data());
1810 TCanvas *ctrans = 0;
1811 if(!(ctrans = (TCanvas*)gROOT->GetListOfCanvases()->FindObject(namecanv.Data())))
1813 ctrans = CreateCanvas(namecanv.Data());
1814 ctrans->Divide(1,2);
1816 TCanvas *ctrans2 = 0;
1817 if(!(ctrans2 = (TCanvas*)gROOT->GetListOfCanvases()->FindObject(namecanv2.Data())))
1819 ctrans2 = CreateCanvas(namecanv2.Data());
1820 // ctrans2->Divide(1,2);
1823 Int_t binfirst = hproj->GetXaxis()->GetFirst();
1824 Int_t binlast = hproj->GetXaxis()->GetLast();
1825 Int_t bins = binlast -binfirst +1;
1828 for(Int_t pot = 0; pot<=10 ; pot++)
1830 Int_t comp = (Int_t)TMath::Power(2,pot);
1831 if(bins>=comp)power = pot;
1834 bins = (Int_t)TMath::Power(2,power);
1836 // sampling frequency ;
1837 Double_t deltat = 1.0/(Float_t)GetSamplingFrequency();
1840 TH1D* htransrealfreq = new TH1D(namehtrreal.Data(),namehtrreal.Data(),10000,-1/(2*deltat),1/(2*deltat));
1841 TH1D* htransimagfreq = new TH1D(namehtrimag.Data(),namehtrimag.Data(),10000,-1/(2*deltat),1/(2*deltat));
1842 TH1D* htransmag = new TH1D(namehtrmag.Data(),namehtrmag.Data(),10000,-1/(2*deltat),1/(2*deltat));
1847 if(fPadUsedRoc==1) { titlereal="OROC DFT real part"; titleimag="OROC DFT imag part"; titlemag="OROC DFT magnitude"; }
1848 else { titlereal="IROC DFT real part"; titleimag="IROC DFT imag part"; titlemag="IROC DFT magnitude"; }
1850 htransrealfreq->SetTitle(titlereal.Data()); htransrealfreq->SetXTitle("f/hz"); htransrealfreq->SetYTitle("z_{real}(f)");
1851 htransimagfreq->SetTitle(titleimag.Data()); htransimagfreq->SetXTitle("f/hz"); htransimagfreq->SetYTitle("z_{imag}(f)");
1852 htransmag->SetTitle(titlemag.Data()); htransmag->SetXTitle("f/hz"); htransmag->SetYTitle("mag(f)");
1854 // create complex packed data array
1855 const Int_t kdatasiz = 2*bins;
1856 Double_t* data = new Double_t[kdatasiz];
1857 for(Int_t i=0;i<2*bins;i++) { data[i] = 0.0;}
1858 for(Int_t i=0;i<bins;i++) { data[2*i] = (Double_t)hproj->GetBinContent(binfirst+i); }
1860 // make fourier transformation
1861 AliTPCMonitorFFT* four = new AliTPCMonitorFFT();
1862 four->ComplexRadix2ForwardWrap(data,1,bins);
1864 // write output and fill histos forward
1865 Double_t freq = 0.0;
1866 for(Int_t i=0;i<2*bins;i++)
1870 if(i<(bins/2)) { freq = i/(bins*deltat) ; }
1871 else { freq = -1*((bins-i)/(bins*deltat)); }
1872 htransrealfreq->Fill( freq,data[2*i] );
1873 htransimagfreq->Fill( freq,data[2*i+1]);
1874 htransmag->Fill( freq, TMath::Sqrt(data[2*i]*data[2*i]+data[2*i+1]*data[2*i+1]) );
1879 htransrealfreq->Draw();
1881 htransimagfreq->Draw();
1890 //__________________________________________________________________
1891 void AliTPCMonitor::ShowSel(Int_t* compval)
1894 // Show only selected components
1895 // First restore original histogram from clone
1896 // Than remove all not matching pads form histos
1898 Int_t connector = 0;
1900 Int_t altrochip = 0;
1901 Int_t feclocbran = 0;
1908 Float_t maxiroc = fHistIROCClone->GetMaximum();
1909 Float_t maxoroc = fHistOROCClone->GetMaximum();
1912 // restore original histos
1913 for(Int_t row = 0; row<fkNRowsIroc; row++)
1915 for(Int_t pad = 0; pad<fkNPadsIroc; pad++)
1917 index = (Int_t)fHistIROCIndex->GetCellContent(row+1,pad+1);
1918 if(index==-1)continue;
1919 else fHistIROC->SetCellContent(row+1,pad+1,fHistIROCClone->GetCellContent(row+1,pad+1));
1922 for(Int_t row = 0; row<fkNRowsOroc; row++)
1924 for(Int_t pad = 0; pad<fkNPadsOroc; pad++)
1926 index = (Int_t)fHistOROCIndex->GetCellContent(row+1,pad+1);
1927 if(index==-1)continue;
1928 else fHistOROC->SetCellContent(row+1,pad+1,fHistOROCClone->GetCellContent(row+1,pad+1));
1933 // remove not matching entries from fHistIROC/fHistOROC
1936 TH2S* fHistIndex =0;
1940 for(Int_t row = 0; row< (fkNRowsIroc + fkNRowsOroc); row++)
1942 if(row<fkNRowsIroc) { fHist=fHistIROC ; fHistIndex = fHistIROCIndex; npads = fkNPadsIroc; subrows =0 ;}
1943 else { fHist=fHistOROC ; fHistIndex = fHistOROCIndex; npads = fkNPadsOroc; subrows =fkNRowsIroc;}
1945 for(Int_t pad = 0; pad<npads; pad++)
1947 index = (Int_t)fHistIndex->GetCellContent(row -subrows +1,pad+1);
1948 if(index==-1) continue ;
1949 hwadd = (Int_t)fHistChannelTime->GetCellContent(index,0);
1952 fecnr = fMapHand->GetFECfromHw(hwadd);
1953 if(compval[0]!=-1 && fecnr!=compval[0]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; }
1956 rcuget = (hwadd & fgkHwMaskRCU)>> 12;
1957 if(compval[1]!=-1 && rcuget!=compval[1]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; }
1960 branch = fMapHand->U2fGetBranch(fecnr) ;
1961 if(compval[2]!=-1 && branch!=compval[2]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; }
1964 feclocbran= fMapHand->U2fGetFECinBranch(fecnr) ;
1965 if(compval[3]!=-1 && feclocbran!=compval[3]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; }
1968 connector = fMapHand->GetFECconnector(hwadd);
1969 if(compval[4]!=-1 && connector!=compval[4]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; }
1972 altrochip = fMapHand->GetAltro(hwadd);
1973 if(compval[5]!=-1 && altrochip!=compval[5]) { fHist->SetCellContent(row-subrows+1,pad+1,0); continue; }
1980 if(gROOT->GetListOfCanvases()->FindObject("ciroc"))
1982 c1 = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("ciroc");
1984 fHistIROC->Draw("COLZ");
1985 fHistIROC->SetMaximum(maxiroc);
1986 fHistIROC->SetMinimum(0.0);
1989 if(gROOT->GetListOfCanvases()->FindObject("coroc"))
1991 c2 = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("coroc");
1993 fHistOROC->Draw("COLZ");
1994 fHistOROC->SetMaximum(maxoroc);
1995 fHistOROC->SetMinimum(0.0);
2001 //__________________________________________________________________
2002 void AliTPCMonitor::ResizeCanv()
2004 // Resize canvases and delete some of them
2006 TString carry1=Form(".x %s/TPC/AliTPCMonitorExec.C(1)",gSystem->Getenv("ALICE_ROOT"));
2007 TString carry3=Form(".x %s/TPC/AliTPCMonitorExec.C(2)",gSystem->Getenv("ALICE_ROOT"));
2008 if(fVerb) cout << " canv 1 " << endl;
2010 if(gROOT->GetListOfCanvases()->FindObject( "coroc_ch")) { delete gROOT->GetListOfCanvases()->FindObject("coroc_ch") ; }
2011 if(gROOT->GetListOfCanvases()->FindObject( "ciroc_ch")) { delete gROOT->GetListOfCanvases()->FindObject("ciroc_ch") ; }
2013 // for 2dim plots delete create and draw again
2014 if(gROOT->GetListOfCanvases()->FindObject("ciroc"))
2016 delete gROOT->GetListOfCanvases()->FindObject("ciroc");
2017 TCanvas* ciroc = CreateCanvas("ciroc");
2019 fHistIROC->Draw("COLZ");
2020 ciroc->AddExec("pad",carry1.Data());
2021 ciroc->AddExec("row",carry3.Data());
2025 // for 2dim plots delete create and draw again
2026 if(gROOT->GetListOfCanvases()->FindObject("coroc"))
2028 delete gROOT->GetListOfCanvases()->FindObject("coroc");
2029 TCanvas* coroc = CreateCanvas("coroc");
2031 fHistOROC->Draw("COLZ");
2033 coroc->AddExec("pad",carry1.Data());
2034 coroc->AddExec("row",carry3.Data());
2039 if(gROOT->GetListOfCanvases()->FindObject( "cbasemean")) { delete gROOT->GetListOfCanvases()->FindObject("cbasemean"); }
2040 if(gROOT->GetListOfCanvases()->FindObject( "cbase")) { delete gROOT->GetListOfCanvases()->FindObject("cbase");}
2041 if(gROOT->GetListOfCanvases()->FindObject( "cbaserms")) { delete gROOT->GetListOfCanvases()->FindObject("cbaserms"); }
2042 if(gROOT->GetListOfCanvases()->FindObject( "cmax")) { delete gROOT->GetListOfCanvases()->FindObject("cmax"); }
2043 if(gROOT->GetListOfCanvases()->FindObject( "csum")) { delete gROOT->GetListOfCanvases()->FindObject("csum"); }
2044 if(gROOT->GetListOfCanvases()->FindObject( "ciroc_ch_trans")) { delete gROOT->GetListOfCanvases()->FindObject("ciroc_ch_trans");}
2045 if(gROOT->GetListOfCanvases()->FindObject( "coroc_ch_trans")) { delete gROOT->GetListOfCanvases()->FindObject("coroc_ch_trans");}
2046 if(gROOT->GetListOfCanvases()->FindObject( "crowtime")) { delete gROOT->GetListOfCanvases()->FindObject("crowtime"); }
2047 if(gROOT->GetListOfCanvases()->FindObject( "crowmax")) { delete gROOT->GetListOfCanvases()->FindObject("crowmax"); }
2048 if(gROOT->GetListOfCanvases()->FindObject( "cxmax")) { delete gROOT->GetListOfCanvases()->FindObject("cxmax"); }
2049 if(gROOT->GetListOfCanvases()->FindObject( "crmsoroc")) { delete gROOT->GetListOfCanvases()->FindObject("crmsoroc"); fExecPadOrocRms = 0; }
2050 if(gROOT->GetListOfCanvases()->FindObject( "crmsiroc")) { delete gROOT->GetListOfCanvases()->FindObject("crmsiroc"); fExecPadIrocRms = 0; }
2051 if(gROOT->GetListOfCanvases()->FindObject( "crowmax")) { delete gROOT->GetListOfCanvases()->FindObject("crowmax"); }
2052 if(gROOT->GetListOfCanvases()->FindObject( "crowmax")) { delete gROOT->GetListOfCanvases()->FindObject("crowmax"); }
2059 //__________________________________________________________________
2060 Int_t AliTPCMonitor::ExecProcess()
2062 // Executable for global Histogram
2063 // Will be called from /TPC/AliTPCMonitorExec.C(3)
2064 // Call ProcessEvent for same event and sector pointed at
2069 Int_t event = gPad->GetEvent();
2070 if(event != 61) return -1;
2072 TObject *select = gPad->GetSelected();
2073 TString name=select->GetName();
2074 if(!select) return -1;
2075 if(!select->InheritsFrom("TH2")) {gPad->SetUniqueID(0); return -1; }
2076 if( name=="hglobal" || name=="SIDE A" ) side = 0;
2077 else if( name=="hglobal2" || name=="SIDE C" ) side = 1;
2080 Int_t px = gPad->GetEventX();
2081 Int_t py = gPad->GetEventY();
2082 Float_t upy = gPad->AbsPixeltoY(py);
2083 Float_t upx = gPad->AbsPixeltoX(px);
2084 Float_t y = gPad->PadtoY(upy);
2085 Float_t x = gPad->PadtoX(upx);
2087 Int_t testy = ((TH2*)select)->GetYaxis()->FindBin(y);
2088 Int_t testx = ((TH2*)select)->GetXaxis()->FindBin(x);
2089 if(((TH2*)select)->GetCellContent(testx,testy)==0) return -1 ;
2091 Float_t alpha = 0.0;
2092 if(x>0.0 && y > 0.0) alpha = TMath::Abs(TMath::ATan(TMath::Abs(x/y)));
2093 if(x>0.0 && y < 0.0) alpha = TMath::Abs(TMath::ATan(TMath::Abs(y/x)));
2094 if(x<0.0 && y < 0.0) alpha = TMath::Abs(TMath::ATan(TMath::Abs(x/y)));
2095 if(x<0.0 && y > 0.0) alpha = TMath::Abs(TMath::ATan(TMath::Abs(y/x)));
2097 if(x>0.0 && y < 0.0) alpha += ( TMath::Pi()/2);
2098 if(x<0.0 && y < 0.0) alpha += ( TMath::Pi());
2099 if(x<0.0 && y > 0.0) alpha += (1.5*TMath::Pi());
2101 sector = (Int_t)(alpha/(2*TMath::Pi()/18.0));
2102 if(alpha> (sector+0.5)*(2*TMath::Pi()/18.0)) sector+=1;
2104 if(sector==18 && side ==0 ) {
2105 AliWarning("There was a wromg assignment of sector 0 with sector 18. Check sectors");
2109 sector = (18-sector +4)%18;
2110 SetLastSector(sector+ side*18);
2111 SetProcNextEvent(0);
2113 if(fVerb) cout << "AliTPCMonitor::ExecProcess() next side " << side << " next sector " << sector << endl;
2115 return (Int_t)ProcessEvent();
2119 //__________________________________________________________________
2120 Int_t AliTPCMonitor::GetRCUPatch(Int_t runid, Int_t eqid) const
2123 // Return RCU patch index for given equipment id eqid
2128 if ( eqid<768 || eqid>983 ) return 0; //no TPC eqid
2129 if(eqid>=1000) return 0;
2130 patch = fMapEqidsRcu[eqid] ;
2134 if(eqid==408) {patch = 13*6+4 +0; }
2135 if(eqid==409) {patch = 13*6+5 +0; }
2136 if(eqid==509) {patch = 13*6+0 +0; }
2137 if(eqid==512) {patch = 13*6+3 +0; }
2138 if(eqid==513) {patch = 13*6+1 +0; }
2139 if(eqid==517) {patch = 13*6+2 +0; }
2141 if(eqid==404) {patch = 4*6+5 +0; }
2142 if(eqid==504) {patch = 4*6+4 +0; }
2143 if(eqid==407) {patch = 4*6+3 +0; }
2144 if(eqid==503) {patch = 4*6+2 +0; }
2145 if(eqid==508) {patch = 4*6+1 +0; }
2146 if(eqid==506) {patch = 4*6+0 +0; }
2151 //__________________________________________________________________
2152 void AliTPCMonitor::DumpHeader(AliRawReader * reader) const
2154 // Dump Event header for format
2156 cout << "EventHeader : fReader->GetEquipmentSize() :" << reader->GetEquipmentSize() << endl;
2157 cout << "EventHeader : fReader->GetType() :" << reader->GetType() << endl;
2158 cout << "EventHeader : fReader->GetRunNumber() :" << reader->GetRunNumber() << endl;
2159 cout << "EventHeader : fReader->GetEventId() :" << *(reader->GetEventId()) << endl;
2160 cout << "EventHeader : fReader->GetLDCId() :" << reader->GetLDCId() << endl;
2161 cout << "EventHeader : fReader->GetGDCId() :" << reader->GetGDCId() << endl;
2165 //__________________________________________________________________
2166 Double_t AliTPCMonitor::Gamma4(Double_t* x, Double_t* par) {
2168 // Gamma4 function used to fit signals
2169 // Defined in sections: diverging branch set to 0
2173 val = par[0]*exp(4.0)* pow((x[0]-par[1])/par[2],4)*exp(-4.0*(x[0]-par[1])/par[2])+ par[3];
2179 //__________________________________________________________________
2180 TCanvas* AliTPCMonitor::CreateCanvas(const Char_t* name)
2186 Int_t xoffset = GetCanvasXOffset();
2187 Int_t xsize = GetCanvasXSize();
2188 Int_t ysize = GetCanvasYSize();
2189 Int_t xspace = GetCanvasXSpace();
2190 Int_t yspace = GetCanvasYSpace();
2193 // ROC 2dim max distribution
2194 if( sname=="coroc") { canv = new TCanvas("coroc" ,"coroc" , -1+xoffset,(Int_t)(yspace+0.5*ysize) ,(Int_t)(1.5*xsize),(Int_t)(1.5*ysize)); return canv; }
2195 else if(sname=="ciroc") { canv = new TCanvas("ciroc" ,"ciroc" , -1+xoffset, 0 ,(Int_t)(1.5*xsize),(Int_t)(1.5*ysize)); return canv; }
2196 // ROC 2dim rms distribution
2197 else if(sname=="crmsoroc") { canv = new TCanvas("crmsoroc" ,"crmsoroc" , -1+xoffset,(Int_t)(yspace+0.5*ysize) ,(Int_t)(1.5*xsize),(Int_t)(1.5*ysize)); return canv; }
2198 else if(sname=="crmsiroc") { canv = new TCanvas("crmsiroc" ,"crmsiroc" , -1+xoffset, 0 ,(Int_t)(1.5*xsize),(Int_t)(1.5*ysize)); return canv; }
2199 // Global ADC max Histos
2200 else if(sname=="SIDE C all") { canv = new TCanvas("SIDE C all" ,"SIDE C all" , (Int_t)(3*xspace+ xoffset),(Int_t)(yspace+0.5*ysize) ,(Int_t)(1.5*xsize),(Int_t)(1.5*ysize)); return canv; }
2201 else if(sname=="SIDE A all") { canv = new TCanvas("SIDE A all" ,"SIDE A all" , (Int_t)(3*xspace+ xoffset), 0 ,(Int_t)(1.5*xsize),(Int_t)(1.5*ysize)); return canv; }
2202 // 1 dim max sum basekine distribution
2203 else if(sname=="cmax") { canv = new TCanvas("cmax" ,"cmax" , -1+xoffset, 3*yspace ,(Int_t)(1.0*xsize),(Int_t)(1.0*ysize)); return canv; }
2204 else if(sname=="csum") { canv = new TCanvas("csum" ,"csum" , xspace+xoffset, 3*yspace ,(Int_t)(1.0*xsize),(Int_t)(1.0*ysize)); return canv; }
2205 else if(sname=="cbasemean") { canv = new TCanvas("cbasemean" ,"cbasemean" , 2*xspace+xoffset, 3*yspace ,(Int_t)(1.0*xsize),(Int_t)(1.0*ysize)); return canv; }
2206 else if(sname=="cbaserms") { canv = new TCanvas("cbaserms" ,"cbaserms" , 3*xspace+xoffset, 3*yspace ,(Int_t)(1.0*xsize),(Int_t)(1.0*ysize)); return canv; }
2207 // Projections of single channel
2208 else if(sname=="coroc_ch") { canv = new TCanvas("coroc_ch" ,"coroc_ch" , (Int_t)(1.5*xspace+xoffset),(Int_t)(yspace+0.5*ysize),(Int_t)(1.5*xsize),(Int_t)(1.5*ysize)); return canv; }
2209 else if(sname=="ciroc_ch") { canv = new TCanvas("ciroc_ch" ,"ciroc_ch" , (Int_t)(1.5*xspace+xoffset), 0 ,(Int_t)(1.5*xsize),(Int_t)(1.5*ysize)); return canv; }
2210 // FFT for single channel
2211 else if(sname=="coroc_ch_trans") { canv = new TCanvas("coroc_ch_trans","coroc_ch_trans",(Int_t)(3.0*xspace+xoffset),(Int_t)(yspace+0.5*ysize),(Int_t)(1.5*xsize),(Int_t)(1.5*ysize)); return canv; }
2212 else if(sname=="ciroc_ch_trans") { canv = new TCanvas("ciroc_ch_trans","ciroc_ch_trans",(Int_t)(3.0*xspace+xoffset), 0 ,(Int_t)(1.5*xsize),(Int_t)(1.5*ysize)); return canv; }
2213 else if(sname=="coroc_ch_trans2") { canv = new TCanvas("coroc_ch_trans2","coroc_ch_trans2",(Int_t)(3.0*xspace+xoffset),(Int_t)(yspace+0.5*ysize),(Int_t)(1.5*xsize),(Int_t)(1.5*ysize)); return canv; }
2214 else if(sname=="ciroc_ch_trans2") { canv = new TCanvas("ciroc_ch_trans2","ciroc_ch_trans2",(Int_t)(3.0*xspace+xoffset), 0 ,(Int_t)(1.5*xsize),(Int_t)(1.5*ysize)); return canv; }
2215 // row profile histograms
2216 else if(sname=="crowtime") { canv = new TCanvas("crowtime" ,"crowtime" , 1*xspace+xoffset, 2*yspace +ysize ,(Int_t)(1.0*xsize),(Int_t)(1.0*ysize)); return canv; }
2217 else if(sname=="crowmax") { canv = new TCanvas("crowmax" ,"crowmax" , 2*xspace+xoffset, 2*yspace +ysize ,(Int_t)(1.0*xsize),(Int_t)(1.0*ysize)); return canv; }
2218 else if(sname=="cxmax") { canv = new TCanvas("cxmax" ,"cxmax" , 3*xspace+xoffset, 2*yspace +ysize ,(Int_t)(1.0*xsize),(Int_t)(1.0*ysize)); return canv; }
2219 else { cout << " Warning Canvas name unknown " << endl; return 0 ; }
2222 //__________________________________________________________________
2223 void AliTPCMonitor::WriteHistos()
2225 // Writes all available histograms to a file in current directory
2226 // File name will be specified by : sector, side, runid and eventnumber
2228 if(GetEventProcessed())
2230 AliInfo("Write histos to file");
2231 TString name=Form("SIDE_%i_SECTOR_%02i_RUN_%05i_EventID_%06i.root",(GetLastSector()/18),(GetLastSector()%18),fRunId,fEventNumber);
2232 TFile* f = new TFile(name.Data(),"recreate");
2233 for(Int_t i =0; i<fHistList->GetEntries(); i++)
2235 if(((TH1*)fHistList->At(i))!=0)
2237 ((TH1*)fHistList->At(i))->Write();
2245 AliError("No Event Processed : Chose Format , File and push 'Next Event' ");
2250 //__________________________________________________________________
2251 TH1* AliTPCMonitor::GetHisto(char* histname)
2254 // Returns histogram specified by histname
2255 // check available names for histos in CreateHistos()
2258 if((TH1*)fHistList->FindObject(histname))
2260 hist = (TH1*)fHistList->FindObject(histname);
2264 cout << " AliTPCMonitor::GetHisto :: Can not find histo with name " << histname << endl;