]>
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 | // // | |
17f2cd01 | 22 | // last modified by F. Bellini (fbellini@cern.ch) on 02/03/2010 // |
04236e67 | 23 | /////////////////////////////////////////////////////////////////////// |
24 | ||
17f2cd01 | 25 | |
04236e67 | 26 | #include <TClonesArray.h> |
04236e67 | 27 | #include <TH1F.h> |
28 | #include <TH2F.h> | |
5c7c93fa | 29 | |
30 | #include "AliLog.h" | |
17f2cd01 | 31 | #include "AliCDBManager.h" |
32 | #include "AliCDBStorage.h" | |
33 | #include "AliCDBEntry.h" | |
04236e67 | 34 | #include "AliESDEvent.h" |
35 | #include "AliESDtrack.h" | |
17f2cd01 | 36 | #include "AliQA.h" |
04236e67 | 37 | #include "AliQAChecker.h" |
38 | #include "AliRawReader.h" | |
5c7c93fa | 39 | |
40 | #include "AliTOFcluster.h" | |
41 | #include "AliTOFQADataMakerRec.h" | |
04236e67 | 42 | #include "AliTOFRawStream.h" |
43 | #include "AliTOFrawData.h" | |
5c7c93fa | 44 | #include "AliTOFGeometry.h" |
5192f264 | 45 | #include "AliTOFdigit.h" |
17f2cd01 | 46 | #include "AliTOFChannelOnlineStatusArray.h" |
47 | ||
04236e67 | 48 | |
49 | ClassImp(AliTOFQADataMakerRec) | |
50 | ||
51 | //____________________________________________________________________________ | |
52 | AliTOFQADataMakerRec::AliTOFQADataMakerRec() : | |
17f2cd01 | 53 | AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kTOF), "TOF Quality Assurance Data Maker"), |
54 | fCalibData(0x0), | |
55 | fEnableNoiseFiltering(kFALSE) | |
04236e67 | 56 | { |
57 | // | |
58 | // ctor | |
59 | // | |
60 | } | |
61 | ||
62 | //____________________________________________________________________________ | |
63 | AliTOFQADataMakerRec::AliTOFQADataMakerRec(const AliTOFQADataMakerRec& qadm) : | |
17f2cd01 | 64 | AliQADataMakerRec(), |
65 | fCalibData(qadm.fCalibData), | |
66 | fEnableNoiseFiltering(qadm.fEnableNoiseFiltering) | |
04236e67 | 67 | { |
68 | // | |
69 | //copy ctor | |
70 | // | |
71 | SetName((const char*)qadm.GetName()) ; | |
72 | SetTitle((const char*)qadm.GetTitle()); | |
73 | } | |
74 | ||
75 | //__________________________________________________________________ | |
76 | AliTOFQADataMakerRec& AliTOFQADataMakerRec::operator = (const AliTOFQADataMakerRec& qadm ) | |
77 | { | |
78 | // | |
79 | // assignment operator. | |
80 | // | |
81 | this->~AliTOFQADataMakerRec(); | |
82 | new(this) AliTOFQADataMakerRec(qadm); | |
83 | return *this; | |
84 | } | |
85 | ||
17f2cd01 | 86 | //---------------------------------------------------------------------------- |
87 | AliTOFChannelOnlineStatusArray* AliTOFQADataMakerRec::GetCalibData() const | |
88 | { | |
89 | AliCDBManager *man = AliCDBManager::Instance(); | |
90 | ||
91 | AliCDBEntry *cdbe=0; | |
92 | ||
93 | cdbe = man->Get("TOF/Calib/Status",fRun); | |
94 | if(!cdbe){ | |
95 | AliWarning("Load of calibration data from default storage failed!"); | |
96 | AliWarning("Calibration data will be loaded from local storage ($ALICE_ROOT)"); | |
97 | man->SetDefaultStorage("local://$ALICE_ROOT/OCDB"); | |
98 | cdbe = man->Get("TOF/Calib/Status",fRun); | |
99 | } | |
100 | // Retrieval of data in directory TOF/Calib/Data: | |
101 | ||
102 | AliTOFChannelOnlineStatusArray * array = 0; | |
103 | if (cdbe) array = (AliTOFChannelOnlineStatusArray *)cdbe->GetObject(); | |
104 | if (!array) AliFatal("No calibration data from calibration database !"); | |
105 | ||
106 | return array; | |
107 | ||
108 | } | |
109 | ||
110 | ||
111 | ||
04236e67 | 112 | //____________________________________________________________________________ |
113 | void AliTOFQADataMakerRec::InitRaws() | |
114 | { | |
115 | // | |
116 | // create Raws histograms in Raws subdir | |
117 | // | |
135306ea | 118 | |
7d297381 | 119 | const Bool_t expert = kTRUE ; |
120 | const Bool_t saveCorr = kTRUE ; | |
121 | const Bool_t image = kTRUE ; | |
04236e67 | 122 | |
17f2cd01 | 123 | TH1F * h0 = new TH1F("hTOFRaws", "Number of TOF Raw Hits; TOF raw hits number;Counts ",1001, -1., 1000.) ; |
124 | TH1F * h1 = new TH1F("hTOFRawsIA", "Number of TOF Raw Hits - I/A side; TOF raw hits number [10 power];Counts ",1001, -1., 1000.) ; | |
125 | TH1F * h2 = new TH1F("hTOFRawsOA", "Number of TOF Raw Hits - O/A side; TOF raw hits number [10 power];Counts ",1001, -1., 1000.) ; | |
126 | TH1F * h3 = new TH1F("hTOFRawsIC", "Number of TOF Raw Hits - I/C side; TOF raw hits number [10 power];Counts ",1001, -1., 1000.) ; | |
127 | TH1F * h4 = new TH1F("hTOFRawsOC", "Number of TOF Raw Hits - O/C side; TOF raw hits number [10 power] ;Counts ",1001, -1., 1000.) ; | |
128 | TH1F * h5 = new TH1F("hTOFRawsTimeIA", "Raws Time Spectrum in TOF (ns) - I/A side;Measured raw TOF time [ns];Counts", 100000,0. ,2440.) ; | |
129 | TH1F * h6 = new TH1F("hTOFRawsTimeOA", "Raws Time Spectrum in TOF (ns) - O/A side;Measured raw TOF time [ns];Counts", 100000,0. ,2440.) ; | |
130 | TH1F * h7 = new TH1F("hTOFRawsTimeIC", "Raws Time Spectrum in TOF (ns) - I/C side;Measured raw TOF time [ns];Counts", 100000,0. ,2440.) ; | |
131 | TH1F * h8 = new TH1F("hTOFRawsTimeOC", "Raws Time Spectrum in TOF (ns) - O/C side;Measured raw TOF time [ns];Counts", 100000,0. ,2440.) ; | |
132 | TH1F * h9 = new TH1F("hTOFRawsToTIA", "Raws ToT Spectrum in TOF (ns) - I/A side;Measured raw ToT [ns];Counts", 10000, 0., 244.) ; | |
133 | TH1F * h10 = new TH1F("hTOFRawsToTOA", "Raws ToT Spectrum in TOF (ns) - O/A side;Measured raw ToT [ns];Counts", 10000, 0., 244.) ; | |
134 | TH1F * h11 = new TH1F("hTOFRawsToTIC", "Raws ToT Spectrum in TOF (ns) - I/C side;Measured raw ToT [ns];Counts", 10000, 0., 244.) ; | |
135 | TH1F * h12 = new TH1F("hTOFRawsToTOC", "Raws ToT Spectrum in TOF (ns) - O/C side;Measured raw ToT [ns];Counts", 10000, 0., 244.) ; | |
136 | TH1F * h13 = new TH1F("hTOFRawsTRMHitRate035", "TRM hit rate - crates 0 to 35 ;TRM index = DDL*10+TRM(0-9);Counts", 361, 0., 361.) ; | |
137 | TH1F * h14 = new TH1F("hTOFRawsTRMHitRate3671","TRM hit rate - crates 36 to 71 ;TRM index = DDL*10+TRM(0-9);Counts", 361, 361., 722.) ; | |
138 | TH1F * h15 = new TH1F("hTOFRawsVolumeErrorCounter","Invalid hit/volume association error counter per DDL; DDL; error counter ",73, -1., 72.) ; | |
139 | TH2F * h16 = 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) ; | |
140 | TH1F * h17 = new TH1F("hTOFOrphansTime", "Raws Time Spectrum in TOF (ns) for hits with no ToT measurement;Measured raw TOF time [ns];Counts", 100000,0. ,2440.) ; | |
141 | TH1F * h18 = new TH1F("hTOFRawsDecodingErrorCounter", "Invalid hit/equipment association error counter per DDL; DDL; error counter ",73, -1., 72.) ; | |
142 | TH1F * h19 = new TH1F("hTOFRawsWords", "Number of TOF Raw words per event; TOF raw words number;Counts ",1001, -1., 1000.) ; | |
143 | TH2F * h20 = new TH2F("hTOFRawTimeVsDDL", "TOF raw time spectrum vs DDL; TOF raw time [ns];DDL ",1000,0. ,2440., 72, 0., 72.) ; | |
144 | TH2F * h21 = new TH2F("hTOFRawToTVsDDL", "TOF raw ToT spectrum vs DDL; TOF raw ToT [ns];DDL ", 100, 0., 244., 72, 0., 72.) ; | |
44ed7a66 | 145 | |
17f2cd01 | 146 | h0->Sumw2() ; |
147 | h1->Sumw2() ; | |
148 | h2->Sumw2() ; | |
149 | h3->Sumw2() ; | |
150 | h4->Sumw2() ; | |
151 | h5->Sumw2() ; | |
152 | h6->Sumw2() ; | |
153 | h7->Sumw2() ; | |
154 | h8->Sumw2() ; | |
155 | h9->Sumw2() ; | |
156 | h10->Sumw2() ; | |
157 | h11->Sumw2() ; | |
158 | h12->Sumw2() ; | |
159 | h13->Sumw2() ; | |
160 | h14->Sumw2() ; | |
161 | h15->Sumw2() ; | |
162 | h16->Sumw2() ; | |
163 | h17->Sumw2() ; | |
164 | h18->Sumw2() ; | |
165 | h19->Sumw2() ; | |
166 | h20->Sumw2() ; | |
167 | h21->Sumw2() ; | |
168 | ||
169 | Add2RawsList(h0, 0, !expert, image, !saveCorr) ; | |
170 | Add2RawsList(h1, 1, expert, !image, !saveCorr) ; | |
171 | Add2RawsList(h2, 2, expert, !image, !saveCorr) ; | |
172 | Add2RawsList(h3, 3, expert, !image, !saveCorr) ; | |
173 | Add2RawsList(h4, 4, expert, !image, !saveCorr) ; | |
174 | Add2RawsList(h5, 5, !expert, image, !saveCorr) ; | |
175 | Add2RawsList(h6, 6, !expert, image, !saveCorr) ; | |
176 | Add2RawsList(h7, 7, !expert, image, !saveCorr) ; | |
177 | Add2RawsList(h8, 8, !expert, image, !saveCorr) ; | |
178 | Add2RawsList(h9, 9, !expert, image, !saveCorr) ; | |
179 | Add2RawsList(h10, 10, !expert, image, !saveCorr) ; | |
180 | Add2RawsList(h11, 11, !expert, image, !saveCorr) ; | |
181 | Add2RawsList(h12, 12, !expert, image, !saveCorr) ; | |
182 | Add2RawsList(h13, 13, expert, !image, !saveCorr) ; | |
183 | Add2RawsList(h14, 14, expert, !image, !saveCorr) ; | |
184 | Add2RawsList(h15, 15, expert, !image, !saveCorr) ; | |
185 | Add2RawsList(h16, 16, !expert, image, !saveCorr) ; | |
186 | Add2RawsList(h17, 17, expert, !image, !saveCorr) ; | |
187 | Add2RawsList(h18, 18, expert, !image, !saveCorr) ; | |
188 | Add2RawsList(h19, 19, expert, !image, !saveCorr) ; | |
189 | Add2RawsList(h20, 20, expert, !image, !saveCorr) ; | |
190 | Add2RawsList(h21, 21, expert, !image, !saveCorr) ; | |
191 | ||
44ed7a66 | 192 | } |
193 | ||
04236e67 | 194 | //____________________________________________________________________________ |
195 | void AliTOFQADataMakerRec::InitRecPoints() | |
196 | { | |
197 | // | |
198 | // create RecPoints histograms in RecPoints subdir | |
199 | // | |
135306ea | 200 | |
17f2cd01 | 201 | Bool_t expert = kFALSE; |
eca4fa66 | 202 | |
17f2cd01 | 203 | TH1F * h0 = new TH1F("hTOFRecPoints", "Number of TOF RecPoints ",301, -1.02, 5.) ; h0->Sumw2() ; |
204 | Add2RecPointsList(h0, 0, expert) ; | |
04236e67 | 205 | |
17f2cd01 | 206 | TH1F * h1 = new TH1F("hTOFRecPointsTime", "RecPoints Time Spectrum in TOF (ns)", 2000, 0., 200) ; |
04236e67 | 207 | h1->Sumw2() ; |
17f2cd01 | 208 | Add2RecPointsList(h1, 1, expert) ; |
04236e67 | 209 | |
17f2cd01 | 210 | TH1F * h2 = new TH1F("hTOFRecPointsRawTime", "RecPoints raw Time Spectrum in TOF (ns)", 2000, 0., 200) ; |
04236e67 | 211 | h2->Sumw2() ; |
17f2cd01 | 212 | Add2RecPointsList(h2, 2, expert) ; |
04236e67 | 213 | |
17f2cd01 | 214 | TH1F * h3 = new TH1F("hTOFRecPointsToT", "RecPoints ToT Spectrum in TOF (ns)", 500, 0., 50) ; |
04236e67 | 215 | h3->Sumw2() ; |
17f2cd01 | 216 | Add2RecPointsList(h3, 3, expert) ; |
04236e67 | 217 | |
17f2cd01 | 218 | TH2F * h4 = new TH2F("hTOFRecPointsClusMap","RecPoints vs TOF eta-phi",183, -0.5, 182.5,865,-0.5,864.5) ; |
04236e67 | 219 | h4->Sumw2() ; |
17f2cd01 | 220 | Add2RecPointsList(h4, 4, expert) ; |
221 | ||
04236e67 | 222 | } |
223 | ||
224 | //____________________________________________________________________________ | |
225 | void AliTOFQADataMakerRec::InitESDs() | |
226 | { | |
227 | // | |
228 | //create ESDs histograms in ESDs subdir | |
229 | // | |
135306ea | 230 | |
17f2cd01 | 231 | Bool_t expert = kFALSE; |
232 | ||
233 | TH1F * h0 = new TH1F("hTOFESDs", "Number of matched TOF tracks over ESDs", 250, -1., 4.) ; | |
04236e67 | 234 | h0->Sumw2() ; |
17f2cd01 | 235 | Add2ESDsList(h0, 0, expert) ; |
04236e67 | 236 | |
17f2cd01 | 237 | TH1F * h1 = new TH1F("hTOFESDsTime", "Time Spectrum in TOF (ns)", 2000, 0., 200) ; |
04236e67 | 238 | h1->Sumw2() ; |
17f2cd01 | 239 | Add2ESDsList(h1, 1, expert) ; |
04236e67 | 240 | |
17f2cd01 | 241 | TH1F * h2 = new TH1F("hTOFESDsRawTime", "raw Time Spectrum in TOF (ns)", 2000, 0., 200) ; |
04236e67 | 242 | h2->Sumw2() ; |
17f2cd01 | 243 | Add2ESDsList(h2, 2, expert) ; |
04236e67 | 244 | |
17f2cd01 | 245 | TH1F * h3 = new TH1F("hTOFESDsToT", "ToT Spectrum in TOF (ns)", 500, 0., 50) ; |
04236e67 | 246 | h3->Sumw2() ; |
17f2cd01 | 247 | Add2ESDsList(h3, 3, expert) ; |
04236e67 | 248 | |
17f2cd01 | 249 | TH1F * h4 = new TH1F("hTOFESDsPID", "Fraction of matched TOF tracks with good PID glag", 100, 0., 1.) ; |
04236e67 | 250 | h4->Sumw2() ; |
17f2cd01 | 251 | Add2ESDsList(h4, 4, expert) ; |
04236e67 | 252 | } |
253 | ||
254 | //____________________________________________________________________________ | |
255 | void AliTOFQADataMakerRec::MakeRaws(AliRawReader* rawReader) | |
256 | { | |
257 | // | |
258 | // makes data from Raws | |
259 | // | |
eca4fa66 | 260 | |
04236e67 | 261 | Double_t tdc2ns=AliTOFGeometry::TdcBinWidth()*1E-3; |
262 | Double_t tot2ns=AliTOFGeometry::ToTBinWidth()*1E-3; | |
263 | ||
17f2cd01 | 264 | Int_t nentries=0; |
265 | Int_t ntof[5]; /* 0=tot, 1=IA, 2=OA, 3=IC, 4=OC*/ | |
266 | for (Int_t j=0;j<5;j++){ ntof[j]=0;} | |
04236e67 | 267 | |
17f2cd01 | 268 | Int_t equipmentID[5]; //(ddl, trm, chain,tdc,channel) |
269 | Int_t volumeID[5]; //(sector,plate,strip,padX,padZ) | |
270 | Int_t volumeID2[5]; //(sector,plate,strip,padZ,padX) to use AliTOFGeometry::GetIndex() | |
271 | Int_t out[5]; // out=(indexZ,indexPhi) | |
272 | Int_t chIndex=-1; | |
04236e67 | 273 | |
274 | TClonesArray * clonesRawData; | |
275 | AliTOFRawStream tofInput(rawReader); | |
17f2cd01 | 276 | |
277 | //uncomment if needed to apply DeltaBC correction | |
278 | //tofInput.ApplyBCCorrections(kTRUE); | |
279 | ||
04236e67 | 280 | for (Int_t iDDL = 0; iDDL < AliTOFGeometry::NDDL()*AliTOFGeometry::NSectors(); iDDL++){ |
281 | rawReader->Reset(); | |
17f2cd01 | 282 | tofInput.LoadRawDataBuffers(iDDL); |
04236e67 | 283 | clonesRawData = (TClonesArray*)tofInput.GetRawData(); |
284 | for (Int_t iRawData = 0; iRawData<clonesRawData->GetEntriesFast(); iRawData++) { | |
17f2cd01 | 285 | nentries++; |
286 | AliTOFrawData *tofRawDatum = (AliTOFrawData*)clonesRawData->UncheckedAt(iRawData); | |
287 | ||
288 | if (tofRawDatum->GetTOF()){ | |
289 | ||
290 | equipmentID[0]=iDDL; | |
291 | equipmentID[1]=tofRawDatum->GetTRM(); | |
292 | equipmentID[2]=tofRawDatum->GetTRMchain(); | |
293 | equipmentID[3]=tofRawDatum->GetTDC(); | |
294 | equipmentID[4]=tofRawDatum->GetTDCchannel(); | |
295 | ||
296 | if (!CheckEquipID(equipmentID)) GetRawsData(18)->Fill(equipmentID[0]); | |
297 | else { | |
298 | tofInput.EquipmentId2VolumeId(iDDL, | |
299 | tofRawDatum->GetTRM(), | |
300 | tofRawDatum->GetTRMchain(), | |
301 | tofRawDatum->GetTDC(), | |
302 | tofRawDatum->GetTDCchannel(), | |
303 | volumeID); | |
304 | ||
305 | if (!CheckVolumeID(volumeID)) GetRawsData(15)->Fill(equipmentID[0]); | |
306 | else { | |
307 | GetMapIndeces(volumeID,out); | |
308 | ||
309 | volumeID2[0]=volumeID[0]; | |
310 | volumeID2[1]=volumeID[1]; | |
311 | volumeID2[2]=volumeID[2]; | |
312 | volumeID2[3]=volumeID[4]; | |
313 | volumeID2[4]=volumeID[3]; | |
314 | chIndex=AliTOFGeometry::GetIndex(volumeID2); | |
315 | ||
316 | if (tofRawDatum->GetTOT()){ | |
317 | if (!(fCalibData->GetNoiseStatus(chIndex)==AliTOFChannelOnlineStatusArray::kTOFNoiseBad)) {//noise filter | |
318 | ntof[0]++; //counter for tof hits | |
319 | if (volumeID2[0]>4 && volumeID2[0]<14){ //I side | |
320 | if ((iDDL%4==0)|| (iDDL%4==1)){ //A side | |
321 | ntof[1]++; | |
322 | GetRawsData(5)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;//in ns | |
323 | GetRawsData(9)->Fill( tofRawDatum->GetTOT()*tot2ns) ;//in ns | |
324 | } else { | |
325 | if ((iDDL%4==2)|| (iDDL%4==3)){//C side | |
326 | ntof[3]++; | |
327 | GetRawsData(7)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;//in ns | |
328 | GetRawsData(11)->Fill( tofRawDatum->GetTOT()*tot2ns) ;//in ns | |
329 | } | |
330 | } | |
331 | } else { | |
332 | if (volumeID2[0]<5 || volumeID2[0]>13){ //O side | |
333 | if ((iDDL%4==0)|| (iDDL%4==1)){ //A side | |
334 | ntof[2]++; | |
335 | GetRawsData(6)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;//in ns | |
336 | GetRawsData(10)->Fill( tofRawDatum->GetTOT()*tot2ns) ;//in ns | |
337 | } else { | |
338 | if ((iDDL%4==2)|| (iDDL%4==3)){//C side | |
339 | ntof[4]++; | |
340 | GetRawsData(8)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;//in ns | |
341 | GetRawsData(12)->Fill( tofRawDatum->GetTOT()*tot2ns) ;//in ns | |
342 | } | |
343 | } | |
344 | } | |
345 | } | |
346 | //compute TRM offset | |
347 | Int_t trm= iDDL*10+(volumeID[1]-3); | |
348 | if (iDDL>=0 && iDDL<36) GetRawsData(13)->Fill(trm) ;//in ns | |
349 | if (iDDL>=36 && iDDL<72) GetRawsData(14)->Fill(trm) ;//in ns | |
350 | GetRawsData(16)->Fill( out[0],out[1]) ;//raw map | |
351 | ||
352 | GetRawsData(20)->Fill(tofRawDatum->GetTOF()*tdc2ns,iDDL); | |
353 | GetRawsData(21)->Fill(tofRawDatum->GetTOT()*tot2ns,iDDL); | |
354 | ||
355 | }//noise filter | |
356 | }//end hit selection | |
357 | else { //orphans | |
358 | if (!(fCalibData->GetNoiseStatus(chIndex) == AliTOFChannelOnlineStatusArray::kTOFNoiseBad)) | |
359 | GetRawsData(17)->Fill( tofRawDatum->GetTOF()*tdc2ns) ;//in ns | |
360 | }//end orphans | |
361 | }//end volumeID check | |
362 | }//end equipID check | |
363 | } | |
04236e67 | 364 | } // while loop |
365 | ||
366 | clonesRawData->Clear(); | |
04236e67 | 367 | } // DDL Loop |
368 | ||
17f2cd01 | 369 | for (Int_t j=0;j<5;j++){ |
370 | if(ntof[j]<=0) GetRawsData(j)->Fill(-1.) ; | |
371 | else GetRawsData(j)->Fill(ntof[j]); | |
04236e67 | 372 | } |
17f2cd01 | 373 | if (nentries<=0) GetRawsData(19)->Fill(-1.) ; |
374 | else GetRawsData(19)->Fill(nentries) ; | |
44ed7a66 | 375 | |
44ed7a66 | 376 | } |
377 | ||
44ed7a66 | 378 | |
379 | //____________________________________________________________________________ | |
04236e67 | 380 | void AliTOFQADataMakerRec::MakeRecPoints(TTree * clustersTree) |
381 | { | |
17f2cd01 | 382 | // |
383 | // Make data from Clusters | |
384 | // | |
04236e67 | 385 | |
17f2cd01 | 386 | Double_t tdc2ns=AliTOFGeometry::TdcBinWidth()*1E-3; |
387 | Double_t tot2ns=AliTOFGeometry::ToTBinWidth()*1E-3; | |
04236e67 | 388 | |
17f2cd01 | 389 | Int_t in[5]; |
390 | Int_t out[5]; | |
04236e67 | 391 | |
17f2cd01 | 392 | TBranch *branch=clustersTree->GetBranch("TOF"); |
393 | if (!branch) { | |
394 | AliError("can't get the branch with the TOF clusters !"); | |
395 | return; | |
396 | } | |
397 | ||
398 | static TClonesArray dummy("AliTOFcluster",10000); | |
399 | dummy.Clear(); | |
400 | TClonesArray *clusters=&dummy; | |
401 | branch->SetAddress(&clusters); | |
402 | ||
403 | // Import the tree | |
404 | clustersTree->GetEvent(0); | |
405 | ||
406 | Int_t nentries=clusters->GetEntriesFast(); | |
407 | if(nentries<=0){ | |
408 | GetRecPointsData(0)->Fill(-1.) ; | |
409 | }else{ | |
410 | GetRecPointsData(0)->Fill(TMath::Log10(nentries)) ; | |
411 | } | |
412 | ||
413 | TIter next(clusters) ; | |
414 | AliTOFcluster * c ; | |
415 | while ( (c = dynamic_cast<AliTOFcluster *>(next())) ) { | |
416 | GetRecPointsData(1)->Fill(c->GetTDC()*tdc2ns); | |
417 | GetRecPointsData(2)->Fill(c->GetTDCRAW()*tdc2ns); | |
418 | GetRecPointsData(3)->Fill(c->GetToT()*tot2ns); | |
419 | ||
420 | in[0] = c->GetDetInd(0); | |
421 | in[1] = c->GetDetInd(1); | |
422 | in[2] = c->GetDetInd(2); | |
423 | in[3] = c->GetDetInd(4); //X and Z indeces inverted in RecPoints | |
424 | in[4] = c->GetDetInd(3); //X and Z indeces inverted in RecPoints | |
425 | ||
426 | GetMapIndeces(in,out); | |
427 | GetRecPointsData(4)->Fill(out[0],out[1]); | |
428 | ||
429 | } | |
04236e67 | 430 | } |
431 | ||
432 | //____________________________________________________________________________ | |
433 | void AliTOFQADataMakerRec::MakeESDs(AliESDEvent * esd) | |
434 | { | |
435 | // | |
436 | // make QA data from ESDs | |
437 | // | |
438 | Int_t ntrk = esd->GetNumberOfTracks() ; | |
439 | Int_t ntof=0; | |
440 | Int_t ntofpid=0; | |
441 | while (ntrk--) { | |
442 | AliESDtrack *track=esd->GetTrack(ntrk); | |
443 | Double_t tofTime=track->GetTOFsignal()*1E-3;//in ns | |
444 | Double_t tofTimeRaw=track->GetTOFsignalRaw()*1E-3;//in ns | |
445 | Double_t tofToT=track->GetTOFsignalToT(); //in ns | |
446 | if(!(tofTime>0))continue; | |
447 | ntof++; | |
448 | GetESDsData(1)->Fill(tofTime); | |
449 | GetESDsData(2)->Fill(tofTimeRaw); | |
450 | GetESDsData(3)->Fill(tofToT); | |
451 | //check how many tracks where ESD PID is ok | |
452 | UInt_t status=track->GetStatus(); | |
453 | if (((status&AliESDtrack::kESDpid)==0) || | |
454 | ((status&AliESDtrack::kTOFpid)==0)) continue; | |
455 | ntofpid++; | |
456 | } | |
457 | ||
458 | Int_t nentries=ntof; | |
459 | if(nentries<=0){ | |
460 | GetESDsData(0)->Fill(-1.) ; | |
461 | }else{ | |
462 | GetESDsData(0)->Fill(TMath::Log10(nentries)) ; | |
463 | } | |
464 | ||
17f2cd01 | 465 | if(ntof>0)GetESDsData(4)->Fill(ntofpid/ntof) ; |
466 | ||
04236e67 | 467 | } |
468 | ||
469 | //____________________________________________________________________________ | |
470 | void AliTOFQADataMakerRec::StartOfDetectorCycle() | |
471 | { | |
472 | // | |
473 | //Detector specific actions at start of cycle | |
474 | //to be implemented | |
17f2cd01 | 475 | |
476 | fCalibData = GetCalibData(); | |
477 | ||
04236e67 | 478 | } |
479 | ||
480 | //____________________________________________________________________________ | |
4e25ac79 | 481 | void AliTOFQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list) |
04236e67 | 482 | { |
483 | //Detector specific actions at end of cycle | |
484 | // do the QA checking | |
17f2cd01 | 485 | |
4e25ac79 | 486 | AliQAChecker::Instance()->Run(AliQAv1::kTOF, task, list) ; |
04236e67 | 487 | } |
488 | //____________________________________________________________________________ | |
489 | void AliTOFQADataMakerRec::GetMapIndeces(Int_t* in , Int_t* out) | |
490 | { | |
491 | // | |
492 | //return appropriate indeces for the theta-phi map | |
493 | // | |
494 | ||
495 | Int_t npadX = AliTOFGeometry::NpadX(); | |
496 | Int_t npadZ = AliTOFGeometry::NpadZ(); | |
497 | Int_t nStripA = AliTOFGeometry::NStripA(); | |
498 | Int_t nStripB = AliTOFGeometry::NStripB(); | |
499 | Int_t nStripC = AliTOFGeometry::NStripC(); | |
500 | ||
501 | Int_t isector = in[0]; | |
502 | Int_t iplate = in[1]; | |
503 | Int_t istrip = in[2]; | |
504 | Int_t ipadX = in[3]; | |
505 | Int_t ipadZ = in[4]; | |
506 | ||
507 | Int_t stripOffset = 0; | |
508 | switch (iplate) { | |
509 | case 0: | |
510 | stripOffset = 0; | |
511 | break; | |
512 | case 1: | |
513 | stripOffset = nStripC; | |
514 | break; | |
515 | case 2: | |
516 | stripOffset = nStripC+nStripB; | |
517 | break; | |
518 | case 3: | |
519 | stripOffset = nStripC+nStripB+nStripA; | |
520 | break; | |
521 | case 4: | |
522 | stripOffset = nStripC+nStripB+nStripA+nStripB; | |
523 | break; | |
524 | default: | |
17f2cd01 | 525 | AliDebug(1,Form("Wrong plate number in TOF (%d) !",iplate)); |
04236e67 | 526 | break; |
527 | }; | |
528 | Int_t zindex=npadZ*(istrip+stripOffset)+(ipadZ+1); | |
529 | Int_t phiindex=npadX*isector+ipadX+1; | |
530 | out[0]=zindex; | |
531 | out[1]=phiindex; | |
532 | ||
533 | } | |
17f2cd01 | 534 | //--------------------------------------------------------------- |
535 | Bool_t AliTOFQADataMakerRec::CheckVolumeID(Int_t *volumeID) | |
536 | { | |
537 | ||
538 | for (Int_t j=0;j<5;j++){ | |
539 | if (volumeID[j]<0) { | |
540 | AliDebug(1,Form("Invalid detector volume index for volumeID[%i]",j)); | |
541 | return kFALSE; | |
542 | } | |
543 | } | |
544 | return kTRUE; | |
545 | ||
546 | } | |
547 | ||
548 | //--------------------------------------------------------------- | |
549 | Bool_t AliTOFQADataMakerRec::CheckEquipID(Int_t *equipmentID) | |
550 | { | |
551 | for (Int_t j=0;j<5;j++){ | |
552 | if (equipmentID[j]<0) { | |
553 | if (j==0)equipmentID[j]=-1; | |
554 | AliDebug(1,Form("Invalid equipment volume index for equipmentID[%i]",j)); | |
555 | return kFALSE; | |
556 | } | |
557 | } | |
558 | return kTRUE; | |
559 | } | |
560 |