]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TOF/AliTOFQADataMakerRec.cxx
Fix for coverity
[u/mrichter/AliRoot.git] / TOF / AliTOFQADataMakerRec.cxx
CommitLineData
04236e67 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16///////////////////////////////////////////////////////////////////////
17// //
18// Produces the data needed to calculate the TOF quality assurance. //
19// QA objects are 1 & 2 Dimensional histograms. //
20// author: S.Arcelli //
21// //
22///////////////////////////////////////////////////////////////////////
23
fc71ba02 24/*
724eb92e 25Modified by fbellini on 18/01/2011
26- reduced histo binning to reduce size
27- added decoding errors plot
28- added channel maps and options for DQM shifters
29- new list of recPoints and ESDs plots
30- removed hTrmChannels035 and hTrmChannels3671
31
32 Modified by bvonhall on 03/11/2010
dce30a9d 33 - modified declaration of hTrmChannels035 and hTrmChannels3671 in EndOfDetectorCycle()
34 to prevent memory corruption
35
724eb92e 36 Modified by adecaro on 18/10/2010
e648d82d 37 - fTOFRawStream object set as private member
38
724eb92e 39Modified by fbellini on 13/09/2010
ea8ae424 40 - Set TLines as private members
41 - Set image flag for expert histos
42
724eb92e 43Modified by fbellini on 14/06/2010
5b4ed716 44 - Updated plots
45 - use LoadRawDataBuffersV2()
46
fc71ba02 47 Modified by fbellini on 10/05/2010
48 - Fixed EndOfDetectorCycle() memory corruption bug
49
50 Modified by fbellini on 22/04/2010
f63f6d7e 51 - Added filter for physics events
52
53 Modified by fbellini on 16/04/2010
5f144062 54 - Added EnableDqmShifterOpt()
55 - Modified EndOfDetectorCycle() with options for DQM
56 - Updated ESDs QA
57
58 Modified by fbellini on 30/03/2010
59 - Changed raws time histos range to 610ns
60 - Added FilterLTMData() and FilterSpare() methods
61 - Added check on enabled channels for raw data
62 - Updated RecPoints QA
63
64 Modified by fbellini on 02/03/2010
65 - Fixed raw data decoding methods (use AliTOFRawStream::LoadRawDataBuffer())
66 - Added filter for noisy channels and read map from OCDB
67 - Added GetCalibData() method
68 - Added CheckVolumeID() and CheckEquipID() methods
69 - Updated Raw QA
32bd8225 70*/
71
04236e67 72#include <TClonesArray.h>
04236e67 73#include <TH1F.h>
74#include <TH2F.h>
5f144062 75#include <TLine.h>
724eb92e 76#include <TPaveText.h>
32bd8225 77
17f2cd01 78#include "AliCDBManager.h"
17f2cd01 79#include "AliCDBEntry.h"
04236e67 80#include "AliESDEvent.h"
81#include "AliESDtrack.h"
04236e67 82#include "AliQAChecker.h"
83#include "AliRawReader.h"
32bd8225 84#include "AliTOFRawStream.h"
5c7c93fa 85#include "AliTOFcluster.h"
86#include "AliTOFQADataMakerRec.h"
04236e67 87#include "AliTOFrawData.h"
5c7c93fa 88#include "AliTOFGeometry.h"
17f2cd01 89#include "AliTOFChannelOnlineStatusArray.h"
724eb92e 90#include "AliTOFDecoderSummaryData.h"
91#include "AliTOFDecoderV2.h"
dce30a9d 92
04236e67 93ClassImp(AliTOFQADataMakerRec)
94
95//____________________________________________________________________________
96 AliTOFQADataMakerRec::AliTOFQADataMakerRec() :
17f2cd01 97 AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kTOF), "TOF Quality Assurance Data Maker"),
98 fCalibData(0x0),
5f144062 99 fEnableNoiseFiltering(kFALSE),
e648d82d 100 fEnableDqmShifterOpt(kFALSE),
101 fProcessedRawEventN(0),
724eb92e 102 fIsSOC(kFALSE),
e648d82d 103 fLineExpTimeMin(new TLine(200., 0., 200., 0.)),
104 fLineExpTimeMax(new TLine(250., 0., 250., 0.)),
105 fLineExpTotMin(new TLine(5., 0., 5., 0.)),
106 fLineExpTotMax(new TLine(20., 0., 20., 0.)),
724eb92e 107 fTOFRawStream(AliTOFRawStream()),
108 fDecoderSummary(new AliTOFDecoderSummaryData())
04236e67 109{
110 //
111 // ctor
724eb92e 112 //
113 for (Int_t sm=0;sm<17;sm++){
114 fLineSMid[sm] = new TLine( sm+1, 0., sm+1, 91.);
ea8ae424 115 }
724eb92e 116 //initialize all TRM counters to -1 i.e. invalid value
117 // for (Int_t trm=0;trm<720;trm++){
118 // fTRMNoisyArray[trm]=-1;
119 // fTRMHwOkArray[trm]=-1;
120 // fTRMEnabledArray[trm]=-1;
121 // }
122
04236e67 123}
124
125//____________________________________________________________________________
126AliTOFQADataMakerRec::AliTOFQADataMakerRec(const AliTOFQADataMakerRec& qadm) :
17f2cd01 127 AliQADataMakerRec(),
128 fCalibData(qadm.fCalibData),
5f144062 129 fEnableNoiseFiltering(qadm.fEnableNoiseFiltering),
130 fEnableDqmShifterOpt(qadm.fEnableDqmShifterOpt),
ea8ae424 131 fProcessedRawEventN(qadm.fProcessedRawEventN),
724eb92e 132 fIsSOC(qadm.fIsSOC),
ea8ae424 133 fLineExpTimeMin(qadm.fLineExpTimeMin),
134 fLineExpTimeMax(qadm.fLineExpTimeMax),
135 fLineExpTotMin(qadm.fLineExpTotMin),
97430dfe 136 fLineExpTotMax(qadm.fLineExpTotMax),
724eb92e 137 fTOFRawStream(qadm.fTOFRawStream),
138 fDecoderSummary(qadm.fDecoderSummary)
04236e67 139{
140 //
141 //copy ctor
142 //
143 SetName((const char*)qadm.GetName()) ;
144 SetTitle((const char*)qadm.GetTitle());
ea8ae424 145
724eb92e 146 for (Int_t sm=0;sm<17;sm++){
147 fLineSMid[sm]=qadm.fLineSMid[sm];
ea8ae424 148 }
724eb92e 149
150 // for (Int_t trm=0;trm<10;trm++){
151 // fTRMNoisyArray[trm]=qadm.fTRMNoisyArray[trm];
152 // fTRMHwOkArray[trm]=qadm.fTRMHwOkArray[trm];
153 // fTRMEnabledArray[trm]=qadm.fTRMEnabledArray[trm];
154 // }
155
04236e67 156}
157
158//__________________________________________________________________
159AliTOFQADataMakerRec& AliTOFQADataMakerRec::operator = (const AliTOFQADataMakerRec& qadm )
160{
161 //
162 // assignment operator.
163 //
164 this->~AliTOFQADataMakerRec();
165 new(this) AliTOFQADataMakerRec(qadm);
166 return *this;
167}
168
97430dfe 169//----------------------------------------------------------------------------
170AliTOFQADataMakerRec::~AliTOFQADataMakerRec()
171{
172
173 fTOFRawStream.Clear();
e648d82d 174 delete fLineExpTimeMin;
175 delete fLineExpTimeMax;
176 delete fLineExpTotMin;
177 delete fLineExpTotMax;
178 for (Int_t sm=0;sm<10;sm++){
724eb92e 179 delete fLineSMid[sm];
180 }
181 if (fDecoderSummary)
182 delete fDecoderSummary;
97430dfe 183}
17f2cd01 184//----------------------------------------------------------------------------
185AliTOFChannelOnlineStatusArray* AliTOFQADataMakerRec::GetCalibData() const
186{
32bd8225 187 //
188 // Retrive TOF calib objects from OCDB
189 //
724eb92e 190 AliCDBManager *man = AliCDBManager::Instance();
191 AliCDBEntry *cdbe=0;
192
193 cdbe = man->Get("TOF/Calib/Status",fRun);
194 if(!cdbe){
195 AliWarning("Load of calibration data from default storage failed!");
196 AliWarning("Calibration data will be loaded from local storage ($ALICE_ROOT)");
197 man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
17f2cd01 198 cdbe = man->Get("TOF/Calib/Status",fRun);
724eb92e 199 }
200 // Retrieval of data in directory TOF/Calib/Data:
201
202 AliTOFChannelOnlineStatusArray * array = 0;
203 if (cdbe) array = (AliTOFChannelOnlineStatusArray *)cdbe->GetObject();
204 if (!array) AliFatal("No calibration data from calibration database !");
205
206 return array;
17f2cd01 207}
208
04236e67 209//____________________________________________________________________________
210void AliTOFQADataMakerRec::InitRaws()
211{
212 //
213 // create Raws histograms in Raws subdir
214 //
7d297381 215 const Bool_t expert = kTRUE ;
216 const Bool_t saveCorr = kTRUE ;
217 const Bool_t image = kTRUE ;
04236e67 218
724eb92e 219 TH1I * h0 = new TH1I("hTOFRaws", "TOF raw hit multiplicity; TOF raw hits number; Events ",200, 0, 200) ;
5f144062 220
724eb92e 221 TH1I * h1 = new TH1I("hTOFRawsIA", "TOF raw hit multiplicity - I/A side; TOF raw hits number ;Events ",200, 0, 200) ;
222 TH1I * h2 = new TH1I("hTOFRawsOA", "TOF raw hit multiplicity - O/A side; TOF raw hits number ;Events ",200, 0, 200) ;
223 TH1I * h3 = new TH1I("hTOFRawsIC", "TOF raw hit multiplicity - I/C side; TOF raw hits number ;Events ",200, 0, 200) ;
224 TH1I * h4 = new TH1I("hTOFRawsOC", "TOF raw hit multiplicity - O/C side; TOF raw hits number ;Events ",200, 0, 200) ;
5f144062 225
724eb92e 226 TH1F * h5 = new TH1F("hTOFRawsTime", "TOF Raws - Hit time (ns);Measured Hit time [ns];Hits", 250,0. ,610.) ;
227 TH1F * h6 = new TH1F("hTOFRawsTimeIA", "TOF Raws - Hit time (ns) - I/A side;Measured Hit time [ns];Hits", 250,0. ,610.) ;
228 TH1F * h7 = new TH1F("hTOFRawsTimeOA", "TOF Raws - Hit time (ns) - O/A side;Measured Hit time [ns];Hits", 250,0. ,610.) ;
229 TH1F * h8 = new TH1F("hTOFRawsTimeIC", "TOF Raws - Hit time (ns) - I/C side;Measured Hit time [ns];Hits", 250,0. ,610.) ;
230 TH1F * h9 = new TH1F("hTOFRawsTimeOC", "TOF Raws - Hit time (ns) - O/C side;Measured Hit time [ns];Hits", 250,0. ,610.) ;
231
232 TH1F * h10 = new TH1F("hTOFRawsToT", "TOF Raws - Hit ToT (ns);Measured Hit ToT (ns);Hits", 100, 0., 48.8) ;
233
234 TH1F * h11 = new TH1F("hTOFRawsToTIA", "TOF Raws - Hit ToT (ns) - I/A side;Measured Hit ToT (ns);Hits", 100, 0., 48.8) ;
235 TH1F * h12 = new TH1F("hTOFRawsToTOA", "TOF Raws - Hit ToT (ns) - O/A side;Measured Hit ToT (ns);Hits", 100, 0., 48.8) ;
236 TH1F * h13 = new TH1F("hTOFRawsToTIC", "TOF Raws - Hit ToT (ns) - I/C side;Measured Hit ToT (ns);Hits", 100, 0., 48.8) ;
237 TH1F * h14 = new TH1F("hTOFRawsToTOC", "TOF Raws - Hit ToT (ns) - O/C side;Measured Hit ToT (ns);Hits", 100, 0., 48.8) ;
238
5b4ed716 239 TH1F * h15 = new TH1F("hTOFRawsLTMHits", "LTMs OR signals; Crate; Counts", 72, 0., 72.);
724eb92e 240 TH2F * h16 = new TH2F("hTOFrefMap", "TOF enabled channel reference map;sector;strip", 72, 0., 18., 91, 0., 91.);
241 TH2F * h17 = new TH2F("hTOFRawHitMap","TOF raw hit map;sector;strip", 72, 0., 18., 91, 0., 91.);
242 TH2I * h18 = new TH2I("hTOFDecodingErrors","Decoding error monitoring; DDL; Error ", 72, 0, 72, 13,1,14);
32bd8225 243
724eb92e 244 h18->GetYaxis()->SetBinLabel(1,"DRM ");
245 h18->GetYaxis()->SetBinLabel(2,"LTM ");
246 h18->GetYaxis()->SetBinLabel(3,"TRM 3 ");
247 h18->GetYaxis()->SetBinLabel(4,"TRM 4");
248 h18->GetYaxis()->SetBinLabel(5,"TRM 5");
249 h18->GetYaxis()->SetBinLabel(6,"TRM 6");
250 h18->GetYaxis()->SetBinLabel(7,"TRM 7");
251 h18->GetYaxis()->SetBinLabel(8,"TRM 8");
252 h18->GetYaxis()->SetBinLabel(9,"TRM 9");
253 h18->GetYaxis()->SetBinLabel(10,"TRM 10");
254 h18->GetYaxis()->SetBinLabel(11,"TRM 11");
255 h18->GetYaxis()->SetBinLabel(12,"TRM 12");
256 h18->GetYaxis()->SetBinLabel(13,"recovered");
32bd8225 257
724eb92e 258 TH1F * h19 = new TH1F("hTOFOrphansTime", "TOF Raws - Orphans time (ns);Measured Hit time [ns];Hits", 250, 0. ,610.) ;
5f144062 259 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., 250, 0., 610.0) ;
ba5613e3 260 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., 250, 0., 610.0) ;
724eb92e 261 TH2F * h22 = new TH2F("hTOFTimeVsStrip","TOF Raws - Hit time vs. strip (theta); Strip index;Raws TOF time (ns) ", 91,0.,91, 250, 0., 610.) ;
5f144062 262 h0->Sumw2() ;
263 h1->Sumw2() ;
264 h2->Sumw2() ;
265 h3->Sumw2() ;
266 h4->Sumw2() ;
724eb92e 267 // h5->Sumw2() ;
5f144062 268 h6->Sumw2() ;
269 h7->Sumw2() ;
270 h8->Sumw2() ;
271 h9->Sumw2() ;
724eb92e 272 // h10->Sumw2() ;
5f144062 273 h11->Sumw2() ;
274 h12->Sumw2() ;
275 h13->Sumw2() ;
276 h14->Sumw2() ;
277 h15->Sumw2() ;
278 h16->Sumw2() ;
279 h17->Sumw2() ;
280 h18->Sumw2() ;
281 h19->Sumw2() ;
282 h20->Sumw2() ;
283 h21->Sumw2() ;
284 h22->Sumw2() ;
724eb92e 285
e648d82d 286 //add lines for DQM shifter
287 //fLineExpTimeMin = new TLine(200., 0., 200., 0.);
288 fLineExpTimeMin->SetLineColor(kGreen);
289 fLineExpTimeMin->SetLineWidth(2);
290
291 //fLineExpTimeMax = new TLine(250., 0., 250., 0.);
292 fLineExpTimeMax->SetLineColor(kGreen);
293 fLineExpTimeMax->SetLineWidth(2);
294
295 //fLineExpTotMin = new TLine( 5., 0., 5., 0.);
296 fLineExpTotMin->SetLineColor(kGreen);
297 fLineExpTotMin->SetLineWidth(2);
298
299 //fLineExpTotMax = new TLine(20., 0., 20., 0.);
300 fLineExpTotMax->SetLineColor(kGreen);
301 fLineExpTotMax->SetLineWidth(2);
302
724eb92e 303 for (Int_t sm=0;sm<17;sm++){
304 //fLineSMid[sm] = new TLine( 1+sm, 0., 1+sm, 91.);
305 fLineSMid[sm]->SetLineColor(kMagenta);
306 fLineSMid[sm]->SetLineWidth(2);
e648d82d 307 }
724eb92e 308
17f2cd01 309 Add2RawsList(h0, 0, !expert, image, !saveCorr) ;
61740cee 310 Add2RawsList(h1, 1, expert, !image, !saveCorr) ;
311 Add2RawsList(h2, 2, expert, !image, !saveCorr) ;
312 Add2RawsList(h3, 3, expert, !image, !saveCorr) ;
313 Add2RawsList(h4, 4, expert, !image, !saveCorr) ;
17f2cd01 314 Add2RawsList(h5, 5, !expert, image, !saveCorr) ;
61740cee 315 Add2RawsList(h6, 6, expert, !image, !saveCorr) ;
316 Add2RawsList(h7, 7, expert, !image, !saveCorr) ;
317 Add2RawsList(h8, 8, expert, !image, !saveCorr) ;
318 Add2RawsList(h9, 9, expert, !image, !saveCorr) ;
17f2cd01 319 Add2RawsList(h10, 10, !expert, image, !saveCorr) ;
5f144062 320 Add2RawsList(h11, 11, expert, !image, !saveCorr) ;
321 Add2RawsList(h12, 12, expert, !image, !saveCorr) ;
17f2cd01 322 Add2RawsList(h13, 13, expert, !image, !saveCorr) ;
323 Add2RawsList(h14, 14, expert, !image, !saveCorr) ;
5f144062 324 Add2RawsList(h15, 15, !expert, image, !saveCorr) ;
325 Add2RawsList(h16, 16, !expert, image, !saveCorr) ;
326 Add2RawsList(h17, 17, !expert, image, !saveCorr) ;
17f2cd01 327 Add2RawsList(h18, 18, expert, !image, !saveCorr) ;
328 Add2RawsList(h19, 19, expert, !image, !saveCorr) ;
329 Add2RawsList(h20, 20, expert, !image, !saveCorr) ;
330 Add2RawsList(h21, 21, expert, !image, !saveCorr) ;
5f144062 331 Add2RawsList(h22, 22, expert, !image, !saveCorr) ;
44ed7a66 332}
333
04236e67 334//____________________________________________________________________________
335void AliTOFQADataMakerRec::InitRecPoints()
336{
337 //
338 // create RecPoints histograms in RecPoints subdir
339 //
724eb92e 340
32bd8225 341 const Bool_t expert = kTRUE ;
342 const Bool_t image = kTRUE ;
04236e67 343
724eb92e 344 TH1I * h0 = new TH1I("hTOFRecPoints", "TOF RecPoints multiplicity ; TOF RecPoints number;Events",200, 0, 200) ;
5f144062 345
724eb92e 346 TH1F * h1 = new TH1F("hTOFRecPointsTimeIA", "RecPoints Time Spectrum in TOF (ns)- I/A side; Calibrated TOF time [ns];Events", 250, 0., 610.) ;
347 TH1F * h2 = new TH1F("hTOFRecPointsTimeOA", "RecPoints Time Spectrum in TOF (ns)- O/A side; Calibrated TOF time [ns];Events", 250, 0., 610.) ;
348 TH1F * h3 = new TH1F("hTOFRecPointsTimeIC", "RecPoints Time Spectrum in TOF (ns)- I/C side; Calibrated TOF time [ns];Events", 250, 0., 610.) ;
349 TH1F * h4 = new TH1F("hTOFRecPointsTimeOC", "RecPoints Time Spectrum in TOF (ns)- O/C side; Calibrated TOF time [ns];Events", 250, 0., 610.) ;
32bd8225 350
724eb92e 351 TH1F * h5 = new TH1F("hTOFRecPointsRawTimeIA", "RecPoints raw Time Spectrum in TOF (ns)-I/A side; Measured TOF time [ns];Hits", 250, 0., 610.) ;
352 TH1F * h6 = new TH1F("hTOFRecPointsRawTimeOA", "RecPoints raw Time Spectrum in TOF (ns)-O/A side; Measured TOF time [ns];Hits", 250, 0., 610.) ;
353 TH1F * h7 = new TH1F("hTOFRecPointsRawTimeIC", "RecPoints raw Time Spectrum in TOF (ns)-I/C side; Measured TOF time [ns];Hits", 250, 0., 610.) ;
354 TH1F * h8 = new TH1F("hTOFRecPointsRawTimeOC", "RecPoints raw Time Spectrum in TOF (ns)-O/C side; Measured TOF time [ns];Hits", 250, 0., 610.) ;
32bd8225 355
724eb92e 356 TH1F * h9 = new TH1F("hTOFRecPointsToTIA", "RecPoints ToT Spectrum in TOF (ns)-I/A side; Measured TOT [ns];Hits", 100, 0., 48.8 ) ;
357 TH1F * h10 = new TH1F("hTOFRecPointsToTOA", "RecPoints ToT Spectrum in TOF (ns)-O/A side; Measured TOT [ns];Hits", 100, 0., 48.8 ) ;
358 TH1F * h11 = new TH1F("hTOFRecPointsToTIC", "RecPoints ToT Spectrum in TOF (ns)-I/C side; Measured TOT [ns];Hits", 100, 0., 48.8 ) ;
359 TH1F * h12 = new TH1F("hTOFRecPointsToTOC", "RecPoints ToT Spectrum in TOF (ns)-O/C side; Measured TOT [ns];Hits", 100, 0., 48.8 ) ;
360
361 TH2F * h13 = new TH2F("hTOFRecPointsClusMap","RecPoints map; sector ;strip", 72, 0., 18., 91, 0., 91.) ;
362 TH2F * h14 = new TH2F("hTOFRecPointsTimeVsStrip","RecPoints TOF time vs. strip (theta); Strip index; RecPoints TOF time (ns) ",91, 0., 91., 250, 0., 610.) ;
363 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) ;
364 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) ;
17f2cd01 365
724eb92e 366 h0->Sumw2() ;
367 h1->Sumw2() ;
368 h2->Sumw2() ;
369 h3->Sumw2() ;
370 h4->Sumw2() ;
371 h5->Sumw2() ;
372 h6->Sumw2() ;
373 h7->Sumw2() ;
374 h8->Sumw2() ;
375 h9->Sumw2() ;
376 h10->Sumw2() ;
377 h11->Sumw2() ;
378 h12->Sumw2() ;
379 h13->Sumw2() ;
380 h14->Sumw2() ;
381 h15->Sumw2() ;
382 h16->Sumw2() ;
383
5f144062 384 Add2RecPointsList(h0, 0, !expert, image) ;
385 Add2RecPointsList(h1, 1, !expert, image) ;
386 Add2RecPointsList(h2, 2, !expert, image) ;
387 Add2RecPointsList(h3, 3, !expert, image) ;
388 Add2RecPointsList(h4, 4, !expert, image) ;
724eb92e 389 Add2RecPointsList(h5, 5, expert, !image) ;
5f144062 390 Add2RecPointsList(h6, 6, expert, !image) ;
391 Add2RecPointsList(h7, 7, expert, !image) ;
392 Add2RecPointsList(h8, 8, expert, !image) ;
724eb92e 393 Add2RecPointsList(h9, 9, !expert, !image) ;
394 Add2RecPointsList(h10, 10, !expert, !image) ;
395 Add2RecPointsList(h11, 11, !expert, !image) ;
396 Add2RecPointsList(h12, 12, !expert, !image) ;
5f144062 397 Add2RecPointsList(h13, 13, expert, !image) ;
724eb92e 398 Add2RecPointsList(h14, 14, expert, image) ;
5f144062 399 Add2RecPointsList(h15, 15, expert, !image) ;
400 Add2RecPointsList(h16, 16, expert, !image) ;
e648d82d 401
04236e67 402}
403
404//____________________________________________________________________________
405void AliTOFQADataMakerRec::InitESDs()
406{
407 //
408 //create ESDs histograms in ESDs subdir
409 //
135306ea 410
5f144062 411 const Bool_t expert = kTRUE ;
412 const Bool_t image = kTRUE ;
04236e67 413
7b81681b 414 TH1I * h0 = new TH1I("hTOFESDs", "Number of matched TOF tracks per event;Number of TOF matched ESD tracks;Counts", 200, 0, 200) ;
724eb92e 415 TH1F * h1 = new TH1F("hTOFESDsTime", "Matched ESDs tracks: TOF Time spectrum; Calibrated TOF time [ns];Counts", 250, 0., 610. ) ;
416 TH1F * h2 = new TH1F("hTOFESDsRawTime", "Matched ESDs tracks: TOF raw Time spectrum;Measured TOF time [ns];Counts", 250, 0., 610.) ;
417 TH1F * h3 = new TH1F("hTOFESDsToT", "Matched ESDs tracks: TOF ToT spectrum; ESDs ToT [ns];Counts",100, 0., 48.8) ;
418 TH1F * h4 = new TH1F("hTOFESDskTOFOUT", "p_{T} distribution of tracks with kTOFout; p_{T} (GeV/c);Counts", 50, 0.20, 5.00) ;
419 TH1F * h5 = new TH1F("hTOFESDskTIME", "p_{T} distribution of tracks with kTOFout && kTIME; p_{T} (GeV/c);Counts", 50, 0.20, 5.00) ;
420 TH1F * h6 = new TH1F("hTOFESDsMatched", "p_{T} distribution of tracks with kTOFout && TOFtime>0; p_{T} (GeV/c);Counts", 50, 0.20, 5.00) ;
421 TH1F * h7 = new TH1F("hTOFESDsMatchingProb", "TPC-TOF track-matching probability;TOF matching probability (%) ;Counts",101, -1.0, 100) ;
422 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.) ;
423 TH1F * h9 = new TH1F("hTOFHitsLength", "Matched ESDs tracks: Length Spectrum; Track length [cm];Counts", 800, 0., 800) ;
424
5f144062 425 h0->Sumw2() ;
04236e67 426 h1->Sumw2() ;
04236e67 427 h2->Sumw2() ;
04236e67 428 h3->Sumw2() ;
5f144062 429 h4->Sumw2() ;
430 h5->Sumw2() ;
431 h6->Sumw2() ;
432 h7->Sumw2() ;
433 h8->Sumw2() ;
434 h9->Sumw2() ;
5f144062 435
436 Add2ESDsList(h0, 0, !expert, image) ;
437 Add2ESDsList(h1, 1, !expert, image) ;
724eb92e 438 Add2ESDsList(h2, 2, expert, !image) ;
439 Add2ESDsList(h3, 3, !expert, !image) ;
5f144062 440 Add2ESDsList(h4, 4, expert, image) ;
441 Add2ESDsList(h5, 5, expert, image) ;
442 Add2ESDsList(h6, 6, expert, image) ;
443 Add2ESDsList(h7, 7, expert, image) ;
724eb92e 444 Add2ESDsList(h8, 8, expert, !image) ;
445 Add2ESDsList(h9, 9, !expert, !image) ;
446
04236e67 447}
448
5f144062 449
04236e67 450//____________________________________________________________________________
451void AliTOFQADataMakerRec::MakeRaws(AliRawReader* rawReader)
452{
453 //
454 // makes data from Raws
455 //
724eb92e 456 if (rawReader->GetType()==7) {
457
458 Double_t tdc2ns=AliTOFGeometry::TdcBinWidth()*1E-3;//in ns
459 Double_t tot2ns=AliTOFGeometry::ToTBinWidth()*1E-3;
460 Int_t ntof[5]; /* 0=tot, 1=IA, 2=OA, 3=IC, 4=OC*/
461 for (Int_t j=0;j<5;j++){ ntof[j]=0;}
462 Int_t equipmentID[5]; //(ddl, trm, chain,tdc,channel)
463 Int_t volumeID[5]; //(sector,plate,strip,padX,padZ)
464 Int_t volumeID2[5]; //(sector,plate,strip,padZ,padX) to use AliTOFGeometry::GetIndex()
465 Int_t chIndex=-1;
466
467 TClonesArray * clonesRawData;
468 fTOFRawStream.SetRawReader(rawReader);
469
470 //uncomment if needed to apply DeltaBC correction
471 //fTOFRawStream.ApplyBCCorrections(kTRUE);
472
473 fDecoderSummary->Reset();
474 for (Int_t iDDL = 0; iDDL < AliTOFGeometry::NDDL()*AliTOFGeometry::NSectors(); iDDL++){
475 rawReader->Reset();
476 fTOFRawStream.LoadRawDataBuffersV2(iDDL);
477
478 //* get decoding error counters
479 fDecoderSummary = ( (AliTOFDecoderV2*) fTOFRawStream.GetDecoderV2() ) ->GetDecoderSummaryData();
480 if ( (fDecoderSummary) && (fDecoderSummary ->GetErrorDetected()) ) {
481 Int_t errorSlotID=(Int_t) fDecoderSummary->GetErrorSlotID();
482 GetRawsData(18)->Fill(iDDL,errorSlotID);
483 if (fDecoderSummary -> GetRecoverError() )
484 GetRawsData(18)->Fill(iDDL,13);
485 }
486
487 clonesRawData = (TClonesArray*)fTOFRawStream.GetRawData();
488 for (Int_t iRawData = 0; iRawData<clonesRawData->GetEntriesFast(); iRawData++) {
489 AliTOFrawData *tofRawDatum = (AliTOFrawData*)clonesRawData->UncheckedAt(iRawData);
f63f6d7e 490
724eb92e 491 if (tofRawDatum->GetTOF()){
492 equipmentID[0]=iDDL;
493 equipmentID[1]=tofRawDatum->GetTRM();
494 equipmentID[2]=tofRawDatum->GetTRMchain();
495 equipmentID[3]=tofRawDatum->GetTDC();
496 equipmentID[4]=tofRawDatum->GetTDCchannel();
497
498 if (CheckEquipID(equipmentID)){
499 fTOFRawStream.EquipmentId2VolumeId(iDDL,
500 tofRawDatum->GetTRM(),
501 tofRawDatum->GetTRMchain(),
502 tofRawDatum->GetTDC(),
503 tofRawDatum->GetTDCchannel(),
504 volumeID);
505 //LTM data
506 if (FilterLTMData(equipmentID)) { //counts LTM hits
507 if (equipmentID[2]==1) { //crate left, A-side or C-side
508 GetRawsData(15)->Fill(equipmentID[0]);
509 } else {
510 if (equipmentID[0]<36) { GetRawsData(15)->Fill(equipmentID[0]-1); }
511 else { GetRawsData(15)->Fill(equipmentID[0]+1); }
512 }
513 continue;
514 }
17f2cd01 515
724eb92e 516 //TRM data
517 if (CheckVolumeID(volumeID)){
518 volumeID2[0]=volumeID[0];
519 volumeID2[1]=volumeID[1];
520 volumeID2[2]=volumeID[2];
521 volumeID2[3]=volumeID[4];
522 volumeID2[4]=volumeID[3];
523 chIndex=AliTOFGeometry::GetIndex(volumeID2);
524
525 if (tofRawDatum->GetTOT()){
526 if (!(fCalibData->GetNoiseStatus(chIndex)==AliTOFChannelOnlineStatusArray::kTOFNoiseBad)
527 && (fCalibData->GetHWStatus(chIndex) == AliTOFChannelOnlineStatusArray::kTOFHWOk)) {//noise and enabled filter
528 ntof[0]++; //counter for tof hits
529
530 //fill global spectra for DQM plots
531 GetRawsData(5)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;//in ns
532 GetRawsData(10)->Fill( tofRawDatum->GetTOT()*tot2ns) ;//in ns
533
534 //fill side-related spectra for experts plots
535 Int_t ddlACside=iDDL/36; // 0 or 1
536 Int_t ddlPerSm=iDDL%4;
537
538 if (volumeID2[0]>4 && volumeID2[0]<14){ //I side
539 if (ddlPerSm<2){ //A side
540 ntof[1]++;
541 GetRawsData(6)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;
542 GetRawsData(11)->Fill( tofRawDatum->GetTOT()*tot2ns) ;
543 } else { //C side
544 ntof[3]++;
545 GetRawsData(8)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;
546 GetRawsData(13)->Fill( tofRawDatum->GetTOT()*tot2ns) ;
547 }
548 } else {
549 if (volumeID2[0]<5 || volumeID2[0]>13){ //O side
550 if (ddlPerSm<2){ //A side
551 ntof[2]++;
552 GetRawsData(7)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;
553 GetRawsData(12)->Fill( tofRawDatum->GetTOT()*tot2ns) ;
554 } else {//C side
555 ntof[4]++;
556 GetRawsData(9)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;
557 GetRawsData(14)->Fill( tofRawDatum->GetTOT()*tot2ns) ;
558 }
559 }
560 }
561
562 //compute TRM offset
563 Int_t trm= iDDL*10+(equipmentID[1]-3);
564 GetRawsData(20+ddlACside)->Fill(trm,tofRawDatum->GetTOF()*tdc2ns);
565 GetRawsData(22)->Fill(GetStripIndex(volumeID),tofRawDatum->GetTOF()*tdc2ns) ;
566 Short_t fea = volumeID2[4]/12;
567 Float_t hitmapx = volumeID2[0] + ((Double_t)(3 - fea) + 0.5) *0.25;
568 GetRawsData(17)->Fill(hitmapx,GetStripIndex(volumeID2));
569 }//noise filter
570 }//end hit selection
571 else { //orphans
572 if (!(fCalibData->GetNoiseStatus(chIndex) == AliTOFChannelOnlineStatusArray::kTOFNoiseBad)
573 && (fCalibData->GetHWStatus(chIndex) == AliTOFChannelOnlineStatusArray::kTOFHWOk))
574 GetRawsData(19)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;//in ns
575 }//end orphans
576 }//end volumeID check
577 }//end equipID check
578 }//end tof check
579 }//loop on raw data
580 clonesRawData->Clear();
581 } // DDL Loop
582
583 for (Int_t j=0;j<5;j++) { GetRawsData(j)->Fill(ntof[j]); }
584 fProcessedRawEventN++;
585 fTOFRawStream.Clear();
586 } else {
587 AliDebug(1,Form("Event of type %d found. Skipping non-physics event for QA.\n", rawReader->GetType()));
588 }
589
590 //fill reference map for DQM shifter only once in a detector cycle
591 if (fIsSOC) {
592 Int_t geoId[5]={-1,-1,-1,-1,-1};// pgeoId=(sm, mod, strip, padZ, padX)
593 Int_t detId[5]={-1,-1,-1,-1,-1};//detID=(ddl,trm,tdc, chain,channel)
594 Int_t trmIndex=-1;
595 for (Int_t ch = 0; ch < fCalibData->GetSize(); ch++) {
596 AliTOFGeometry::GetVolumeIndices(ch,geoId);
597 AliTOFRawStream::Geant2EquipmentId(geoId,detId);
598 if ((detId[1]<0)||(detId[0]<0)) continue;
599 trmIndex=(detId[1]-3)+detId[0]*10;
600
601 //set TRM counters
602 // if (fCalibData->GetNoiseStatus(ch)==AliTOFChannelOnlineStatusArray::kTOFNoiseBad)
603 // fTRMNoisyArray[trmIndex]+=1;
604 // if (fCalibData->GetHWStatus(ch) == AliTOFChannelOnlineStatusArray::kTOFHWOk)
605 // fTRMHwOkArray[trmIndex]+=1;
606
607 if ( (!(fCalibData->GetNoiseStatus(ch)==AliTOFChannelOnlineStatusArray::kTOFNoiseBad))
608 && (fCalibData->GetHWStatus(ch) == AliTOFChannelOnlineStatusArray::kTOFHWOk) ){
609 //fTRMEnabledArray[trmIndex]+=1;
610 //fill reference map with info from OCDB
611 Short_t fea = geoId[4]/12;
612 Float_t hitmapx = geoId[0] + ((Double_t)(3 - fea) + 0.5)*0.25;
613 GetRawsData(16)->Fill(hitmapx, GetStripIndex(geoId));
614 }
f63f6d7e 615 }
724eb92e 616 //printf("Counters for noisy, enabled and good channels in TOF TRMs read from OCDB.\n");
617 fIsSOC=kFALSE;
618 }
619
620 //enable options for DQM shifter
621 EnableDqmShifterOpt(kTRUE);
44ed7a66 622}
623
44ed7a66 624//____________________________________________________________________________
04236e67 625void AliTOFQADataMakerRec::MakeRecPoints(TTree * clustersTree)
626{
f63f6d7e 627 //
32bd8225 628 // Make data from Clusters
629 //
630
631 Double_t tdc2ns=AliTOFGeometry::TdcBinWidth()*1E-3;
632 Double_t tot2ns=AliTOFGeometry::ToTBinWidth()*1E-3;
724eb92e 633
634 Int_t volumeID2[5];//(sm, plate,strip, padZ,padX)
635 //Int_t volumeID[5];//(sm, plate,strip, padX,padZ)
636
32bd8225 637 TBranch *branch=clustersTree->GetBranch("TOF");
638 if (!branch) {
639 AliError("can't get the branch with the TOF clusters !");
640 return;
641 }
642
643 static TClonesArray dummy("AliTOFcluster",10000);
644 dummy.Clear();
645 TClonesArray *clusters=&dummy;
646 branch->SetAddress(&clusters);
724eb92e 647
32bd8225 648 // Import the tree
649 clustersTree->GetEvent(0);
650
7b81681b 651 GetRecPointsData(0)->Fill((Int_t)clusters->GetEntriesFast()) ;
32bd8225 652
653 TIter next(clusters) ;
654 AliTOFcluster * c ;
655 while ( (c = dynamic_cast<AliTOFcluster *>(next())) ) {
656
724eb92e 657 // volumeID2[0] = c->GetDetInd(0);
658 // volumeID2[1] = c->GetDetInd(1);
659 // volumeID2[2] = c->GetDetInd(2);
660 // volumeID2[3] = c->GetDetInd(4); //padX
661 // volumeID2[4] = c->GetDetInd(3); //padZ
32bd8225 662
663 for (Int_t i=0;i<5;i++){
724eb92e 664 volumeID2[i]=c->GetDetInd(i); //X and Z indeces inverted in RecPoints
32bd8225 665 }
724eb92e 666 //Int_t chIndex=AliTOFGeometry::GetIndex(volumeID2);
32bd8225 667 Int_t iDDL=AliTOFRawStream::Geant2DDL(volumeID2);
5f144062 668 Int_t iTRM=AliTOFRawStream::Geant2TRM(volumeID2);
724eb92e 669 Short_t fea = volumeID2[4]/12;
670 Float_t hitmapx = volumeID2[0] + ((Double_t)(3 - fea) + 0.5) *0.25;
671 Int_t ddlACside=iDDL/36; // 0 or 1
672 Int_t ddlPerSm=iDDL%4;
673
674 if ((c->GetTDCRAW()) && (c->GetTDC()) && (c->GetToT())){
675 if (volumeID2[0]>4 && volumeID2[0]<14){ //I side
676 if (ddlPerSm<2){ //A side
677 GetRecPointsData(1)->Fill( c->GetTDC()*tdc2ns) ;//in ns
678 GetRecPointsData(5)->Fill( c->GetTDCRAW()*tdc2ns) ;//in ns
679 GetRecPointsData(9)->Fill( c->GetToT()*tot2ns) ;//in ns
680 } else {//C side
681 GetRecPointsData(3)->Fill( c->GetTDC()*tdc2ns) ;//in ns
682 GetRecPointsData(7)->Fill( c->GetTDCRAW()*tdc2ns) ;//in ns
683 GetRecPointsData(11)->Fill( c->GetToT()*tot2ns) ;//in ns
5f144062 684 }
724eb92e 685 } else {
686 if (volumeID2[0]<5 || volumeID2[0]>13){ //O side
687 if (ddlPerSm<2){ //A side
688 GetRecPointsData(2)->Fill( c->GetTDC()*tdc2ns) ;//in ns
689 GetRecPointsData(6)->Fill( c->GetTDCRAW()*tdc2ns) ;//in ns
690 GetRecPointsData(10)->Fill( c->GetToT()*tot2ns) ;//in ns
691 } else { //C side
692 GetRecPointsData(4)->Fill( c->GetTDC()*tdc2ns) ;//in ns
693 GetRecPointsData(8)->Fill( c->GetTDCRAW()*tdc2ns) ;//in ns
694 GetRecPointsData(12)->Fill( c->GetToT()*tot2ns) ;//in ns
695 }
5f144062 696 }
724eb92e 697 }
698 GetRecPointsData(13)->Fill(hitmapx,GetStripIndex(volumeID2));
699 GetRecPointsData(14)->Fill(GetStripIndex(volumeID2), c->GetTDC()*tdc2ns) ;
700 Int_t trm= iDDL*10+(iTRM-3);
701 if (ddlACside==0) { //A side
702 GetRecPointsData(15)->Fill(trm,c->GetTDC()*tdc2ns);
703 } else {//C side
704 GetRecPointsData(16)->Fill(trm,c->GetTDC()*tdc2ns);
705 }
5f144062 706 }//hit selection
724eb92e 707 }//end while
5f144062 708 EnableDqmShifterOpt(kFALSE);
04236e67 709}
710
711//____________________________________________________________________________
5f144062 712void AliTOFQADataMakerRec::MakeESDs(AliESDEvent * esd)
04236e67 713{
714 //
715 // make QA data from ESDs
716 //
724eb92e 717 const Double_t speedOfLight = TMath::C()*1E2*1E-12; // cm/ps
718 const Double_t pionMass = 0.13957018; //GeV/c^2
5f144062 719
724eb92e 720 Int_t ntrk = esd->GetNumberOfTracks() ;
721 Int_t ntpc=0;
722 Int_t ntofout=0;
7b81681b 723
724eb92e 724 while (ntrk--) {
725 AliESDtrack *track=esd->GetTrack(ntrk);
726 Double_t tofTime=track->GetTOFsignal();//in ps
727 Double_t tofTimeRaw=track->GetTOFsignalRaw();//in ps
728 Double_t tofToT=track->GetTOFsignalToT(); //in ps
729
730 UInt_t status=track->GetStatus();
731 if (track->IsOn(AliESDtrack::kTPCrefit)) {
732 ntpc++;
733 Double_t y=track->Eta();
734 if (TMath::Abs(y)<0.9) { //select TOF acceptance
735 if ((status&AliESDtrack::kTOFout)!=0) { //define matching
736 ntofout++;
737 GetESDsData(1)->Fill(tofTime*1E-3);
738 GetESDsData(2)->Fill(tofTimeRaw*1E-3);
739 GetESDsData(3)->Fill(tofToT*1E-3);
740 GetESDsData(4)->Fill(track->Pt());
741
742 Double_t length =track->GetIntegratedLength();
743 Double_t mom2=(track->Pt()*track->Pt())+(track->Pz()*track->Pz());
744 Double_t piTexp = TMath::Sqrt(1+(pionMass*pionMass/mom2))*length/speedOfLight; //in ps
745 GetESDsData(8)->Fill(tofTime-piTexp);
746 GetESDsData(9)->Fill(length);
747
748 if ((status&AliESDtrack::kTIME)!=0)
749 GetESDsData(5)->Fill(track->Pt());
750
751 if (tofTime>0)
752 GetESDsData(6)->Fill(track->Pt());
753 } //end check on matched tracks
754 }
755 }//end check on TPCrefit
5f144062 756 }
757
724eb92e 758 GetESDsData(0)->Fill(ntofout) ;
5f144062 759 if(ntpc>0){
724eb92e 760 Float_t ratio = (Float_t)ntofout/(Float_t)ntpc*100.; //matching probability
761 GetESDsData(7)->Fill(ratio) ;
5f144062 762 }
763
764 if(ntofout>0) {
724eb92e 765 Float_t ratio = (Float_t)ntofout/(Float_t)ntpc*100; //matched over propagated to TOF outer radius
5f144062 766 GetESDsData(8)->Fill(ratio) ;
767 }
768 EnableDqmShifterOpt(kFALSE);
04236e67 769}
5f144062 770
04236e67 771//____________________________________________________________________________
772void AliTOFQADataMakerRec::StartOfDetectorCycle()
773{
774 //
775 //Detector specific actions at start of cycle
724eb92e 776 // ResetAllTRMcounters();
17f2cd01 777 fCalibData = GetCalibData();
724eb92e 778 fIsSOC=kTRUE;
779 return;
780}
04236e67 781
782//____________________________________________________________________________
4e25ac79 783void AliTOFQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
04236e67 784{
785 //Detector specific actions at end of cycle
786 // do the QA checking
e648d82d 787
724eb92e 788 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
789 if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) )
790 continue ;
791
792 if (fEnableDqmShifterOpt){
793 // Help make the raw qa histogram easier to interpret for the DQM shifter
794 if (!GetRawsData(0) || !GetRawsData(5) || !GetRawsData(10)
795 || !GetRawsData(15) || !GetRawsData(16) || !GetRawsData(17)) {
796 printf("No histogram for DQM found - Possible memory corruption ???. Please check\n") ;
797 continue;
798 }
799 printf("=========>Processed %i physics raw events. \n",fProcessedRawEventN);
800
801 //Double_t monitorPeriodLength=fProcessedRawEventN*600*1E-9;//in s
802
803 if (fCalibData){
804 //set minima and maxima to allow log scale
805 Double_t yTimeMax = GetRawsData(5)->GetMaximum();
806 Double_t yTotMax = GetRawsData(10)->GetMaximum();
807 yTimeMax+=yTimeMax*0.1;
808 yTotMax+=+yTotMax*0.1;
809 fLineExpTimeMin->SetY2(yTimeMax);
810 fLineExpTimeMax->SetY2(yTimeMax);
811 fLineExpTotMin->SetY2(yTotMax);
812 fLineExpTotMax->SetY2(yTotMax);
5f144062 813
724eb92e 814 for (Int_t j=0;j<18;j++){
815 if ((j==0)||(j==5)||(j==10)||(j==15)||(j==16)||(j==17)) {
816 GetRawsData(j)->GetXaxis()->SetLabelOffset(0.005);
817 GetRawsData(j)->GetXaxis()->SetLabelSize(0.05);
818 GetRawsData(j)->GetXaxis()->SetTitleOffset(0.8);
819 GetRawsData(j)->GetXaxis()->SetTitleSize(0.05);
820 GetRawsData(j)->GetYaxis()->SetLabelOffset(0.005);
821 GetRawsData(j)->GetYaxis()->SetLabelSize(0.06);
822 GetRawsData(j)->GetYaxis()->SetTitleOffset(0.8);
823 GetRawsData(j)->GetYaxis()->SetTitleSize(0.06);
824 }
ba5613e3 825 }
724eb92e 826
827 GetRawsData(5)->GetYaxis()->SetRangeUser(0.1, yTimeMax);
828 GetRawsData(10)->GetYaxis()->SetRangeUser(0.1, yTotMax);
829 GetRawsData(5)->GetListOfFunctions()->Add(fLineExpTimeMin);
830 GetRawsData(5)->GetListOfFunctions()->Add(fLineExpTimeMax);
831 GetRawsData(10)->GetListOfFunctions()->Add(fLineExpTotMin);
832 GetRawsData(10)->GetListOfFunctions()->Add(fLineExpTotMax);
833
834 for (Int_t sm=0;sm<17;sm++){
835 GetRawsData(16)->GetListOfFunctions()->Add(fLineSMid[sm]);
836 GetRawsData(17)->GetListOfFunctions()->Add(fLineSMid[sm]);
837 }
838
839 //TBox *phosHoleBox=new TBox(13,38,16,53);
840 TPaveText *phosHoleBox=new TPaveText(13,38,16,53,"b");
841 phosHoleBox->SetFillStyle(0);
842 phosHoleBox->SetFillColor(kWhite);
843 phosHoleBox->SetLineColor(kMagenta);
844 phosHoleBox->SetLineWidth(2);
845 phosHoleBox->AddText("PHOS");
846 GetRawsData(16)->GetListOfFunctions()->Add(phosHoleBox);
847 GetRawsData(17)->GetListOfFunctions()->Add(phosHoleBox);
848
849 //make up for all histos
850 for(Int_t j=0;j<5;j++){
851 GetRawsData(j)->SetMarkerColor(kBlue);
852 GetRawsData(j)->SetMarkerStyle(8);
853 GetRawsData(j)->SetMarkerSize(0.7);
854 }
855 for(Int_t j=5;j<15;j++){
856 GetRawsData(j)->SetLineColor(kBlue);
857 GetRawsData(j)->SetLineWidth(1);
858 GetRawsData(j)->SetMarkerColor(kBlue);
859 //GetRawsData(j)->SetFillColor(kWhite);
860 //GetRawsData(j)->SetDrawOption("bar");
861 }
862
863 GetRawsData(15)->SetLineColor(kBlue);
864 GetRawsData(15)->SetLineWidth(1);
865 GetRawsData(15)->SetMarkerStyle(8);
866 GetRawsData(15)->SetMarkerSize(0.7);
867 GetRawsData(15)->SetMarkerColor(kBlue);//Option("bar");
868
869 GetRawsData(16)->SetOption("colz");
870 GetRawsData(17)->SetOption("colz");
871 GetRawsData(18)->SetOption("colz");
872 // GetRawsData(0)->SetDrawOption("logy");
873 }
874 }//END ENABLE DQM SHIFTER OPT
875 } //end for
876 AliQAChecker::Instance()->Run(AliQAv1::kTOF, task, list) ;
04236e67 877}
878//____________________________________________________________________________
32bd8225 879void AliTOFQADataMakerRec::GetMapIndeces(const Int_t* const in , Int_t* out)
04236e67 880{
881 //
882 //return appropriate indeces for the theta-phi map
883 //
884
885 Int_t npadX = AliTOFGeometry::NpadX();
886 Int_t npadZ = AliTOFGeometry::NpadZ();
887 Int_t nStripA = AliTOFGeometry::NStripA();
888 Int_t nStripB = AliTOFGeometry::NStripB();
889 Int_t nStripC = AliTOFGeometry::NStripC();
890
891 Int_t isector = in[0];
892 Int_t iplate = in[1];
893 Int_t istrip = in[2];
894 Int_t ipadX = in[3];
895 Int_t ipadZ = in[4];
896
897 Int_t stripOffset = 0;
898 switch (iplate) {
899 case 0:
900 stripOffset = 0;
901 break;
902 case 1:
903 stripOffset = nStripC;
904 break;
905 case 2:
906 stripOffset = nStripC+nStripB;
907 break;
908 case 3:
909 stripOffset = nStripC+nStripB+nStripA;
910 break;
911 case 4:
912 stripOffset = nStripC+nStripB+nStripA+nStripB;
913 break;
914 default:
17f2cd01 915 AliDebug(1,Form("Wrong plate number in TOF (%d) !",iplate));
04236e67 916 break;
917 };
918 Int_t zindex=npadZ*(istrip+stripOffset)+(ipadZ+1);
919 Int_t phiindex=npadX*isector+ipadX+1;
920 out[0]=zindex;
921 out[1]=phiindex;
922
5f144062 923}
924
925//---------------------------------------------------------------
926Int_t AliTOFQADataMakerRec::GetStripIndex(const Int_t * const in)
927{
928 /* return tof strip index between 0 and 91 */
929
930 Int_t nStripA = AliTOFGeometry::NStripA();
931 Int_t nStripB = AliTOFGeometry::NStripB();
932 Int_t nStripC = AliTOFGeometry::NStripC();
933
934 // Int_t isector = in[0];
935 Int_t iplate = in[1];
936 Int_t istrip = in[2];
937 //Int_t ipadX = in[3];
938 //Int_t ipadZ = in[4];
939
940 Int_t stripOffset = 0;
941 switch (iplate) {
942 case 0:
943 stripOffset = 0;
944 break;
945 case 1:
946 stripOffset = nStripC;
947 break;
948 case 2:
949 stripOffset = nStripC+nStripB;
950 break;
951 case 3:
952 stripOffset = nStripC+nStripB+nStripA;
953 break;
954 case 4:
955 stripOffset = nStripC+nStripB+nStripA+nStripB;
956 break;
957 default:
958 AliDebug(1,Form("Wrong plate number in TOF (%d) !",iplate));
959 stripOffset=-1;
960 break;
961 };
962
963 if (stripOffset<0 || stripOffset>92) return -1;
964 else
965 return (stripOffset+istrip);
966
04236e67 967}
17f2cd01 968//---------------------------------------------------------------
32bd8225 969Bool_t AliTOFQADataMakerRec::CheckVolumeID(const Int_t * const volumeID)
17f2cd01 970{
32bd8225 971 //
972 //Checks volume ID validity
973 //
17f2cd01 974
975 for (Int_t j=0;j<5;j++){
976 if (volumeID[j]<0) {
977 AliDebug(1,Form("Invalid detector volume index for volumeID[%i]",j));
978 return kFALSE;
979 }
980 }
981 return kTRUE;
982
983}
984
985//---------------------------------------------------------------
32bd8225 986Bool_t AliTOFQADataMakerRec::CheckEquipID(const Int_t * const equipmentID)
17f2cd01 987{
32bd8225 988 //
989 //Checks equipment ID validity
990
17f2cd01 991 for (Int_t j=0;j<5;j++){
992 if (equipmentID[j]<0) {
17f2cd01 993 AliDebug(1,Form("Invalid equipment volume index for equipmentID[%i]",j));
994 return kFALSE;
995 }
996 }
997 return kTRUE;
998}
32bd8225 999//---------------------------------------------------------------
1000Bool_t AliTOFQADataMakerRec::FilterLTMData(const Int_t * const equipmentID) const
1001{
1002 /*It returns kTRUE if data come from LTM.
5f144062 1003 It thus filters trigger-related signals */
32bd8225 1004
1005 Int_t ddl, trm, tdc;
1006 //if (!CheckEquipID(equipmentID)) return kFALSE;
1007 ddl = equipmentID[0];
1008 trm = equipmentID[1];
1009 tdc = equipmentID[3];
1010
1011 if ((ddl%2==1) && (trm==3) && (tdc>11 && tdc<15))
1012 return kTRUE;
1013 else
1014 return kFALSE;
1015
1016}
1017//---------------------------------------------------------------
1018Bool_t AliTOFQADataMakerRec::FilterSpare(const Int_t * const equipmentID) const
1019{
1020 /*It returns kTRUE if data come from spare
1021 equipment ID.
1022 So far only check on TRM 3 crate left is implemented */
1023
1024 Int_t ddl, trm, tdc;
1025 //if (!CheckEquipID(equipmentID)) return kFALSE;
1026 ddl = equipmentID[0];
1027 trm = equipmentID[1];
1028 tdc = equipmentID[3];
1029
1030 if ((ddl%2==1) && (trm==3) && (tdc>2 && tdc<12))
1031 return kTRUE;
1032 else
1033 return kFALSE;
1034
1035}
724eb92e 1036//----------------------------------------------------------------
1037/*void AliTOFQADataMakerRec::ResetAllTRMcounters()
1038{
1039 //resets all TRM counters to 0
1040 for (Int_t trm=0;trm<720;trm++){
1041 fTRMNoisyArray[trm]=-1;
1042 fTRMHwOkArray[trm]=-1;
1043 fTRMEnabledArray[trm]=-1;
1044 }
1045 return;
1046
1047}
1048*/