]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSQualAssDataMaker.cxx
Important changes to the reconstructor classes. Complete elimination of the run-loade...
[u/mrichter/AliRoot.git] / PHOS / AliPHOSQualAssDataMaker.cxx
CommitLineData
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
45ClassImp(AliPHOSQualAssDataMaker)
46
47//____________________________________________________________________________
48 AliPHOSQualAssDataMaker::AliPHOSQualAssDataMaker() :
a5fa6165 49 AliQualAssDataMaker(AliQualAss::GetDetName(AliQualAss::kPHOS), "PHOS Quality Assurance Data Maker"),
ddd1a39c 50 fhHits(0x0),
51 fhHitsMul(0x0),
52 fhDigits(0x0),
53 fhDigitsMul(0x0),
54 fhSDigits(0x0),
55 fhSDigitsMul(0x0),
56 fhEmcRecPoints(0x0),
57 fhEmcRecPointsMul(0x0),
58 fhCpvRecPoints(0x0),
59 fhCpvRecPointsMul(0x0),
60 fhTrackSegments(0x0),
61 fhTrackSegmentsMul(0x0),
62 fhRecParticles(0x0),
63 fhRecParticlesMul(0x0),
64 fhESDs(0x0),
65 fhESDsMul(0x0)
66{
67 // ctor
68 fDetectorDir = fOutput->GetDirectory(GetName()) ;
69 if (!fDetectorDir)
70 fDetectorDir = fOutput->mkdir(GetName()) ;
71}
72
73//____________________________________________________________________________
74AliPHOSQualAssDataMaker::AliPHOSQualAssDataMaker(const AliPHOSQualAssDataMaker& qadm) :
75 AliQualAssDataMaker(),
76 fhHits(qadm.fhHits),
77 fhHitsMul(qadm.fhHitsMul),
78 fhDigits(qadm.fhDigits),
79 fhDigitsMul(qadm.fhDigitsMul),
80 fhSDigits(qadm.fhSDigits),
81 fhSDigitsMul(qadm.fhSDigitsMul),
82 fhEmcRecPoints(qadm.fhEmcRecPoints),
83 fhEmcRecPointsMul(qadm.fhEmcRecPointsMul),
84 fhCpvRecPoints(qadm.fhCpvRecPoints),
85 fhCpvRecPointsMul(qadm.fhCpvRecPointsMul),
86 fhTrackSegments(qadm.fhTrackSegments),
87 fhTrackSegmentsMul(qadm.fhTrackSegmentsMul),
88 fhRecParticles(qadm.fhRecParticles),
89 fhRecParticlesMul(qadm.fhRecParticlesMul),
90 fhESDs(qadm.fhESDs),
91 fhESDsMul(qadm.fhESDsMul)
92{
93 //copy ctor
94 SetName((const char*)qadm.GetName()) ;
95 SetTitle((const char*)qadm.GetTitle());
96}
97
98//__________________________________________________________________
99AliPHOSQualAssDataMaker& AliPHOSQualAssDataMaker::operator = (const AliPHOSQualAssDataMaker& qadm )
100{
101 // Equal operator.
102 this->~AliPHOSQualAssDataMaker();
103 new(this) AliPHOSQualAssDataMaker(qadm);
104 return *this;
105}
106
107//____________________________________________________________________________
108void AliPHOSQualAssDataMaker::InitESDs()
109{
110 //create ESDs histograms in ESDs subdir
111 fhESDs = new TH1F("hPhosESDs", "ESDs energy distribution in PHOS", 100, 0., 100.) ;
a5fa6165 112 fhESDs->Sumw2() ;
ddd1a39c 113 fhESDsMul = new TH1I("hPhosESDsMul", "ESDs multiplicity distribution in PHOS", 100, 0., 100) ;
a5fa6165 114 fhESDsMul->Sumw2() ;
ddd1a39c 115}
116
117//____________________________________________________________________________
118void AliPHOSQualAssDataMaker::InitHits()
119{
120 // create Hits histograms in Hits subdir
121 fhHits = new TH1F("hPhosHits", "Hits energy distribution in PHOS", 100, 0., 100.) ;
a5fa6165 122 fhHits->Sumw2() ;
ddd1a39c 123 fhHitsMul = new TH1I("hPhosHitsMul", "Hits multiplicity distribution in PHOS", 500, 0., 10000) ;
a5fa6165 124 fhHitsMul->Sumw2() ;
ddd1a39c 125}
126
127//____________________________________________________________________________
128void AliPHOSQualAssDataMaker::InitDigits()
129{
130 // create Digits histograms in Digits subdir
131 fhDigits = new TH1I("hPhosDigits", "Digits amplitude distribution in PHOS", 500, 0, 5000) ;
a5fa6165 132 fhDigits->Sumw2() ;
ddd1a39c 133 fhDigitsMul = new TH1I("hPhosDigitsMul", "Digits multiplicity distribution in PHOS", 500, 0, 1000) ;
a5fa6165 134 fhDigitsMul->Sumw2() ;
ddd1a39c 135}
136
137//____________________________________________________________________________
138void AliPHOSQualAssDataMaker::InitRecParticles()
139{
140 // create Reconstructed particles histograms in RecParticles subdir
141 fhRecParticles = new TH1F("hPhosRecParticles", "RecParticles energy distribution in PHOS", 100, 0., 100.) ;
a5fa6165 142 fhRecParticles->Sumw2() ;
ddd1a39c 143 fhRecParticlesMul = new TH1I("hPhosRecParticlesMul", "RecParticles multiplicity distribution in PHOS", 100, 0, 100) ;
a5fa6165 144 fhRecParticlesMul->Sumw2() ;
ddd1a39c 145}
146
147//____________________________________________________________________________
148void AliPHOSQualAssDataMaker::InitRecPoints()
149{
150 // create Reconstructed Points histograms in RecPoints subdir
151 fhEmcRecPoints = new TH1F("hEmcPhosRecPoints", "EMCA RecPoints energy distribution in PHOS", 100, 0., 100.) ;
a5fa6165 152 fhEmcRecPoints->Sumw2() ;
ddd1a39c 153 fhEmcRecPointsMul = new TH1I("hEmcPhosRecPointsMul", "EMCA RecPoints multiplicity distribution in PHOS", 100, 0, 100) ;
a5fa6165 154 fhEmcRecPointsMul->Sumw2() ;
ddd1a39c 155
156 fhCpvRecPoints = new TH1F("hCpvPhosRecPoints", "CPV RecPoints energy distribution in PHOS", 100, 0., 100.) ;
a5fa6165 157 fhCpvRecPoints->Sumw2() ;
ddd1a39c 158 fhCpvRecPointsMul = new TH1I("hCpvPhosRecPointsMul", "CPV RecPoints multiplicity distribution in PHOS", 100, 0, 100) ;
a5fa6165 159 fhCpvRecPointsMul->Sumw2() ;
ddd1a39c 160}
161
162//____________________________________________________________________________
163void AliPHOSQualAssDataMaker::InitSDigits()
164{
165 // create SDigits histograms in SDigits subdir
166 fhSDigits = new TH1F("hPhosSDigits", "SDigits energy distribution in PHOS", 100, 0., 100.) ;
a5fa6165 167 fhSDigits->Sumw2() ;
ddd1a39c 168 fhSDigitsMul = new TH1I("hPhosSDigitsMul", "SDigits multiplicity distribution in PHOS", 500, 0, 10000) ;
a5fa6165 169 fhSDigitsMul->Sumw2() ;
ddd1a39c 170}
171
172//____________________________________________________________________________
173void AliPHOSQualAssDataMaker::InitTrackSegments()
174{
175 // create Track Segments histograms in TrackSegments subdir
176 fhTrackSegments = new TH1F("hPhosTrackSegments", "TrackSegments EMC-CPV distance in PHOS", 500, 0., 5000.) ;
a5fa6165 177 fhTrackSegments->Sumw2() ;
ddd1a39c 178 fhTrackSegmentsMul = new TH1I("hPhosTrackSegmentsMul", "TrackSegments multiplicity distribution in PHOS", 100, 0, 100) ;
a5fa6165 179 fhTrackSegmentsMul->Sumw2() ;
ddd1a39c 180}
181
182//____________________________________________________________________________
d76c31f4 183void AliPHOSQualAssDataMaker::MakeESDs(AliESDEvent * esd)
ddd1a39c 184{
185 // make QA data from ESDs
186
ddd1a39c 187 Int_t maxClu = esd->GetNumberOfPHOSClusters() ;
188 Int_t index = 0, count = 0 ;
189 for ( index = 0 ; index < maxClu; index++ ) {
190 AliESDCaloCluster * clu = esd->GetCaloCluster(index) ;
191 fhESDs->Fill(clu->E()) ;
192 count++ ;
193 }
194 fhESDsMul->Fill(count) ;
195}
196
197//____________________________________________________________________________
d76c31f4 198void AliPHOSQualAssDataMaker::MakeHits(TObject * data)
ddd1a39c 199{
200 //make QA data from Hits
201
d76c31f4 202 TClonesArray * hits = dynamic_cast<TClonesArray *>(data) ;
203 if (!hits) {
204 AliError("Wrong type of hits container") ;
205 } else {
206 fhHitsMul->Fill(hits->GetEntriesFast()) ;
207 TIter next(hits) ;
208 AliPHOSHit * hit ;
209 while ( (hit = dynamic_cast<AliPHOSHit *>(next())) ) {
210 fhHits->Fill( hit->GetEnergy()) ;
211 }
212 }
213}
ddd1a39c 214
215//____________________________________________________________________________
d76c31f4 216void AliPHOSQualAssDataMaker::MakeDigits(TObject * data)
ddd1a39c 217{
218 // makes data from Digits
219
d76c31f4 220 TClonesArray * digits = dynamic_cast<TClonesArray *>(data) ;
221 if (!digits) {
222 AliError("Wrong type of digits container") ;
223 } else {
224 fhDigitsMul->Fill(digits->GetEntriesFast()) ;
225 TIter next(digits) ;
226 AliPHOSDigit * digit ;
227 while ( (digit = dynamic_cast<AliPHOSDigit *>(next())) ) {
228 fhDigits->Fill( digit->GetEnergy()) ;
229 }
230 }
ddd1a39c 231}
232
233//____________________________________________________________________________
d76c31f4 234// void AliPHOSQualAssDataMaker::MakeRecParticles(TTree * recpar)
235// {
236// // makes data from RecParticles
ddd1a39c 237
d76c31f4 238// TClonesArray * recparticles = dynamic_cast<TClonesArray*>(fData) ;
239// fhRecParticlesMul->Fill(recparticles->GetEntriesFast()) ;
240// TIter next(recparticles) ;
241// AliPHOSRecParticle * recparticle ;
242// while ( (recparticle = dynamic_cast<AliPHOSRecParticle *>(next())) ) {
243// fhRecParticles->Fill( recparticle->Energy()) ;
244// }
245// }
ddd1a39c 246
247//____________________________________________________________________________
d76c31f4 248void AliPHOSQualAssDataMaker::MakeRecPoints(TTree * clustersTree)
ddd1a39c 249{
d76c31f4 250 {
251 // makes data from RecPoints
252 TBranch *emcbranch = clustersTree->GetBranch("PHOSEmcRP");
253 if (!emcbranch) {
254 AliError("can't get the branch with the PHOS EMC clusters !");
255 return;
256 }
257 TObjArray * emcrecpoints = new TObjArray(100) ;
258 emcbranch->SetAddress(&emcrecpoints);
259 emcbranch->GetEntry(0);
260
261 fhEmcRecPointsMul->Fill(emcrecpoints->GetEntriesFast()) ;
262 TIter next(emcrecpoints) ;
ddd1a39c 263 AliPHOSEmcRecPoint * rp ;
264 while ( (rp = dynamic_cast<AliPHOSEmcRecPoint *>(next())) ) {
265 fhEmcRecPoints->Fill( rp->GetEnergy()) ;
266 }
d76c31f4 267 emcrecpoints->Delete();
268 delete emcrecpoints;
269 }
270 {
271 TBranch *cpvbranch = clustersTree->GetBranch("PHOSCpvRP");
272 if (!cpvbranch) {
273 AliError("can't get the branch with the PHOS CPV clusters !");
274 return;
275 }
276 TObjArray *cpvrecpoints = new TObjArray(100) ;
277 cpvbranch->SetAddress(&cpvrecpoints);
278 cpvbranch->GetEntry(0);
279
280 fhCpvRecPointsMul->Fill(cpvrecpoints->GetEntriesFast()) ;
281 TIter next(cpvrecpoints) ;
ddd1a39c 282 AliPHOSCpvRecPoint * rp ;
283 while ( (rp = dynamic_cast<AliPHOSCpvRecPoint *>(next())) ) {
284 fhCpvRecPoints->Fill( rp->GetEnergy()) ;
285 }
d76c31f4 286 cpvrecpoints->Delete();
287 delete cpvrecpoints;
288 }
ddd1a39c 289}
290
291//____________________________________________________________________________
d76c31f4 292void AliPHOSQualAssDataMaker::MakeSDigits(TObject * data)
ddd1a39c 293{
294 // makes data from SDigits
d76c31f4 295
296 TClonesArray * sdigits = dynamic_cast<TClonesArray *>(data) ;
297 if (!sdigits) {
298 AliError("Wrong type of sdigits container") ;
299 } else {
300 fhSDigitsMul->Fill(sdigits->GetEntriesFast()) ;
301 TIter next(sdigits) ;
302 AliPHOSDigit * sdigit ;
303 while ( (sdigit = dynamic_cast<AliPHOSDigit *>(next())) ) {
304 fhSDigits->Fill( sdigit->GetEnergy()) ;
305 }
306 }
ddd1a39c 307}
308
309//____________________________________________________________________________
d76c31f4 310// void AliPHOSQualAssDataMaker::MakeTrackSegments(TTree * ts)
311// {
312// // makes data from TrackSegments
ddd1a39c 313
d76c31f4 314// TClonesArray * tracksegments = dynamic_cast<TClonesArray*>(fData) ;
ddd1a39c 315
d76c31f4 316// fhTrackSegmentsMul->Fill(tracksegments->GetEntriesFast()) ;
317// TIter next(tracksegments) ;
318// AliPHOSTrackSegment * ts ;
319// while ( (ts = dynamic_cast<AliPHOSTrackSegment *>(next())) ) {
320// fhTrackSegments->Fill( ts->GetCpvDistance()) ;
321// }
322// }