]>
Commit | Line | Data |
---|---|---|
8dc34e37 | 1 | /**************************************************************************\r |
2 | * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *\r | |
3 | * *\r | |
4 | * Author: The ALICE Off-line Project. *\r | |
5 | * Contributors are mentioned in the code where appropriate. *\r | |
6 | * *\r | |
7 | * Permission to use, copy, modify and distribute this software and its *\r | |
8 | * documentation strictly for non-commercial purposes is hereby granted *\r | |
9 | * without fee, provided that the above copyright notice appears in all *\r | |
10 | * copies and that both the copyright notice and this permission notice *\r | |
11 | * appear in the supporting documentation. The authors make no claims *\r | |
12 | * about the suitability of this software for any purpose. It is *\r | |
13 | * provided "as is" without express or implied warranty. *\r | |
14 | **************************************************************************/\r | |
15 | \r | |
6f5308d9 | 16 | /* $Id$ */\r |
17 | \r | |
8dc34e37 | 18 | // *************************************************************\r |
19 | // Checks the quality assurance \r | |
20 | // by comparing with reference data\r | |
21 | // contained in a DB\r | |
22 | // -------------------------------------------------------------\r | |
23 | // W. Ferrarese + P. Cerello Feb 2008\r | |
24 | // INFN Torino\r | |
25 | \r | |
26 | // --- ROOT system ---\r | |
27 | #include <TTree.h>\r | |
28 | // --- Standard library ---\r | |
29 | \r | |
30 | // --- AliRoot header files ---\r | |
31 | #include "AliITSQASDDDataMakerSim.h"\r | |
32 | #include "AliLog.h"\r | |
33 | #include "AliQA.h"\r | |
34 | #include "AliQAChecker.h"\r | |
35 | #include "AliQADataMakerSim.h"\r | |
36 | #include "AliITSQADataMakerSim.h"\r | |
37 | #include "AliRawReader.h"\r | |
38 | #include "AliITSdigit.h"\r | |
39 | #include "AliITS.h"\r | |
40 | #include "AliITSmodule.h"\r | |
41 | #include "AliITShit.h"\r | |
42 | #include "AliITSLoader.h"\r | |
43 | #include "AliRunLoader.h"\r | |
44 | #include "AliRun.h"\r | |
45 | #include "AliITSsegmentationSDD.h"\r | |
46 | #include "AliITSpList.h"\r | |
47 | \r | |
48 | ClassImp(AliITSQASDDDataMakerSim)\r | |
49 | \r | |
50 | //____________________________________________________________________________ \r | |
51 | AliITSQASDDDataMakerSim::AliITSQASDDDataMakerSim(AliITSQADataMakerSim *aliITSQADataMakerSim) :\r | |
52 | TObject(),\r | |
53 | fAliITSQADataMakerSim(aliITSQADataMakerSim),\r | |
54 | fSDDhDigits(0),\r | |
55 | fSDDhSDigits(0),\r | |
56 | fSDDhHits(0),\r | |
c71529b0 | 57 | fGenOffset(0)\r |
8dc34e37 | 58 | {\r |
59 | //ctor used to discriminate OnLine-Offline analysis \r | |
60 | }\r | |
61 | \r | |
62 | //____________________________________________________________________________ \r | |
63 | AliITSQASDDDataMakerSim::AliITSQASDDDataMakerSim(const AliITSQASDDDataMakerSim& qadm) :\r | |
64 | TObject(),\r | |
65 | fAliITSQADataMakerSim(qadm.fAliITSQADataMakerSim),\r | |
66 | fSDDhDigits(qadm.fSDDhDigits),\r | |
67 | fSDDhSDigits(qadm.fSDDhSDigits),\r | |
68 | fSDDhHits(qadm.fSDDhHits),\r | |
c71529b0 | 69 | fGenOffset(qadm.fGenOffset)\r |
8dc34e37 | 70 | {\r |
71 | //copy ctor \r | |
72 | fAliITSQADataMakerSim->SetName((const char*)qadm.fAliITSQADataMakerSim->GetName()) ; \r | |
73 | fAliITSQADataMakerSim->SetTitle((const char*)qadm.fAliITSQADataMakerSim->GetTitle());\r | |
74 | }\r | |
75 | \r | |
76 | //__________________________________________________________________\r | |
77 | AliITSQASDDDataMakerSim& AliITSQASDDDataMakerSim::operator = (const AliITSQASDDDataMakerSim& qac )\r | |
78 | {\r | |
79 | // Equal operator.\r | |
80 | this->~AliITSQASDDDataMakerSim();\r | |
81 | new(this) AliITSQASDDDataMakerSim(qac);\r | |
82 | return *this;\r | |
83 | }\r | |
84 | \r | |
85 | //____________________________________________________________________________ \r | |
86 | void AliITSQASDDDataMakerSim::StartOfDetectorCycle()\r | |
87 | {\r | |
88 | //Detector specific actions at start of cycle\r | |
89 | AliDebug(1,"AliITSQADM::Start of SDD Cycle\n");\r | |
90 | }\r | |
91 | \r | |
92 | //____________________________________________________________________________ \r | |
93 | void AliITSQASDDDataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t /*task*/, TObjArray* /*list*/)\r | |
94 | {\r | |
95 | // launch the QA checking\r | |
96 | AliDebug(1,"AliITSDM instantiates checker with Run(AliQA::kITS, task, list)\n"); \r | |
97 | //AliQAChecker::Instance()->Run( AliQA::kITS , task, list);\r | |
98 | }\r | |
99 | \r | |
100 | //____________________________________________________________________________ \r | |
101 | void AliITSQASDDDataMakerSim::InitDigits()\r | |
102 | { \r | |
c71529b0 | 103 | // Initialization for DIGIT data - SDD - \r |
104 | fGenOffset = (fAliITSQADataMakerSim->fDigitsQAList)->GetEntries();\r | |
8dc34e37 | 105 | //fSDDhDigits must be incremented by one unit every time a histogram is ADDED to the QA List\r |
8dc34e37 | 106 | TH1F* h0=new TH1F("SDD DIGITS Module Pattern","SDD DIGITS Module Pattern",260,239.5,499.5); //hmod\r |
107 | h0->GetXaxis()->SetTitle("SDD Module Number");\r | |
108 | h0->GetYaxis()->SetTitle("# DIGITS");\r | |
c71529b0 | 109 | fAliITSQADataMakerSim->Add2DigitsList(h0,fGenOffset);\r |
8dc34e37 | 110 | fSDDhDigits ++;\r |
111 | TH1F* h1=new TH1F("SDD Anode Distribution","DIGITS Anode Distribution",512,-0.5,511.5); //hanocc\r | |
112 | h1->GetXaxis()->SetTitle("Anode Number");\r | |
113 | h1->GetYaxis()->SetTitle("# DIGITS");\r | |
c71529b0 | 114 | fAliITSQADataMakerSim->Add2DigitsList(h1,1+fGenOffset);\r |
8dc34e37 | 115 | fSDDhDigits ++;\r |
116 | TH1F* h2=new TH1F("SDD Tbin Distribution","DIGITS Tbin Distribution",256,-0.5,255.5); //htbocc\r | |
117 | h2->GetXaxis()->SetTitle("Tbin Number");\r | |
118 | h2->GetYaxis()->SetTitle("# DIGITS");\r | |
c71529b0 | 119 | fAliITSQADataMakerSim->Add2DigitsList(h2,2+fGenOffset);\r |
8dc34e37 | 120 | fSDDhDigits ++;\r |
121 | TH1F* h3=new TH1F("SDD ADC Counts Distribution","DIGITS ADC Counts Distribution",200,0.,1024.); //hsig\r | |
122 | h3->GetXaxis()->SetTitle("ADC Value");\r | |
123 | h3->GetYaxis()->SetTitle("# DIGITS");\r | |
c71529b0 | 124 | fAliITSQADataMakerSim->Add2DigitsList(h3,3+fGenOffset);\r |
8dc34e37 | 125 | fSDDhDigits ++;\r |
126 | AliDebug(1,Form("%d SDD Digits histograms booked\n",fSDDhDigits));\r | |
127 | }\r | |
128 | \r | |
129 | //____________________________________________________________________________\r | |
130 | void AliITSQASDDDataMakerSim::MakeDigits(TTree * digits)\r | |
131 | { \r | |
132 | // Fill QA for DIGIT - SDD -\r | |
6f5308d9 | 133 | // printf("AliITSQASDDDataMakerSim::MakeDigits called \n");\r |
8dc34e37 | 134 | AliITS *fITS = (AliITS*)gAlice->GetModule("ITS");\r |
135 | fITS->SetTreeAddress();\r | |
136 | TClonesArray *iITSdigits = fITS->DigitsAddress(1);\r | |
137 | for(Int_t i=0; i<260; i++){\r | |
138 | Int_t nmod=i+240;\r | |
139 | digits->GetEvent(nmod);\r | |
140 | Int_t ndigits = iITSdigits->GetEntries();\r | |
c71529b0 | 141 | fAliITSQADataMakerSim->GetDigitsData(fGenOffset)->Fill(nmod,ndigits);\r |
8dc34e37 | 142 | for (Int_t idig=0; idig<ndigits; idig++) {\r |
143 | AliITSdigit *dig=(AliITSdigit*)iITSdigits->UncheckedAt(idig);\r | |
144 | Int_t iz=dig->GetCoord1(); // cell number z\r | |
145 | Int_t ix=dig->GetCoord2(); // cell number x\r | |
146 | Int_t sig=dig->GetSignal();\r | |
c71529b0 | 147 | fAliITSQADataMakerSim->GetDigitsData(1+fGenOffset)->Fill(iz);\r |
148 | fAliITSQADataMakerSim->GetDigitsData(2+fGenOffset)->Fill(ix);\r | |
149 | fAliITSQADataMakerSim->GetDigitsData(3+fGenOffset)->Fill(sig);\r | |
8dc34e37 | 150 | }\r |
151 | }\r | |
152 | }\r | |
153 | \r | |
154 | //____________________________________________________________________________ \r | |
155 | void AliITSQASDDDataMakerSim::InitSDigits()\r | |
156 | { \r | |
157 | // Initialization for SDIGIT data - SDD -\r | |
c71529b0 | 158 | fGenOffset = (fAliITSQADataMakerSim->fSDigitsQAList)->GetEntries();\r |
8dc34e37 | 159 | //fSDDhSDigits must be incremented by one unit every time a histogram is ADDED to the QA List\r |
160 | TH1F* h0=new TH1F("SDD SDIGITS Module Pattern","SDIGITS SDD Module Pattern",260,239.5,499.5); //hmod\r | |
161 | h0->GetXaxis()->SetTitle("SDD Module Number");\r | |
162 | h0->GetYaxis()->SetTitle("# SDIGITS");\r | |
c71529b0 | 163 | fAliITSQADataMakerSim->Add2SDigitsList(h0,fGenOffset);\r |
8dc34e37 | 164 | fSDDhSDigits ++;\r |
165 | TH1F* h1=new TH1F("SDD Anode Distribution","SDIGITS Anode Distribution",512,-0.5,511.5); //hanocc\r | |
166 | h1->GetXaxis()->SetTitle("Anode Number");\r | |
167 | h1->GetYaxis()->SetTitle("# SDIGITS");\r | |
c71529b0 | 168 | fAliITSQADataMakerSim->Add2SDigitsList(h1,1+fGenOffset);\r |
8dc34e37 | 169 | fSDDhSDigits ++;\r |
170 | TH1F* h2=new TH1F("SDD Tbin Distribution","SDIGITS Tbin Distribution",256,-0.5,255.5); //htbocc\r | |
171 | h2->GetXaxis()->SetTitle("Tbin Number");\r | |
172 | h2->GetYaxis()->SetTitle("# SDIGITS");\r | |
c71529b0 | 173 | fAliITSQADataMakerSim->Add2SDigitsList(h2,2+fGenOffset);\r |
8dc34e37 | 174 | fSDDhSDigits ++;\r |
175 | TH1F* h3=new TH1F("SDD ADC Counts Distribution","SDIGITS ADC Counts Distribution",200,0.,1024.); //hsig\r | |
176 | h3->GetXaxis()->SetTitle("ADC Value");\r | |
177 | h3->GetYaxis()->SetTitle("# SDIGITS");\r | |
c71529b0 | 178 | fAliITSQADataMakerSim->Add2SDigitsList(h3,3+fGenOffset);\r |
8dc34e37 | 179 | fSDDhSDigits ++;\r |
180 | \r | |
181 | AliDebug(1,Form("%d SDD SDigits histograms booked\n",fSDDhSDigits));\r | |
182 | }\r | |
183 | \r | |
184 | //____________________________________________________________________________\r | |
185 | void AliITSQASDDDataMakerSim::MakeSDigits(TTree * sdigits)\r | |
186 | { \r | |
187 | // Fill QA for SDIGIT - SDD -\r | |
6f5308d9 | 188 | // printf("AliITSQASDDDataMakerSim::MakeSDigits called \n");\r |
8dc34e37 | 189 | AliITSsegmentationSDD* seg = new AliITSsegmentationSDD();\r |
190 | Int_t nan=seg->Npz();\r | |
191 | Int_t ntb=seg->Npx();\r | |
192 | Int_t scaleSize=4;\r | |
193 | AliITSpList* list=new AliITSpList(nan,ntb*scaleSize);\r | |
194 | \r | |
195 | //AliITS *fITS = (AliITS*)gAlice->GetModule("ITS");\r | |
196 | //fITS->SetTreeAddress();\r | |
197 | //TClonesArray *ITSdigits = fITS->DigitsAddress(1);\r | |
198 | //TFile *sper = new TFile("sper.root","CREATE"); //agginto a mano x prova\r | |
199 | //digits->Write();\r | |
200 | //sper->Close();\r | |
201 | \r | |
202 | \r | |
203 | TBranch *brchSDigits = sdigits->GetBranch("ITS");\r | |
204 | for(Int_t id=0; id<260; id++){\r | |
205 | Int_t nmod=id+240;\r | |
206 | TClonesArray * sdig = new TClonesArray( "AliITSpListItem",1000 );\r | |
207 | brchSDigits->SetAddress( &sdig );\r | |
208 | brchSDigits->GetEvent(nmod);\r | |
209 | Int_t nsdig=sdig->GetEntries();\r | |
c71529b0 | 210 | fAliITSQADataMakerSim->GetSDigitsData(fGenOffset)->Fill(nmod,nsdig);\r |
8dc34e37 | 211 | for(Int_t i=0;i<nsdig;i++){\r |
212 | AliITSpListItem *cell=(AliITSpListItem*)sdig->At(i);\r | |
213 | Float_t sig=cell->GetSignal();\r | |
214 | Int_t idx=cell->GetIndex();\r | |
215 | Int_t ia,it;\r | |
216 | list->GetCell(idx,ia,it);\r | |
c71529b0 | 217 | fAliITSQADataMakerSim->GetSDigitsData(1+fGenOffset)->Fill(ia);\r |
218 | fAliITSQADataMakerSim->GetSDigitsData(2+fGenOffset)->Fill(it);\r | |
219 | fAliITSQADataMakerSim->GetSDigitsData(3+fGenOffset)->Fill(sig);\r | |
8dc34e37 | 220 | }\r |
221 | delete sdig;\r | |
222 | }\r | |
223 | }\r | |
224 | \r | |
225 | //____________________________________________________________________________ \r | |
226 | void AliITSQASDDDataMakerSim::InitHits()\r | |
227 | { \r | |
228 | // Initialization for HITS data - SDD -\r | |
c71529b0 | 229 | fGenOffset = (fAliITSQADataMakerSim->fHitsQAList)->GetEntries();\r |
8dc34e37 | 230 | //fSDDhHits must be incremented by one unit every time a histogram is ADDED to the QA List\r |
231 | //printf("AliITSQASDDDataMakerSim::InitHits called \n");\r | |
232 | TH1F *h0=new TH1F("SDD HITS Module Pattern","SDD HITS Module Pattern",260,239.5,499.5); \r | |
233 | h0->GetXaxis()->SetTitle("SDD Module Number");\r | |
234 | h0->GetYaxis()->SetTitle("# HITS");\r | |
c71529b0 | 235 | fAliITSQADataMakerSim->Add2HitsList(h0,fGenOffset);\r |
8dc34e37 | 236 | fSDDhHits ++;\r |
237 | TH1F *h1=new TH1F("SDD HIT lenght along local Y Coord","HIT lenght along local Y Coord",200,0.,350.);\r | |
238 | h1->GetXaxis()->SetTitle("HIT lenght (um)");\r | |
239 | h1->GetYaxis()->SetTitle("# HITS");\r | |
c71529b0 | 240 | fAliITSQADataMakerSim->Add2HitsList(h1,1+fGenOffset);\r |
8dc34e37 | 241 | fSDDhHits ++;\r |
242 | TH1F *h2=new TH1F("SDD HIT lenght along local Y Coord - Zoom","SDD HIT lenght along local Y Coord - Zoom",200,250.,350.);\r | |
243 | h2->GetXaxis()->SetTitle("HIT lenght (um)");\r | |
244 | h2->GetYaxis()->SetTitle("# HITS");\r | |
c71529b0 | 245 | fAliITSQADataMakerSim->Add2HitsList(h2,2+fGenOffset);\r |
8dc34e37 | 246 | fSDDhHits ++;\r |
247 | TH1F *h3=new TH1F("SDD Deposited Energy Distribution (loc Y > 200um)","SDD HITS Deposited Energy Distribution (loc Y > 200um)",200,0.,350.);\r | |
248 | h3->GetXaxis()->SetTitle("ADC counts???");\r | |
249 | h3->GetYaxis()->SetTitle("# HITS");\r | |
c71529b0 | 250 | fAliITSQADataMakerSim->Add2HitsList(h3,3+fGenOffset);\r |
8dc34e37 | 251 | fSDDhHits ++;\r |
252 | //printf("%d SDD Hits histograms booked\n",fSDDhHits);\r | |
253 | AliDebug(1,Form("%d SDD Hits histograms booked\n",fSDDhHits));\r | |
254 | }\r | |
255 | \r | |
256 | //____________________________________________________________________________\r | |
257 | void AliITSQASDDDataMakerSim::MakeHits(TTree * hits)\r | |
258 | { \r | |
259 | // Fill QA for HITS - SDD -\r | |
260 | //printf("AliITSQASDDDataMakerSim::MakeHits called \n");\r | |
261 | AliITS *fITS = (AliITS*)gAlice->GetModule("ITS");\r | |
262 | fITS->SetTreeAddress();\r | |
263 | Int_t nmodules;\r | |
6f5308d9 | 264 | if(!(fITS->InitModules(-1,nmodules))){\r |
265 | AliError("ITS geometry not available - nothing done");\r | |
266 | return;\r | |
267 | }\r | |
8dc34e37 | 268 | \r |
269 | fITS->FillModules(hits,0);\r | |
270 | \r | |
271 | for(Int_t i=0; i<260; i++){\r | |
272 | Int_t nmod=i+240;\r | |
273 | AliITSmodule *modu = fITS->GetModule(nmod);\r | |
274 | TObjArray *arrHits = modu->GetHits();\r | |
275 | Int_t nhits = arrHits->GetEntriesFast();\r | |
276 | //printf("--w--AliITSQASDDDataMakerSim::MakeHits nhits = %d\n",nhits);\r | |
277 | for (Int_t iHit=0;iHit<nhits;iHit++) {\r | |
278 | AliITShit *hit = (AliITShit*) arrHits->At(iHit);\r | |
c71529b0 | 279 | fAliITSQADataMakerSim->GetHitsData(fGenOffset)->Fill(nmod);\r |
8dc34e37 | 280 | Double_t xl,yl,zl,xl0,yl0,zl0;\r |
281 | Double_t tof,tof0;\r | |
282 | hit->GetPositionL(xl,yl,zl,tof);\r | |
283 | hit->GetPositionL0(xl0,yl0,zl0,tof0);\r | |
284 | Float_t dyloc=TMath::Abs(yl-yl0)*10000.;\r | |
c71529b0 | 285 | fAliITSQADataMakerSim->GetHitsData(1+fGenOffset)->Fill(dyloc);\r |
8dc34e37 | 286 | Float_t edep=hit->GetIonization()*1000000;\r |
287 | if(dyloc>200.){ \r | |
c71529b0 | 288 | fAliITSQADataMakerSim->GetHitsData(2+fGenOffset)->Fill(edep);\r |
289 | fAliITSQADataMakerSim->GetHitsData(3+fGenOffset)->Fill(dyloc);\r | |
8dc34e37 | 290 | }\r |
291 | }\r | |
292 | }\r | |
293 | }\r |