]>
Commit | Line | Data |
---|---|---|
ddd1a39c | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, 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 | ||
17 | /* $Id$ */ | |
18 | ||
19 | /* | |
20 | Produces the data needed to calculate the quality assurance. | |
21 | All data must be mergeable objects. | |
22 | Y. Schutz CERN July 2007 | |
23 | */ | |
24 | ||
25 | // --- ROOT system --- | |
26 | #include <TClonesArray.h> | |
27 | #include <TFile.h> | |
28 | #include <TH1F.h> | |
29 | #include <TH1I.h> | |
30 | ||
31 | // --- Standard library --- | |
32 | ||
33 | // --- AliRoot header files --- | |
34 | #include "AliESDCaloCluster.h" | |
35 | #include "AliESDEvent.h" | |
36 | #include "AliLog.h" | |
37 | #include "AliPHOSDigit.h" | |
38 | #include "AliPHOSHit.h" | |
39 | #include "AliPHOSQualAssDataMaker.h" | |
40 | #include "AliPHOSCpvRecPoint.h" | |
41 | #include "AliPHOSEmcRecPoint.h" | |
42 | #include "AliPHOSRecParticle.h" | |
43 | #include "AliPHOSTrackSegment.h" | |
44 | ||
45 | ClassImp(AliPHOSQualAssDataMaker) | |
46 | ||
47 | //____________________________________________________________________________ | |
48 | AliPHOSQualAssDataMaker::AliPHOSQualAssDataMaker() : | |
117e9d0d | 49 | AliQualAssDataMaker(AliQualAss::GetDetName(AliQualAss::kPHOS), "PHOS Quality Assurance Data Maker") |
ddd1a39c | 50 | { |
51 | // ctor | |
ddd1a39c | 52 | } |
53 | ||
54 | //____________________________________________________________________________ | |
55 | AliPHOSQualAssDataMaker::AliPHOSQualAssDataMaker(const AliPHOSQualAssDataMaker& qadm) : | |
117e9d0d | 56 | AliQualAssDataMaker() |
ddd1a39c | 57 | { |
58 | //copy ctor | |
59 | SetName((const char*)qadm.GetName()) ; | |
60 | SetTitle((const char*)qadm.GetTitle()); | |
61 | } | |
62 | ||
63 | //__________________________________________________________________ | |
64 | AliPHOSQualAssDataMaker& AliPHOSQualAssDataMaker::operator = (const AliPHOSQualAssDataMaker& qadm ) | |
65 | { | |
66 | // Equal operator. | |
67 | this->~AliPHOSQualAssDataMaker(); | |
68 | new(this) AliPHOSQualAssDataMaker(qadm); | |
69 | return *this; | |
70 | } | |
71 | ||
5b188f2f | 72 | //____________________________________________________________________________ |
73 | void AliPHOSQualAssDataMaker::EndOfDetectorCycle() | |
74 | { | |
75 | //Detector specific actions at end of cycle | |
76 | } | |
77 | ||
ddd1a39c | 78 | //____________________________________________________________________________ |
79 | void AliPHOSQualAssDataMaker::InitESDs() | |
80 | { | |
81 | //create ESDs histograms in ESDs subdir | |
117e9d0d | 82 | TH1F * h0 = new TH1F("hPhosESDs", "ESDs energy distribution in PHOS", 100, 0., 100.) ; |
83 | h0->Sumw2() ; | |
84 | Add2ESDsList(h0, 0) ; | |
85 | TH1I * h1 = new TH1I("hPhosESDsMul", "ESDs multiplicity distribution in PHOS", 100, 0., 100) ; | |
86 | h1->Sumw2() ; | |
87 | Add2ESDsList(h1, 1) ; | |
ddd1a39c | 88 | } |
89 | ||
90 | //____________________________________________________________________________ | |
91 | void AliPHOSQualAssDataMaker::InitHits() | |
92 | { | |
93 | // create Hits histograms in Hits subdir | |
117e9d0d | 94 | TH1F * h0 = new TH1F("hPhosHits", "Hits energy distribution in PHOS", 100, 0., 100.) ; |
95 | h0->Sumw2() ; | |
96 | Add2HitsList(h0, 0) ; | |
97 | TH1I * h1 = new TH1I("hPhosHitsMul", "Hits multiplicity distribution in PHOS", 500, 0., 10000) ; | |
98 | h1->Sumw2() ; | |
99 | Add2HitsList(h1, 1) ; | |
ddd1a39c | 100 | } |
101 | ||
102 | //____________________________________________________________________________ | |
103 | void AliPHOSQualAssDataMaker::InitDigits() | |
104 | { | |
105 | // create Digits histograms in Digits subdir | |
117e9d0d | 106 | TH1I * h0 = new TH1I("hPhosDigits", "Digits amplitude distribution in PHOS", 500, 0, 5000) ; |
107 | h0->Sumw2() ; | |
108 | Add2DigitsList(h0, 0) ; | |
109 | TH1I * h1 = new TH1I("hPhosDigitsMul", "Digits multiplicity distribution in PHOS", 500, 0, 1000) ; | |
110 | h1->Sumw2() ; | |
111 | Add2DigitsList(h1, 0) ; | |
ddd1a39c | 112 | } |
113 | ||
114 | //____________________________________________________________________________ | |
117e9d0d | 115 | //void AliPHOSQualAssDataMaker::InitRecParticles() |
116 | //{ | |
117 | // // create Reconstructed particles histograms in RecParticles subdir | |
118 | // fhRecParticles = new TH1F("hPhosRecParticles", "RecParticles energy distribution in PHOS", 100, 0., 100.) ; | |
119 | // fhRecParticles->Sumw2() ; | |
120 | // fhRecParticlesMul = new TH1I("hPhosRecParticlesMul", "RecParticles multiplicity distribution in PHOS", 100, 0, 100) ; | |
121 | // fhRecParticlesMul->Sumw2() ; | |
122 | //} | |
ddd1a39c | 123 | |
124 | //____________________________________________________________________________ | |
125 | void AliPHOSQualAssDataMaker::InitRecPoints() | |
126 | { | |
127 | // create Reconstructed Points histograms in RecPoints subdir | |
117e9d0d | 128 | TH1F * h0 = new TH1F("hEmcPhosRecPoints", "EMCA RecPoints energy distribution in PHOS", 100, 0., 100.) ; |
129 | h0->Sumw2() ; | |
130 | Add2RecPointsList(h0, 0) ; | |
131 | TH1I * h1 = new TH1I("hEmcPhosRecPointsMul", "EMCA RecPoints multiplicity distribution in PHOS", 100, 0, 100) ; | |
132 | h1->Sumw2() ; | |
133 | Add2RecPointsList(h1, 1) ; | |
ddd1a39c | 134 | |
117e9d0d | 135 | TH1F * h2 = new TH1F("hCpvPhosRecPoints", "CPV RecPoints energy distribution in PHOS", 100, 0., 100.) ; |
136 | h2->Sumw2() ; | |
137 | Add2RecPointsList(h2, 2) ; | |
138 | TH1I * h3 = new TH1I("hCpvPhosRecPointsMul", "CPV RecPoints multiplicity distribution in PHOS", 100, 0, 100) ; | |
139 | h3->Sumw2() ; | |
140 | Add2RecPointsList(h3, 3) ; | |
ddd1a39c | 141 | } |
142 | ||
143 | //____________________________________________________________________________ | |
117e9d0d | 144 | void AliPHOSQualAssDataMaker::InitRaws() |
ddd1a39c | 145 | { |
117e9d0d | 146 | // create Raws histograms in Raws subdir |
147 | TH1F * h0 = new TH1F("hEmcPhosRaws", "EMCA Raws in PHOS", 100, 0., 100.) ; | |
148 | h0->Sumw2() ; | |
149 | Add2RawsList(h0, 0) ; | |
ddd1a39c | 150 | } |
151 | ||
152 | //____________________________________________________________________________ | |
117e9d0d | 153 | void AliPHOSQualAssDataMaker::InitSDigits() |
ddd1a39c | 154 | { |
117e9d0d | 155 | // create SDigits histograms in SDigits subdir |
156 | TH1F * h0 = new TH1F("hPhosSDigits", "SDigits energy distribution in PHOS", 100, 0., 100.) ; | |
157 | h0->Sumw2() ; | |
158 | Add2SDigitsList(h0, 0) ; | |
159 | TH1I * h1 = new TH1I("hPhosSDigitsMul", "SDigits multiplicity distribution in PHOS", 500, 0, 10000) ; | |
160 | h1->Sumw2() ; | |
161 | Add2SDigitsList(h1, 1) ; | |
ddd1a39c | 162 | } |
163 | ||
117e9d0d | 164 | //____________________________________________________________________________ |
165 | //void AliPHOSQualAssDataMaker::InitTrackSegments() | |
166 | //{ | |
167 | // // create Track Segments histograms in TrackSegments subdir | |
168 | // fhTrackSegments = new TH1F("hPhosTrackSegments", "TrackSegments EMC-CPV distance in PHOS", 500, 0., 5000.) ; | |
169 | // fhTrackSegments->Sumw2() ; | |
170 | // fhTrackSegmentsMul = new TH1I("hPhosTrackSegmentsMul", "TrackSegments multiplicity distribution in PHOS", 100, 0, 100) ; | |
171 | // fhTrackSegmentsMul->Sumw2() ; | |
172 | //} | |
173 | ||
ddd1a39c | 174 | //____________________________________________________________________________ |
d76c31f4 | 175 | void AliPHOSQualAssDataMaker::MakeESDs(AliESDEvent * esd) |
ddd1a39c | 176 | { |
177 | // make QA data from ESDs | |
178 | ||
ddd1a39c | 179 | Int_t maxClu = esd->GetNumberOfPHOSClusters() ; |
180 | Int_t index = 0, count = 0 ; | |
181 | for ( index = 0 ; index < maxClu; index++ ) { | |
182 | AliESDCaloCluster * clu = esd->GetCaloCluster(index) ; | |
117e9d0d | 183 | GetESDsData(0)->Fill(clu->E()) ; |
ddd1a39c | 184 | count++ ; |
185 | } | |
117e9d0d | 186 | GetESDsData(1)->Fill(count) ; |
ddd1a39c | 187 | } |
188 | ||
189 | //____________________________________________________________________________ | |
d76c31f4 | 190 | void AliPHOSQualAssDataMaker::MakeHits(TObject * data) |
ddd1a39c | 191 | { |
192 | //make QA data from Hits | |
193 | ||
d76c31f4 | 194 | TClonesArray * hits = dynamic_cast<TClonesArray *>(data) ; |
195 | if (!hits) { | |
196 | AliError("Wrong type of hits container") ; | |
197 | } else { | |
117e9d0d | 198 | GetHitsData(1)->Fill(hits->GetEntriesFast()) ; |
d76c31f4 | 199 | TIter next(hits) ; |
200 | AliPHOSHit * hit ; | |
201 | while ( (hit = dynamic_cast<AliPHOSHit *>(next())) ) { | |
117e9d0d | 202 | GetHitsData(0)->Fill( hit->GetEnergy()) ; |
d76c31f4 | 203 | } |
204 | } | |
205 | } | |
ddd1a39c | 206 | //____________________________________________________________________________ |
d76c31f4 | 207 | void AliPHOSQualAssDataMaker::MakeDigits(TObject * data) |
ddd1a39c | 208 | { |
209 | // makes data from Digits | |
210 | ||
d76c31f4 | 211 | TClonesArray * digits = dynamic_cast<TClonesArray *>(data) ; |
212 | if (!digits) { | |
213 | AliError("Wrong type of digits container") ; | |
214 | } else { | |
117e9d0d | 215 | GetDigitsData(1)->Fill(digits->GetEntriesFast()) ; |
d76c31f4 | 216 | TIter next(digits) ; |
217 | AliPHOSDigit * digit ; | |
218 | while ( (digit = dynamic_cast<AliPHOSDigit *>(next())) ) { | |
117e9d0d | 219 | GetDigitsData(0)->Fill( digit->GetEnergy()) ; |
d76c31f4 | 220 | } |
221 | } | |
ddd1a39c | 222 | } |
223 | ||
224 | //____________________________________________________________________________ | |
d76c31f4 | 225 | // void AliPHOSQualAssDataMaker::MakeRecParticles(TTree * recpar) |
226 | // { | |
227 | // // makes data from RecParticles | |
ddd1a39c | 228 | |
d76c31f4 | 229 | // TClonesArray * recparticles = dynamic_cast<TClonesArray*>(fData) ; |
230 | // fhRecParticlesMul->Fill(recparticles->GetEntriesFast()) ; | |
231 | // TIter next(recparticles) ; | |
232 | // AliPHOSRecParticle * recparticle ; | |
233 | // while ( (recparticle = dynamic_cast<AliPHOSRecParticle *>(next())) ) { | |
234 | // fhRecParticles->Fill( recparticle->Energy()) ; | |
235 | // } | |
236 | // } | |
ddd1a39c | 237 | |
117e9d0d | 238 | //____________________________________________________________________________ |
5b188f2f | 239 | void AliPHOSQualAssDataMaker::MakeRaws(TObject * data) |
117e9d0d | 240 | { |
241 | GetRawsData(1)->Fill(99) ; | |
242 | } | |
243 | ||
ddd1a39c | 244 | //____________________________________________________________________________ |
d76c31f4 | 245 | void AliPHOSQualAssDataMaker::MakeRecPoints(TTree * clustersTree) |
ddd1a39c | 246 | { |
d76c31f4 | 247 | { |
248 | // makes data from RecPoints | |
249 | TBranch *emcbranch = clustersTree->GetBranch("PHOSEmcRP"); | |
250 | if (!emcbranch) { | |
251 | AliError("can't get the branch with the PHOS EMC clusters !"); | |
252 | return; | |
253 | } | |
254 | TObjArray * emcrecpoints = new TObjArray(100) ; | |
255 | emcbranch->SetAddress(&emcrecpoints); | |
256 | emcbranch->GetEntry(0); | |
257 | ||
117e9d0d | 258 | GetRecPointsData(1)->Fill(emcrecpoints->GetEntriesFast()) ; |
d76c31f4 | 259 | TIter next(emcrecpoints) ; |
ddd1a39c | 260 | AliPHOSEmcRecPoint * rp ; |
261 | while ( (rp = dynamic_cast<AliPHOSEmcRecPoint *>(next())) ) { | |
117e9d0d | 262 | GetRecPointsData(0)->Fill( rp->GetEnergy()) ; |
ddd1a39c | 263 | } |
d76c31f4 | 264 | emcrecpoints->Delete(); |
265 | delete emcrecpoints; | |
266 | } | |
267 | { | |
268 | TBranch *cpvbranch = clustersTree->GetBranch("PHOSCpvRP"); | |
269 | if (!cpvbranch) { | |
270 | AliError("can't get the branch with the PHOS CPV clusters !"); | |
271 | return; | |
272 | } | |
273 | TObjArray *cpvrecpoints = new TObjArray(100) ; | |
274 | cpvbranch->SetAddress(&cpvrecpoints); | |
275 | cpvbranch->GetEntry(0); | |
276 | ||
117e9d0d | 277 | GetRecPointsData(1)->Fill(cpvrecpoints->GetEntriesFast()) ; |
d76c31f4 | 278 | TIter next(cpvrecpoints) ; |
ddd1a39c | 279 | AliPHOSCpvRecPoint * rp ; |
280 | while ( (rp = dynamic_cast<AliPHOSCpvRecPoint *>(next())) ) { | |
117e9d0d | 281 | GetRecPointsData(0)->Fill( rp->GetEnergy()) ; |
ddd1a39c | 282 | } |
d76c31f4 | 283 | cpvrecpoints->Delete(); |
284 | delete cpvrecpoints; | |
285 | } | |
ddd1a39c | 286 | } |
287 | ||
288 | //____________________________________________________________________________ | |
d76c31f4 | 289 | void AliPHOSQualAssDataMaker::MakeSDigits(TObject * data) |
ddd1a39c | 290 | { |
291 | // makes data from SDigits | |
d76c31f4 | 292 | |
293 | TClonesArray * sdigits = dynamic_cast<TClonesArray *>(data) ; | |
294 | if (!sdigits) { | |
295 | AliError("Wrong type of sdigits container") ; | |
296 | } else { | |
117e9d0d | 297 | GetSDigitsData(1)->Fill(sdigits->GetEntriesFast()) ; |
d76c31f4 | 298 | TIter next(sdigits) ; |
299 | AliPHOSDigit * sdigit ; | |
300 | while ( (sdigit = dynamic_cast<AliPHOSDigit *>(next())) ) { | |
117e9d0d | 301 | GetSDigitsData(0)->Fill( sdigit->GetEnergy()) ; |
d76c31f4 | 302 | } |
303 | } | |
ddd1a39c | 304 | } |
305 | ||
306 | //____________________________________________________________________________ | |
d76c31f4 | 307 | // void AliPHOSQualAssDataMaker::MakeTrackSegments(TTree * ts) |
308 | // { | |
309 | // // makes data from TrackSegments | |
ddd1a39c | 310 | |
d76c31f4 | 311 | // TClonesArray * tracksegments = dynamic_cast<TClonesArray*>(fData) ; |
ddd1a39c | 312 | |
d76c31f4 | 313 | // fhTrackSegmentsMul->Fill(tracksegments->GetEntriesFast()) ; |
314 | // TIter next(tracksegments) ; | |
315 | // AliPHOSTrackSegment * ts ; | |
316 | // while ( (ts = dynamic_cast<AliPHOSTrackSegment *>(next())) ) { | |
317 | // fhTrackSegments->Fill( ts->GetCpvDistance()) ; | |
318 | // } | |
319 | // } | |
5b188f2f | 320 | |
321 | //____________________________________________________________________________ | |
322 | void AliPHOSQualAssDataMaker::StartOfDetectorCycle() | |
323 | { | |
324 | //Detector specific actions at start of cycle | |
325 | ||
326 | } |