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