]>
Commit | Line | Data |
---|---|---|
04236e67 | 1 | /************************************************************************** |
2 | * Copyright(c) 2007-2009, 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 | /* $Id$ */ | |
17 | ||
18 | // ************************************************************* | |
19 | // Checks the quality assurance | |
20 | // by comparing with reference data | |
21 | // contained in a DB | |
22 | // ------------------------------------------------------------- | |
8c823e5a | 23 | // W. Ferrarese + P. Cerello Feb 2008 |
04236e67 | 24 | // INFN Torino |
25 | ||
26 | // --- ROOT system --- | |
04236e67 | 27 | #include <TTree.h> |
04236e67 | 28 | // --- Standard library --- |
29 | ||
30 | // --- AliRoot header files --- | |
31 | #include "AliITSQADataMakerRec.h" | |
8c823e5a | 32 | #include "AliITSQASPDDataMakerRec.h" |
33 | #include "AliITSQASDDDataMakerRec.h" | |
34 | #include "AliITSQASSDDataMakerRec.h" | |
04236e67 | 35 | #include "AliLog.h" |
36 | #include "AliQA.h" | |
37 | #include "AliQAChecker.h" | |
c71529b0 | 38 | #include "AliITSQAChecker.h" |
04236e67 | 39 | #include "AliRawReader.h" |
a90a332e | 40 | #include "AliESDEvent.h" |
41 | #include "AliESDtrack.h" | |
42 | #include "AliESDVertex.h" | |
43 | #include "AliMultiplicity.h" | |
04236e67 | 44 | |
45 | ClassImp(AliITSQADataMakerRec) | |
46 | ||
47 | //____________________________________________________________________________ | |
8c823e5a | 48 | AliITSQADataMakerRec::AliITSQADataMakerRec(Bool_t kMode, Short_t subDet, Short_t ldc) : |
49 | AliQADataMakerRec(AliQA::GetDetName(AliQA::kITS), "ITS Quality Assurance Data Maker"), | |
1aa7c4f5 | 50 | fkOnline(kMode), |
8c823e5a | 51 | fSubDetector(subDet), |
1aa7c4f5 | 52 | fLDC(ldc), |
8c823e5a | 53 | fSPDDataMaker(NULL), |
54 | fSDDDataMaker(NULL), | |
55 | fSSDDataMaker(NULL) | |
1aa7c4f5 | 56 | { |
1aa7c4f5 | 57 | //ctor used to discriminate OnLine-Offline analysis |
8c823e5a | 58 | if(fSubDetector < 0 || fSubDetector > 3) { |
59 | AliError("Error: fSubDetector number out of range; return\n"); | |
60 | } | |
61 | ||
62 | // Initialization for RAW data | |
63 | if(fSubDetector == 0 || fSubDetector == 1) { | |
64 | AliDebug(1,"AliITSQADM::Create SPD DataMakerRec\n"); | |
65 | fSPDDataMaker = new AliITSQASPDDataMakerRec(this,fkOnline); | |
66 | } | |
67 | if(fSubDetector == 0 || fSubDetector == 2) { | |
68 | AliDebug(1,"AliITSQADM::Create SDD DataMakerRec\n"); | |
69 | fSDDDataMaker = new AliITSQASDDDataMakerRec(this,fkOnline); | |
70 | } | |
71 | if(fSubDetector == 0 || fSubDetector == 3) { | |
72 | AliDebug(1,"AliITSQADM::Create SSD DataMakerRec\n"); | |
73 | fSSDDataMaker = new AliITSQASSDDataMakerRec(this,fkOnline); | |
74 | } | |
1aa7c4f5 | 75 | } |
76 | ||
04236e67 | 77 | //____________________________________________________________________________ |
8c823e5a | 78 | AliITSQADataMakerRec::~AliITSQADataMakerRec(){ |
79 | // destructor | |
80 | if(fSPDDataMaker)delete fSPDDataMaker; | |
81 | if(fSDDDataMaker)delete fSDDDataMaker; | |
82 | if(fSSDDataMaker)delete fSSDDataMaker; | |
04236e67 | 83 | } |
84 | ||
85 | //____________________________________________________________________________ | |
86 | AliITSQADataMakerRec::AliITSQADataMakerRec(const AliITSQADataMakerRec& qadm) : | |
8c823e5a | 87 | AliQADataMakerRec(), |
9db10425 | 88 | fkOnline(qadm.fkOnline), |
8c823e5a | 89 | fSubDetector(qadm.fSubDetector), |
9db10425 | 90 | fLDC(qadm.fLDC), |
8c823e5a | 91 | fSPDDataMaker(NULL), |
92 | fSDDDataMaker(NULL), | |
93 | fSSDDataMaker(NULL) | |
04236e67 | 94 | { |
95 | //copy ctor | |
96 | SetName((const char*)qadm.GetName()) ; | |
8c823e5a | 97 | SetTitle((const char*)qadm.GetTitle()); |
04236e67 | 98 | } |
99 | ||
100 | //__________________________________________________________________ | |
101 | AliITSQADataMakerRec& AliITSQADataMakerRec::operator = (const AliITSQADataMakerRec& qac ) | |
102 | { | |
103 | // Equal operator. | |
104 | this->~AliITSQADataMakerRec(); | |
105 | new(this) AliITSQADataMakerRec(qac); | |
106 | return *this; | |
107 | } | |
108 | ||
109 | //____________________________________________________________________________ | |
8c823e5a | 110 | void AliITSQADataMakerRec::StartOfDetectorCycle() |
04236e67 | 111 | { |
112 | //Detector specific actions at start of cycle | |
113 | AliDebug(1,"AliITSQADM::Start of ITS Cycle\n"); | |
8c823e5a | 114 | if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->StartOfDetectorCycle(); |
115 | if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->StartOfDetectorCycle(); | |
116 | if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->StartOfDetectorCycle(); | |
04236e67 | 117 | } |
118 | ||
119 | //____________________________________________________________________________ | |
92a357bf | 120 | void AliITSQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray* list) |
04236e67 | 121 | { |
122 | // launch the QA checking | |
123 | AliDebug(1,"AliITSDM instantiates checker with Run(AliQA::kITS, task, list)\n"); | |
8c823e5a | 124 | if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->EndOfDetectorCycle(task, list); |
125 | if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->EndOfDetectorCycle(task, list); | |
126 | if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->EndOfDetectorCycle(task, list); | |
04236e67 | 127 | |
c71529b0 | 128 | AliQAChecker *qac = AliQAChecker::Instance(); |
129 | AliITSQAChecker *qacb = (AliITSQAChecker *) qac->GetDetQAChecker(0); | |
3647765c | 130 | if(fSubDetector == 0 ){ |
131 | qacb->SetTaskOffset(fSPDDataMaker->GetOffset(), fSDDDataMaker->GetOffset(), fSSDDataMaker->GetOffset()); //Setting the offset for the QAChecker list | |
132 | } | |
c71529b0 | 133 | qac->Run( AliQA::kITS , task, list); //temporary skipping the checking |
04236e67 | 134 | } |
135 | ||
136 | //____________________________________________________________________________ | |
8c823e5a | 137 | void AliITSQADataMakerRec::EndOfDetectorCycle(const char * /*fgDataName*/) |
04236e67 | 138 | { |
8c823e5a | 139 | //eventually used for different AliQAChecker::Instance()->Run |
04236e67 | 140 | } |
141 | ||
142 | //____________________________________________________________________________ | |
143 | void AliITSQADataMakerRec::InitRaws() | |
1aa7c4f5 | 144 | { |
8c823e5a | 145 | // Initialization for RAW data |
146 | if(fSubDetector == 0 || fSubDetector == 1) { | |
147 | AliDebug(1,"AliITSQADM:: SPD InitRaws\n"); | |
148 | fSPDDataMaker->InitRaws(); | |
1aa7c4f5 | 149 | } |
8c823e5a | 150 | if(fSubDetector == 0 || fSubDetector == 2) { |
151 | AliDebug(1,"AliITSQADM:: SDD InitRaws\n"); | |
152 | fSDDDataMaker->InitRaws(); | |
04236e67 | 153 | } |
8c823e5a | 154 | if(fSubDetector == 0 || fSubDetector == 3) { |
155 | AliDebug(1,"AliITSQADM:: SSD InitRaws\n"); | |
156 | fSSDDataMaker->InitRaws(); | |
04236e67 | 157 | } |
1aa7c4f5 | 158 | } |
159 | ||
04236e67 | 160 | //____________________________________________________________________________ |
161 | void AliITSQADataMakerRec::MakeRaws(AliRawReader* rawReader) | |
162 | { | |
8c823e5a | 163 | // Fill QA for RAW |
164 | if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeRaws(rawReader); | |
165 | if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeRaws(rawReader); | |
166 | if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeRaws(rawReader); | |
1aa7c4f5 | 167 | } |
04236e67 | 168 | |
169 | //____________________________________________________________________________ | |
170 | void AliITSQADataMakerRec::InitRecPoints() | |
1aa7c4f5 | 171 | { |
172 | // Initialization for RECPOINTS | |
8c823e5a | 173 | if(fSubDetector == 0 || fSubDetector == 1) { |
174 | AliDebug(1,"AliITSQADM:: SPD InitRecPoints\n"); | |
175 | fSPDDataMaker->InitRecPoints(); | |
04236e67 | 176 | } |
8c823e5a | 177 | if(fSubDetector == 0 || fSubDetector == 2) { |
178 | AliDebug(1,"AliITSQADM:: SDD InitRecPoints\n"); | |
179 | fSDDDataMaker->InitRecPoints(); | |
1aa7c4f5 | 180 | } |
8c823e5a | 181 | if(fSubDetector == 0 || fSubDetector == 3) { |
182 | AliDebug(1,"AliITSQADM:: SSD InitRecPoints\n"); | |
183 | fSSDDataMaker->InitRecPoints(); | |
1aa7c4f5 | 184 | } |
1aa7c4f5 | 185 | } |
04236e67 | 186 | |
187 | //____________________________________________________________________________ | |
188 | void AliITSQADataMakerRec::MakeRecPoints(TTree * clustersTree) | |
1aa7c4f5 | 189 | { |
190 | // Fill QA for recpoints | |
8c823e5a | 191 | if(fSubDetector == 0 || fSubDetector == 1) fSPDDataMaker->MakeRecPoints(clustersTree); |
192 | if(fSubDetector == 0 || fSubDetector == 2) fSDDDataMaker->MakeRecPoints(clustersTree); | |
193 | if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeRecPoints(clustersTree); | |
04236e67 | 194 | } |
195 | ||
d7d87ceb | 196 | |
a90a332e | 197 | //____________________________________________________________________________ |
198 | void AliITSQADataMakerRec::InitESDs() | |
199 | { | |
200 | // Create ESDs histograms in ESDs subdir | |
201 | ||
202 | TH1F *hESDClustersMI = | |
203 | new TH1F("hESDClustersMI", "N ITS clusters per track (MI); N clusters; Counts", | |
204 | 7, -0.5, 6.5); | |
205 | hESDClustersMI->Sumw2(); | |
206 | hESDClustersMI->SetMinimum(0); | |
207 | Add2ESDsList(hESDClustersMI, 0); | |
208 | ||
209 | TH1F *hESDClusterMapMI = | |
d7d87ceb | 210 | new TH1F("hESDClusterMapMI", "N tracks with point Layer (MI); Layer; N tracks", |
a90a332e | 211 | 6, -0.5, 5.5); |
212 | hESDClusterMapMI->Sumw2(); | |
213 | hESDClusterMapMI->SetMinimum(0); | |
214 | Add2ESDsList(hESDClusterMapMI, 1); | |
215 | ||
216 | TH1F *hESDClustersSA = | |
217 | new TH1F("hESDClustersSA", "N ITS clusters per track (SA); N clusters; Counts", | |
218 | 7, -0.5, 6.5); | |
219 | hESDClustersSA->Sumw2(); | |
220 | hESDClustersSA->SetMinimum(0); | |
221 | Add2ESDsList(hESDClustersSA, 2); | |
222 | ||
223 | TH1F *hESDClusterMapSA = | |
d7d87ceb | 224 | new TH1F("hESDClusterMapSA", "N tracks with point Layer (SA); Layer; N tracks", |
a90a332e | 225 | 6, -0.5, 5.5); |
226 | hESDClusterMapSA->Sumw2(); | |
227 | hESDClusterMapSA->SetMinimum(0); | |
228 | Add2ESDsList(hESDClusterMapSA, 3); | |
229 | ||
230 | TH1F *hSPDVertexX = | |
231 | new TH1F("hSPDVertexX","SPD Vertex x; x [cm]; N events", | |
232 | 10000,-2,2); | |
233 | hSPDVertexX->Sumw2(); | |
234 | Add2ESDsList(hSPDVertexX, 4); | |
235 | ||
236 | TH1F *hSPDVertexY = | |
237 | new TH1F("hSPDVertexY","SPD Vertex y; y [cm]; N events", | |
238 | 10000,-2,2); | |
239 | hSPDVertexY->Sumw2(); | |
240 | Add2ESDsList(hSPDVertexY, 5); | |
241 | ||
242 | TH1F *hSPDVertexZ = | |
d7d87ceb | 243 | new TH1F("hSPDVertexZ","SPD Vertex Z; z [cm]; N events", |
a90a332e | 244 | 10000,-20,20); |
245 | hSPDVertexZ->Sumw2(); | |
246 | Add2ESDsList(hSPDVertexZ, 6); | |
247 | ||
248 | TH1F *hSPDVertexContrOverMult = | |
249 | new TH1F("hSPDVertexContrOverMult","SPD Vertex: contributors / multiplicity; N contributors / SPD multiplicity; N events", | |
250 | 100,-4,20); | |
251 | hSPDVertexContrOverMult->Sumw2(); | |
252 | Add2ESDsList(hSPDVertexContrOverMult, 7); | |
253 | ||
254 | TH1F *hTrkVertexX = | |
255 | new TH1F("hTrkVertexX","ITS+TPC Trk Vertex x; x [cm]; N events", | |
256 | 10000,-2,2); | |
257 | hTrkVertexX->Sumw2(); | |
258 | Add2ESDsList(hTrkVertexX, 8); | |
259 | ||
260 | TH1F *hTrkVertexY = | |
261 | new TH1F("hTrkVertexY","ITS+TPC Trk Vertex y; y [cm]; N events", | |
262 | 10000,-2,2); | |
263 | hTrkVertexY->Sumw2(); | |
264 | Add2ESDsList(hTrkVertexY, 9); | |
265 | ||
266 | TH1F *hTrkVertexZ = | |
d7d87ceb | 267 | new TH1F("hTrkVertexZ","ITS+TPC Trk Vertex Z; z [cm]; N events", |
a90a332e | 268 | 10000,-20,20); |
269 | hTrkVertexZ->Sumw2(); | |
270 | Add2ESDsList(hTrkVertexZ, 10); | |
271 | ||
d7d87ceb | 272 | TH1F *hTrkVertexContrOverITSrefit5 = |
273 | new TH1F("hTrkVertexContrOverITSrefit5","ITS+TPC Trk Vertex: contributors / tracks; N contributors / N trks kITSrefit with 5 or 6 clusters; N events", | |
274 | 100,-4,2); | |
275 | hTrkVertexContrOverITSrefit5->Sumw2(); | |
276 | Add2ESDsList(hTrkVertexContrOverITSrefit5, 11); | |
a90a332e | 277 | |
278 | TH1F *hSPDTrkVertexDeltaX = | |
279 | new TH1F("hSPDTrkVertexDeltaX","Comparison of SPD and Trk vertices: x; xSPD-xTrk [cm]; N events", | |
280 | 1000,-1,1); | |
281 | hSPDTrkVertexDeltaX->Sumw2(); | |
282 | Add2ESDsList(hSPDTrkVertexDeltaX, 12); | |
283 | ||
284 | TH1F *hSPDTrkVertexDeltaY = | |
285 | new TH1F("hSPDTrkVertexDeltaY","Comparison of SPD and Trk vertices: y; ySPD-yTrk [cm]; N events", | |
286 | 1000,-1,1); | |
287 | hSPDTrkVertexDeltaY->Sumw2(); | |
288 | Add2ESDsList(hSPDTrkVertexDeltaY, 13); | |
289 | ||
290 | TH1F *hSPDTrkVertexDeltaZ = | |
291 | new TH1F("hSPDTrkVertexDeltaZ","Comparison of SPD and Trk vertices: z; zSPD-zTrk [cm]; N events", | |
292 | 1000,-1,1); | |
293 | hSPDTrkVertexDeltaZ->Sumw2(); | |
294 | Add2ESDsList(hSPDTrkVertexDeltaZ, 14); | |
295 | ||
296 | return; | |
297 | } | |
298 | ||
299 | //____________________________________________________________________________ | |
300 | void AliITSQADataMakerRec::MakeESDs(AliESDEvent *esd) | |
301 | { | |
302 | // Make QA data from ESDs | |
303 | ||
304 | const Int_t nESDTracks = esd->GetNumberOfTracks(); | |
d7d87ceb | 305 | Int_t nITSrefit5 = 0; |
a90a332e | 306 | |
307 | // loop on tracks | |
308 | for(Int_t i = 0; i < nESDTracks; i++) { | |
309 | ||
310 | AliESDtrack *track = esd->GetTrack(i); | |
311 | ||
312 | Int_t nclsITS = track->GetNcls(0); | |
313 | ||
314 | Bool_t itsrefit=kFALSE,tpcin=kFALSE; | |
315 | if ((track->GetStatus() & AliESDtrack::kITSrefit)) itsrefit=kTRUE; | |
316 | if ((track->GetStatus() & AliESDtrack::kTPCin)) tpcin=kTRUE; | |
d7d87ceb | 317 | if(nclsITS>=5 && itsrefit) nITSrefit5++; |
a90a332e | 318 | |
319 | if(tpcin) { | |
320 | GetESDsData(0)->Fill(nclsITS); | |
321 | } else { | |
322 | GetESDsData(2)->Fill(nclsITS); | |
323 | } | |
324 | ||
325 | for(Int_t layer=0; layer<6; layer++) { | |
326 | ||
327 | if(TESTBIT(track->GetITSClusterMap(),layer)) { | |
328 | if(tpcin) { | |
329 | GetESDsData(1)->Fill(layer); | |
330 | } else { | |
331 | GetESDsData(3)->Fill(layer); | |
332 | } | |
333 | } | |
334 | ||
335 | } | |
336 | ||
337 | } // end loop on tracks | |
338 | ||
339 | // vertices | |
340 | const AliESDVertex *vtxSPD = esd->GetPrimaryVertexSPD(); | |
341 | const AliESDVertex *vtxTrk = esd->GetPrimaryVertex(); | |
342 | ||
a90a332e | 343 | Int_t mult = ((AliMultiplicity*)(esd->GetMultiplicity()))->GetNumberOfTracklets(); |
344 | if(mult>0) | |
345 | GetESDsData(7)->Fill((Float_t)(vtxSPD->GetNContributors())/(Float_t)mult); | |
346 | ||
d7d87ceb | 347 | if(nITSrefit5>0) |
348 | GetESDsData(11)->Fill((Float_t)(vtxTrk->GetNIndices())/(Float_t)nITSrefit5); | |
a90a332e | 349 | |
d7d87ceb | 350 | if(vtxSPD->GetNContributors()>0) { |
351 | GetESDsData(4)->Fill(vtxSPD->GetXv()); | |
352 | GetESDsData(5)->Fill(vtxSPD->GetYv()); | |
353 | GetESDsData(6)->Fill(vtxSPD->GetZv()); | |
354 | } | |
a90a332e | 355 | |
d7d87ceb | 356 | if(vtxTrk->GetNContributors()>0) { |
357 | GetESDsData(8)->Fill(vtxTrk->GetXv()); | |
358 | GetESDsData(9)->Fill(vtxTrk->GetYv()); | |
359 | GetESDsData(10)->Fill(vtxTrk->GetZv()); | |
360 | } | |
361 | ||
362 | if(vtxSPD->GetNContributors()>0 && | |
363 | vtxTrk->GetNContributors()>0) { | |
364 | GetESDsData(12)->Fill(vtxSPD->GetXv()-vtxTrk->GetXv()); | |
365 | GetESDsData(13)->Fill(vtxSPD->GetYv()-vtxTrk->GetYv()); | |
366 | GetESDsData(14)->Fill(vtxSPD->GetZv()-vtxTrk->GetZv()); | |
367 | } | |
a90a332e | 368 | |
369 | return; | |
370 | } |