]>
Commit | Line | Data |
---|---|---|
1 | /**************************************************************************\r | |
2 | * Copyright(c) 1998-1999, 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 | |
16 | // --- Standard library ---\r | |
17 | #include <Riostream.h>\r | |
18 | // --- ROOT system ---\r | |
19 | #include <TClonesArray.h>\r | |
20 | #include <TFile.h> \r | |
21 | #include <TH1F.h> \r | |
22 | #include <TH2F.h>\r | |
23 | #include <TBranch.h>\r | |
24 | #include <TTree.h>\r | |
25 | // --- AliRoot header files ---\r | |
26 | #include "AliLog.h"\r | |
27 | #include "AliQAChecker.h"\r | |
28 | #include "AliZDCQADataMakerSim.h"\r | |
29 | #include "AliZDCHit.h"\r | |
30 | #include "AliZDCDigit.h"\r | |
31 | #include "AliZDCRawStream.h"\r | |
32 | \r | |
33 | ClassImp(AliZDCQADataMakerSim)\r | |
34 | \r | |
35 | //____________________________________________________________________________ \r | |
36 | AliZDCQADataMakerSim::AliZDCQADataMakerSim() : \r | |
37 | AliQADataMakerSim(AliQA::GetDetName(AliQA::kZDC), "ZDC Quality Assurance Data Maker"),\r | |
38 | fHits(0),\r | |
39 | fDigit(0)\r | |
40 | {\r | |
41 | // ctor\r | |
42 | }\r | |
43 | \r | |
44 | //____________________________________________________________________________ \r | |
45 | AliZDCQADataMakerSim::AliZDCQADataMakerSim(const AliZDCQADataMakerSim& qadm) :\r | |
46 | AliQADataMakerSim(), \r | |
47 | fHits(0),\r | |
48 | fDigit(0) \r | |
49 | {\r | |
50 | //copy ctor \r | |
51 | SetName((const char*)qadm.GetName()); \r | |
52 | SetTitle((const char*)qadm.GetTitle()); \r | |
53 | }\r | |
54 | \r | |
55 | //__________________________________________________________________\r | |
56 | AliZDCQADataMakerSim& AliZDCQADataMakerSim::operator = (const AliZDCQADataMakerSim& qadm )\r | |
57 | {\r | |
58 | // Equal operator.\r | |
59 | this->~AliZDCQADataMakerSim();\r | |
60 | new(this) AliZDCQADataMakerSim(qadm);\r | |
61 | return *this;\r | |
62 | }\r | |
63 | \r | |
64 | //____________________________________________________________________________ \r | |
65 | void AliZDCQADataMakerSim::InitHits()\r | |
66 | {\r | |
67 | // create Hits histograms in Hits subdir\r | |
68 | //\r | |
69 | TH2F * hZNCh = new TH2F("hZNCh", "Hits centroid in ZNC", 100, -5.,5.,100,-5.,5.);\r | |
70 | TH2F * hZNAh = new TH2F("hZNAh", "Hits centroid in ZNA", 100, -5.,5.,100,-5.,5.);\r | |
71 | // NB -> For the moment no check is performesd on ZP centroids\r | |
72 | // TH2F * hZPCh = new TH2F("hZPCh", "Hits centroid in ZPC", 100,-12.,12.,100,-12.,12.); \r | |
73 | // TH2F * hZPAh = new TH2F("hZPAh", "Hits centroid in ZPA", 100,-12.,12.,100,-12.,12.); \r | |
74 | Add2HitsList(hZNCh, 0);\r | |
75 | Add2HitsList(hZNAh, 1);\r | |
76 | // Add2HitsList(hZPCh, 2);\r | |
77 | // Add2HitsList(hZPAh, 3);\r | |
78 | }\r | |
79 | \r | |
80 | \r | |
81 | //____________________________________________________________________________ \r | |
82 | void AliZDCQADataMakerSim::InitDigits()\r | |
83 | {\r | |
84 | // create Digits histograms in Digits subdir\r | |
85 | //\r | |
86 | // ------------------- HIGH GAIN CHAIN ---------------------------\r | |
87 | TH1F * hDigZNCTot = new TH1F("hDigZNCTot", "Signal in ZNC", 100, 0., 6000.);\r | |
88 | TH1F * hDigZNATot = new TH1F("hDigZNATot", "Signal in ZNA", 100, 0., 6000.);\r | |
89 | TH1F * hDigZPCTot = new TH1F("hDigZPCTot", "Signal in ZPC", 100, 0., 6000.);\r | |
90 | TH1F * hDigZPATot = new TH1F("hDigZPATot", "Signal in ZPA", 100, 0., 6000.);\r | |
91 | Add2DigitsList(hDigZNCTot, 0);\r | |
92 | Add2DigitsList(hDigZNATot, 1);\r | |
93 | Add2DigitsList(hDigZPCTot, 2);\r | |
94 | Add2DigitsList(hDigZPATot, 3);\r | |
95 | //\r | |
96 | TH1F * hDigSumQZNC = new TH1F("hDigSumQZNC", "Signal in 4 ZNC PMQ",100, 0., 4000.);\r | |
97 | TH1F * hDigSumQZNA = new TH1F("hDigSumQZNA", "Signal in 4 ZNA PMQ",100, 0., 4000.);\r | |
98 | TH1F * hDigSumQZPC = new TH1F("hDigSumQZPC", "Signal in 4 ZPC PMQ",100, 0., 4000.);\r | |
99 | TH1F * hDigSumQZPA = new TH1F("hDigSumQZPA", "Signal in 4 ZPA PMQ",100, 0., 4000.);\r | |
100 | Add2DigitsList(hDigSumQZNC, 4, kTRUE);\r | |
101 | Add2DigitsList(hDigSumQZNA, 5, kTRUE);\r | |
102 | Add2DigitsList(hDigSumQZPC, 6, kTRUE);\r | |
103 | Add2DigitsList(hDigSumQZPA, 7, kTRUE);\r | |
104 | //\r | |
105 | TH1F * hDigPMCZNC = new TH1F("hDigPMCZNC", "Signal in ZNC PMC",100, 0., 4000.);\r | |
106 | TH1F * hDigPMCZNA = new TH1F("hDigPMCZNA", "Signal in ZNA PMC",100, 0., 4000.);\r | |
107 | TH1F * hDigPMCZPC = new TH1F("hDigPMCZPC", "Signal in ZPC PMC",100, 0., 4000.);\r | |
108 | TH1F * hDigPMCZPA = new TH1F("hDigPMCZPA", "Signal in ZPA PMC",100, 0., 4000.);\r | |
109 | Add2DigitsList(hDigPMCZNC, 8, kTRUE);\r | |
110 | Add2DigitsList(hDigPMCZNA, 9, kTRUE);\r | |
111 | Add2DigitsList(hDigPMCZPC, 10, kTRUE);\r | |
112 | Add2DigitsList(hDigPMCZPA, 11, kTRUE);\r | |
113 | // \r | |
114 | // ------------------- LOW GAIN CHAIN ---------------------------\r | |
115 | /* TH1F * hDigZNCTotlg = new TH1F("hDigZNCTotlg", "Digit lg signal in ZNC", 100, 0., 6000.);\r | |
116 | TH1F * hDigZNATotlg = new TH1F("hDigZNATotlg", "Digit lg signal in ZNA", 100, 0., 6000.);\r | |
117 | TH1F * hDigZPCTotlg = new TH1F("hDigZPCTotlg", "Digit lg signal in ZPC", 100, 0., 6000.);\r | |
118 | TH1F * hDigZPATotlg = new TH1F("hDigZPATotlg", "Digit lg signal in ZPA", 100, 0., 6000.);\r | |
119 | Add2DigitsList(hDigZNCTotlg, 12);\r | |
120 | Add2DigitsList(hDigZNATotlg, 13);\r | |
121 | Add2DigitsList(hDigZPCTotlg, 14);\r | |
122 | Add2DigitsList(hDigZPATotlg, 15);\r | |
123 | //\r | |
124 | TH1F * hDigSumQZNClg = new TH1F("hDigSumQZNClg", "Signal in 4 ZNC PMQlg",100, 0., 4000.);\r | |
125 | TH1F * hDigSumQZNAlg = new TH1F("hDigSumQZNAlg", "Signal in 4 ZNA PMQlg",100, 0., 4000.);\r | |
126 | TH1F * hDigSumQZPClg = new TH1F("hDigSumQZPClg", "Signal in 4 ZPC PMQlg",100, 0., 4000.);\r | |
127 | TH1F * hDigSumQZPAlg = new TH1F("hDigSumQZPAlg", "Signal in 4 ZPA PMQlg",100, 0., 4000.);\r | |
128 | Add2DigitsList(hDigSumQZNClg, 16, kTRUE);\r | |
129 | Add2DigitsList(hDigSumQZNAlg, 17, kTRUE);\r | |
130 | Add2DigitsList(hDigSumQZPClg, 18, kTRUE);\r | |
131 | Add2DigitsList(hDigSumQZPAlg, 19, kTRUE);\r | |
132 | //\r | |
133 | TH1F * hDigPMCZNClg = new TH1F("hDigPMCZNClg", "Signal in ZNC PMClg",100, 0., 4000.);\r | |
134 | TH1F * hDigPMCZNAlg = new TH1F("hDigPMCZNAlg", "Signal in ZNA PMClg",100, 0., 4000.);\r | |
135 | TH1F * hDigPMCZPClg = new TH1F("hDigPMCZPClg", "Signal in ZPC PMClg",100, 0., 4000.);\r | |
136 | TH1F * hDigPMCZPAlg = new TH1F("hDigPMCZPAlg", "Signal in ZPA PMClg",100, 0., 4000.);\r | |
137 | Add2DigitsList(hDigPMCZNClg, 20, kTRUE);\r | |
138 | Add2DigitsList(hDigPMCZNAlg, 21, kTRUE);\r | |
139 | Add2DigitsList(hDigPMCZPClg, 22, kTRUE);\r | |
140 | Add2DigitsList(hDigPMCZPAlg, 23, kTRUE);\r | |
141 | */\r | |
142 | }\r | |
143 | \r | |
144 | //____________________________________________________________________________\r | |
145 | void AliZDCQADataMakerSim::MakeHits(TClonesArray * /*data*/)\r | |
146 | {\r | |
147 | //filling QA histos for Hits\r | |
148 | //\r | |
149 | TIter next(fHits); \r | |
150 | AliZDCHit * hit; \r | |
151 | while((hit = dynamic_cast<AliZDCHit *>(next()))){\r | |
152 | if(hit->GetVolume(0)==1) GetHitsData(0)->Fill(hit->GetXImpact(),hit->GetYImpact());\r | |
153 | else if(hit->GetVolume(0)==4) GetHitsData(1)->Fill(hit->GetXImpact(), hit->GetYImpact());\r | |
154 | // else if(hit->GetVolume(0)==2) GetHitsData(1)->Fill(hit->GetXImpact(), hit->GetYImpact());\r | |
155 | // else if(hit->GetVolume(0)==5) GetHitsData(3)->Fill(hit->GetXImpact(), hit->GetYImpact());\r | |
156 | }\r | |
157 | }\r | |
158 | \r | |
159 | //___________________________________________________________________________\r | |
160 | void AliZDCQADataMakerSim::MakeHits(TTree * hitTree)\r | |
161 | {\r | |
162 | // make QA data from Hit Tree\r | |
163 | //\r | |
164 | if(!hitTree){\r | |
165 | AliError("Hit Tree not found!"); \r | |
166 | return;\r | |
167 | }\r | |
168 | //\r | |
169 | \r | |
170 | TBranch * branch = hitTree->GetBranch("ZDC") ;\r | |
171 | \r | |
172 | if(!branch){\r | |
173 | AliError("ZDC branch in Hit Tree not found!"); \r | |
174 | return;\r | |
175 | } \r | |
176 | else{\r | |
177 | char** add = (char**) (branch->GetAddress());\r | |
178 | if(add){\r | |
179 | fHits = (TClonesArray*)(*add);\r | |
180 | } \r | |
181 | else{\r | |
182 | if(!fHits) fHits = new TClonesArray("AliZDCHit", 1000);\r | |
183 | branch->SetAddress(&fHits);\r | |
184 | }\r | |
185 | Int_t ntracks = (Int_t) hitTree->GetEntries();\r | |
186 | //printf("\n\t *** no.track %d\n",ntracks);\r | |
187 | if (ntracks<=0) return;\r | |
188 | //\r | |
189 | for(Int_t itrack=0; itrack<ntracks; itrack++){\r | |
190 | \r | |
191 | branch->GetEntry(itrack);\r | |
192 | //\r | |
193 | //printf("\t *** track %d",itrack);\r | |
194 | //hits->Print("");\r | |
195 | //printf("\n");\r | |
196 | //\r | |
197 | MakeHits(); \r | |
198 | fHits->Clear();\r | |
199 | } \r | |
200 | }\r | |
201 | }\r | |
202 | \r | |
203 | //___________________________________________________________________________\r | |
204 | void AliZDCQADataMakerSim::MakeDigits(TTree *digitTree )\r | |
205 | {\r | |
206 | // makes data from Digit Tree\r | |
207 | TBranch * branch = digitTree->GetBranch("ZDC");\r | |
208 | if(!branch){\r | |
209 | AliError("ZDC branch in Digit Tree not found"); \r | |
210 | return;\r | |
211 | } \r | |
212 | char** add = (char**) (branch->GetAddress());\r | |
213 | if(add){\r | |
214 | fDigit = (AliZDCDigit*)(*add);\r | |
215 | } \r | |
216 | else{\r | |
217 | if(!fDigit) fDigit = new AliZDCDigit();\r | |
218 | branch->SetAddress(&fDigit);\r | |
219 | }\r | |
220 | \r | |
221 | Int_t ndig = digitTree->GetEntries();\r | |
222 | \r | |
223 | Float_t adcSum_ZNC=0., adcSum_ZNA=0., adcSum_ZPC=0., adcSum_ZPA=0.;\r | |
224 | Float_t adcSumQ_ZNC=0., adcSumQ_ZNA=0., adcSumQ_ZPC=0., adcSumQ_ZPA=0.;\r | |
225 | //Float_t adcSum_ZNC_lg=0., adcSum_ZNA_lg=0., adcSum_ZPC_lg=0., adcSum_ZPA_lg=0.;\r | |
226 | //Float_t adcSumQ_ZNC_lg=0., adcSumQ_ZNA_lg=0., adcSumQ_ZPC_lg=0., adcSumQ_ZPA_lg=0.;\r | |
227 | //\r | |
228 | for(Int_t i = 0; i < ndig; i++){\r | |
229 | digitTree->GetEntry(i);\r | |
230 | if(fDigit->GetSector(0)==1){\r | |
231 | adcSum_ZNC += fDigit->GetADCValue(0);\r | |
232 | //adcSum_ZNC_lg += fDigit->GetADCValue(1);\r | |
233 | //\r | |
234 | if(fDigit->GetSector(1)!=0){\r | |
235 | adcSumQ_ZNC += fDigit->GetADCValue(0);\r | |
236 | //adcSumQ_ZNC_lg+= fDigit->GetADCValue(1);\r | |
237 | }\r | |
238 | else{\r | |
239 | GetDigitsData(8)->Fill(fDigit->GetADCValue(0));\r | |
240 | //GetDigitsData(20)->Fill(fDigit->GetADCValue(1));\r | |
241 | }\r | |
242 | }\r | |
243 | else if(fDigit->GetSector(0)==2){\r | |
244 | adcSum_ZPC += fDigit->GetADCValue(0);\r | |
245 | //adcSum_ZPC_lg += fDigit->GetADCValue(1);\r | |
246 | //\r | |
247 | if(fDigit->GetSector(1)!=0){\r | |
248 | adcSumQ_ZPC += fDigit->GetADCValue(0);\r | |
249 | //adcSumQ_ZPC_lg+= fDigit->GetADCValue(1);\r | |
250 | }\r | |
251 | else{\r | |
252 | GetDigitsData(10)->Fill(fDigit->GetADCValue(0));\r | |
253 | //GetDigitsData(22)->Fill(fDigit->GetADCValue(1));\r | |
254 | }\r | |
255 | }\r | |
256 | else if(fDigit->GetSector(0)==4){\r | |
257 | adcSum_ZNA += fDigit->GetADCValue(0);\r | |
258 | //adcSum_ZNA_lg += fDigit->GetADCValue(1);\r | |
259 | //\r | |
260 | if(fDigit->GetSector(1)!=0){\r | |
261 | adcSumQ_ZNA += fDigit->GetADCValue(0);\r | |
262 | //adcSumQ_ZNA_lg+= fDigit->GetADCValue(1);\r | |
263 | }\r | |
264 | else{\r | |
265 | GetDigitsData(9)->Fill(fDigit->GetADCValue(0));\r | |
266 | //GetDigitsData(21)->Fill(fDigit->GetADCValue(1));\r | |
267 | }\r | |
268 | }\r | |
269 | else if(fDigit->GetSector(0)==5){\r | |
270 | adcSum_ZPA += fDigit->GetADCValue(0);\r | |
271 | //adcSum_ZPA_lg += fDigit->GetADCValue(1);\r | |
272 | //\r | |
273 | if(fDigit->GetSector(1)!=0){\r | |
274 | adcSumQ_ZPA += fDigit->GetADCValue(0);\r | |
275 | //adcSumQ_ZPA_lg+= fDigit->GetADCValue(1);\r | |
276 | }\r | |
277 | else{\r | |
278 | GetDigitsData(11)->Fill(fDigit->GetADCValue(0));\r | |
279 | //GetDigitsData(23)->Fill(fDigit->GetADCValue(1));\r | |
280 | }\r | |
281 | }\r | |
282 | }\r | |
283 | //\r | |
284 | GetDigitsData(0)->Fill(adcSum_ZNC);\r | |
285 | GetDigitsData(1)->Fill(adcSum_ZNA);\r | |
286 | GetDigitsData(2)->Fill(adcSum_ZPC);\r | |
287 | GetDigitsData(3)->Fill(adcSum_ZPA);\r | |
288 | //\r | |
289 | GetDigitsData(4)->Fill(adcSumQ_ZNC);\r | |
290 | GetDigitsData(5)->Fill(adcSumQ_ZNA);\r | |
291 | GetDigitsData(6)->Fill(adcSumQ_ZPC);\r | |
292 | GetDigitsData(7)->Fill(adcSumQ_ZPA);\r | |
293 | //\r | |
294 | /*GetDigitsData(12)->Fill(adcSum_ZNC_lg);\r | |
295 | GetDigitsData(13)->Fill(adcSum_ZNA_lg);\r | |
296 | GetDigitsData(14)->Fill(adcSum_ZPC_lg);\r | |
297 | GetDigitsData(15)->Fill(adcSum_ZPA_lg);\r | |
298 | //\r | |
299 | GetDigitsData(16)->Fill(adcSumQ_ZNC_lg);\r | |
300 | GetDigitsData(17)->Fill(adcSumQ_ZNA_lg);\r | |
301 | GetDigitsData(18)->Fill(adcSumQ_ZPC_lg);\r | |
302 | GetDigitsData(19)->Fill(adcSumQ_ZPA_lg);*/\r | |
303 | }\r | |
304 | \r | |
305 | //____________________________________________________________________________\r | |
306 | void AliZDCQADataMakerSim::StartOfDetectorCycle()\r | |
307 | {\r | |
308 | //Detector specific actions at start of cycle\r | |
309 | \r | |
310 | }\r | |
311 | \r | |
312 | //____________________________________________________________________________ \r | |
313 | void AliZDCQADataMakerSim::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray ** list)\r | |
314 | {\r | |
315 | // Detector specific actions at end of cycle\r | |
316 | // do the QA checking\r | |
317 | AliQAChecker::Instance()->Run(AliQA::kZDC, task, list); \r | |
318 | }\r |