]>
Commit | Line | Data |
---|---|---|
379510c2 | 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 | // Checks the quality assurance | |
19 | // by comparing with reference data | |
20 | // contained in a DB | |
21 | // ------------------------------------------------------------- | |
22 | // W. Ferrarese + P. Cerello INFN Torino Feb 2008 | |
23 | // M. Nicassio D. Elia INFN Bari April 2008 | |
24 | // maria.nicassio@ba.infn.it | |
25 | ||
26 | // --- ROOT system --- | |
27 | #include <TTree.h> | |
28 | #include <TH2.h> | |
29 | #include <TH1.h> | |
30 | // --- Standard library --- | |
31 | ||
32 | // --- AliRoot header files --- | |
33 | #include "AliRun.h" | |
34 | #include "AliITSQADataMakerSim.h" | |
35 | #include "AliITSQASPDDataMakerSim.h" | |
36 | #include "AliQA.h" | |
37 | #include "AliQAChecker.h" | |
38 | #include "AliITSdigit.h" | |
39 | #include "AliITSdigitSPD.h" | |
40 | #include "AliITS.h" | |
41 | #include "AliITSmodule.h" | |
42 | #include "AliITShit.h" | |
43 | #include "AliITSLoader.h" | |
44 | #include "AliRunLoader.h" | |
45 | ||
46 | ClassImp(AliITSQASPDDataMakerSim) | |
47 | ||
48 | //____________________________________________________________________________ | |
49 | AliITSQASPDDataMakerSim::AliITSQASPDDataMakerSim(AliITSQADataMakerSim *aliITSQADataMakerSim) : | |
50 | TObject(), | |
51 | fAliITSQADataMakerSim(aliITSQADataMakerSim), | |
3647765c | 52 | fSPDhTask(0), |
3f905799 | 53 | fGenOffsetH(0), |
54 | fGenOffsetS(0), | |
55 | fGenOffsetD(0) | |
379510c2 | 56 | { |
57 | //ctor used to discriminate OnLine-Offline analysis | |
58 | } | |
59 | ||
60 | //____________________________________________________________________________ | |
61 | AliITSQASPDDataMakerSim::AliITSQASPDDataMakerSim(const AliITSQASPDDataMakerSim& qadm) : | |
62 | TObject(), | |
63 | fAliITSQADataMakerSim(qadm.fAliITSQADataMakerSim), | |
3647765c | 64 | fSPDhTask(qadm.fSPDhTask), |
3f905799 | 65 | fGenOffsetH(qadm.fGenOffsetH), |
66 | fGenOffsetS(qadm.fGenOffsetS), | |
67 | fGenOffsetD(qadm.fGenOffsetD) | |
379510c2 | 68 | { |
69 | //copy ctor | |
70 | fAliITSQADataMakerSim->SetName((const char*)qadm.fAliITSQADataMakerSim->GetName()) ; | |
71 | fAliITSQADataMakerSim->SetTitle((const char*)qadm.fAliITSQADataMakerSim->GetTitle()); | |
72 | } | |
73 | ||
74 | //__________________________________________________________________ | |
75 | AliITSQASPDDataMakerSim& AliITSQASPDDataMakerSim::operator = (const AliITSQASPDDataMakerSim& qac ) | |
76 | { | |
77 | // Equal operator. | |
78 | this->~AliITSQASPDDataMakerSim(); | |
79 | new(this) AliITSQASPDDataMakerSim(qac); | |
80 | return *this; | |
81 | } | |
82 | ||
83 | //____________________________________________________________________________ | |
84 | void AliITSQASPDDataMakerSim::StartOfDetectorCycle() | |
85 | { | |
86 | //Detector specific actions at start of cycle | |
87 | AliDebug(1,"AliITSQADM::Start of SPD Cycle\n"); | |
88 | } | |
89 | ||
90 | //____________________________________________________________________________ | |
91 | void AliITSQASPDDataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t /*task*/, TObjArray* /*list*/) | |
92 | { | |
93 | // launch the QA checking | |
94 | AliDebug(1,"AliITSDM instantiates checker with Run(AliQA::kITS, task, list)\n"); | |
95 | ||
96 | //AliQAChecker::Instance()->Run( AliQA::kITS , task, list); | |
97 | } | |
98 | ||
99 | //____________________________________________________________________________ | |
100 | void AliITSQASPDDataMakerSim::InitDigits() | |
101 | { | |
102 | // Initialization for DIGIT data - SPD - | |
3f905799 | 103 | fGenOffsetD = (fAliITSQADataMakerSim->fDigitsQAList)->GetEntries(); |
3647765c | 104 | //fSPDhTask must be incremented by one unit every time a histogram is ADDED to the QA List |
379510c2 | 105 | |
106 | Char_t name[50]; | |
107 | Char_t title[50]; | |
108 | ||
109 | TH1F *hlayer = new TH1F("LayPattern_SPD","Layer map - SPD",6,0.,6.); | |
110 | hlayer->GetXaxis()->SetTitle("Layer number"); | |
111 | hlayer->GetYaxis()->SetTitle("Entries"); | |
3f905799 | 112 | fAliITSQADataMakerSim->Add2DigitsList(hlayer,fGenOffsetD); |
3647765c | 113 | fSPDhTask++; |
379510c2 | 114 | |
115 | TH1F **hmod = new TH1F*[2]; | |
116 | for (Int_t iLay=0; iLay<2; iLay++) { | |
117 | sprintf(name,"ModPattern_SPD%d",iLay+1); | |
118 | sprintf(title,"Module map - SPD Layer %d",iLay+1); | |
119 | hmod[iLay]=new TH1F(name,title,240,0,240); | |
120 | hmod[iLay]->GetXaxis()->SetTitle("Module number"); | |
121 | hmod[iLay]->GetYaxis()->SetTitle("Entries"); | |
3f905799 | 122 | fAliITSQADataMakerSim->Add2DigitsList(hmod[iLay],1+iLay+fGenOffsetD); |
3647765c | 123 | fSPDhTask++; |
379510c2 | 124 | } |
125 | ||
126 | TH1F *hcolumns = new TH1F("Columns_SPD","Columns - SPD",160,0.,160.); | |
127 | hcolumns->GetXaxis()->SetTitle("Column number"); | |
128 | hcolumns->GetYaxis()->SetTitle("Entries"); | |
3f905799 | 129 | fAliITSQADataMakerSim->Add2DigitsList(hcolumns,3+fGenOffsetD); |
3647765c | 130 | fSPDhTask++; |
379510c2 | 131 | |
132 | TH1F *hrows = new TH1F("Rows_SPD","Rows - SPD",256,0.,256.); | |
133 | hrows->GetXaxis()->SetTitle("Row number"); | |
134 | hrows->GetYaxis()->SetTitle("Entries"); | |
3f905799 | 135 | fAliITSQADataMakerSim->Add2DigitsList(hrows,4+fGenOffsetD); |
3647765c | 136 | fSPDhTask++; |
379510c2 | 137 | |
138 | TH1F** hMultSPDdigits = new TH1F*[2]; | |
139 | for (Int_t iLay=0; iLay<2; ++iLay) { | |
140 | sprintf(name,"DigitMultiplicity_SPD%d",iLay+1); | |
141 | sprintf(title,"Digit multiplicity - SPD Layer %d",iLay+1); | |
142 | hMultSPDdigits[iLay]=new TH1F(name,title,200,0.,200.); | |
143 | hMultSPDdigits[iLay]->GetXaxis()->SetTitle("Digit multiplicity"); | |
144 | hMultSPDdigits[iLay]->GetYaxis()->SetTitle("Entries"); | |
3f905799 | 145 | fAliITSQADataMakerSim->Add2DigitsList(hMultSPDdigits[iLay], 5+iLay+fGenOffsetD); |
3647765c | 146 | fSPDhTask++; |
379510c2 | 147 | } |
148 | ||
149 | TH2F *hMultSPDdig2MultSPDdig1 = new TH2F("DigitMultCorrelation_SPD","Digit multiplicity correlation - SPD",200,0.,200.,200,0.,200.); | |
150 | hMultSPDdig2MultSPDdig1->GetXaxis()->SetTitle("Digit multiplicity (Layer 1)"); | |
151 | hMultSPDdig2MultSPDdig1->GetYaxis()->SetTitle("Digit multiplicity (Layer 2)"); | |
3f905799 | 152 | fAliITSQADataMakerSim->Add2DigitsList(hMultSPDdig2MultSPDdig1,7+fGenOffsetD); |
3647765c | 153 | fSPDhTask++; |
379510c2 | 154 | |
3647765c | 155 | AliDebug(1,Form("%d SPD Digits histograms booked\n",fSPDhTask)); |
379510c2 | 156 | |
157 | } | |
158 | ||
159 | //____________________________________________________________________________ | |
160 | void AliITSQASPDDataMakerSim::MakeDigits(TTree *digits) | |
161 | { | |
162 | // Fill QA for DIGIT - SPD - | |
163 | AliITS *fITS = (AliITS*)gAlice->GetModule("ITS"); | |
164 | fITS->SetTreeAddress(); | |
165 | TClonesArray *iITSdigits = fITS->DigitsAddress(0); // 0->SPD | |
166 | ||
167 | Int_t nDigitsL1=0; | |
168 | Int_t nDigitsL2=0; | |
169 | ||
170 | for (Int_t imod=0; imod<240; ++imod){ | |
171 | digits->GetEvent(imod); | |
172 | Int_t ndigits = iITSdigits->GetEntries(); | |
173 | if (imod<80) { | |
3f905799 | 174 | fAliITSQADataMakerSim->GetDigitsData(0+fGenOffsetD)->Fill(0.5,ndigits); |
175 | fAliITSQADataMakerSim->GetDigitsData(1+fGenOffsetD)->Fill(imod,ndigits); | |
379510c2 | 176 | nDigitsL1+=ndigits; |
177 | } | |
178 | else { | |
3f905799 | 179 | fAliITSQADataMakerSim->GetDigitsData(0+fGenOffsetD)->Fill(1,ndigits); |
180 | fAliITSQADataMakerSim->GetDigitsData(2+fGenOffsetD)->Fill(imod,ndigits); | |
379510c2 | 181 | nDigitsL2+=ndigits; |
182 | } | |
183 | for (Int_t idig=0; idig<ndigits; ++idig) { | |
184 | AliITSdigit *dig=(AliITSdigit*)iITSdigits->UncheckedAt(idig); | |
185 | Int_t col=dig->GetCoord1(); // cell number z | |
186 | Int_t row=dig->GetCoord2(); // cell number x | |
3f905799 | 187 | fAliITSQADataMakerSim->GetDigitsData(3+fGenOffsetD)->Fill(col); |
188 | fAliITSQADataMakerSim->GetDigitsData(4+fGenOffsetD)->Fill(row); | |
379510c2 | 189 | } |
190 | } | |
3f905799 | 191 | fAliITSQADataMakerSim->GetDigitsData(5+fGenOffsetD)->Fill(nDigitsL1); |
192 | fAliITSQADataMakerSim->GetDigitsData(6+fGenOffsetD)->Fill(nDigitsL2); | |
193 | fAliITSQADataMakerSim->GetDigitsData(7+fGenOffsetD)->Fill(nDigitsL1,nDigitsL2); | |
379510c2 | 194 | } |
195 | ||
196 | //____________________________________________________________________________ | |
197 | void AliITSQASPDDataMakerSim::InitSDigits() | |
198 | { | |
199 | // Initialization for SDIGIT data - SPD - | |
3f905799 | 200 | fGenOffsetS = (fAliITSQADataMakerSim->fSDigitsQAList)->GetEntries(); |
c71529b0 | 201 | //printf("--W-- AliITSQASPDDataMakerSim::InitSDigits() fGenOffset= %d \n",fGenOffset); |
3647765c | 202 | //fSPDhTask must be incremented by one unit every time a histogram is ADDED to the QA List |
c71529b0 | 203 | |
379510c2 | 204 | Char_t name[50]; |
205 | Char_t title[50]; | |
206 | ||
207 | TH1F *hlayer = new TH1F("LayPattern_SPD","Layer map - SPD",6,0.,6.); | |
208 | hlayer->GetXaxis()->SetTitle("Layer number"); | |
209 | hlayer->GetYaxis()->SetTitle("Entries"); | |
3f905799 | 210 | fAliITSQADataMakerSim->Add2SDigitsList(hlayer,fGenOffsetS); |
3647765c | 211 | fSPDhTask++; |
379510c2 | 212 | |
213 | TH1F **hmod = new TH1F*[2]; | |
214 | for (Int_t iLay=0; iLay<2; ++iLay) { | |
215 | sprintf(name,"ModPattern_SPD%d",iLay+1); | |
216 | sprintf(title,"Module map - SPD Layer %d",iLay+1); | |
217 | hmod[iLay]=new TH1F(name,title,240,0,240); | |
218 | hmod[iLay]->GetXaxis()->SetTitle("Module number"); | |
219 | hmod[iLay]->GetYaxis()->SetTitle("Entries"); | |
3f905799 | 220 | fAliITSQADataMakerSim->Add2SDigitsList(hmod[iLay],1+iLay+fGenOffsetS); |
3647765c | 221 | fSPDhTask++; |
379510c2 | 222 | } |
223 | ||
224 | ||
3647765c | 225 | AliDebug(1,Form("%d SPD SDigits histograms booked\n",fSPDhTask)); |
379510c2 | 226 | |
227 | } | |
228 | ||
229 | //____________________________________________________________________________ | |
230 | void AliITSQASPDDataMakerSim::MakeSDigits(TTree *sdigits) | |
231 | { | |
232 | // Fill QA for SDIGIT - SPD - | |
233 | TBranch *brchSDigits = sdigits->GetBranch("ITS"); | |
234 | for (Int_t imod=0; imod<240; ++imod){ | |
235 | TClonesArray * sdig = new TClonesArray( "AliITSpListItem",1000 ); | |
236 | brchSDigits->SetAddress( &sdig ); | |
237 | brchSDigits->GetEvent(imod); | |
238 | Int_t nsdig=sdig->GetEntries(); | |
239 | if (imod<80) { | |
3f905799 | 240 | fAliITSQADataMakerSim->GetSDigitsData(0+fGenOffsetS)->Fill(0.5,nsdig); |
241 | fAliITSQADataMakerSim->GetSDigitsData(1+fGenOffsetS)->Fill(imod,nsdig); | |
379510c2 | 242 | } |
243 | else { | |
3f905799 | 244 | fAliITSQADataMakerSim->GetSDigitsData(0+fGenOffsetS)->Fill(1,nsdig); |
245 | fAliITSQADataMakerSim->GetSDigitsData(2+fGenOffsetS)->Fill(imod,nsdig); | |
379510c2 | 246 | } |
247 | delete sdig; | |
248 | } | |
249 | ||
250 | } | |
251 | ||
252 | //____________________________________________________________________________ | |
253 | void AliITSQASPDDataMakerSim::InitHits() | |
254 | { | |
255 | // Initialization for HITS data - SPD - | |
3f905799 | 256 | fGenOffsetH = (fAliITSQADataMakerSim->fHitsQAList)->GetEntries(); |
c71529b0 | 257 | //printf("--W-- AliITSQASPDDataMakerSim::InitHits() fGenOffset= %d \n",fGenOffset); |
3647765c | 258 | //fSPDhTask must be incremented by one unit every time a histogram is ADDED to the QA List |
379510c2 | 259 | Char_t name[50]; |
260 | Char_t title[50]; | |
261 | ||
262 | TH1F *hlayer = new TH1F("LayPattern_SPD","Layer map - SPD",6,0.,6.); | |
263 | hlayer->GetXaxis()->SetTitle("Layer number"); | |
264 | hlayer->GetYaxis()->SetTitle("Entries"); | |
3f905799 | 265 | fAliITSQADataMakerSim->Add2HitsList(hlayer,fGenOffsetH); |
3647765c | 266 | fSPDhTask++; |
379510c2 | 267 | |
268 | TH1F **hmod = new TH1F*[2]; | |
269 | for (Int_t iLay=0; iLay<2; ++iLay) { | |
270 | sprintf(name,"ModPattern_SPD%d",iLay+1); | |
271 | sprintf(title,"Module map - SPD Layer %d",iLay+1); | |
272 | hmod[iLay]=new TH1F(name,title,240,0,240); | |
273 | hmod[iLay]->GetXaxis()->SetTitle("Module number"); | |
274 | hmod[iLay]->GetYaxis()->SetTitle("Entries"); | |
3f905799 | 275 | fAliITSQADataMakerSim->Add2HitsList(hmod[iLay],1+iLay+fGenOffsetH); |
3647765c | 276 | fSPDhTask++; |
379510c2 | 277 | } |
278 | ||
279 | TH1F *hhitlenght = new TH1F("Lenght_SPD","Hit lenght along y_{loc} coord",210,0.,210.); | |
280 | hhitlenght->GetXaxis()->SetTitle("Hit lenght [#mum]"); | |
281 | hhitlenght->GetYaxis()->SetTitle("# hits"); | |
3f905799 | 282 | fAliITSQADataMakerSim->Add2HitsList(hhitlenght,3+fGenOffsetH); |
3647765c | 283 | fSPDhTask++; |
379510c2 | 284 | |
285 | TH1F *hEdepos = new TH1F("EnergyDeposit_SPD","Deposited energy distribution (y_{loc}>180 #mum)",150,0.,300.); | |
286 | hEdepos->GetXaxis()->SetTitle("Deposited energy [keV]"); | |
287 | hEdepos->GetYaxis()->SetTitle("# hits"); | |
3f905799 | 288 | fAliITSQADataMakerSim->Add2HitsList(hEdepos,4+fGenOffsetH); |
3647765c | 289 | fSPDhTask++; |
379510c2 | 290 | |
3647765c | 291 | AliDebug(1,Form("%d SPD Hits histograms booked\n",fSPDhTask)); |
379510c2 | 292 | |
293 | } | |
294 | ||
295 | //____________________________________________________________________________ | |
296 | void AliITSQASPDDataMakerSim::MakeHits(TTree *hits) | |
297 | { | |
298 | // Fill QA for HITS - SPD - | |
299 | AliITS *fITS = (AliITS*)gAlice->GetModule("ITS"); | |
300 | fITS->SetTreeAddress(); | |
301 | Int_t nmodules; | |
302 | fITS->InitModules(-1,nmodules); //-1->number of modules taken from AliITSgeom class kept in fITSgeom | |
303 | //nmodules is set | |
304 | ||
305 | fITS->FillModules(hits,0); | |
306 | ||
307 | for (Int_t imod=0; imod<240; ++imod){ | |
308 | AliITSmodule *module = fITS->GetModule(imod); | |
309 | TObjArray *arrHits = module->GetHits(); | |
310 | Int_t nhits = arrHits->GetEntriesFast(); | |
311 | if (imod<80) { | |
3f905799 | 312 | fAliITSQADataMakerSim->GetHitsData(fGenOffsetH)->Fill(0.5,nhits); |
313 | fAliITSQADataMakerSim->GetHitsData(1+fGenOffsetH)->Fill(imod,nhits); | |
379510c2 | 314 | } else { |
3f905799 | 315 | fAliITSQADataMakerSim->GetHitsData(fGenOffsetH)->Fill(1,nhits); |
316 | fAliITSQADataMakerSim->GetHitsData(2+fGenOffsetH)->Fill(imod,nhits); | |
379510c2 | 317 | } |
379510c2 | 318 | for (Int_t iHit=0; iHit<nhits; ++iHit) { |
319 | AliITShit *hit = (AliITShit*) arrHits->At(iHit); | |
320 | Double_t xl,yl,zl,xl0,yl0,zl0; | |
321 | Double_t tof,tof0; | |
322 | hit->GetPositionL(xl,yl,zl,tof); | |
323 | hit->GetPositionL0(xl0,yl0,zl0,tof0); | |
324 | Float_t dyloc=TMath::Abs(yl-yl0)*10000.; | |
3f905799 | 325 | fAliITSQADataMakerSim->GetHitsData(3+fGenOffsetH)->Fill(dyloc); |
379510c2 | 326 | Float_t edep=hit->GetIonization()*1000000; |
327 | if(dyloc>180.){ | |
3f905799 | 328 | fAliITSQADataMakerSim->GetHitsData(4+fGenOffsetH)->Fill(edep); |
379510c2 | 329 | } |
330 | } | |
331 | } | |
332 | } |