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