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 **************************************************************************/
16 ///////////////////////////////////////////////////////////////////////
18 // Produces the data needed to calculate the TOF quality assurance. //
19 // QA objects are 1 & 2 Dimensional histograms. //
20 // author: S.Arcelli //
22 ///////////////////////////////////////////////////////////////////////
25 Modified by fbellini on 01/11/2011
26 - removed TLines as functions
27 - changed shifters plots for 2012 DQM
29 Modified by fbellini on 01/11/2011
30 - added histograms for LTM monitoring
33 Modified by fbellini on 17/10/2011
34 - fix for memory leak in constructor
35 - added methods to read histos ranges from config file in DQM
36 - added CTTM maps + relative methods to retrieve CTTM numbering
37 - removed obslete comments
39 Modified by fbellini & rshanoian on 06/07/2011
40 - changes for trigger classes implementation
41 - fRunNumber added as private member
42 - added time vs BCID plot
44 Modified by fbellini on 18/01/2011
45 - reduced histo binning to reduce size
46 - added decoding errors plot
47 - added channel maps and options for DQM shifters
48 - new list of recPoints and ESDs plots
49 - removed hTrmChannels035 and hTrmChannels3671
51 Modified by bvonhall on 03/11/2010
52 - modified declaration of hTrmChannels035 and hTrmChannels3671 in EndOfDetectorCycle()
53 to prevent memory corruption
55 Modified by adecaro on 18/10/2010
56 - fTOFRawStream object set as private member
58 Modified by fbellini on 13/09/2010
59 - Set TLines as private members
60 - Set image flag for expert histos
62 Modified by fbellini on 14/06/2010
64 - use LoadRawDataBuffersV2()
66 Modified by fbellini on 10/05/2010
67 - Fixed EndOfDetectorCycle() memory corruption bug
69 Modified by fbellini on 22/04/2010
70 - Added filter for physics events
72 Modified by fbellini on 16/04/2010
73 - Added EnableDqmShifterOpt()
74 - Modified EndOfDetectorCycle() with options for DQM
77 Modified by fbellini on 30/03/2010
78 - Changed raws time histos range to 610ns
79 - Added FilterLTMData() and FilterSpare() methods
80 - Added check on enabled channels for raw data
81 - Updated RecPoints QA
83 Modified by fbellini on 02/03/2010
84 - Fixed raw data decoding methods (use AliTOFRawStream::LoadRawDataBuffer())
85 - Added filter for noisy channels and read map from OCDB
86 - Added GetCalibData() method
87 - Added CheckVolumeID() and CheckEquipID() methods
93 #include <TClonesArray.h>
97 #include <TPaveText.h>
99 #include "AliCDBManager.h"
100 #include "AliCDBEntry.h"
101 #include "AliESDEvent.h"
102 #include "AliESDtrack.h"
103 #include "AliQAChecker.h"
104 #include "AliRawReader.h"
105 #include "AliTOFRawStream.h"
106 #include "AliTOFcluster.h"
107 #include "AliTOFQADataMakerRec.h"
108 #include "AliTOFrawData.h"
109 #include "AliTOFGeometry.h"
110 #include "AliTOFChannelOnlineStatusArray.h"
111 #include "AliTOFDecoderSummaryData.h"
112 #include "AliTOFDecoderV2.h"
114 ClassImp(AliTOFQADataMakerRec)
116 Int_t AliTOFQADataMakerRec::fgNbinsMultiplicity=200; //number of bins in multiplicity plot
117 Int_t AliTOFQADataMakerRec::fgRangeMinMultiplicity=0;//min range in multiplicity plot
118 Int_t AliTOFQADataMakerRec::fgRangeMaxMultiplicity=200;//max range in multiplicity plot
119 Int_t AliTOFQADataMakerRec::fgNbinsTime=250;//number of bins in time plot
120 const Float_t AliTOFQADataMakerRec::fgkNbinsWidthTime=2.44;//width of bins in time plot
121 Float_t AliTOFQADataMakerRec::fgRangeMinTime=0.0;//range min in time plot
122 Float_t AliTOFQADataMakerRec::fgRangeMaxTime=620.0; //range max in time plot
123 Int_t AliTOFQADataMakerRec::fgCutNmaxFiredMacropad=50;//cut on number of max fired macropad
124 const Int_t AliTOFQADataMakerRec::fgkFiredMacropadLimit=50;//cut on number of max fired macropad
127 //____________________________________________________________________________
128 AliTOFQADataMakerRec::AliTOFQADataMakerRec() :
129 AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kTOF), "TOF Quality Assurance Data Maker"),
131 fEnableNoiseFiltering(kFALSE),
132 fEnableDqmShifterOpt(kFALSE),
134 fLineExpTimeMin(0x0),
135 fLineExpTimeMax(0x0),
138 fTOFRawStream(AliTOFRawStream()),
141 fCalib(AliTOFcalib())
146 // fLineExpTimeMin = new TLine(200., 0., 200., 0.);
147 // fLineExpTimeMax = new TLine(250., 0., 250., 0.);
148 // fLineExpTotMin = new TLine(5., 0., 5., 0.);
149 // fLineExpTotMax = new TLine(20., 0., 20., 0.);
151 for (Int_t sm=0;sm<17;sm++){
152 fLineSMid[sm] = new TLine( sm+1, 0., sm+1, 91.);
155 for (Int_t sm=0;sm<71;sm++){
156 fLineLTMid[sm] = new TLine( sm+1, 0., sm+1, 23.);
159 for (Int_t sm=0;sm<22;sm++){
160 fLineLTMbitId[sm] = new TLine( 0., sm+1, 72. ,sm+1);
165 //____________________________________________________________________________
166 AliTOFQADataMakerRec::AliTOFQADataMakerRec(const AliTOFQADataMakerRec& qadm) :
168 fCalibData(qadm.fCalibData),
169 fEnableNoiseFiltering(qadm.fEnableNoiseFiltering),
170 fEnableDqmShifterOpt(qadm.fEnableDqmShifterOpt),
172 fLineExpTimeMin(qadm.fLineExpTimeMin),
173 fLineExpTimeMax(qadm.fLineExpTimeMax),
174 fLineExpTotMin(qadm.fLineExpTotMin),
175 fLineExpTotMax(qadm.fLineExpTotMax),
176 fTOFRawStream(qadm.fTOFRawStream),
177 fDecoderSummary(qadm.fDecoderSummary),
178 fRunNumber(qadm.fRunNumber),
184 SetName((const char*)qadm.GetName()) ;
185 SetTitle((const char*)qadm.GetTitle());
187 for (Int_t sm=0;sm<17;sm++){
188 fLineSMid[sm]=qadm.fLineSMid[sm];
191 for (Int_t sm=0;sm<71;sm++){
192 fLineLTMid[sm] = qadm.fLineLTMid[sm];
195 for (Int_t sm=0;sm<22;sm++){
196 fLineLTMbitId[sm] = qadm.fLineLTMbitId[sm];
201 //__________________________________________________________________
202 AliTOFQADataMakerRec& AliTOFQADataMakerRec::operator = (const AliTOFQADataMakerRec& qadm )
205 // assignment operator.
207 this->~AliTOFQADataMakerRec();
208 new(this) AliTOFQADataMakerRec(qadm);
212 //----------------------------------------------------------------------------
213 AliTOFQADataMakerRec::~AliTOFQADataMakerRec()
216 fTOFRawStream.Clear();
219 delete fLineExpTimeMin;
221 delete fLineExpTimeMax;
223 delete fLineExpTotMin;
225 delete fLineExpTotMax;
227 for (Int_t sm=0;sm<17;sm++){
229 delete fLineSMid[sm];
231 for (Int_t sm=0;sm<71;sm++){
233 delete fLineLTMid[sm];
235 for (Int_t sm=0;sm<22;sm++){
236 if (fLineLTMbitId[sm])
237 delete fLineLTMbitId[sm];
241 //----------------------------------------------------------------------------
242 AliTOFChannelOnlineStatusArray* AliTOFQADataMakerRec::GetCalibData()
245 // Retrive TOF calib objects from OCDB
247 AliCDBManager *man = AliCDBManager::Instance();
250 if (fRun<=0) fRunNumber=145288; //reference run from LHC11a
251 else fRunNumber=fRun;
253 if (man->GetRun()!=fRunNumber){
254 fRunNumber=man->GetRun();
255 AliWarning(Form("Run number mismatch found: setting it to value from current AliCDBManager instance = %i", fRunNumber));
257 cdbe = man->Get("TOF/Calib/Status",fRunNumber);
261 AliWarning("Load of calibration data from default (alien://) storage failed!");
262 printf("Calibration data will be loaded from local storage - ok if on DQM station!");
263 man->SetDefaultStorage("local:///local/cdb/");
264 cdbe = man->Get("TOF/Calib/Status",fRun);
267 AliWarning("Load of calibration data from local DQM machine storage failed!");
268 AliWarning("Calibration data will be loaded from local ($ALICE_ROOT) storage ");
269 man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
270 cdbe = man->Get("TOF/Calib/Status",fRunNumber);
273 // Retrieval of data in directory TOF/Calib/Data:
274 AliTOFChannelOnlineStatusArray * array = 0;
276 printf("======= OCDB object for TOF retrieved from run %i in %s\n",fRunNumber,cdbe->GetName());
277 array = (AliTOFChannelOnlineStatusArray *)cdbe->GetObject();
279 if (!array) AliFatal("No calibration data from calibration database !");
281 fCalib.Init(fRunNumber);
285 //____________________________________________________________________________
286 void AliTOFQADataMakerRec::InitRaws()
289 // create Raws histograms in Raws subdir
291 ReadHistogramRangeFromFile(gSystem->Getenv("TOFDQMHISTO_CONFIGFILE"));
293 const Bool_t expert = kTRUE ;
294 const Bool_t saveCorr = kTRUE ;
295 const Bool_t image = kTRUE ;
297 TH1I * h0 = new TH1I("hTOFRaws","TOF raw hit multiplicity; TOF raw hits number; Events ",fgNbinsMultiplicity, fgRangeMinMultiplicity, fgRangeMaxMultiplicity);
298 TH1I * h1 = new TH1I("hTOFRawsIA","TOF raw hit multiplicity - I/A side; TOF raw hits number;Events ",fgNbinsMultiplicity, fgRangeMinMultiplicity, fgRangeMaxMultiplicity);
299 TH1I * h2 = new TH1I("hTOFRawsOA","TOF raw hit multiplicity - O/A side; TOF raw hits number;Events ",fgNbinsMultiplicity, fgRangeMinMultiplicity, fgRangeMaxMultiplicity);
300 TH1I * h3 = new TH1I("hTOFRawsIC","TOF raw hit multiplicity - I/C side; TOF raw hits number;Events ",fgNbinsMultiplicity, fgRangeMinMultiplicity, fgRangeMaxMultiplicity);
301 TH1I * h4 = new TH1I("hTOFRawsOC","TOF raw hit multiplicity - O/C side; TOF raw hits number;Events ",fgNbinsMultiplicity, fgRangeMinMultiplicity, fgRangeMaxMultiplicity);
303 TH1F * h5 = new TH1F("hTOFRawsTime", "TOF Raws - Hit time (ns);Measured Hit time [ns];Hits", fgNbinsTime,fgRangeMinTime,fgRangeMaxTime);
304 TH1F * h6 = new TH1F("hTOFRawsTimeIA", "TOF Raws - Hit time (ns) - I/A side;Measured Hit time [ns];Hits", fgNbinsTime,fgRangeMinTime,fgRangeMaxTime);
305 TH1F * h7 = new TH1F("hTOFRawsTimeOA", "TOF Raws - Hit time (ns) - O/A side;Measured Hit time [ns];Hits", fgNbinsTime,fgRangeMinTime,fgRangeMaxTime);
306 TH1F * h8 = new TH1F("hTOFRawsTimeIC", "TOF Raws - Hit time (ns) - I/C side;Measured Hit time [ns];Hits", fgNbinsTime,fgRangeMinTime,fgRangeMaxTime);
307 TH1F * h9 = new TH1F("hTOFRawsTimeOC", "TOF Raws - Hit time (ns) - O/C side;Measured Hit time [ns];Hits", fgNbinsTime,fgRangeMinTime,fgRangeMaxTime);
309 TH1F * h10 = new TH1F("hTOFRawsToT", "TOF Raws - Hit ToT (ns);Measured Hit ToT (ns);Hits", 100, 0., 48.8);
311 TH1F * h11 = new TH1F("hTOFRawsToTIA", "TOF Raws - Hit ToT (ns) - I/A side;Measured Hit ToT (ns);Hits", 100, 0., 48.8);
312 TH1F * h12 = new TH1F("hTOFRawsToTOA", "TOF Raws - Hit ToT (ns) - O/A side;Measured Hit ToT (ns);Hits", 100, 0., 48.8);
313 TH1F * h13 = new TH1F("hTOFRawsToTIC", "TOF Raws - Hit ToT (ns) - I/C side;Measured Hit ToT (ns);Hits", 100, 0., 48.8);
314 TH1F * h14 = new TH1F("hTOFRawsToTOC", "TOF Raws - Hit ToT (ns) - O/C side;Measured Hit ToT (ns);Hits", 100, 0., 48.8);
316 TH1F * h15 = new TH1F("hTOFRawsLTMHits", "LTMs OR signals; Crate; Counts", 72, 0., 72.);
317 TH2F * h16 = new TH2F("hTOFrefMap", "TOF enabled channel reference map;sector;strip", 72, 0., 18., 91, 0., 91.);
318 TH2F * h17 = new TH2F("hTOFRawHitMap","TOF raw hit map;sector;strip", 72, 0., 18., 91, 0., 91.);
319 TH2I * h18 = new TH2I("hTOFDecodingErrors","Decoding error monitoring; DDL; Error ", 72, 0, 72, 13,1,14);
321 h18->GetYaxis()->SetBinLabel(1,"DRM ");
322 h18->GetYaxis()->SetBinLabel(2,"LTM ");
323 h18->GetYaxis()->SetBinLabel(3,"TRM 3 ");
324 h18->GetYaxis()->SetBinLabel(4,"TRM 4");
325 h18->GetYaxis()->SetBinLabel(5,"TRM 5");
326 h18->GetYaxis()->SetBinLabel(6,"TRM 6");
327 h18->GetYaxis()->SetBinLabel(7,"TRM 7");
328 h18->GetYaxis()->SetBinLabel(8,"TRM 8");
329 h18->GetYaxis()->SetBinLabel(9,"TRM 9");
330 h18->GetYaxis()->SetBinLabel(10,"TRM 10");
331 h18->GetYaxis()->SetBinLabel(11,"TRM 11");
332 h18->GetYaxis()->SetBinLabel(12,"TRM 12");
333 h18->GetYaxis()->SetBinLabel(13,"recovered");
335 TH1F * h19 = new TH1F("hTOFOrphansTime", "TOF Raws - Orphans time (ns);Measured Hit time [ns];Hits",fgNbinsTime,fgRangeMinTime,fgRangeMaxTime);
336 TH2F * h20 = new TH2F("hTOFRawTimeVsTRM035", "TOF raws - Hit time vs TRM - crates 0 to 35; TRM index = DDL*10+TRM(0-9);TOF raw time [ns]", 361, 0., 361.,fgNbinsTime,fgRangeMinTime,fgRangeMaxTime);
337 TH2F * h21 = new TH2F("hTOFRawTimeVsTRM3671", "TOF raws - Hit time vs TRM - crates 36 to 72; TRM index = DDL**10+TRM(0-9);TOF raw time [ns]", 361, 360., 721.,fgNbinsTime, fgRangeMinTime,fgRangeMaxTime);
338 TH2F * h22 = new TH2F("hTOFTimeVsStrip","TOF raw hit time vs. MRPC (along z axis); MRPC index along z axis; Raws TOF time (ns) ", 91,0.,91,fgNbinsTime,fgRangeMinTime,fgRangeMaxTime);
339 TH2F * h23 = new TH2F("hTOFtimeVsBCID","TOF time vs BCID; BCID; time (ns) ", 3564, 0., 3564.,fgNbinsTime,fgRangeMinTime,fgRangeMaxTime);
340 TH2F * h24 = new TH2F("hTOFchannelEfficiencyMap","TOF channels (HWok && efficient && !noisy && !problematic);sector;strip", 72, 0., 18., 91, 0., 91.);
341 TH2F * h25 = new TH2F("hTOFhitsCTTM","Map of hit pads according to CTTM numbering;LTM index;bit index", 72, 0., 72., 23, 0., 23.);
342 TH2F * h26 = new TH2F("hTOFmacropadCTTM","Map of hit macropads according to CTTM numbering;LTM index; bit index", 72, 0., 72., 23, 0., 23.);
343 TH2F * h27 = new TH2F("hTOFmacropadDeltaPhiTime","#Deltat vs #Delta#Phi of hit macropads;#Delta#Phi (degrees);#DeltaBX", 18, 0., 180., 20, 0., 20.0);
344 TH2I *h28 = new TH2I("hBXVsCttmBit","BX ID in TOF matching window vs trg channel; trg channel; BX", 1728, 0, 1728, 24, 0, 24);
345 TH2F *h29 = new TH2F("hTimeVsCttmBit","TOF raw time vs trg channel; trg channel; raw time (ns)", 1728, 0., 1728., fgNbinsTime, fgRangeMinTime, fgRangeMaxTime);
347 h25->GetYaxis()->SetTickLength(-0.02);
348 h26->GetYaxis()->SetTickLength(-0.02);
349 h25->GetYaxis()->SetNdivisions(210);
350 h26->GetYaxis()->SetNdivisions(210);
351 h25->GetXaxis()->SetTickLength(-0.02);
352 h26->GetXaxis()->SetTickLength(-0.02);
353 h25->GetXaxis()->SetLabelOffset(0.015);
354 h26->GetXaxis()->SetLabelOffset(0.015);
355 h25->GetXaxis()->SetNdivisions(515);
356 h26->GetXaxis()->SetNdivisions(515);
389 //add lines for DQM shifter
390 fLineExpTimeMin = new TLine(200., 0., 200., 0.);
391 fLineExpTimeMax = new TLine(300., 0., 300., 0.);
392 fLineExpTotMin = new TLine(10., 0., 10., 0.);
393 fLineExpTotMax = new TLine(15., 0., 15., 0.);
395 fLineExpTimeMin->SetLineColor(kGreen);
396 fLineExpTimeMin->SetLineWidth(2);
398 fLineExpTimeMax->SetLineColor(kGreen);
399 fLineExpTimeMax->SetLineWidth(2);
401 fLineExpTotMin->SetLineColor(kGreen);
402 fLineExpTotMin->SetLineWidth(2);
404 fLineExpTotMax->SetLineColor(kGreen);
405 fLineExpTotMax->SetLineWidth(2);
408 for (Int_t sm=0;sm<17;sm++){
409 fLineSMid[sm]->SetLineColor(kMagenta);
410 fLineSMid[sm]->SetLineWidth(2);
413 h5->GetListOfFunctions()->Add(fLineExpTimeMin);
414 h5->GetListOfFunctions()->Add(fLineExpTimeMax);
415 h10->GetListOfFunctions()->Add(fLineExpTotMin);
416 h10->GetListOfFunctions()->Add(fLineExpTotMax);
418 for (Int_t sm=0;sm<17;sm++){
419 h16->GetListOfFunctions()->Add(fLineSMid[sm]);
420 h17->GetListOfFunctions()->Add(fLineSMid[sm]);
422 for (Int_t sm=0;sm<71;sm++){
423 fLineLTMid[sm]->SetLineColor(kBlack);
424 fLineLTMid[sm]->SetLineWidth(1);
425 h26->GetListOfFunctions()->Add(fLineLTMid[sm]);
426 h25->GetListOfFunctions()->Add(fLineLTMid[sm]);
428 for (Int_t sm=0;sm<22;sm++){
429 fLineLTMbitId[sm]->SetLineColor(kBlack);
430 fLineLTMbitId[sm]->SetLineWidth(1);
431 h26->GetListOfFunctions()->Add(fLineLTMbitId[sm]);
432 h25->GetListOfFunctions()->Add(fLineLTMbitId[sm]);
435 TPaveText *phosHoleBox=new TPaveText(13,38,16,53,"b");
436 phosHoleBox->SetFillStyle(0);
437 phosHoleBox->SetFillColor(kWhite);
438 phosHoleBox->SetLineColor(kMagenta);
439 phosHoleBox->SetLineWidth(2);
440 phosHoleBox->AddText("PHOS");
441 h16->GetListOfFunctions()->Add(phosHoleBox);
442 h17->GetListOfFunctions()->Add(phosHoleBox);
444 // h0->SetDrawOption("logy");
445 // h5->SetDrawOption("logy");
446 // h10->SetDrawOption("logy");
448 Add2RawsList(h0, 0, !expert, image, !saveCorr) ;
449 Add2RawsList(h1, 1, expert, !image, !saveCorr) ;
450 Add2RawsList(h2, 2, expert, !image, !saveCorr) ;
451 Add2RawsList(h3, 3, expert, !image, !saveCorr) ;
452 Add2RawsList(h4, 4, expert, !image, !saveCorr) ;
453 Add2RawsList(h5, 5, !expert, image, !saveCorr) ;
454 Add2RawsList(h6, 6, expert, !image, !saveCorr) ;
455 Add2RawsList(h7, 7, expert, !image, !saveCorr) ;
456 Add2RawsList(h8, 8, expert, !image, !saveCorr) ;
457 Add2RawsList(h9, 9, expert, !image, !saveCorr) ;
458 Add2RawsList(h10, 10, !expert, image, !saveCorr) ;
459 Add2RawsList(h11, 11, expert, !image, !saveCorr) ;
460 Add2RawsList(h12, 12, expert, !image, !saveCorr) ;
461 Add2RawsList(h13, 13, expert, !image, !saveCorr) ;
462 Add2RawsList(h14, 14, expert, !image, !saveCorr) ;
463 Add2RawsList(h15, 15, expert, !image, !saveCorr) ;
464 Add2RawsList(h16, 16, !expert, image, !saveCorr) ;
465 Add2RawsList(h17, 17, !expert, image, !saveCorr) ;
466 Add2RawsList(h18, 18, expert, !image, !saveCorr) ;
467 Add2RawsList(h19, 19, expert, !image, !saveCorr) ;
468 Add2RawsList(h20, 20, expert, !image, !saveCorr) ;
469 Add2RawsList(h21, 21, expert, !image, !saveCorr) ;
470 Add2RawsList(h22, 22, expert, !image, !saveCorr) ;
471 Add2RawsList(h23, 23, expert, !image, !saveCorr) ;
472 Add2RawsList(h24, 24, expert, !image, !saveCorr) ;
473 Add2RawsList(h25, 25, expert, !image, !saveCorr) ;
474 Add2RawsList(h26, 26, expert, image, !saveCorr) ;
475 Add2RawsList(h27, 27, expert, !image, !saveCorr) ;
476 Add2RawsList(h28, 28, expert, !image, !saveCorr) ;
477 Add2RawsList(h29, 29, expert, !image, !saveCorr) ;
480 ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line
483 //____________________________________________________________________________
484 void AliTOFQADataMakerRec::InitRecPoints()
487 // create RecPoints histograms in RecPoints subdir
490 const Bool_t expert = kTRUE ;
491 const Bool_t image = kTRUE ;
493 TH1I * h0 = new TH1I("hTOFRecPoints", "TOF RecPoints multiplicity ; TOF RecPoints number;Events",200, 0, 200) ;
495 TH1F * h1 = new TH1F("hTOFRecPointsTimeIA", "RecPoints Time Spectrum in TOF (ns)- I/A side; Calibrated TOF time [ns];Events", 250, 0., 610.) ;
496 TH1F * h2 = new TH1F("hTOFRecPointsTimeOA", "RecPoints Time Spectrum in TOF (ns)- O/A side; Calibrated TOF time [ns];Events", 250, 0., 610.) ;
497 TH1F * h3 = new TH1F("hTOFRecPointsTimeIC", "RecPoints Time Spectrum in TOF (ns)- I/C side; Calibrated TOF time [ns];Events", 250, 0., 610.) ;
498 TH1F * h4 = new TH1F("hTOFRecPointsTimeOC", "RecPoints Time Spectrum in TOF (ns)- O/C side; Calibrated TOF time [ns];Events", 250, 0., 610.) ;
500 TH1F * h5 = new TH1F("hTOFRecPointsRawTimeIA", "RecPoints raw Time Spectrum in TOF (ns)-I/A side; Measured TOF time [ns];Hits", 250, 0., 610.) ;
501 TH1F * h6 = new TH1F("hTOFRecPointsRawTimeOA", "RecPoints raw Time Spectrum in TOF (ns)-O/A side; Measured TOF time [ns];Hits", 250, 0., 610.) ;
502 TH1F * h7 = new TH1F("hTOFRecPointsRawTimeIC", "RecPoints raw Time Spectrum in TOF (ns)-I/C side; Measured TOF time [ns];Hits", 250, 0., 610.) ;
503 TH1F * h8 = new TH1F("hTOFRecPointsRawTimeOC", "RecPoints raw Time Spectrum in TOF (ns)-O/C side; Measured TOF time [ns];Hits", 250, 0., 610.) ;
505 TH1F * h9 = new TH1F("hTOFRecPointsToTIA", "RecPoints ToT Spectrum in TOF (ns)-I/A side; Measured TOT [ns];Hits", 100, 0., 48.8 ) ;
506 TH1F * h10 = new TH1F("hTOFRecPointsToTOA", "RecPoints ToT Spectrum in TOF (ns)-O/A side; Measured TOT [ns];Hits", 100, 0., 48.8 ) ;
507 TH1F * h11 = new TH1F("hTOFRecPointsToTIC", "RecPoints ToT Spectrum in TOF (ns)-I/C side; Measured TOT [ns];Hits", 100, 0., 48.8 ) ;
508 TH1F * h12 = new TH1F("hTOFRecPointsToTOC", "RecPoints ToT Spectrum in TOF (ns)-O/C side; Measured TOT [ns];Hits", 100, 0., 48.8 ) ;
510 TH2F * h13 = new TH2F("hTOFRecPointsClusMap","RecPoints map; sector ;strip", 72, 0., 18., 91, 0., 91.) ;
511 TH2F * h14 = new TH2F("hTOFRecPointsTimeVsStrip","RecPoints TOF time vs. strip (theta); Strip index; RecPoints TOF time (ns) ",91, 0., 91., 250, 0., 610.) ;
512 TH2F * h15 = new TH2F("hTOFRecPointsTimeVsTRM035","TOF RecPoints time vs TRM - crates 0 to 35; TRM index = DDL*10+TRM(0-9);TOF time [ns]", 361, 0., 361., 250, 0., 610.0) ;
513 TH2F * h16 = new TH2F("hTOFRecPointsTimeVsTRM3671","TOF RecPoints time vs TRM - crates 36 to 72; TRM index = DDL**10+TRM(0-9);TOF time [ns]", 361, 360., 721., 250, 0., 610.0) ;
533 Add2RecPointsList(h0, 0, !expert, image) ;
534 Add2RecPointsList(h1, 1, !expert, image) ;
535 Add2RecPointsList(h2, 2, !expert, image) ;
536 Add2RecPointsList(h3, 3, !expert, image) ;
537 Add2RecPointsList(h4, 4, !expert, image) ;
538 Add2RecPointsList(h5, 5, expert, !image) ;
539 Add2RecPointsList(h6, 6, expert, !image) ;
540 Add2RecPointsList(h7, 7, expert, !image) ;
541 Add2RecPointsList(h8, 8, expert, !image) ;
542 Add2RecPointsList(h9, 9, !expert, !image) ;
543 Add2RecPointsList(h10, 10, !expert, !image) ;
544 Add2RecPointsList(h11, 11, !expert, !image) ;
545 Add2RecPointsList(h12, 12, !expert, !image) ;
546 Add2RecPointsList(h13, 13, expert, !image) ;
547 Add2RecPointsList(h14, 14, expert, image) ;
548 Add2RecPointsList(h15, 15, expert, !image) ;
549 Add2RecPointsList(h16, 16, expert, !image) ;
551 ClonePerTrigClass(AliQAv1::kRECPOINTS); // this should be the last line
554 //____________________________________________________________________________
555 void AliTOFQADataMakerRec::InitESDs()
558 //create ESDs histograms in ESDs subdir
561 const Bool_t expert = kTRUE ;
562 const Bool_t image = kTRUE ;
564 TH1I * h0 = new TH1I("hTOFESDs", "Number of matched TOF tracks per event;Number of TOF matched ESD tracks;Counts", 200, 0, 200) ;
565 TH1F * h1 = new TH1F("hTOFESDsTime", "Matched ESDs tracks: TOF Time spectrum; Calibrated TOF time [ns];Counts", 250, 0., 610. ) ;
566 TH1F * h2 = new TH1F("hTOFESDsRawTime", "Matched ESDs tracks: TOF raw Time spectrum;Measured TOF time [ns];Counts", 250, 0., 610.) ;
567 TH1F * h3 = new TH1F("hTOFESDsToT", "Matched ESDs tracks: TOF ToT spectrum; ESDs ToT [ns];Counts",100, 0., 48.8) ;
568 TH1F * h4 = new TH1F("hTOFESDskTOFOUT", "p_{T} distribution of tracks with kTOFout; p_{T} (GeV/c);Counts", 50, 0.20, 5.00) ;
569 TH1F * h5 = new TH1F("hTOFESDskTIME", "p_{T} distribution of tracks with kTOFout && kTIME; p_{T} (GeV/c);Counts", 50, 0.20, 5.00) ;
570 TH1F * h6 = new TH1F("hTOFESDsMatched", "p_{T} distribution of tracks with kTOFout && TOFtime>0; p_{T} (GeV/c);Counts", 50, 0.20, 5.00) ;
571 TH1F * h7 = new TH1F("hTOFESDsMatchingProb", "TPC-TOF track-matching probability;TOF matching probability (%) ;Counts",101, -1.0, 100) ;
572 TH1F * h8 = new TH1F("hTOFESDsDiffTime", "ESDs t_{TOF}-t_{exp,pi} spectrum in TOF (ps); t_{TOF}-t_{exp,pi} [ps];Counts", 200, -2440., 2440.) ;
573 TH1F * h9 = new TH1F("hTOFHitsLength", "Matched ESDs tracks: Length Spectrum; Track length [cm];Counts", 800, 0., 800) ;
586 Add2ESDsList(h0, 0, !expert, image) ;
587 Add2ESDsList(h1, 1, !expert, image) ;
588 Add2ESDsList(h2, 2, expert, !image) ;
589 Add2ESDsList(h3, 3, !expert, !image) ;
590 Add2ESDsList(h4, 4, expert, image) ;
591 Add2ESDsList(h5, 5, expert, image) ;
592 Add2ESDsList(h6, 6, expert, image) ;
593 Add2ESDsList(h7, 7, expert, image) ;
594 Add2ESDsList(h8, 8, expert, !image) ;
595 Add2ESDsList(h9, 9, !expert, !image) ;
597 ClonePerTrigClass(AliQAv1::kESDS); // this should be the last line
601 //____________________________________________________________________________
602 void AliTOFQADataMakerRec::MakeRaws(AliRawReader* rawReader)
605 // makes data from Raws
607 if (rawReader->GetType()==7) {
609 Double_t tdc2ns=AliTOFGeometry::TdcBinWidth()*1E-3;//in ns
610 Double_t tot2ns=AliTOFGeometry::ToTBinWidth()*1E-3;
611 Int_t ntof[5]; /* 0=tot, 1=IA, 2=OA, 3=IC, 4=OC*/
612 for (Int_t j=0;j<5;j++){ ntof[j]=0;}
613 Int_t equipmentID[5]; //(ddl, trm, chain,tdc,channel)
614 Int_t volumeID[5]; //(sector,plate,strip,padX,padZ)
615 Int_t volumeID2[5]; //(sector,plate,strip,padZ,padX) to use AliTOFGeometry::GetIndex()
617 Int_t indexCTTM[2]={-1,-1};
618 Int_t indexGeo2CTTM[2]={-1,-1};
619 Float_t macropadPhiTimeUPC[fgkFiredMacropadLimit][2];
620 for (Int_t ii=0;ii<2;ii++){
621 for (Int_t jj=0;jj<fgkFiredMacropadLimit;jj++){
622 macropadPhiTimeUPC[jj][ii]=-999.0;
626 TClonesArray * clonesRawData;
627 fTOFRawStream.SetRawReader(rawReader);
628 Int_t BCID=rawReader->GetBCID();
630 Int_t nFiredMacropad=0,
632 nFiredMacropad=GetNumberOfFiredMacropad(rawReader);
634 //uncomment if needed to apply DeltaBC correction
635 //fTOFRawStream.ApplyBCCorrections(kTRUE);
637 if (fDecoderSummary){
638 fDecoderSummary->Reset();
640 for (Int_t iDDL = 0; iDDL < AliTOFGeometry::NDDL()*AliTOFGeometry::NSectors(); iDDL++){
642 fTOFRawStream.LoadRawDataBuffersV2(iDDL);
644 //* get decoding error counters
645 fDecoderSummary = ( (AliTOFDecoderV2*) fTOFRawStream.GetDecoderV2() )->GetDecoderSummaryData();
646 if ( (fDecoderSummary) && (fDecoderSummary ->GetErrorDetected()) ) {
647 Int_t errorSlotID=(Int_t) fDecoderSummary->GetErrorSlotID();
648 FillRawsData(18,iDDL,errorSlotID);
649 if (fDecoderSummary -> GetRecoverError() )
650 FillRawsData(18,iDDL,13);
653 clonesRawData = (TClonesArray*)fTOFRawStream.GetRawData();
654 for (Int_t iRawData = 0; iRawData<clonesRawData->GetEntriesFast(); iRawData++) {
655 AliTOFrawData *tofRawDatum = (AliTOFrawData*)clonesRawData->UncheckedAt(iRawData);
656 Float_t tofRawTime=tofRawDatum->GetTOF()*tdc2ns;
658 if (tofRawDatum->GetTOF()){
660 equipmentID[1]=tofRawDatum->GetTRM();
661 equipmentID[2]=tofRawDatum->GetTRMchain();
662 equipmentID[3]=tofRawDatum->GetTDC();
663 equipmentID[4]=tofRawDatum->GetTDCchannel();
665 if (CheckEquipID(equipmentID)){
666 fTOFRawStream.EquipmentId2VolumeId(iDDL,
667 tofRawDatum->GetTRM(),
668 tofRawDatum->GetTRMchain(),
669 tofRawDatum->GetTDC(),
670 tofRawDatum->GetTDCchannel(),
673 if (FilterLTMData(equipmentID)) { //counts LTM hits
674 if (equipmentID[2]==1) //crate left, A-side or C-side
675 FillRawsData(15,equipmentID[0]);
677 FillRawsData(15,equipmentID[0]-1);
679 //retrieve CTTM index (Ltm, bit)
680 GetCTTMIndex(equipmentID, indexCTTM);
682 //get BX index within TOF-matching window
684 indexBC= TMath::Nint(tofRawTime/24.4);
686 Int_t indexCttmChannel=indexCTTM[0]*24+indexCTTM[1];
687 FillRawsData(28,indexCttmChannel,indexBC);
688 FillRawsData(29,indexCttmChannel,tofRawTime);
690 //fired macropad map (from LTM hits) - only for low multi evts (UPC)
691 if ((nFiredMacropad<=fgCutNmaxFiredMacropad)){
693 AliInfo(Form("Event found with %i fired macropads in BCID = %i!",nFiredMacropad,BCID));
694 FillRawsData(26,indexCTTM[0],indexCTTM[1]);
695 Float_t halfSMphi=-999.0;
697 halfSMphi=indexCTTM[0]*10.+5.;
698 else halfSMphi=(indexCTTM[0]-36)*10.+5.;
699 macropadPhiTimeUPC[iFiredMacropad][0]=halfSMphi;
700 macropadPhiTimeUPC[iFiredMacropad][1]=indexBC;
705 if (CheckVolumeID(volumeID)){
706 volumeID2[0]=volumeID[0];
707 volumeID2[1]=volumeID[1];
708 volumeID2[2]=volumeID[2];
709 volumeID2[3]=volumeID[4];
710 volumeID2[4]=volumeID[3];
711 chIndex=AliTOFGeometry::GetIndex(volumeID2);
713 //fill hit map according to CTTM numbering
714 GetGeo2CTTMIndex(volumeID2, indexGeo2CTTM);
715 if ((nFiredMacropad<=fgCutNmaxFiredMacropad)){
716 FillRawsData(25,indexGeo2CTTM[0],indexGeo2CTTM[1]);
719 if (tofRawDatum->GetTOT()){
720 if (!(fCalibData->GetNoiseStatus(chIndex)==AliTOFChannelOnlineStatusArray::kTOFNoiseBad)
721 && (fCalibData->GetHWStatus(chIndex) == AliTOFChannelOnlineStatusArray::kTOFHWOk)) {//noise and enabled filter
722 ntof[0]++; //counter for tof hits
724 //fill global spectra for DQM plots
725 FillRawsData(5, tofRawTime) ;//in ns
726 FillRawsData(10, tofRawDatum->GetTOT()*tot2ns) ;//in ns
727 FillRawsData(23, BCID, tofRawTime) ;//in ns
729 //fill side-related spectra for experts plots
730 Int_t ddlACside=iDDL/36; // 0 or 1
731 Int_t ddlPerSm=iDDL%4;
733 if (volumeID2[0]>4 && volumeID2[0]<14){ //O side
734 if (ddlPerSm<2){ //A side
736 FillRawsData(6, tofRawTime) ;
737 FillRawsData(11, tofRawDatum->GetTOT()*tot2ns) ;
740 FillRawsData(8, tofRawTime) ;
741 FillRawsData(13, tofRawDatum->GetTOT()*tot2ns) ;
744 if (volumeID2[0]<5 || volumeID2[0]>13){ //I side
745 if (ddlPerSm<2){ //A side
747 FillRawsData(7, tofRawTime) ;
748 FillRawsData(12, tofRawDatum->GetTOT()*tot2ns) ;
751 FillRawsData(9, tofRawTime) ;
752 FillRawsData(14, tofRawDatum->GetTOT()*tot2ns) ;
758 Int_t trm= iDDL*10+(equipmentID[1]-3);
759 FillRawsData(20+ddlACside,trm,tofRawTime);
760 FillRawsData(22,GetStripIndex(volumeID),tofRawTime) ;
761 Short_t fea = volumeID2[4]/12;
762 Float_t hitmapx = volumeID2[0] + ((Double_t)(3 - fea) + 0.5) *0.25;
763 FillRawsData(17,hitmapx,GetStripIndex(volumeID2));
764 if (fCalib.IsChannelEnabled(chIndex,kTRUE,kTRUE))//checks also if efficient and if problematic
765 FillRawsData(24,hitmapx,GetStripIndex(volumeID2));
769 if (!(fCalibData->GetNoiseStatus(chIndex) == AliTOFChannelOnlineStatusArray::kTOFNoiseBad)
770 && (fCalibData->GetHWStatus(chIndex) == AliTOFChannelOnlineStatusArray::kTOFHWOk))
771 FillRawsData(19, tofRawTime) ;//in ns
773 }//end volumeID check
777 clonesRawData->Clear();
780 for (Int_t j=0;j<5;j++) FillRawsData(j,ntof[j]);
781 fTOFRawStream.Clear();
783 if ((nFiredMacropad<=fgCutNmaxFiredMacropad)){
784 Float_t deltaPhiMacropad=-999.;
785 Float_t deltaTimeMacropad=-999.;
786 for (Int_t j=0;j<fgCutNmaxFiredMacropad+1; j++){
787 for (Int_t k=j+1;k<fgCutNmaxFiredMacropad+1; k++){
788 if ((macropadPhiTimeUPC[j][0]>0.0)&&(macropadPhiTimeUPC[k][0]>0.0)){
789 deltaPhiMacropad=TMath::Abs(macropadPhiTimeUPC[j][0]-macropadPhiTimeUPC[k][0]);
790 deltaTimeMacropad=TMath::Abs(macropadPhiTimeUPC[j][1]-macropadPhiTimeUPC[k][1]);
791 if (deltaPhiMacropad<=180.)
792 FillRawsData(27, deltaPhiMacropad,deltaTimeMacropad);
794 FillRawsData(27, TMath::Abs(360.0-deltaPhiMacropad),deltaTimeMacropad);
798 }//end cut on number of fired macropad
800 AliDebug(1,Form("Event of type %d found. Skipping non-physics event for QA.\n", rawReader->GetType()));
803 //fill reference map for DQM shifter only once in a detector cycle
805 Int_t geoId[5]={-1,-1,-1,-1,-1};// pgeoId=(sm, mod, strip, padZ, padX)
806 Int_t detId[5]={-1,-1,-1,-1,-1};//detID=(ddl,trm,tdc, chain,channel)
808 for (Int_t ch = 0; ch < fCalibData->GetSize(); ch++) {
809 AliTOFGeometry::GetVolumeIndices(ch,geoId);
810 AliTOFRawStream::Geant2EquipmentId(geoId,detId);
811 if ((detId[1]<0)||(detId[0]<0)) continue;
812 trmIndex=(detId[1]-3)+detId[0]*10;
814 if ( (!(fCalibData->GetNoiseStatus(ch)==AliTOFChannelOnlineStatusArray::kTOFNoiseBad))
815 && (fCalibData->GetHWStatus(ch) == AliTOFChannelOnlineStatusArray::kTOFHWOk) ){
816 //fill reference map with info from OCDB
817 Short_t fea = geoId[4]/12;
818 Float_t hitmapx = geoId[0] + ((Double_t)(3 - fea) + 0.5)*0.25;
819 FillRawsData(16,hitmapx, GetStripIndex(geoId));
825 //enable options for DQM shifter
826 EnableDqmShifterOpt(kTRUE);
828 IncEvCountCycleRaws();
829 IncEvCountTotalRaws();
833 //____________________________________________________________________________
834 void AliTOFQADataMakerRec::MakeRecPoints(TTree * clustersTree)
837 // Make data from Clusters
840 Double_t tdc2ns=AliTOFGeometry::TdcBinWidth()*1E-3;
841 Double_t tot2ns=AliTOFGeometry::ToTBinWidth()*1E-3;
843 Int_t volumeID2[5];//(sm, plate,strip, padZ,padX)
844 //Int_t volumeID[5];//(sm, plate,strip, padX,padZ)
846 TBranch *branch=clustersTree->GetBranch("TOF");
848 AliError("can't get the branch with the TOF clusters !");
852 static TClonesArray dummy("AliTOFcluster",10000);
854 TClonesArray *clusters=&dummy;
855 branch->SetAddress(&clusters);
858 clustersTree->GetEvent(0);
860 FillRecPointsData(0,(Int_t)clusters->GetEntriesFast()) ;
862 TIter next(clusters) ;
864 while ( (c = dynamic_cast<AliTOFcluster *>(next())) ) {
866 // volumeID2[0] = c->GetDetInd(0);
867 // volumeID2[1] = c->GetDetInd(1);
868 // volumeID2[2] = c->GetDetInd(2);
869 // volumeID2[3] = c->GetDetInd(4); //padX
870 // volumeID2[4] = c->GetDetInd(3); //padZ
872 for (Int_t i=0;i<5;i++){
873 volumeID2[i]=c->GetDetInd(i); //X and Z indeces inverted in RecPoints
875 //Int_t chIndex=AliTOFGeometry::GetIndex(volumeID2);
876 Int_t iDDL=AliTOFRawStream::Geant2DDL(volumeID2);
877 Int_t iTRM=AliTOFRawStream::Geant2TRM(volumeID2);
878 Short_t fea = volumeID2[4]/12;
879 Float_t hitmapx = volumeID2[0] + ((Double_t)(3 - fea) + 0.5) *0.25;
880 Int_t ddlACside=iDDL/36; // 0 or 1
881 Int_t ddlPerSm=iDDL%4;
883 if ((c->GetTDCRAW()) && (c->GetTDC()) && (c->GetToT())){
884 if (volumeID2[0]>4 && volumeID2[0]<14){ //I side
885 if (ddlPerSm<2){ //A side
886 FillRecPointsData(1, c->GetTDC()*tdc2ns) ;//in ns
887 FillRecPointsData(5, c->GetTDCRAW()*tdc2ns) ;//in ns
888 FillRecPointsData(9, c->GetToT()*tot2ns) ;//in ns
890 FillRecPointsData(3, c->GetTDC()*tdc2ns) ;//in ns
891 FillRecPointsData(7, c->GetTDCRAW()*tdc2ns) ;//in ns
892 FillRecPointsData(11, c->GetToT()*tot2ns) ;//in ns
895 if (volumeID2[0]<5 || volumeID2[0]>13){ //O side
896 if (ddlPerSm<2){ //A side
897 FillRecPointsData(2, c->GetTDC()*tdc2ns) ;//in ns
898 FillRecPointsData(6, c->GetTDCRAW()*tdc2ns) ;//in ns
899 FillRecPointsData(10, c->GetToT()*tot2ns) ;//in ns
901 FillRecPointsData(4, c->GetTDC()*tdc2ns) ;//in ns
902 FillRecPointsData(8, c->GetTDCRAW()*tdc2ns) ;//in ns
903 FillRecPointsData(12, c->GetToT()*tot2ns) ;//in ns
907 FillRecPointsData(13,hitmapx,GetStripIndex(volumeID2));
908 FillRecPointsData(14,GetStripIndex(volumeID2), c->GetTDC()*tdc2ns) ;
909 Int_t trm= iDDL*10+(iTRM-3);
910 if (ddlACside==0) { //A side
911 FillRecPointsData(15,trm,c->GetTDC()*tdc2ns);
913 FillRecPointsData(16,trm,c->GetTDC()*tdc2ns);
917 EnableDqmShifterOpt(kFALSE);
919 IncEvCountCycleRecPoints();
920 IncEvCountTotalRecPoints();
924 //____________________________________________________________________________
925 void AliTOFQADataMakerRec::MakeESDs(AliESDEvent * esd)
928 // make QA data from ESDs
930 const Double_t speedOfLight = TMath::C()*1E2*1E-12; // cm/ps
931 const Double_t pionMass = 0.13957018; //GeV/c^2
933 Int_t ntrk = esd->GetNumberOfTracks() ;
938 AliESDtrack *track=esd->GetTrack(ntrk);
939 Double_t tofTime=track->GetTOFsignal();//in ps
940 Double_t tofTimeRaw=track->GetTOFsignalRaw();//in ps
941 Double_t tofToT=track->GetTOFsignalToT(); //in ps
943 UInt_t status=track->GetStatus();
944 if (track->IsOn(AliESDtrack::kTPCrefit)) {
946 Double_t y=track->Eta();
947 if (TMath::Abs(y)<0.9) { //select TOF acceptance
948 if ((status&AliESDtrack::kTOFout)!=0) { //define matching
950 FillESDsData(1,tofTime*1E-3);
951 FillESDsData(2,tofTimeRaw*1E-3);
952 FillESDsData(3,tofToT*1E-3);
953 FillESDsData(4,track->Pt());
955 Double_t length =track->GetIntegratedLength();
956 Double_t mom2=(track->Pt()*track->Pt())+(track->Pz()*track->Pz());
957 Double_t piTexp = TMath::Sqrt(1+(pionMass*pionMass/mom2))*length/speedOfLight; //in ps
958 FillESDsData(8,tofTime-piTexp);
959 FillESDsData(9,length);
961 if ((status&AliESDtrack::kTIME)!=0)
962 FillESDsData(5,track->Pt());
965 FillESDsData(6,track->Pt());
966 } //end check on matched tracks
968 }//end check on TPCrefit
971 FillESDsData(0,ntofout) ;
973 Float_t ratio = (Float_t)ntofout/(Float_t)ntpc*100.; //matching probability
974 FillESDsData(7,ratio) ;
978 Float_t ratio = (Float_t)ntofout/(Float_t)ntpc*100; //matched over propagated to TOF outer radius
979 FillESDsData(8,ratio) ;
981 EnableDqmShifterOpt(kFALSE);
983 IncEvCountCycleESDs();
984 IncEvCountTotalESDs();
988 //____________________________________________________________________________
989 void AliTOFQADataMakerRec::StartOfDetectorCycle()
992 //Detector specific actions at start of cycle
993 fCalibData = GetCalibData();
998 //____________________________________________________________________________
999 void AliTOFQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
1001 //Detector specific actions at end of cycle
1002 // do the QA checking
1003 ResetEventTrigClasses();
1005 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
1006 if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) ) continue ;
1007 SetEventSpecie(AliRecoParam::ConvertIndex(specie));
1009 for (int itc=-1;itc<GetNTrigClasses();itc++) { // RS: loop over eventual clones per trigger class
1011 if (fEnableDqmShifterOpt) {
1012 // RS: fetch the histograms for given trigger class
1013 TObjArray& arrRW = *GetRawsDataOfTrigClass(itc);
1015 // Help make the raw qa histogram easier to interpret for the DQM shifter
1016 if (!arrRW[ 0] || !arrRW[ 5] || !arrRW[10] || !arrRW[15] || !arrRW[16] || !arrRW[17]) continue;
1018 printf("=========>Processed %i physics raw of specie %s with TrigGlass %d\n",
1019 GetEvCountCycleRaws(itc),AliRecoParam::GetEventSpecieName(specie), itc);
1021 //Double_t monitorPeriodLength=fProcessedRawEventN*600*1E-9;//in s
1024 //set minima and maxima to allow log scale
1025 Double_t yTimeMax = ((TH1*)arrRW[5])->GetMaximum()*1.05;
1026 Double_t yTotMax = ((TH1*)arrRW[10])->GetMaximum()*1.05;
1027 fLineExpTimeMin->SetY2(yTimeMax);
1028 fLineExpTimeMax->SetY2(yTimeMax);
1029 fLineExpTotMin->SetY2(yTotMax);
1030 fLineExpTotMax->SetY2(yTotMax);
1032 for (Int_t j=0;j<18;j++){
1033 if ((j==0)||(j==5)||(j==10)||(j==15)||(j==16)||(j==17)) {
1034 TH1* htmp = (TH1*)arrRW[j];
1035 htmp->GetXaxis()->SetLabelOffset(0.005);
1036 htmp->GetXaxis()->SetLabelSize(0.05);
1037 htmp->GetXaxis()->SetTitleOffset(0.8);
1038 htmp->GetXaxis()->SetTitleSize(0.05);
1039 htmp->GetYaxis()->SetLabelOffset(0.005);
1040 htmp->GetYaxis()->SetLabelSize(0.06);
1041 htmp->GetYaxis()->SetTitleOffset(0.8);
1042 htmp->GetYaxis()->SetTitleSize(0.06);
1045 //make up for all histos
1046 for(Int_t j=0;j<5;j++) {
1047 TH1* htmp = (TH1*)arrRW[j];
1048 if (!htmp) continue;
1049 htmp->SetMarkerColor(kBlue);
1050 htmp->SetMarkerStyle(8);
1051 htmp->SetMarkerSize(0.7);
1053 for(Int_t j=5;j<15;j++) {
1054 TH1* htmp = (TH1*)arrRW[j];
1055 if (!htmp) continue;
1056 htmp->SetLineColor(kBlue);
1057 htmp->SetLineWidth(1);
1058 htmp->SetMarkerColor(kBlue);
1061 TH1* htmp = (TH1*)arrRW[15];
1062 htmp->SetLineColor(kBlue);
1063 htmp->SetLineWidth(1);
1064 htmp->SetMarkerStyle(8);
1065 htmp->SetMarkerSize(0.7);
1066 htmp->SetMarkerColor(kBlue);//Option("bar");
1068 TString title25 = Form("Map of hit pads according to CTTM numbering (Max Fired Macropad = %i)",fgCutNmaxFiredMacropad);
1069 TString title26 = Form("Map of hit macropads according to CTTM numbering (Max Fired Macropad = %i)",fgCutNmaxFiredMacropad);
1070 TString title27 = Form("#Deltat vs #Delta#Phi of hit macropads (Max Fired Macropad = %i)",fgCutNmaxFiredMacropad);
1072 if ( (htmp=(TH1*)arrRW[16]) ) htmp->SetOption("colz");
1073 if ( (htmp=(TH1*)arrRW[17]) ) htmp->SetOption("colz");
1074 if ( (htmp=(TH1*)arrRW[18]) ) htmp->SetOption("colz");
1075 if ( (htmp=(TH1*)arrRW[22]) ) htmp->SetOption("colz");
1076 if ( (htmp=(TH1*)arrRW[23]) ) htmp->SetOption("colz");
1077 if ( (htmp=(TH1*)arrRW[24]) ) htmp->SetOption("colz");
1078 if ( (htmp=(TH1*)arrRW[28]) ) htmp->SetOption("colz");
1079 if ( (htmp=(TH1*)arrRW[29]) ) htmp->SetOption("colz");
1081 if ( (htmp=(TH1*)arrRW[25]) ) {
1082 htmp->SetOption("colz");
1083 htmp->SetTitle(title25.Data());
1085 if ( (htmp=(TH1*)arrRW[26]) ) {
1086 htmp->SetOption("colz");
1087 htmp->SetTitle(title26.Data());
1089 if ( (htmp=(TH1*)arrRW[27]) ){
1090 htmp->SetOption("colz");
1091 htmp->SetTitle(title27.Data());
1094 }//END ENABLE DQM SHIFTER OPT
1095 } // RS: loop over trigger classes
1098 AliQAChecker::Instance()->Run(AliQAv1::kTOF, task, list) ;
1101 //____________________________________________________________________________
1102 void AliTOFQADataMakerRec::GetMapIndeces(const Int_t* const in , Int_t* out)
1105 //return appropriate indeces for the theta-phi map
1108 Int_t npadX = AliTOFGeometry::NpadX();
1109 Int_t npadZ = AliTOFGeometry::NpadZ();
1110 Int_t nStripA = AliTOFGeometry::NStripA();
1111 Int_t nStripB = AliTOFGeometry::NStripB();
1112 Int_t nStripC = AliTOFGeometry::NStripC();
1114 Int_t isector = in[0];
1115 Int_t iplate = in[1];
1116 Int_t istrip = in[2];
1117 Int_t ipadX = in[3];
1118 Int_t ipadZ = in[4];
1120 Int_t stripOffset = 0;
1126 stripOffset = nStripC;
1129 stripOffset = nStripC+nStripB;
1132 stripOffset = nStripC+nStripB+nStripA;
1135 stripOffset = nStripC+nStripB+nStripA+nStripB;
1138 AliDebug(1,Form("Wrong plate number in TOF (%d) !",iplate));
1141 Int_t zindex=npadZ*(istrip+stripOffset)+(ipadZ+1);
1142 Int_t phiindex=npadX*isector+ipadX+1;
1148 //---------------------------------------------------------------
1149 Int_t AliTOFQADataMakerRec::GetStripIndex(const Int_t * const in)
1151 /* return tof strip index between 0 and 91 */
1153 Int_t nStripA = AliTOFGeometry::NStripA();
1154 Int_t nStripB = AliTOFGeometry::NStripB();
1155 Int_t nStripC = AliTOFGeometry::NStripC();
1157 // Int_t isector = in[0];
1158 Int_t iplate = in[1];
1159 Int_t istrip = in[2];
1160 //Int_t ipadX = in[3];
1161 //Int_t ipadZ = in[4];
1163 Int_t stripOffset = 0;
1169 stripOffset = nStripC;
1172 stripOffset = nStripC+nStripB;
1175 stripOffset = nStripC+nStripB+nStripA;
1178 stripOffset = nStripC+nStripB+nStripA+nStripB;
1181 AliDebug(1,Form("Wrong plate number in TOF (%d) !",iplate));
1186 if (stripOffset<0 || stripOffset>92) return -1;
1188 return (stripOffset+istrip);
1191 //---------------------------------------------------------------
1192 Bool_t AliTOFQADataMakerRec::CheckVolumeID(const Int_t * const volumeID)
1195 //Checks volume ID validity
1197 for (Int_t j=0;j<5;j++){
1198 if (volumeID[j]<0) {
1199 AliDebug(1,Form("Invalid detector volume index for volumeID[%i]",j));
1206 //---------------------------------------------------------------
1207 Bool_t AliTOFQADataMakerRec::CheckEquipID(const Int_t * const equipmentID)
1210 //Checks equipment ID validity
1211 for (Int_t j=0;j<5;j++){
1212 if (equipmentID[j]<0) {
1213 AliDebug(1,Form("Invalid equipment volume index for equipmentID[%i]",j));
1219 //---------------------------------------------------------------
1220 Bool_t AliTOFQADataMakerRec::FilterLTMData(const Int_t * const equipmentID) const
1222 /*It returns kTRUE if data come from LTM.
1223 It thus filters trigger-related signals */
1225 Int_t ddl, trm, tdc;
1226 //if (!CheckEquipID(equipmentID)) return kFALSE;
1227 ddl = equipmentID[0];
1228 trm = equipmentID[1];
1229 tdc = equipmentID[3];
1231 if ((ddl%2==1) && (trm==3) && (tdc>11 && tdc<15))
1237 //---------------------------------------------------------------
1238 Bool_t AliTOFQADataMakerRec::FilterSpare(const Int_t * const equipmentID) const
1240 /*It returns kTRUE if data come from spare
1242 So far only check on TRM 3 crate left is implemented */
1244 Int_t ddl, trm, tdc;
1245 //if (!CheckEquipID(equipmentID)) return kFALSE;
1246 ddl = equipmentID[0];
1247 trm = equipmentID[1];
1248 tdc = equipmentID[3];
1250 if ((ddl%2==1) && (trm==3) && (tdc>2 && tdc<12))
1256 //-----------------------------------------------------------------------------
1257 void AliTOFQADataMakerRec::GetGeo2LTMIndex(const Int_t * const detind, Int_t *indexLTM) {
1259 // getting LTMmatrix indexes for current digit
1261 Int_t stripId=GetStripIndex(detind);
1263 if (detind[1]==0 || detind[1]==1 || (detind[1]==2 && detind[2]<=7)) { //A side
1264 if (detind[4]<24){ //R
1265 indexLTM[0] = detind[0]*2;
1267 indexLTM[0] = detind[0]*2+1;
1269 indexLTM[1]=stripId;
1273 indexLTM[0] = detind[0]*2+36;
1275 indexLTM[0] = (detind[0]*2+1)+36;
1277 indexLTM[1]=90-stripId;
1280 // if (indexLTM[0]<36) { //A side
1281 // if (detind[1] ==0){
1282 // indexLTM[1] = detind[2];
1284 // else if (detind[1] ==1){
1285 // indexLTM[1] = detind[2]+nStripB;
1287 // else if (detind[1] ==2){
1288 // indexLTM[1] = detind[2]+19*2;
1291 // AliError("Smth Wrong!!!");
1295 // if (detind[1]==2){
1296 // if (detind[4]<24)
1297 // indexLTM[1] = (nStripAL-detind[2])+nStripC+nStripB;
1299 // indexLTM[1] = (nStripAR-detind[2])+nStripC+nStripB;
1301 // else if (detind[1] ==3){
1302 // indexLTM[1] = (nStripB-detind[2])+nStripC;
1304 // else if (detind[1] ==4){
1305 // indexLTM[1] = nStripC-detind[2];
1308 // AliError("Smth Wrong!!!");
1313 //-----------------------------------------------------------------------------
1314 void AliTOFQADataMakerRec::GetGeo2CTTMIndex(Int_t *detind, Int_t *indexCTTM) {
1316 // Returns CTTM index corresponding to the detector element detind
1318 GetGeo2LTMIndex(detind,indexCTTM);
1323 //-------------------------------------------------------------------------
1324 Int_t AliTOFQADataMakerRec::GetNumberOfFiredMacropad(AliRawReader * rawReader){
1327 TClonesArray * clonesRawData;
1328 if (!rawReader) return 0;
1329 for (Int_t iDDL = 0; iDDL < AliTOFGeometry::NDDL()*AliTOFGeometry::NSectors(); iDDL++){
1331 fTOFRawStream.LoadRawDataBuffersV2(iDDL);
1332 clonesRawData = (TClonesArray*)fTOFRawStream.GetRawData();
1333 for (Int_t iRawData = 0; iRawData<clonesRawData->GetEntriesFast(); iRawData++) {
1334 AliTOFrawData *tofRawDatum = (AliTOFrawData*)clonesRawData->UncheckedAt(iRawData);
1335 if (tofRawDatum->GetTOF()){
1336 if ( (tofRawDatum->GetTRM()==3)&&
1337 (tofRawDatum->GetTDC()>11)&&
1338 (tofRawDatum->GetTDC()<15)) {
1347 //----------------------------------------------------------------
1348 void AliTOFQADataMakerRec::GetCTTMIndex(Int_t *equipid, Int_t *indexCTTM) {
1350 // Returns CTTM index corresponding to the equipment id equipid, only for LTM hits
1351 // equipid = (crate, trm, chain, tdc, channel)
1353 if ( (equipid[1]!=3)||(equipid[3]<12) ){
1358 Int_t modStrip2LTM[3][8]={ { 0, 1, 2, 3, 4, 5, 6, 7},
1359 { 8, 9, 10, 11, 12, 13, 14, 15},
1360 {16, 17, 18, 19, 20, 21, 22, 23}
1363 Int_t DDL2LTMmatrix[72]={0,1,37,36,2,3,39,38,4,5,41,40,6,7,43,42,8,9,45,44,10,11,47,46,12,13,49,48,14,15,51,50,16,17,53,52,18,19,
1364 55,54,20,21,57,56,22,23,59,58,24,25,61,60,26,27,63,62,28,29,65,64,30,31,67,66,32,33,69,68,34,35,71,70};
1366 Int_t itdc=equipid[3]%12;
1370 else crate=equipid[0];
1372 indexCTTM[0]=DDL2LTMmatrix[crate];
1373 indexCTTM[1]=modStrip2LTM[itdc][equipid[4]];
1377 //_____________________________________________________________________________
1378 void AliTOFQADataMakerRec::ReadHistogramRangeFromFile(const Char_t * filename)
1381 // read histogram ranges from configuration file
1384 AliInfo("Config file with histograms ranges not found or invalid -> use default values.");
1385 SetDefaultHistogramRange();
1386 SetDefaultCutNmaxFiredMacropad();
1390 std::fstream configFile;
1391 configFile.open(filename, std::fstream::in);
1392 if (!configFile.is_open()){
1393 AliInfo("Cannot open config file with histograms ranges -> use default values.");
1394 SetDefaultHistogramRange();
1399 Int_t begin = configFile.tellg();
1400 configFile.seekg(0, std::fstream::end); /* end */
1401 Int_t end = configFile.tellg();
1402 Int_t size = end - begin;
1403 configFile.seekg(0, std::fstream::beg); /* rewind file */
1405 AliInfo(Form("Unexpected EOF of config file with histograms ranges. File size: %d -> use default values", size));
1406 SetDefaultHistogramRange();
1410 Int_t minMulti=9999, maxMulti=-9999;
1411 Int_t nbinsMulti=0,nbinsTime=0;
1412 Float_t minTime=9999.0, maxTime=-9999.0;
1413 Int_t cutFiredMacropad=0;
1415 while (!configFile.eof()) {
1416 configFile >> cutFiredMacropad >> minMulti >> maxMulti >> minTime >> maxTime;
1417 configFile >> endoflist;
1418 if (endoflist.Contains("end")) break;
1421 //set multiplicity histo ranges
1422 if (minMulti>maxMulti){
1423 AliInfo("Invalid range for multiplicity histogram set. Changing to default values.");
1424 SetDefaultMultiHistogramRange();
1426 nbinsMulti = maxMulti-minMulti;
1427 SetNbinsMultiplicityHisto(nbinsMulti);
1428 SetMultiplicityHistoRange(minMulti,maxMulti);
1429 //AliInfo(Form("Setting multiplicity histogram ranges to: multMin = %i - multMax = %i - nMultBins = %i", fgRangeMinMultiplicity, fgRangeMaxMultiplicity, fgNbinsMultiplicity));
1432 //set time histo ranges
1433 if (minTime>maxTime){
1434 AliInfo("Invalid range for time histogram set. Changing to default values.");
1435 SetDefaultTimeHistogramRange();
1437 nbinsTime = TMath::Nint((maxTime - minTime)/fgkNbinsWidthTime);//ns
1438 maxTime=minTime+nbinsTime*fgkNbinsWidthTime;//ns
1439 SetNbinsTimeHisto(nbinsTime);
1440 SetTimeHistoRange(minTime,maxTime);
1441 //AliInfo(Form("Setting time histogram ranges to: timeMin = %5.2f ns - timeMax = %5.2f ns - nTimeBins = %i", fgRangeMinTime, fgRangeMaxTime,fgNbinsTime));
1444 if ((cutFiredMacropad>0)&&(cutFiredMacropad<fgkFiredMacropadLimit)){
1445 AliInfo("Invalid value for cut on fired macropad. Changing to default values.");
1446 SetDefaultCutNmaxFiredMacropad();
1448 SetCutNmaxFiredMacropad(cutFiredMacropad);
1449 //AliInfo(Form("Setting cut on fired macropad to: = %i",cutFiredMacropad));
1451 AliInfo(Form("Setting: multMin = %i - multMax = %i - nMultBins = %i, timeMin = %5.2f ns - timeMax = %5.2f ns - nTimeBins = %i, cutMaxFiredMacropad = %i",
1452 fgRangeMinMultiplicity, fgRangeMaxMultiplicity, fgNbinsMultiplicity, fgRangeMinTime, fgRangeMaxTime,fgNbinsTime, cutFiredMacropad));
1457 //_____________________________________________________________________________
1458 void AliTOFQADataMakerRec::SetDefaultHistogramRange()
1461 // set default histogram ranges (tuned on 2011 pp collisions)
1463 AliInfo("Setting all histogram ranges to default values.");
1464 SetDefaultMultiHistogramRange();
1465 SetDefaultTimeHistogramRange();
1466 SetDefaultCutNmaxFiredMacropad();
1470 //_____________________________________________________________________________
1471 void AliTOFQADataMakerRec::SetDefaultMultiHistogramRange()
1474 // set default histogram ranges (tuned on 2011 pp collisions)
1476 SetMultiplicityHistoRange (0, 200);
1477 SetNbinsMultiplicityHisto(200);
1478 AliInfo("Setting Multiplicity histogram ranges to default values.");
1479 AliInfo(Form("multMin = %i - multMax = %i - nMultBins = %i",
1480 fgRangeMinMultiplicity, fgRangeMaxMultiplicity, fgNbinsMultiplicity));
1484 //_____________________________________________________________________________
1485 void AliTOFQADataMakerRec::SetDefaultTimeHistogramRange()
1488 // set default histogram ranges (tuned on 2011 pp collisions)
1490 SetNbinsTimeHisto(250);
1491 SetTimeHistoRange (0.0,610.);
1493 AliInfo("Setting Time histogram ranges to default values:");
1494 AliInfo(Form("timeMin = %5.2f ns - timeMax = %5.2f ns - nTimeBins = %i",
1495 fgRangeMinTime, fgRangeMaxTime,fgNbinsTime));
1499 //------------------------------------------------------------------
1500 void AliTOFQADataMakerRec::SetDefaultCutNmaxFiredMacropad()
1503 // set default cut on fired macropad
1505 SetCutNmaxFiredMacropad(50);
1506 AliInfo(Form("Setting cut on fired macropad to default values: NfiredMacropad = %i", fgCutNmaxFiredMacropad));