1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
20 Produces the data needed to calculate the quality assurance.
21 All data must be mergeable objects.
22 Y. Schutz CERN July 2007
25 // --- ROOT system ---
26 #include <TClonesArray.h>
32 // --- Standard library ---
34 // --- AliRoot header files ---
35 #include "AliESDCaloCluster.h"
36 #include "AliESDEvent.h"
38 #include "AliPHOSQADataMakerRec.h"
39 #include "AliQAChecker.h"
40 #include "AliPHOSCpvRecPoint.h"
41 #include "AliPHOSEmcRecPoint.h"
42 #include "AliPHOSRecParticle.h"
43 #include "AliPHOSTrackSegment.h"
44 #include "AliPHOSRawDecoder.h"
45 #include "AliPHOSReconstructor.h"
46 #include "AliPHOSRecoParam.h"
48 ClassImp(AliPHOSQADataMakerRec)
50 //____________________________________________________________________________
51 AliPHOSQADataMakerRec::AliPHOSQADataMakerRec() :
52 AliQADataMakerRec(AliQA::GetDetName(AliQA::kPHOS), "PHOS Quality Assurance Data Maker")
57 //____________________________________________________________________________
58 AliPHOSQADataMakerRec::AliPHOSQADataMakerRec(const AliPHOSQADataMakerRec& qadm) :
62 SetName((const char*)qadm.GetName()) ;
63 SetTitle((const char*)qadm.GetTitle());
66 //__________________________________________________________________
67 AliPHOSQADataMakerRec& AliPHOSQADataMakerRec::operator = (const AliPHOSQADataMakerRec& qadm )
70 this->~AliPHOSQADataMakerRec();
71 new(this) AliPHOSQADataMakerRec(qadm);
75 //____________________________________________________________________________
76 void AliPHOSQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * list)
78 //Detector specific actions at end of cycle
80 AliQAChecker::Instance()->Run(AliQA::kPHOS, task, list) ;
83 //____________________________________________________________________________
84 void AliPHOSQADataMakerRec::InitESDs()
86 //create ESDs histograms in ESDs subdir
88 TH1F * h0 = new TH1F("hPhosESDs", "ESDs energy distribution in PHOS", 100, 0., 100.) ;
91 TH1I * h1 = new TH1I("hPhosESDsMul", "ESDs multiplicity distribution in PHOS", 100, 0., 100) ;
96 //____________________________________________________________________________
97 //void AliPHOSQADataMakerRec::InitRecParticles()
99 // // create Reconstructed particles histograms in RecParticles subdir
100 // fhRecParticles = new TH1F("hPhosRecParticles", "RecParticles energy distribution in PHOS", 100, 0., 100.) ;
101 // fhRecParticles->Sumw2() ;
102 // fhRecParticlesMul = new TH1I("hPhosRecParticlesMul", "RecParticles multiplicity distribution in PHOS", 100, 0, 100) ;
103 // fhRecParticlesMul->Sumw2() ;
106 //____________________________________________________________________________
107 void AliPHOSQADataMakerRec::InitRecPoints()
109 // create Reconstructed Points histograms in RecPoints subdir
110 TH1F * h0 = new TH1F("hEmcPhosRecPoints", "EMCA RecPoints energy distribution in PHOS", 100, 0., 100.) ;
112 Add2RecPointsList(h0, 0) ;
113 TH1I * h1 = new TH1I("hEmcPhosRecPointsMul", "EMCA RecPoints multiplicity distribution in PHOS", 100, 0, 100) ;
115 Add2RecPointsList(h1, 1) ;
117 TH1F * h2 = new TH1F("hCpvPhosRecPoints", "CPV RecPoints energy distribution in PHOS", 100, 0., 100.) ;
119 Add2RecPointsList(h2, 2) ;
120 TH1I * h3 = new TH1I("hCpvPhosRecPointsMul", "CPV RecPoints multiplicity distribution in PHOS", 100, 0, 100) ;
122 Add2RecPointsList(h3, 3) ;
125 //____________________________________________________________________________
126 void AliPHOSQADataMakerRec::InitRaws()
128 // create Raws histograms in Raws subdir
129 const Int_t modMax = 5 ;
130 TH2I * h0[modMax*2] ;
133 for (Int_t mod = 0; mod < modMax; mod++) {
134 sprintf(title, "Low Gain Rows x Columns for PHOS module %d", mod) ;
135 sprintf(name, "hLowPHOSxyMod%d", mod) ;
136 h0[mod] = new TH2I(name, title, 64, 1, 65, 56, 1, 57) ;
137 Add2RawsList(h0[mod], mod) ;
138 sprintf(title, "High Gain Rows x Columns for PHOS module %d", mod) ;
139 sprintf(name, "hHighPHOSxyMod%d", mod) ;
140 h0[mod+modMax] = new TH2I(name, title, 64, 1, 65, 56, 1, 57) ;
141 Add2RawsList(h0[mod+modMax], mod+modMax) ;
143 TH1I * h10 = new TH1I("hLowPhosModules", "Low Gain Hits in EMCA PHOS modules", 6, 0, 6) ;
145 Add2RawsList(h10, 10) ;
146 TH1I * h11 = new TH1I("hHighPhosModules", "High Gain Hits in EMCA PHOS modules", 6, 0, 6) ;
148 Add2RawsList(h11, 11) ;
149 TH1F * h12 = new TH1F("hLowPhosRawtime", "Low Gain Time of raw hits in PHOS", 100, 0, 100.) ;
151 Add2RawsList(h12, 12) ;
152 TH1F * h13 = new TH1F("hHighPhosRawtime", "High Gain Time of raw hits in PHOS", 100, 0, 100.) ;
154 Add2RawsList(h13, 13) ;
155 TH1F * h14 = new TH1F("hLowPhosRawEnergy", "Low Gain Energy of raw hits in PHOS", 100, 0., 100.) ;
157 Add2RawsList(h14, 14) ;
158 TH1F * h15 = new TH1F("hHighPhosRawEnergy", "High Gain Energy of raw hits in PHOS", 100, 0., 100.) ;
160 Add2RawsList(h15, 15) ;
164 //____________________________________________________________________________
165 //void AliPHOSQADataMakerRec::InitTrackSegments()
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() ;
174 //____________________________________________________________________________
175 void AliPHOSQADataMakerRec::MakeESDs(AliESDEvent * esd)
177 // make QA data from ESDs
180 for ( Int_t index = 0; index < esd->GetNumberOfCaloClusters() ; index++ ) {
181 AliESDCaloCluster * clu = esd->GetCaloCluster(index) ;
182 if ( clu->IsPHOS() ) {
183 GetESDsData(0)->Fill(clu->E()) ;
187 GetESDsData(1)->Fill(count) ;
190 //____________________________________________________________________________
191 // void AliPHOSQADataMakerRec::MakeRecParticles(TTree * recpar)
193 // // makes data from RecParticles
195 // TClonesArray * recparticles = dynamic_cast<TClonesArray*>(fData) ;
196 // fhRecParticlesMul->Fill(recparticles->GetEntriesFast()) ;
197 // TIter next(recparticles) ;
198 // AliPHOSRecParticle * recparticle ;
199 // while ( (recparticle = dynamic_cast<AliPHOSRecParticle *>(next())) ) {
200 // fhRecParticles->Fill( recparticle->Energy()) ;
204 //____________________________________________________________________________
205 void AliPHOSQADataMakerRec::MakeRaws(AliRawReader* rawReader)
207 const Int_t modMax = 5 ;
209 AliPHOSRawDecoder decoder(rawReader);
210 decoder.SetOldRCUFormat(kFALSE);
211 decoder.SubtractPedestals(AliPHOSReconstructor::GetRecoParamEmc()->SubtractPedestals());
213 while (decoder.NextDigit()) {
214 Int_t module = decoder.GetModule() ;
215 Int_t row = decoder.GetRow() ;
216 Int_t col = decoder.GetColumn() ;
217 Double_t time = decoder.GetTime() ;
218 Double_t energy = decoder.GetEnergy() ;
219 Bool_t lowGain = decoder.IsLowGain();
221 GetRawsData(module)->Fill(row, col) ;
222 GetRawsData(10)->Fill(module) ;
223 GetRawsData(12)->Fill(time) ;
224 GetRawsData(14)->Fill(energy) ;
226 GetRawsData(module+modMax)->Fill(row, col) ;
227 GetRawsData(11)->Fill(module) ;
228 GetRawsData(13)->Fill(time) ;
229 GetRawsData(15)->Fill(energy) ;
231 //AliInfo(Form(" %d %d %d %d %f %f\n", count, module, row, col, time, energy)) ;
236 //____________________________________________________________________________
237 void AliPHOSQADataMakerRec::MakeRecPoints(TTree * clustersTree)
240 // makes data from RecPoints
241 TBranch *emcbranch = clustersTree->GetBranch("PHOSEmcRP");
243 AliError("can't get the branch with the PHOS EMC clusters !");
246 TObjArray * emcrecpoints = new TObjArray(100) ;
247 emcbranch->SetAddress(&emcrecpoints);
248 emcbranch->GetEntry(0);
250 GetRecPointsData(1)->Fill(emcrecpoints->GetEntriesFast()) ;
251 TIter next(emcrecpoints) ;
252 AliPHOSEmcRecPoint * rp ;
253 while ( (rp = dynamic_cast<AliPHOSEmcRecPoint *>(next())) ) {
254 GetRecPointsData(0)->Fill( rp->GetEnergy()) ;
256 emcrecpoints->Delete();
260 TBranch *cpvbranch = clustersTree->GetBranch("PHOSCpvRP");
262 AliError("can't get the branch with the PHOS CPV clusters !");
265 TObjArray *cpvrecpoints = new TObjArray(100) ;
266 cpvbranch->SetAddress(&cpvrecpoints);
267 cpvbranch->GetEntry(0);
269 GetRecPointsData(1)->Fill(cpvrecpoints->GetEntriesFast()) ;
270 TIter next(cpvrecpoints) ;
271 AliPHOSCpvRecPoint * rp ;
272 while ( (rp = dynamic_cast<AliPHOSCpvRecPoint *>(next())) ) {
273 GetRecPointsData(0)->Fill( rp->GetEnergy()) ;
275 cpvrecpoints->Delete();
280 //____________________________________________________________________________
281 // void AliPHOSQADataMakerRec::MakeTrackSegments(TTree * ts)
283 // // makes data from TrackSegments
285 // TClonesArray * tracksegments = dynamic_cast<TClonesArray*>(fData) ;
287 // fhTrackSegmentsMul->Fill(tracksegments->GetEntriesFast()) ;
288 // TIter next(tracksegments) ;
289 // AliPHOSTrackSegment * ts ;
290 // while ( (ts = dynamic_cast<AliPHOSTrackSegment *>(next())) ) {
291 // fhTrackSegments->Fill( ts->GetCpvDistance()) ;
295 //____________________________________________________________________________
296 void AliPHOSQADataMakerRec::StartOfDetectorCycle()
298 //Detector specific actions at start of cycle