]>
Commit | Line | Data |
---|---|---|
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 | // ------------------------------------------------------------- | |
23 | // W. Ferrarese + P. Cerello Feb 2008 | |
24 | // INFN Torino | |
25 | // SSD QA part: P. Christakoglou - NIKHEF/UU | |
26 | ||
27 | // --- ROOT system --- | |
28 | #include <TTree.h> | |
29 | #include <TH1.h> | |
30 | #include <TH2.h> | |
31 | #include <TMath.h> | |
32 | // --- Standard library --- | |
33 | ||
34 | // --- AliRoot header files --- | |
35 | #include "AliITS.h" | |
36 | #include "AliITSmodule.h" | |
37 | #include "AliITShit.h" | |
38 | #include "AliITSdigit.h" | |
39 | #include "AliITSpListItem.h" | |
40 | #include "AliRun.h" | |
41 | #include "AliITSQADataMakerSim.h" | |
42 | #include "AliITSQASSDDataMakerSim.h" | |
43 | #include "AliLog.h" | |
44 | #include "AliQAv1.h" | |
45 | #include "AliQAChecker.h" | |
46 | #include "AliRawReader.h" | |
47 | ||
48 | ClassImp(AliITSQASSDDataMakerSim) | |
49 | ||
50 | //____________________________________________________________________________ | |
51 | AliITSQASSDDataMakerSim::AliITSQASSDDataMakerSim(AliITSQADataMakerSim *aliITSQADataMakerSim) : | |
52 | TObject(), | |
53 | fAliITSQADataMakerSim(aliITSQADataMakerSim), | |
54 | //fSSDhTask(0), | |
55 | fSSDhHTask(0), | |
56 | fSSDhSTask(0), | |
57 | fSSDhDTask(0), | |
58 | fGenOffsetH(0), | |
59 | fGenOffsetS(0), | |
60 | fGenOffsetD(0) | |
61 | { | |
62 | //ctor used to discriminate OnLine-Offline analysis | |
63 | fGenOffsetH= new Int_t[AliRecoParam::kNSpecies]; | |
64 | fGenOffsetS= new Int_t[AliRecoParam::kNSpecies]; | |
65 | fGenOffsetD= new Int_t[AliRecoParam::kNSpecies]; | |
66 | for(Int_t i=0; i<AliRecoParam::kNSpecies; i++) | |
67 | { | |
68 | fGenOffsetH[i]= 0; | |
69 | fGenOffsetS[i]= 0; | |
70 | fGenOffsetD[i]= 0; | |
71 | } | |
72 | } | |
73 | ||
74 | //____________________________________________________________________________ | |
75 | AliITSQASSDDataMakerSim::AliITSQASSDDataMakerSim(const AliITSQASSDDataMakerSim& qadm) : | |
76 | TObject(), | |
77 | fAliITSQADataMakerSim(qadm.fAliITSQADataMakerSim), | |
78 | //fSSDhTask(qadm.fSSDhTask), | |
79 | fSSDhHTask(qadm.fSSDhHTask), | |
80 | fSSDhSTask(qadm.fSSDhSTask), | |
81 | fSSDhDTask(qadm.fSSDhDTask), | |
82 | fGenOffsetH(qadm.fGenOffsetH), | |
83 | fGenOffsetS(qadm.fGenOffsetS), | |
84 | fGenOffsetD(qadm.fGenOffsetD) | |
85 | { | |
86 | //copy ctor | |
87 | fAliITSQADataMakerSim->SetName((const char*)qadm.fAliITSQADataMakerSim->GetName()) ; | |
88 | fAliITSQADataMakerSim->SetTitle((const char*)qadm.fAliITSQADataMakerSim->GetTitle()); | |
89 | } | |
90 | ||
91 | //__________________________________________________________________ | |
92 | AliITSQASSDDataMakerSim& AliITSQASSDDataMakerSim::operator = (const AliITSQASSDDataMakerSim& qac ) { | |
93 | // Equal operator. | |
94 | this->~AliITSQASSDDataMakerSim(); | |
95 | new(this) AliITSQASSDDataMakerSim(qac); | |
96 | return *this; | |
97 | } | |
98 | ||
99 | //____________________________________________________________________________ | |
100 | void AliITSQASSDDataMakerSim::StartOfDetectorCycle() { | |
101 | //Detector specific actions at start of cycle | |
102 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Start of SSD Cycle\n"); | |
103 | } | |
104 | ||
105 | //____________________________________________________________________________ | |
106 | void AliITSQASSDDataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t /*task*/, TObjArray* /*list*/) { | |
107 | // launch the QA checking | |
108 | AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n"); | |
109 | ||
110 | // AliQAChecker::Instance()->Run( AliQAv1::kITS , task, list); | |
111 | } | |
112 | ||
113 | //____________________________________________________________________________ | |
114 | Int_t AliITSQASSDDataMakerSim::InitDigits() { | |
115 | // Initialization for DIGIT data - SSD - | |
116 | const Bool_t expert = kTRUE ; | |
117 | const Bool_t image = kTRUE ; | |
118 | Int_t rv = 0 ; | |
119 | // fGenOffsetD = (fAliITSQADataMakerSim->fDigitsQAList[AliRecoParam::kDefault])->GetEntries(); | |
120 | ||
121 | // custom code here | |
122 | TH1F *fHistSSDModule = new TH1F("fHistSSDDigitsModule", | |
123 | "SSD Digits Module;SSD Module Number;N_{DIGITS}", | |
124 | 1698,499.5,2197.5); | |
125 | rv = fAliITSQADataMakerSim->Add2DigitsList(fHistSSDModule, | |
126 | fGenOffsetD[fAliITSQADataMakerSim->GetEventSpecie()] + 0, !expert, image); | |
127 | fSSDhDTask += 1; | |
128 | TH2F *fHistSSDModuleStrip = new TH2F("fHistSSDDigitsModuleStrip", | |
129 | "SSD Digits Module Strip;N_{Strip};N_{Module}", | |
130 | 1540,0,1540,1698,499.5,2197.5); | |
131 | rv = fAliITSQADataMakerSim->Add2DigitsList(fHistSSDModuleStrip, | |
132 | fGenOffsetD[fAliITSQADataMakerSim->GetEventSpecie()] + 1, !expert, image); | |
133 | fSSDhDTask += 1; | |
134 | ||
135 | AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SSD Digits histograms booked\n",fSSDhDTask)); | |
136 | return rv ; | |
137 | } | |
138 | ||
139 | //____________________________________________________________________________ | |
140 | Int_t AliITSQASSDDataMakerSim::MakeDigits(TTree *digits) { | |
141 | // Fill QA for DIGIT - SSD - | |
142 | Int_t rv = 0 ; | |
143 | ||
144 | AliITS *fITS = (AliITS*)gAlice->GetModule("ITS"); | |
145 | fITS->SetTreeAddress(); | |
146 | TClonesArray *iSSDdigits = fITS->DigitsAddress(2); | |
147 | for(Int_t iModule = 500; iModule < 2198; iModule++) { | |
148 | iSSDdigits->Clear(); | |
149 | digits->GetEvent(iModule); | |
150 | Int_t ndigits = iSSDdigits->GetEntries(); | |
151 | fAliITSQADataMakerSim->GetDigitsData(fGenOffsetD[fAliITSQADataMakerSim->GetEventSpecie()] + 0)->Fill(iModule,ndigits); | |
152 | if(ndigits != 0) | |
153 | AliDebug(AliQAv1::GetQADebugLevel(),Form("Module: %d - Digits: %d",iModule,ndigits)); | |
154 | ||
155 | for (Int_t iDigit = 0; iDigit < ndigits; iDigit++) { | |
156 | AliITSdigit *dig = (AliITSdigit*)iSSDdigits->UncheckedAt(iDigit); | |
157 | Int_t fStripNumber = (dig->GetCoord1() == 0) ? dig->GetCoord2() : dig->GetCoord2() + fgkNumberOfPSideStrips; | |
158 | ((TH2F *)fAliITSQADataMakerSim->GetDigitsData(fGenOffsetD[fAliITSQADataMakerSim->GetEventSpecie()] + 1))->Fill(fStripNumber,iModule,dig->GetSignal()); | |
159 | }//digit loop | |
160 | }//module loop | |
161 | return rv ; | |
162 | } | |
163 | ||
164 | //____________________________________________________________________________ | |
165 | Int_t AliITSQASSDDataMakerSim::InitSDigits() { | |
166 | // Initialization for SDIGIT data - SSD - | |
167 | const Bool_t expert = kTRUE ; | |
168 | const Bool_t image = kTRUE ; | |
169 | Int_t rv = 0 ; | |
170 | //fGenOffsetS = (fAliITSQADataMakerSim->fSDigitsQAList[AliRecoParam::kDefault])->GetEntries(); | |
171 | ||
172 | // custom code here | |
173 | TH1F *fHistSSDModule = new TH1F("fHistSSDSDigitsModule", | |
174 | "SSD SDigits Module;SSD Module Number;N_{SDIGITS}", | |
175 | 1698,499.5,2197.5); | |
176 | rv = fAliITSQADataMakerSim->Add2SDigitsList(fHistSSDModule, | |
177 | fGenOffsetS[fAliITSQADataMakerSim->GetEventSpecie()] + 0, !expert, image); | |
178 | fSSDhSTask += 1; | |
179 | ||
180 | AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SSD SDigits histograms booked\n",fSSDhSTask)); | |
181 | return rv ; | |
182 | } | |
183 | ||
184 | //____________________________________________________________________________ | |
185 | Int_t AliITSQASSDDataMakerSim::MakeSDigits(TTree *sdigits) { | |
186 | // Fill QA for SDIGIT - SSD - | |
187 | Int_t rv = 0 ; | |
188 | ||
189 | static TClonesArray iSSDEmpty("AliITSpListItem",10000); | |
190 | iSSDEmpty.Clear(); | |
191 | TClonesArray *iSSDsdigits = &iSSDEmpty; | |
192 | ||
193 | // AliDebug(AliQAv1::GetQADebugLevel(), Form("Trying to access the sdigits histogram: %d\n",fGenOffsetS)); | |
194 | ||
195 | TBranch *brchSDigits = sdigits->GetBranch("ITS"); | |
196 | brchSDigits->SetAddress(&iSSDsdigits); | |
197 | for(Int_t iModule = 500; iModule < 2198; iModule++) { | |
198 | iSSDsdigits->Clear(); | |
199 | sdigits->GetEvent(iModule); | |
200 | Int_t ndigits = iSSDsdigits->GetEntries(); | |
201 | fAliITSQADataMakerSim->GetSDigitsData(fGenOffsetS[fAliITSQADataMakerSim->GetEventSpecie()] + 0)->Fill(iModule,ndigits); | |
202 | if(ndigits != 0) | |
203 | AliDebug(AliQAv1::GetQADebugLevel(),Form("Module: %d - Digits: %d",iModule,ndigits)); | |
204 | ||
205 | for (Int_t iDigit = 0; iDigit < ndigits; iDigit++) { | |
206 | AliITSpListItem *dig=(AliITSpListItem*)iSSDsdigits->At(iDigit); | |
207 | dig=0; | |
208 | }//digit loop | |
209 | }//module loop | |
210 | return rv ; | |
211 | } | |
212 | ||
213 | //____________________________________________________________________________ | |
214 | Int_t AliITSQASSDDataMakerSim::InitHits() { | |
215 | // Initialization for HITS data - SSD - | |
216 | const Bool_t expert = kTRUE ; | |
217 | const Bool_t image = kTRUE ; | |
218 | Int_t rv = 0 ; | |
219 | ||
220 | //fGenOffsetH = (fAliITSQADataMakerSim->fHitsQAList[fEventSpecie])->GetEntries(); | |
221 | ||
222 | // custom code here | |
223 | TH1F *fHistSSDModule = new TH1F("fHistSSDHitsModule", | |
224 | "SSD Hits Module;SSD Module Number;N_{HITS}", | |
225 | 1698,499.5,2197.5); | |
226 | rv = fAliITSQADataMakerSim->Add2HitsList(fHistSSDModule, | |
227 | fGenOffsetH[fAliITSQADataMakerSim->GetEventSpecie()] + 0, !expert, image); | |
228 | fSSDhHTask += 1; | |
229 | TH1F *fHistSSDGlobalX = new TH1F("fHistSSDHitsGlobalX", | |
230 | "SSD Hits Global X;x [cm];Entries", | |
231 | 1000,-50.,50.); | |
232 | rv = fAliITSQADataMakerSim->Add2HitsList(fHistSSDGlobalX, | |
233 | fGenOffsetH[fAliITSQADataMakerSim->GetEventSpecie()] + 1, !expert, image); | |
234 | fSSDhHTask += 1; | |
235 | TH1F *fHistSSDGlobalY = new TH1F("fHistSSDHitsGlobalY", | |
236 | "SSD Hits Global Y;y [cm];Entries", | |
237 | 1000,-50.,50.); | |
238 | rv = fAliITSQADataMakerSim->Add2HitsList(fHistSSDGlobalY, | |
239 | fGenOffsetH[fAliITSQADataMakerSim->GetEventSpecie()] + 2, !expert, image); | |
240 | fSSDhHTask += 1; | |
241 | TH1F *fHistSSDGlobalZ = new TH1F("fHistSSDHitsGlobalZ", | |
242 | "SSD Hits Global Z ;z [cm];Entries", | |
243 | 1000,-60.,60.); | |
244 | rv = fAliITSQADataMakerSim->Add2HitsList(fHistSSDGlobalZ, | |
245 | fGenOffsetH[fAliITSQADataMakerSim->GetEventSpecie()] + 3, !expert, image); | |
246 | fSSDhHTask += 1; | |
247 | TH1F *fHistSSDLocalX = new TH1F("fHistSSDHitsLocalX", | |
248 | "SSD Hits Local X;x [cm];Entries", | |
249 | 1000,-4.,4.); | |
250 | rv = fAliITSQADataMakerSim->Add2HitsList(fHistSSDLocalX, | |
251 | fGenOffsetH[fAliITSQADataMakerSim->GetEventSpecie()] + 4, !expert, image); | |
252 | fSSDhHTask += 1; | |
253 | TH1F *fHistSSDLocalY = new TH1F("fHistSSDHitsLocalY", | |
254 | "SSD Hits Local Y;y [cm];Entries", | |
255 | 1000,-0.1,0.1); | |
256 | rv = fAliITSQADataMakerSim->Add2HitsList(fHistSSDLocalY, | |
257 | fGenOffsetH[fAliITSQADataMakerSim->GetEventSpecie()] + 5, !expert, image); | |
258 | fSSDhHTask += 1; | |
259 | TH1F *fHistSSDLocalZ = new TH1F("fHistSSDHitsLocalZ", | |
260 | "SSD Hits Local Z;z [cm];Entries", | |
261 | 1000,-4.,4.); | |
262 | rv = fAliITSQADataMakerSim->Add2HitsList(fHistSSDLocalZ, | |
263 | fGenOffsetH[fAliITSQADataMakerSim->GetEventSpecie()] + 6, !expert, image); | |
264 | fSSDhHTask += 1; | |
265 | TH1F *fHistSSDIonization = new TH1F("fHistSSDHitsIonization", | |
266 | "SSD Hits Ionization;log(dE/dx) [KeV];N_{Hits}", | |
267 | 100,-7,-2); | |
268 | rv = fAliITSQADataMakerSim->Add2HitsList(fHistSSDIonization, | |
269 | fGenOffsetH[fAliITSQADataMakerSim->GetEventSpecie()] + 7, !expert, image); | |
270 | fSSDhHTask += 1; | |
271 | TH2F *fHistSSDGlobalXY = new TH2F("fHistSSDHitsGlobalXY", | |
272 | "SSD Hits Global XY;x [cm];y [cm]", | |
273 | 1000,-50.,50., | |
274 | 1000,-50.,50.); | |
275 | rv = fAliITSQADataMakerSim->Add2HitsList(fHistSSDGlobalXY, | |
276 | fGenOffsetH[fAliITSQADataMakerSim->GetEventSpecie()] + 8, !expert, image); | |
277 | fSSDhHTask += 1; | |
278 | ||
279 | AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SSD Hits histograms booked\n",fSSDhHTask)); | |
280 | return rv ; | |
281 | } | |
282 | ||
283 | ||
284 | //____________________________________________________________________________ | |
285 | Int_t AliITSQASSDDataMakerSim::MakeHits(TTree *hits) { | |
286 | // Fill QA for HITS - SSD - | |
287 | Int_t rv = 0 ; | |
288 | ||
289 | AliITS *fITS = (AliITS*)gAlice->GetModule("ITS"); | |
290 | fITS->SetTreeAddress(); | |
291 | Int_t nmodules; | |
292 | fITS->InitModules(-1,nmodules); | |
293 | fITS->FillModules(hits,0); | |
294 | for(Int_t iModule = 500; iModule < 2198; iModule++) { | |
295 | AliITSmodule *module = fITS->GetModule(iModule); | |
296 | TObjArray *arrHits = module->GetHits(); | |
297 | Int_t nhits = arrHits->GetEntriesFast(); | |
298 | if(nhits != 0) | |
299 | AliDebug(AliQAv1::GetQADebugLevel(),Form("Module: %d - Hits: %d",iModule,nhits)); | |
300 | for (Int_t iHit = 0; iHit < nhits; iHit++) { | |
301 | AliITShit *hit = (AliITShit*) arrHits->At(iHit); | |
302 | ||
303 | fAliITSQADataMakerSim->GetHitsData(fGenOffsetH[fAliITSQADataMakerSim->GetEventSpecie()] + 0)->Fill(iModule); | |
304 | fAliITSQADataMakerSim->GetHitsData(fGenOffsetH[fAliITSQADataMakerSim->GetEventSpecie()] + 1)->Fill(hit->GetXG()); | |
305 | fAliITSQADataMakerSim->GetHitsData(fGenOffsetH[fAliITSQADataMakerSim->GetEventSpecie()] + 2)->Fill(hit->GetYG()); | |
306 | fAliITSQADataMakerSim->GetHitsData(fGenOffsetH[fAliITSQADataMakerSim->GetEventSpecie()] + 3)->Fill(hit->GetZG()); | |
307 | fAliITSQADataMakerSim->GetHitsData(fGenOffsetH[fAliITSQADataMakerSim->GetEventSpecie()] + 4)->Fill(hit->GetXL()); | |
308 | fAliITSQADataMakerSim->GetHitsData(fGenOffsetH[fAliITSQADataMakerSim->GetEventSpecie()] + 5)->Fill(hit->GetYL()); | |
309 | fAliITSQADataMakerSim->GetHitsData(fGenOffsetH[fAliITSQADataMakerSim->GetEventSpecie()] + 6)->Fill(hit->GetZL()); | |
310 | if(hit->GetIonization()) | |
311 | fAliITSQADataMakerSim->GetHitsData(fGenOffsetH[fAliITSQADataMakerSim->GetEventSpecie()] + 7)->Fill(TMath::Log10(hit->GetIonization())); | |
312 | fAliITSQADataMakerSim->GetHitsData(fGenOffsetH[fAliITSQADataMakerSim->GetEventSpecie()] + 8)->Fill(hit->GetXG(),hit->GetYG()); | |
313 | }//hit loop | |
314 | }//module loop | |
315 | return rv ; | |
316 | } | |
317 | ||
318 | //____________________________________________________________________________ | |
319 | Int_t AliITSQASSDDataMakerSim::GetOffset(AliQAv1::TASKINDEX_t task,Int_t specie){ | |
320 | // Returns histogram offset according to the specified task | |
321 | Int_t offset=0; | |
322 | if( task == AliQAv1::kHITS){ | |
323 | offset=fGenOffsetH[specie]; | |
324 | } | |
325 | else if( task == AliQAv1::kSDIGITS) { | |
326 | offset=fGenOffsetS[specie]; | |
327 | } | |
328 | else if( task == AliQAv1::kDIGITS) { | |
329 | offset=fGenOffsetD[specie]; | |
330 | } | |
331 | else { | |
332 | AliInfo("No task has been selected. TaskHisto set to zero.\n"); | |
333 | } | |
334 | ||
335 | return offset; | |
336 | } | |
337 | ||
338 | ||
339 | //____________________________________________________________________________ | |
340 | void AliITSQASSDDataMakerSim::SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset,Int_t specie ){ | |
341 | // Returns histogram offset according to the specified task | |
342 | if( task == AliQAv1::kHITS){ | |
343 | fGenOffsetH[specie] = offset; | |
344 | } | |
345 | else if( task == AliQAv1::kSDIGITS) { | |
346 | fGenOffsetS[specie] = offset; | |
347 | } | |
348 | else if( task == AliQAv1::kDIGITS) { | |
349 | fGenOffsetD[specie] = offset; | |
350 | } | |
351 | else { | |
352 | AliInfo("No task has been selected. TaskHisto set to zero.\n"); | |
353 | } | |
354 | } | |
355 | ||
356 | //____________________________________________________________________________ | |
357 | Int_t AliITSQASSDDataMakerSim::GetTaskHisto(AliQAv1::TASKINDEX_t task) { | |
358 | // Returns the number of booked histograms for the selected task | |
359 | Int_t histotot=0; | |
360 | if( task == AliQAv1::kHITS) { | |
361 | histotot=fSSDhHTask ; | |
362 | } | |
363 | else if( task == AliQAv1::kSDIGITS) { | |
364 | histotot=fSSDhSTask; | |
365 | } | |
366 | else if( task == AliQAv1::kDIGITS) { | |
367 | histotot=fSSDhDTask ; | |
368 | } | |
369 | else { | |
370 | AliInfo("No task has been selected. TaskHisto set to zero.\n"); | |
371 | } | |
372 | return histotot; | |
373 | ||
374 | } |