]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TOF/AliTOFQADataMakerRec.cxx
initialization of magnetic field, setting the kITSrefit flag for the input tracks...
[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
5f144062 24/* Modified by fbellini on 16/04/2010
25 - Added EnableDqmShifterOpt()
26 - Modified EndOfDetectorCycle() with options for DQM
27 - Updated ESDs QA
28
29 Modified by fbellini on 30/03/2010
30 - Changed raws time histos range to 610ns
31 - Added FilterLTMData() and FilterSpare() methods
32 - Added check on enabled channels for raw data
33 - Updated RecPoints QA
34
35 Modified by fbellini on 02/03/2010
36 - Fixed raw data decoding methods (use AliTOFRawStream::LoadRawDataBuffer())
37 - Added filter for noisy channels and read map from OCDB
38 - Added GetCalibData() method
39 - Added CheckVolumeID() and CheckEquipID() methods
40 - Updated Raw QA
32bd8225 41*/
42
04236e67 43#include <TClonesArray.h>
04236e67 44#include <TH1F.h>
45#include <TH2F.h>
5f144062 46#include <TLine.h>
32bd8225 47
17f2cd01 48#include "AliCDBManager.h"
17f2cd01 49#include "AliCDBEntry.h"
04236e67 50#include "AliESDEvent.h"
51#include "AliESDtrack.h"
04236e67 52#include "AliQAChecker.h"
53#include "AliRawReader.h"
32bd8225 54#include "AliTOFRawStream.h"
5c7c93fa 55#include "AliTOFcluster.h"
56#include "AliTOFQADataMakerRec.h"
04236e67 57#include "AliTOFrawData.h"
5c7c93fa 58#include "AliTOFGeometry.h"
17f2cd01 59#include "AliTOFChannelOnlineStatusArray.h"
60
04236e67 61
62ClassImp(AliTOFQADataMakerRec)
63
64//____________________________________________________________________________
65 AliTOFQADataMakerRec::AliTOFQADataMakerRec() :
17f2cd01 66 AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kTOF), "TOF Quality Assurance Data Maker"),
67 fCalibData(0x0),
5f144062 68 fEnableNoiseFiltering(kFALSE),
69 fEnableDqmShifterOpt(kFALSE),
70 fProcessedRawEventN(0)
04236e67 71{
72 //
73 // ctor
74 //
5f144062 75
04236e67 76}
77
78//____________________________________________________________________________
79AliTOFQADataMakerRec::AliTOFQADataMakerRec(const AliTOFQADataMakerRec& qadm) :
17f2cd01 80 AliQADataMakerRec(),
81 fCalibData(qadm.fCalibData),
5f144062 82 fEnableNoiseFiltering(qadm.fEnableNoiseFiltering),
83 fEnableDqmShifterOpt(qadm.fEnableDqmShifterOpt),
84 fProcessedRawEventN(qadm.fProcessedRawEventN)
04236e67 85{
86 //
87 //copy ctor
88 //
89 SetName((const char*)qadm.GetName()) ;
90 SetTitle((const char*)qadm.GetTitle());
5f144062 91
92
04236e67 93}
94
95//__________________________________________________________________
96AliTOFQADataMakerRec& AliTOFQADataMakerRec::operator = (const AliTOFQADataMakerRec& qadm )
97{
98 //
99 // assignment operator.
100 //
101 this->~AliTOFQADataMakerRec();
102 new(this) AliTOFQADataMakerRec(qadm);
103 return *this;
104}
105
17f2cd01 106//----------------------------------------------------------------------------
107AliTOFChannelOnlineStatusArray* AliTOFQADataMakerRec::GetCalibData() const
108{
32bd8225 109 //
110 // Retrive TOF calib objects from OCDB
111 //
17f2cd01 112 AliCDBManager *man = AliCDBManager::Instance();
113
114 AliCDBEntry *cdbe=0;
115
116 cdbe = man->Get("TOF/Calib/Status",fRun);
117 if(!cdbe){
118 AliWarning("Load of calibration data from default storage failed!");
119 AliWarning("Calibration data will be loaded from local storage ($ALICE_ROOT)");
120 man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
121 cdbe = man->Get("TOF/Calib/Status",fRun);
122 }
123 // Retrieval of data in directory TOF/Calib/Data:
124
125 AliTOFChannelOnlineStatusArray * array = 0;
126 if (cdbe) array = (AliTOFChannelOnlineStatusArray *)cdbe->GetObject();
127 if (!array) AliFatal("No calibration data from calibration database !");
128
129 return array;
130
131}
132
133
134
04236e67 135//____________________________________________________________________________
136void AliTOFQADataMakerRec::InitRaws()
137{
138 //
139 // create Raws histograms in Raws subdir
140 //
7d297381 141 const Bool_t expert = kTRUE ;
142 const Bool_t saveCorr = kTRUE ;
143 const Bool_t image = kTRUE ;
04236e67 144
5f144062 145 TH1F * h0 = new TH1F("hTOFRaws", "TOF raw hit multiplicity; TOF raw hits number;Counts ",201, -1., 200.) ;
146
147 TH1F * h1 = new TH1F("hTOFRawsIA", "TOF raw hit multiplicity - I/A side; TOF raw hits number ;Counts ",201, -1., 200.) ;
148 TH1F * h2 = new TH1F("hTOFRawsOA", "TOF raw hit multiplicity - O/A side; TOF raw hits number ;Counts ",201, -1., 200.) ;
149 TH1F * h3 = new TH1F("hTOFRawsIC", "TOF raw hit multiplicity - I/C side; TOF raw hits number ;Counts ",201, -1., 200.) ;
150 TH1F * h4 = new TH1F("hTOFRawsOC", "TOF raw hit multiplicity - O/C side; TOF raw hits number ;Counts ",201, -1., 200.) ;
151
152 TH1F * h5 = new TH1F("hTOFRawsTime", "TOF Raws - Hit time (ns);Measured Hit time [ns];Counts", 25000,0. ,610.) ;
153
154 TH1F * h6 = new TH1F("hTOFRawsTimeIA", "TOF Raws - Hit time (ns) - I/A side;Measured Hit time [ns];Counts", 25000,0. ,610.) ;
155 TH1F * h7 = new TH1F("hTOFRawsTimeOA", "TOF Raws - Hit time (ns) - O/A side;Measured Hit time [ns];Counts", 25000,0. ,610.) ;
156 TH1F * h8 = new TH1F("hTOFRawsTimeIC", "TOF Raws - Hit time (ns) - I/C side;Measured Hit time [ns];Counts", 25000,0. ,610.) ;
157 TH1F * h9 = new TH1F("hTOFRawsTimeOC", "TOF Raws - Hit time (ns) - O/C side;Measured Hit time [ns];Counts", 25000,0. ,610.) ;
158
159 TH1F * h10 = new TH1F("hTOFRawsToT", "TOF Raws - Hit ToT (ns);Measured Hit ToT (ns);Counts", 1000, 0., 48.8) ;
160
161 TH1F * h11 = new TH1F("hTOFRawsToTIA", "TOF Raws - Hit ToT (ns) - I/A side;Measured Hit ToT (ns);Counts", 1000, 0., 48.8) ;
162 TH1F * h12 = new TH1F("hTOFRawsToTOA", "TOF Raws - Hit ToT (ns) - O/A side;Measured Hit ToT (ns);Counts", 1000, 0., 48.8) ;
163 TH1F * h13 = new TH1F("hTOFRawsToTIC", "TOF Raws - Hit ToT (ns) - I/C side;Measured Hit ToT (ns);Counts", 1000, 0., 48.8) ;
164 TH1F * h14 = new TH1F("hTOFRawsToTOC", "TOF Raws - Hit ToT (ns) - O/C side;Measured Hit ToT (ns);Counts", 1000, 0., 48.8) ;
165
166 TH1F * h15 = new TH1F("hTOFRawsLTMHits", "LTM hits ; Crate; Counts", 72, 0., 72.);
167 TH1F * h16 = new TH1F("hTOFRawsTRMHits035", "TRM hits - crates 0 to 35 ;TRM index = SMid*10+TRM(0-9);Hits", 361, 0., 361.) ;
168 TH1F * h17 = new TH1F("hTOFRawsTRMHits3671","TRM hits - crates 36 to 71 ;TRM index = SMid*10+TRM(0-9);Hits", 361, 361., 722.) ;
32bd8225 169
5f144062 170 TH1F * h18 = new TH1F("hTOFRawChannelHits","TOF channel hits count; Channel ID; Hits", 158000, 0., 158000);
32bd8225 171
5f144062 172 TH1F * h19 = new TH1F("hTOFOrphansTime", "TOF Raws - Orphans time (ns);Measured Hit time [ns];Counts", 25000, 0. ,610.) ;
173 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) ;
174 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, 361., 722., 250, 0., 610.0) ;
175 TH2F * h22 = new TH2F("hTOFRawToTVsTRM035", "TOF raws - Hit ToT vs TRM - crates 0 to 35; TRM index = DDL*10+TRM(0-9);TOF raw ToT [ns] ", 361, 0., 361., 100, 0., 48.8) ;
176 TH2F * h23 = new TH2F("hTOFRawToTVsTRM3671", "TOF raws - Hit ToT vs TRM - crates 36 to 72; TRM index = DDL*10+TRM(0-9);TOF raw ToT [ns] ", 361, 361., 722., 100, 0., 48.8) ;
177 TH2F * h24 = new TH2F("hTOFTimeVsStrip","TOF Raws - Hit time vs. strip (theta); Strip index;Raws TOF time (ns) ", 91,0.,91, 250, 0., 610.) ;
44ed7a66 178
5f144062 179// TH2F * h25 = new TH2F("hTOFRawsClusMap","Raws vs TOF eta-phi;eta (2*strip+padz);phi (48*sector+padx)",183, -0.5, 182.5,865,-0.5,864.5) ;
180
181 h0->Sumw2() ;
182 h1->Sumw2() ;
183 h2->Sumw2() ;
184 h3->Sumw2() ;
185 h4->Sumw2() ;
186 h5->Sumw2() ;
187 h6->Sumw2() ;
188 h7->Sumw2() ;
189 h8->Sumw2() ;
190 h9->Sumw2() ;
191 h10->Sumw2() ;
192 h11->Sumw2() ;
193 h12->Sumw2() ;
194 h13->Sumw2() ;
195 h14->Sumw2() ;
196 h15->Sumw2() ;
197 h16->Sumw2() ;
198 h17->Sumw2() ;
199 h18->Sumw2() ;
200 h19->Sumw2() ;
201 h20->Sumw2() ;
202 h21->Sumw2() ;
203 h22->Sumw2() ;
204 h23->Sumw2() ;
205 h24->Sumw2() ;
206
17f2cd01 207 Add2RawsList(h0, 0, !expert, image, !saveCorr) ;
208 Add2RawsList(h1, 1, expert, !image, !saveCorr) ;
209 Add2RawsList(h2, 2, expert, !image, !saveCorr) ;
210 Add2RawsList(h3, 3, expert, !image, !saveCorr) ;
211 Add2RawsList(h4, 4, expert, !image, !saveCorr) ;
212 Add2RawsList(h5, 5, !expert, image, !saveCorr) ;
5f144062 213 Add2RawsList(h6, 6, expert, !image, !saveCorr) ;
214 Add2RawsList(h7, 7, expert, !image, !saveCorr) ;
215 Add2RawsList(h8, 8, expert, !image, !saveCorr) ;
216 Add2RawsList(h9, 9, expert, !image, !saveCorr) ;
17f2cd01 217 Add2RawsList(h10, 10, !expert, image, !saveCorr) ;
5f144062 218 Add2RawsList(h11, 11, expert, !image, !saveCorr) ;
219 Add2RawsList(h12, 12, expert, !image, !saveCorr) ;
17f2cd01 220 Add2RawsList(h13, 13, expert, !image, !saveCorr) ;
221 Add2RawsList(h14, 14, expert, !image, !saveCorr) ;
5f144062 222 Add2RawsList(h15, 15, !expert, image, !saveCorr) ;
223 Add2RawsList(h16, 16, !expert, image, !saveCorr) ;
224 Add2RawsList(h17, 17, !expert, image, !saveCorr) ;
17f2cd01 225 Add2RawsList(h18, 18, expert, !image, !saveCorr) ;
226 Add2RawsList(h19, 19, expert, !image, !saveCorr) ;
227 Add2RawsList(h20, 20, expert, !image, !saveCorr) ;
228 Add2RawsList(h21, 21, expert, !image, !saveCorr) ;
5f144062 229 Add2RawsList(h22, 22, expert, !image, !saveCorr) ;
230 Add2RawsList(h23, 23, expert, !image, !saveCorr) ;
231 Add2RawsList(h24, 24, expert, !image, !saveCorr) ;
17f2cd01 232
44ed7a66 233}
234
04236e67 235//____________________________________________________________________________
236void AliTOFQADataMakerRec::InitRecPoints()
237{
238 //
239 // create RecPoints histograms in RecPoints subdir
240 //
135306ea 241
32bd8225 242 const Bool_t expert = kTRUE ;
243 const Bool_t image = kTRUE ;
04236e67 244
5f144062 245 TH1F * h0 = new TH1F("hTOFRecPoints", "TOF RecPoints multiplicity ; TOF RecPoints number;Counts",201, -1., 200.) ;
246
247 TH1F * h1 = new TH1F("hTOFRecPointsTimeIA", "RecPoints Time Spectrum in TOF (ns)- I/A side; Calibrated TOF time [ns];Counts", 25000, 0., 610.) ;
248 TH1F * h2 = new TH1F("hTOFRecPointsTimeOA", "RecPoints Time Spectrum in TOF (ns)- O/A side; Calibrated TOF time [ns];Counts", 25000, 0., 610.) ;
249 TH1F * h3 = new TH1F("hTOFRecPointsTimeIC", "RecPoints Time Spectrum in TOF (ns)- I/C side; Calibrated TOF time [ns];Counts", 25000, 0., 610.) ;
250 TH1F * h4 = new TH1F("hTOFRecPointsTimeOC", "RecPoints Time Spectrum in TOF (ns)- O/C side; Calibrated TOF time [ns];Counts", 25000, 0., 610.) ;
32bd8225 251
5f144062 252 TH1F * h5 = new TH1F("hTOFRecPointsRawTimeIA", "RecPoints raw Time Spectrum in TOF (ns)-I/A side; Measured TOF time [ns];Counts", 25000, 0., 610.) ;
253 TH1F * h6 = new TH1F("hTOFRecPointsRawTimeOA", "RecPoints raw Time Spectrum in TOF (ns)-O/A side; Measured TOF time [ns];Counts", 25000, 0., 610.) ;
254 TH1F * h7 = new TH1F("hTOFRecPointsRawTimeIC", "RecPoints raw Time Spectrum in TOF (ns)-I/C side; Measured TOF time [ns];Counts", 25000, 0., 610.) ;
255 TH1F * h8 = new TH1F("hTOFRecPointsRawTimeOC", "RecPoints raw Time Spectrum in TOF (ns)-O/C side; Measured TOF time [ns];Counts", 25000, 0., 610.) ;
256
257 TH1F * h9 = new TH1F("hTOFRecPointsToTIA", "RecPoints ToT Spectrum in TOF (ns)-I/A side; Measured TOT [ns];Counts", 1000, 0., 48.8 ) ;
258 TH1F * h10 = new TH1F("hTOFRecPointsToTOA", "RecPoints ToT Spectrum in TOF (ns)-O/A side; Measured TOT [ns];Counts", 1000, 0., 48.8 ) ;
259 TH1F * h11 = new TH1F("hTOFRecPointsToTIC", "RecPoints ToT Spectrum in TOF (ns)-I/C side; Measured TOT [ns];Counts", 1000, 0., 48.8 ) ;
260 TH1F * h12 = new TH1F("hTOFRecPointsToTOC", "RecPoints ToT Spectrum in TOF (ns)-O/C side; Measured TOT [ns];Counts", 1000, 0., 48.8 ) ;
261 TH1F * h13 = new TH1F("hTOFRawChannelHits","TOF channel hits count; Channel ID; Hits", 158000, 0., 158000);
262
263 TH2F * h14 = new TH2F("hTOFRecPointsClusMap","RecPoints vs TOF phi-eta; eta (2*strip+padz);phi (48*sector+padx)",183, -0.5, 182.5,865,-0.5,864.5) ;
264 TH2F * h15 = new TH2F("hTOFRecTimeVsStrip","RecPoints TOF time vs. strip (theta); Strip index; RecPoints TOF time (ns) ",92,-1.,91, 250, 0., 610.) ;
265
266 TH2F * h16 = 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) ;
267 TH2F * h17 = new TH2F("hTOFRecPointsTimeVsTRM3671","TOF RecPoints time vs TRM - crates 36 to 72; TRM index = DDL**10+TRM(0-9);TOF time [ns]", 361, 361., 722., 250, 0., 610.0) ;
268 TH2F * h18 = new TH2F("hTOFRecPointsToTVsTRM035","TOF RecPoints ToT vs TRM - crates 0 to 35; TRM index = DDL*10+TRM(0-9);TOF ToT [ns] ", 361, 0., 361., 100, 0., 48.8) ;
269 TH2F * h19 = new TH2F("hTOFRecPointsToTVsTRM3671","TOF RecPoints ToT vs TRM - crates 36 to 72; TRM index = DDL*10+TRM(0-9);TOF ToT [ns] ", 361, 361., 722., 100, 0., 48.8) ;
32bd8225 270
32bd8225 271 h0->Sumw2() ;
272 h1->Sumw2() ;
273 h2->Sumw2() ;
274 h3->Sumw2() ;
275 h4->Sumw2() ;
276 h5->Sumw2() ;
277 h6->Sumw2() ;
278 h7->Sumw2() ;
279 h8->Sumw2() ;
280 h9->Sumw2() ;
281 h10->Sumw2() ;
282 h11->Sumw2() ;
283 h12->Sumw2() ;
284 h13->Sumw2() ;
5f144062 285 h14->Sumw2() ;
286 h15->Sumw2() ;
287 h16->Sumw2() ;
288 h17->Sumw2() ;
289 h18->Sumw2() ;
290 h19->Sumw2() ;
17f2cd01 291
5f144062 292 Add2RecPointsList(h0, 0, !expert, image) ;
293 Add2RecPointsList(h1, 1, !expert, image) ;
294 Add2RecPointsList(h2, 2, !expert, image) ;
295 Add2RecPointsList(h3, 3, !expert, image) ;
296 Add2RecPointsList(h4, 4, !expert, image) ;
297 Add2RecPointsList(h5, 5, expert, !image) ;
298 Add2RecPointsList(h6, 6, expert, !image) ;
299 Add2RecPointsList(h7, 7, expert, !image) ;
300 Add2RecPointsList(h8, 8, expert, !image) ;
301 Add2RecPointsList(h9, 9, !expert, image) ;
302 Add2RecPointsList(h10, 10, !expert, image) ;
303 Add2RecPointsList(h11, 11, !expert, image) ;
304 Add2RecPointsList(h12, 12, !expert, image) ;
305 Add2RecPointsList(h13, 13, expert, !image) ;
306 Add2RecPointsList(h14, 14, expert, !image) ;
307 Add2RecPointsList(h15, 15, expert, !image) ;
308 Add2RecPointsList(h16, 16, expert, !image) ;
309 Add2RecPointsList(h17, 17, expert, !image) ;
310 Add2RecPointsList(h18, 18, expert, !image) ;
311 Add2RecPointsList(h19, 19, expert, !image) ;
04236e67 312}
313
314//____________________________________________________________________________
315void AliTOFQADataMakerRec::InitESDs()
316{
317 //
318 //create ESDs histograms in ESDs subdir
319 //
135306ea 320
5f144062 321 const Bool_t expert = kTRUE ;
322 const Bool_t image = kTRUE ;
04236e67 323
5f144062 324 TH1F * h0 = new TH1F("hTOFESDs", "Number of matched TOF tracks per event;Number of TOF matched ESD tracks;Counts", 201, -1., 200.) ;
325 TH1F * h1 = new TH1F("hTOFESDsTime", "Matched ESDs tracks: TOF Time spectrum; Calibrated TOF time [ns];Counts", 25000, 0., 610. ) ;
326 TH1F * h2 = new TH1F("hTOFESDsRawTime", "Matched ESDs tracks: TOF raw Time spectrum;Measured TOF time [ns];Counts", 25000, 0., 610.) ;
327 TH1F * h3 = new TH1F("hTOFESDsToT", "Matched ESDs tracks: TOF ToT spectrum; ESDs ToT [ns];Counts",1000, 0., 48.8) ;
328 TH1F * h4 = new TH1F("hTOFESDsPIDoverMatched", "Fraction of TOF identified tracks over matched TOF tracks per event; identified by TOF / matched tracks [%];Counts", 101, -1., 100.) ;
329 TH1F * h5 = new TH1F("hTOFESDsPID", "Fraction of TOF identified tracks over ESD identified tracks per event; identified by TOF / ESD identified [%];Counts", 101, -1., 100.) ;
330 TH1F * h6 = new TH1F("hTOFESDsTPCmatched", "TPC-TOF matched tracks momentum distribution (GeV/c); p (GeV/c);Counts", 50, 0.20, 5.00) ;
331 TH1F * h7 = new TH1F("hTOFESDsMatchingProb", "TPC-TOF track-matching probability per event;TPC-TOF track-matching probability (%) ;Counts",101, -1.0, 100) ;
332 TH1F * h8 = new TH1F("hTOFESDsHitOverTracked", "Fraction of TOF matching tracks over propagated tracks per event; TOF matched / propagated to TOF [%];Counts",101, -1.0, 100.0) ;
333 TH1F * h9 = new TH1F("hTOFESDsDiffTime", "ESDs t_{TOF}-t_{exp} spectrum in TOF (ps); t_{TOF}-t_{exp} [ps];Counts", 200, -2440., 2440.) ;
334 TH1F * h10 = new TH1F("hTOFHitsLength", "Matched ESDs tracks: Length Spectrum; Track length [cm];Counts", 800, 0., 800) ;
335 h0->Sumw2() ;
04236e67 336 h1->Sumw2() ;
04236e67 337 h2->Sumw2() ;
04236e67 338 h3->Sumw2() ;
5f144062 339 h4->Sumw2() ;
340 h5->Sumw2() ;
341 h6->Sumw2() ;
342 h7->Sumw2() ;
343 h8->Sumw2() ;
344 h9->Sumw2() ;
345 h10->Sumw2() ;
346
347 Add2ESDsList(h0, 0, !expert, image) ;
348 Add2ESDsList(h1, 1, !expert, image) ;
349 Add2ESDsList(h2, 2, expert, image) ;
350 Add2ESDsList(h3, 3, !expert, image) ;
351 Add2ESDsList(h4, 4, expert, image) ;
352 Add2ESDsList(h5, 5, expert, image) ;
353 Add2ESDsList(h6, 6, expert, image) ;
354 Add2ESDsList(h7, 7, expert, image) ;
355 Add2ESDsList(h8, 8, expert, image) ;
356 Add2ESDsList(h9, 9, !expert, image) ;
357 Add2ESDsList(h10, 10, !expert, image) ;
04236e67 358}
359
5f144062 360
04236e67 361//____________________________________________________________________________
362void AliTOFQADataMakerRec::MakeRaws(AliRawReader* rawReader)
363{
364 //
365 // makes data from Raws
366 //
eca4fa66 367
5f144062 368 Double_t tdc2ns=AliTOFGeometry::TdcBinWidth()*1E-3;//in ns
04236e67 369 Double_t tot2ns=AliTOFGeometry::ToTBinWidth()*1E-3;
370
17f2cd01 371 Int_t nentries=0;
372 Int_t ntof[5]; /* 0=tot, 1=IA, 2=OA, 3=IC, 4=OC*/
373 for (Int_t j=0;j<5;j++){ ntof[j]=0;}
04236e67 374
17f2cd01 375 Int_t equipmentID[5]; //(ddl, trm, chain,tdc,channel)
376 Int_t volumeID[5]; //(sector,plate,strip,padX,padZ)
377 Int_t volumeID2[5]; //(sector,plate,strip,padZ,padX) to use AliTOFGeometry::GetIndex()
378 Int_t out[5]; // out=(indexZ,indexPhi)
379 Int_t chIndex=-1;
04236e67 380
381 TClonesArray * clonesRawData;
382 AliTOFRawStream tofInput(rawReader);
17f2cd01 383
384 //uncomment if needed to apply DeltaBC correction
385 //tofInput.ApplyBCCorrections(kTRUE);
386
04236e67 387 for (Int_t iDDL = 0; iDDL < AliTOFGeometry::NDDL()*AliTOFGeometry::NSectors(); iDDL++){
388 rawReader->Reset();
17f2cd01 389 tofInput.LoadRawDataBuffers(iDDL);
04236e67 390 clonesRawData = (TClonesArray*)tofInput.GetRawData();
391 for (Int_t iRawData = 0; iRawData<clonesRawData->GetEntriesFast(); iRawData++) {
17f2cd01 392 nentries++;
393 AliTOFrawData *tofRawDatum = (AliTOFrawData*)clonesRawData->UncheckedAt(iRawData);
394
395 if (tofRawDatum->GetTOF()){
396
397 equipmentID[0]=iDDL;
398 equipmentID[1]=tofRawDatum->GetTRM();
399 equipmentID[2]=tofRawDatum->GetTRMchain();
400 equipmentID[3]=tofRawDatum->GetTDC();
401 equipmentID[4]=tofRawDatum->GetTDCchannel();
402
5f144062 403 if (CheckEquipID(equipmentID)){
17f2cd01 404 tofInput.EquipmentId2VolumeId(iDDL,
405 tofRawDatum->GetTRM(),
406 tofRawDatum->GetTRMchain(),
407 tofRawDatum->GetTDC(),
408 tofRawDatum->GetTDCchannel(),
409 volumeID);
32bd8225 410 if (FilterSpare(equipmentID)) continue;
5f144062 411 if (FilterLTMData(equipmentID)){ //counts LTM hits
412 if (tofRawDatum->GetTOT()) GetRawsData(15)->Fill(equipmentID[0]);
413 } else {
414 if (CheckVolumeID(volumeID)){
32bd8225 415
5f144062 416 GetMapIndeces(volumeID,out);
417 volumeID2[0]=volumeID[0];
418 volumeID2[1]=volumeID[1];
419 volumeID2[2]=volumeID[2];
420 volumeID2[3]=volumeID[4];
421 volumeID2[4]=volumeID[3];
422 chIndex=AliTOFGeometry::GetIndex(volumeID2);
423
424 if (tofRawDatum->GetTOT()){
425 if (!(fCalibData->GetNoiseStatus(chIndex)==AliTOFChannelOnlineStatusArray::kTOFNoiseBad)
426 && (fCalibData->GetHWStatus(chIndex) == AliTOFChannelOnlineStatusArray::kTOFHWOk)) {//noise and enabled filter
427 ntof[0]++; //counter for tof hits
428
429 //fill global spectra for DQM plots
430 GetRawsData(5)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;//in ns
431 GetRawsData(10)->Fill( tofRawDatum->GetTOT()*tot2ns) ;//in ns
432
433 //fill side-related spectra for experts plots
434 if (volumeID2[0]>4 && volumeID2[0]<14){ //I side
17f2cd01 435 if ((iDDL%4==0)|| (iDDL%4==1)){ //A side
5f144062 436 ntof[1]++;
437 GetRawsData(6)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;
438 GetRawsData(11)->Fill( tofRawDatum->GetTOT()*tot2ns) ;
17f2cd01 439 } else {
440 if ((iDDL%4==2)|| (iDDL%4==3)){//C side
5f144062 441 ntof[3]++;
442 GetRawsData(8)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;
443 GetRawsData(13)->Fill( tofRawDatum->GetTOT()*tot2ns) ;
17f2cd01 444 }
445 }
5f144062 446 } else {
447 if (volumeID2[0]<5 || volumeID2[0]>13){ //O side
448 if ((iDDL%4==0)|| (iDDL%4==1)){ //A side
449 ntof[2]++;
450 GetRawsData(7)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;
451 GetRawsData(12)->Fill( tofRawDatum->GetTOT()*tot2ns) ;
452 } else {
453 if ((iDDL%4==2)|| (iDDL%4==3)){//C side
454 ntof[4]++;
455 GetRawsData(9)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;
456 GetRawsData(14)->Fill( tofRawDatum->GetTOT()*tot2ns) ;
457 }
458 }
459 }
460 }
461 GetRawsData(18)->Fill(chIndex);
462 //compute TRM offset
463 Int_t trm= iDDL*10+(equipmentID[1]-3);
464 if (iDDL>=0 && iDDL<36) {
465 GetRawsData(16)->Fill(trm) ;
466 GetRawsData(20)->Fill(trm,tofRawDatum->GetTOF()*tdc2ns);
467 GetRawsData(22)->Fill(trm,tofRawDatum->GetTOT()*tot2ns);
17f2cd01 468 }
5f144062 469 if (iDDL>=36 && iDDL<72) {
470 GetRawsData(17)->Fill(trm) ;//in ns
471 GetRawsData(21)->Fill(trm,tofRawDatum->GetTOF()*tdc2ns);
472 GetRawsData(23)->Fill(trm,tofRawDatum->GetTOT()*tot2ns);
473 }
474 GetRawsData(24)->Fill(GetStripIndex(volumeID),tofRawDatum->GetTOF()*tdc2ns) ;
475 //GetRawsData(25)->Fill( out[0],out[1]) ;//raw map
476 }//noise filter
477 }//end hit selection
478 else { //orphans
479 if (!(fCalibData->GetNoiseStatus(chIndex) == AliTOFChannelOnlineStatusArray::kTOFNoiseBad)
480 && (fCalibData->GetHWStatus(chIndex) == AliTOFChannelOnlineStatusArray::kTOFHWOk))
481 GetRawsData(19)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;//in ns
482 }//end orphans
32bd8225 483 }//end volumeID check
5f144062 484 }//end LTM filter
17f2cd01 485 }//end equipID check
486 }
5f144062 487 } //while loop
04236e67 488 clonesRawData->Clear();
04236e67 489 } // DDL Loop
490
17f2cd01 491 for (Int_t j=0;j<5;j++){
492 if(ntof[j]<=0) GetRawsData(j)->Fill(-1.) ;
493 else GetRawsData(j)->Fill(ntof[j]);
04236e67 494 }
5f144062 495 fProcessedRawEventN++;
496 EnableDqmShifterOpt(kTRUE);
44ed7a66 497}
498
44ed7a66 499//____________________________________________________________________________
04236e67 500void AliTOFQADataMakerRec::MakeRecPoints(TTree * clustersTree)
501{
32bd8225 502 //
503 // Make data from Clusters
504 //
505
506 Double_t tdc2ns=AliTOFGeometry::TdcBinWidth()*1E-3;
507 Double_t tot2ns=AliTOFGeometry::ToTBinWidth()*1E-3;
508
509 Int_t volumeID[5];
510 Int_t volumeID2[5];
511 Int_t out[5];
512
513 TBranch *branch=clustersTree->GetBranch("TOF");
514 if (!branch) {
515 AliError("can't get the branch with the TOF clusters !");
516 return;
517 }
518
519 static TClonesArray dummy("AliTOFcluster",10000);
520 dummy.Clear();
521 TClonesArray *clusters=&dummy;
522 branch->SetAddress(&clusters);
523
524 // Import the tree
525 clustersTree->GetEvent(0);
526
527 Int_t nentries=clusters->GetEntriesFast();
528 if(nentries<=0){
529 GetRecPointsData(0)->Fill(-1.) ;
530 }else{
531 GetRecPointsData(0)->Fill(nentries) ;
532 }
533
534 TIter next(clusters) ;
535 AliTOFcluster * c ;
536 while ( (c = dynamic_cast<AliTOFcluster *>(next())) ) {
537
538 volumeID[0] = c->GetDetInd(0);
539 volumeID[1] = c->GetDetInd(1);
540 volumeID[2] = c->GetDetInd(2);
541 volumeID[3] = c->GetDetInd(4); //X and Z indeces inverted in RecPoints
542 volumeID[4] = c->GetDetInd(3); //X and Z indeces inverted in RecPoints
543
544 for (Int_t i=0;i<5;i++){
545 volumeID2[i]=c->GetDetInd(i); //X and Z indeces inverted in RecPoints
546 }
547
548 GetMapIndeces(volumeID,out);
5f144062 549 Int_t chIndex=AliTOFGeometry::GetIndex(volumeID2);
32bd8225 550 Int_t iDDL=AliTOFRawStream::Geant2DDL(volumeID2);
5f144062 551 Int_t iTRM=AliTOFRawStream::Geant2TRM(volumeID2);
552
32bd8225 553 if (c->GetTDCRAW() && c->GetTDC() && c->GetToT()){
554 if (volumeID2[0]>4 && volumeID2[0]<14){ //I side
555 if ((iDDL%4==0)|| (iDDL%4==1)){ //A side
556 GetRecPointsData(1)->Fill( c->GetTDC()*tdc2ns) ;//in ns
557 GetRecPointsData(5)->Fill( c->GetTDCRAW()*tdc2ns) ;//in ns
558 GetRecPointsData(9)->Fill( c->GetToT()*tot2ns) ;//in ns
559
560 } else {
561 if ((iDDL%4==2)|| (iDDL%4==3)){//C side
562 GetRecPointsData(3)->Fill( c->GetTDC()*tdc2ns) ;//in ns
563 GetRecPointsData(7)->Fill( c->GetTDCRAW()*tdc2ns) ;//in ns
564 GetRecPointsData(11)->Fill( c->GetToT()*tot2ns) ;//in ns
565 }
566 }
567 } else {
568 if (volumeID2[0]<5 || volumeID2[0]>13){ //O side
569 if ((iDDL%4==0)|| (iDDL%4==1)){ //A side
570 GetRecPointsData(2)->Fill( c->GetTDC()*tdc2ns) ;//in ns
571 GetRecPointsData(6)->Fill( c->GetTDCRAW()*tdc2ns) ;//in ns
572 GetRecPointsData(10)->Fill( c->GetToT()*tot2ns) ;//in ns
573 } else {
574 if ((iDDL%4==2)|| (iDDL%4==3)){//C side
575 GetRecPointsData(4)->Fill( c->GetTDC()*tdc2ns) ;//in ns
576 GetRecPointsData(8)->Fill( c->GetTDCRAW()*tdc2ns) ;//in ns
577 GetRecPointsData(12)->Fill( c->GetToT()*tot2ns) ;//in ns
578 }
579 }
580 }
581 }
5f144062 582 GetRecPointsData(14)->Fill(out[0],out[1]);
583 GetRecPointsData(15)->Fill(GetStripIndex(volumeID), c->GetTDC()*tdc2ns) ;
584 Int_t trm= iDDL*10+(iTRM-3);
585 if (iDDL>=0 && iDDL<36) {
586 GetRecPointsData(16)->Fill(trm,c->GetTDC()*tdc2ns);
587 GetRecPointsData(18)->Fill(trm,c->GetToT()*tot2ns);
588 }
589 if (iDDL>=36 && iDDL<72) {
590 GetRecPointsData(17)->Fill(trm,c->GetTDC()*tdc2ns);
591 GetRecPointsData(19)->Fill(trm,c->GetToT()*tot2ns);
592 }
593 GetRecPointsData(13)->Fill(chIndex) ;//in ns
594 }//hit selection
32bd8225 595 }//end while
596
5f144062 597 EnableDqmShifterOpt(kFALSE);
04236e67 598}
599
600//____________________________________________________________________________
5f144062 601void AliTOFQADataMakerRec::MakeESDs(AliESDEvent * esd)
04236e67 602{
603 //
604 // make QA data from ESDs
605 //
5f144062 606 const Double_t speedOfLight = TMath::C()*1E2*1E-12; // cm/ps
607 const Double_t pionMass = 0.13957018; //GeV/c^2
608
609 Int_t ntrk = esd->GetNumberOfTracks() ;
610 Int_t ntof=0;
611 Int_t ntofpid=0;
612 Int_t nesdpid=0;
613 Int_t ntpc=0;
614 Int_t ntpctof=0;
615 Int_t ntofout=0;
616
617 while (ntrk--) {
618 AliESDtrack *track=esd->GetTrack(ntrk);
619 Double_t tofTime=track->GetTOFsignal();//in ps
620 Double_t tofTimeRaw=track->GetTOFsignalRaw();//in ps
621 Double_t tofToT=track->GetTOFsignalToT(); //in ps
622
623 UInt_t status=track->GetStatus();
624 if (track->IsOn(AliESDtrack::kTPCrefit)) {
625 ntpc++;
626 Double_t y=track->Eta();
627 if ((status&AliESDtrack::kTOFout)!=0) {
628 ntofout++;
629 if (tofTime>0){
630 ntof++;
631
632 if (TMath::Abs(y)<0.9) {
633 GetESDsData(6)->Fill(track->Pt());
634 ntpctof++;
635 }
636 GetESDsData(1)->Fill(tofTime*1E-3);
637 GetESDsData(2)->Fill(tofTimeRaw*1E-3);
638 GetESDsData(3)->Fill(tofToT*1E-3);
639 //check how many tracks where ESD PID is ok
640 if ((status&AliESDtrack::kESDpid)!=0) nesdpid++;
641 if (((status&AliESDtrack::kESDpid)&AliESDtrack::kTOFpid)!=0) ntofpid++;
642
643 Double_t length =track->GetIntegratedLength();
644 Double_t mom2=(track->Pt()*track->Pt())+(track->Pz()*track->Pz());
645 Double_t eTexp = TMath::Sqrt(1+(pionMass*pionMass/mom2))*length/speedOfLight; //in ps
646 GetESDsData(9)->Fill(tofTime-eTexp);
647 GetESDsData(10)->Fill(length);
648 } //end check on matched tracks
649 }
650 }//end check on TPCrefit
651 }
652 Int_t nentries=ntof;
653 if(nentries<=0){
654 GetESDsData(0)->Fill(-1.) ;
655 }else{
656 GetESDsData(0)->Fill(nentries) ;
657 }
658
659 if(ntof>0) {
660 Float_t ratio = (Int_t)ntofpid/(Int_t)ntof*100; //identified by TOF over matched
661 GetESDsData(4)->Fill(ratio) ;
662 }
663
664 if(nesdpid>0) {
665 Float_t ratio = (Float_t)ntofpid/(Float_t)nesdpid *100; //identified by TOF over identified
666 GetESDsData(5)->Fill(ratio) ;
667 }
668
669 if(ntpc>0){
670 Float_t ratio = (Float_t)ntof/(Float_t)ntpc*100.; //matching probability
671 GetESDsData(7)->Fill(ratio) ;
672 }
673
674 if(ntofout>0) {
675 Float_t ratio = (Float_t)ntof/(Float_t)ntofout*100; //matched over propagated to TOF outer radius
676 GetESDsData(8)->Fill(ratio) ;
677 }
678 EnableDqmShifterOpt(kFALSE);
04236e67 679}
5f144062 680
04236e67 681//____________________________________________________________________________
682void AliTOFQADataMakerRec::StartOfDetectorCycle()
683{
684 //
685 //Detector specific actions at start of cycle
5f144062 686
17f2cd01 687 fCalibData = GetCalibData();
688
04236e67 689}
690
691//____________________________________________________________________________
4e25ac79 692void AliTOFQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
04236e67 693{
694 //Detector specific actions at end of cycle
695 // do the QA checking
5f144062 696
697 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
698 if ( !AliQAv1::Instance()->IsEventSpecieSet(specie) )
699 continue ;
700
701 AliInfo(Form("Processed %i raw events",fProcessedRawEventN));
702
703 if (fEnableDqmShifterOpt){
704 // Help make the raw qa histogram easier to interpret for the DQM shifter
705 if (!GetRawsData(0) || !GetRawsData(5) || !GetRawsData(10)
706 || !GetRawsData(15) || !GetRawsData(16) || !GetRawsData(17)) {
707 printf("No histogram for DQM found - Possible memory corruption ???. Please check\n") ;
708 continue;
709 }
710
711 Double_t yTimeMin = GetRawsData(5)->GetMinimum();
712 Double_t yTimeMax = GetRawsData(5)->GetMaximum();
713 Double_t yTotMin = GetRawsData(10)->GetMinimum();
714 Double_t yTotMax = GetRawsData(10)->GetMaximum();
715
716 TLine* lineExpTimeMin = new TLine(200., yTimeMin, 200., yTimeMax);
717 lineExpTimeMin->SetLineColor(kGreen);
718 lineExpTimeMin->SetLineWidth(2);
719
720 TLine* lineExpTimeMax = new TLine(250., yTimeMin, 250., yTimeMax);
721 lineExpTimeMax->SetLineColor(kGreen);
722 lineExpTimeMax->SetLineWidth(2);
723
724 TLine* lineExpTotMin = new TLine( 5., yTotMin, 5., yTotMax);
725 lineExpTotMin->SetLineColor(kGreen);
726 lineExpTotMin->SetLineWidth(2);
727
728 TLine* lineExpTotMax = new TLine(20., yTotMin, 20., yTotMax);
729 lineExpTotMax->SetLineColor(kGreen);
730 lineExpTotMax->SetLineWidth(2);
731
732 for(Int_t j=0;j<5;j++){
733 //make up for hits count
734 GetRawsData(j)->SetMarkerColor(kRed);
735 GetRawsData(j)->SetMarkerStyle(7);
736
737 //make up for time spectra
738 ((TH1F*)GetRawsData(j+5))->GetListOfFunctions()->Add(lineExpTimeMin);
739 ((TH1F*)GetRawsData(j+5))->GetListOfFunctions()->Add(lineExpTimeMax);
740 GetRawsData(j+5)->SetLineColor(kBlue+1);
741 GetRawsData(j+5)->SetMarkerColor(kBlue+1);
742
743 //make up for tot spectra
744 ((TH1F*)GetRawsData(j+10))->GetListOfFunctions()->Add(lineExpTotMin);
745 ((TH1F*)GetRawsData(j+10))->GetListOfFunctions()->Add(lineExpTotMax);
746 GetRawsData(j+10)->SetLineColor(kBlue+1);
747 GetRawsData(j+10)->SetMarkerColor(kBlue+1);
748 }
749
750 //make up for equipment hits count
751 for(Int_t j=15;j<18;j++){
752 GetRawsData(j)->SetDrawOption("hist");
753 GetRawsData(j)->SetLineColor(kBlue+1);
754 GetRawsData(j)->SetFillColor(kBlue+1);
755 GetRawsData(j)->SetLineWidth(1);
756 if (j==15) {
757 GetRawsData(j)->SetMarkerStyle(8);
758 GetRawsData(j)->SetMarkerColor(kBlue+2);
759 }
760 /*else {
761 Int_t ySMmax=GetRawsData(j)->GetMaximum();
762 TLine* lineSMid[18];
763 for (Int_t sm=0;sm<18;sm++){
764 lineSMid[sm] = new TLine(40*sm, 0,40*sm, ySMmax);
765 lineSMid[sm]->SetLineColor(kMagenta);
766 lineSMid[sm]->SetLineWidth(2);
767 if ((40*sm>=j*360) && (40*sm<=(j+1)*360)) ((TH1F*)GetRawsData(j))->GetListOfFunctions()->Add(lineSMid[sm]);
768 }
769 }
770 */
771 }
772
773 //make up for orphans histo
774 GetRawsData(19)->SetLineColor(kBlue+1);
775 GetRawsData(19)->SetMarkerColor(kBlue+1);
776 ((TH1F*)GetRawsData(19))->GetListOfFunctions()->Add(lineExpTimeMin);
777 ((TH1F*)GetRawsData(19))->GetListOfFunctions()->Add(lineExpTimeMax);
778 }
779 }
780 AliQAChecker::Instance()->Run(AliQAv1::kTOF, task, list) ;
04236e67 781}
782//____________________________________________________________________________
32bd8225 783void AliTOFQADataMakerRec::GetMapIndeces(const Int_t* const in , Int_t* out)
04236e67 784{
785 //
786 //return appropriate indeces for the theta-phi map
787 //
788
789 Int_t npadX = AliTOFGeometry::NpadX();
790 Int_t npadZ = AliTOFGeometry::NpadZ();
791 Int_t nStripA = AliTOFGeometry::NStripA();
792 Int_t nStripB = AliTOFGeometry::NStripB();
793 Int_t nStripC = AliTOFGeometry::NStripC();
794
795 Int_t isector = in[0];
796 Int_t iplate = in[1];
797 Int_t istrip = in[2];
798 Int_t ipadX = in[3];
799 Int_t ipadZ = in[4];
800
801 Int_t stripOffset = 0;
802 switch (iplate) {
803 case 0:
804 stripOffset = 0;
805 break;
806 case 1:
807 stripOffset = nStripC;
808 break;
809 case 2:
810 stripOffset = nStripC+nStripB;
811 break;
812 case 3:
813 stripOffset = nStripC+nStripB+nStripA;
814 break;
815 case 4:
816 stripOffset = nStripC+nStripB+nStripA+nStripB;
817 break;
818 default:
17f2cd01 819 AliDebug(1,Form("Wrong plate number in TOF (%d) !",iplate));
04236e67 820 break;
821 };
822 Int_t zindex=npadZ*(istrip+stripOffset)+(ipadZ+1);
823 Int_t phiindex=npadX*isector+ipadX+1;
824 out[0]=zindex;
825 out[1]=phiindex;
826
5f144062 827}
828
829//---------------------------------------------------------------
830Int_t AliTOFQADataMakerRec::GetStripIndex(const Int_t * const in)
831{
832 /* return tof strip index between 0 and 91 */
833
834 Int_t nStripA = AliTOFGeometry::NStripA();
835 Int_t nStripB = AliTOFGeometry::NStripB();
836 Int_t nStripC = AliTOFGeometry::NStripC();
837
838 // Int_t isector = in[0];
839 Int_t iplate = in[1];
840 Int_t istrip = in[2];
841 //Int_t ipadX = in[3];
842 //Int_t ipadZ = in[4];
843
844 Int_t stripOffset = 0;
845 switch (iplate) {
846 case 0:
847 stripOffset = 0;
848 break;
849 case 1:
850 stripOffset = nStripC;
851 break;
852 case 2:
853 stripOffset = nStripC+nStripB;
854 break;
855 case 3:
856 stripOffset = nStripC+nStripB+nStripA;
857 break;
858 case 4:
859 stripOffset = nStripC+nStripB+nStripA+nStripB;
860 break;
861 default:
862 AliDebug(1,Form("Wrong plate number in TOF (%d) !",iplate));
863 stripOffset=-1;
864 break;
865 };
866
867 if (stripOffset<0 || stripOffset>92) return -1;
868 else
869 return (stripOffset+istrip);
870
04236e67 871}
17f2cd01 872//---------------------------------------------------------------
32bd8225 873Bool_t AliTOFQADataMakerRec::CheckVolumeID(const Int_t * const volumeID)
17f2cd01 874{
32bd8225 875 //
876 //Checks volume ID validity
877 //
17f2cd01 878
879 for (Int_t j=0;j<5;j++){
880 if (volumeID[j]<0) {
881 AliDebug(1,Form("Invalid detector volume index for volumeID[%i]",j));
882 return kFALSE;
883 }
884 }
885 return kTRUE;
886
887}
888
889//---------------------------------------------------------------
32bd8225 890Bool_t AliTOFQADataMakerRec::CheckEquipID(const Int_t * const equipmentID)
17f2cd01 891{
32bd8225 892 //
893 //Checks equipment ID validity
894
17f2cd01 895 for (Int_t j=0;j<5;j++){
896 if (equipmentID[j]<0) {
17f2cd01 897 AliDebug(1,Form("Invalid equipment volume index for equipmentID[%i]",j));
898 return kFALSE;
899 }
900 }
901 return kTRUE;
902}
32bd8225 903//---------------------------------------------------------------
904Bool_t AliTOFQADataMakerRec::FilterLTMData(const Int_t * const equipmentID) const
905{
906 /*It returns kTRUE if data come from LTM.
5f144062 907 It thus filters trigger-related signals */
32bd8225 908
909 Int_t ddl, trm, tdc;
910 //if (!CheckEquipID(equipmentID)) return kFALSE;
911 ddl = equipmentID[0];
912 trm = equipmentID[1];
913 tdc = equipmentID[3];
914
915 if ((ddl%2==1) && (trm==3) && (tdc>11 && tdc<15))
916 return kTRUE;
917 else
918 return kFALSE;
919
920}
921//---------------------------------------------------------------
922Bool_t AliTOFQADataMakerRec::FilterSpare(const Int_t * const equipmentID) const
923{
924 /*It returns kTRUE if data come from spare
925 equipment ID.
926 So far only check on TRM 3 crate left is implemented */
927
928 Int_t ddl, trm, tdc;
929 //if (!CheckEquipID(equipmentID)) return kFALSE;
930 ddl = equipmentID[0];
931 trm = equipmentID[1];
932 tdc = equipmentID[3];
933
934 if ((ddl%2==1) && (trm==3) && (tdc>2 && tdc<12))
935 return kTRUE;
936 else
937 return kFALSE;
938
939}