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 **************************************************************************/
18 Produces the data needed to calculate the quality assurance.
19 All data must be mergeable objects.
23 // --- ROOT system ---
24 #include <TClonesArray.h>
30 // --- Standard library ---
32 // --- AliRoot header files ---
34 #include "AliESDEvent.h"
36 #include "AliPMDQADataMakerRec.h"
37 #include "AliQAChecker.h"
38 #include "AliPMDrecpoint1.h"
39 #include "AliPMDRawStream.h"
40 #include "AliPMDddldata.h"
41 #include "AliPMDUtility.h"
42 #include "AliESDPmdTrack.h"
43 //#include "AliPMDRecoParam.h"
45 ClassImp(AliPMDQADataMakerRec)
47 //____________________________________________________________________________
48 AliPMDQADataMakerRec::AliPMDQADataMakerRec() :
49 AliQADataMakerRec(AliQA::GetDetName(AliQA::kPMD), "PMD Quality Assurance Data Maker")
54 //____________________________________________________________________________
55 AliPMDQADataMakerRec::AliPMDQADataMakerRec(const AliPMDQADataMakerRec& qadm) :
59 SetName((const char*)qadm.GetName()) ;
60 SetTitle((const char*)qadm.GetTitle());
63 //__________________________________________________________________
64 AliPMDQADataMakerRec& AliPMDQADataMakerRec::operator = (const AliPMDQADataMakerRec& qadm )
67 this->~AliPMDQADataMakerRec();
68 new(this) AliPMDQADataMakerRec(qadm);
73 //____________________________________________________________________________
74 void AliPMDQADataMakerRec::InitRaws()
76 // create Raws histograms in Raws subdir
78 TH1F * h0 = new TH1F("hPreDdl0Edep","DDL0 Energy Distribution PRE(PMD)", 100, 0, 2000);
82 TH1F * h1 = new TH1F("hPreDdl1Edep","DDL1 Energy Distribution PRE(PMD)", 100, 0, 2000);
86 TH1F * h2 = new TH1F("hPreDdl2Edep","DDL2 Energy Distribution PRE(PMD)", 100, 0, 2000);
90 TH1F * h3 = new TH1F("hPreDdl3Edep","DDL3 Energy Distribution PRE(PMD)", 100, 0, 2000);
94 TH1F * h4 = new TH1F("hCpvDdl4Edep","DDL4 Energy Distribution CPV(PMD)", 100, 0, 2000);
98 TH1F * h5 = new TH1F("hCpvDdl5Edep","DDL5 Energy Distribution CPV(PMD)", 100, 0, 2000);
104 //____________________________________________________________________________
105 void AliPMDQADataMakerRec::InitRecPoints()
107 // create Reconstructed Points histograms in RecPoints subdir
110 TH2F * h0 = new TH2F("hPreXY","RecPoints Y vs X PRE(PMD)", 100,-100.,100.,100,-100.,100.);
111 Add2RecPointsList(h0,0) ;
113 TH2F * h1 = new TH2F("hCpvXY","RecPoints Y vs X CPV(PMD)", 100,-100.,100.,100,-100.,100.);
114 Add2RecPointsList(h1,1) ;
117 TH1F * h0 = new TH1F("hPreClADC","Cluster ADC of PRE(PMD) plane",500,0.,5000.);
119 Add2RecPointsList(h0, 0) ;
121 TH1F * h1 = new TH1F("hCpvClADC","Cluster ADC of CPV(PMD) plane",500,0.,5000.);
123 Add2RecPointsList(h1, 1) ;
126 TH1I * h2 = new TH1I("hPreClMult","Cluster Multiplicity of PRE(PMD) plane",100,0.,10000.);
128 Add2RecPointsList(h2, 2) ;
130 TH1I * h3 = new TH1I("hCpvClMult","Cluster Multiplicity of CPV(PMD) plane",100,0.,10000.);
132 Add2RecPointsList(h3, 3) ;
137 //____________________________________________________________________________
139 void AliPMDQADataMakerRec::InitESDs()
141 //Create histograms to controll ESD
143 TH1F * h0 = new TH1F("hPreClADC","Cluster ADC of PRE(PMD) plane",500,0.,5000.);
145 Add2ESDsList(h0, 0) ;
147 TH1F * h1 = new TH1F("hCpvClADC","Cluster ADC of CPV(PMD) plane",500,0.,5000.);
149 Add2ESDsList(h1, 1) ;
151 TH1I * h2 = new TH1I("hPreClMult","Cluster Multiplicity of PRE(PMD) plane",100,0.,10000.);
153 Add2ESDsList(h2, 2) ;
155 TH1I * h3 = new TH1I("hCpvClMult","Cluster Multiplicity of CPV(PMD) plane",100,0.,10000.);
157 Add2ESDsList(h3, 3) ;
161 //____________________________________________________________________________
162 void AliPMDQADataMakerRec::MakeRaws(AliRawReader* rawReader)
164 //Fill prepared histograms with Raw digit properties
166 TObjArray pmdddlcont;
167 AliPMDRawStream stream(rawReader);
172 while ((iddl = stream.DdlData(&pmdddlcont)) >=0)
174 Int_t ientries = pmdddlcont.GetEntries();
175 //printf(" ======= DDLNO = %d ientries = %d \n", iddl, ientries);
176 for (Int_t ient = 0; ient < ientries; ient++)
178 AliPMDddldata *pmdddl = (AliPMDddldata*)pmdddlcont.UncheckedAt(ient);
179 //Int_t det = pmdddl->GetDetector();
180 //Int_t smn = pmdddl->GetSMN();
181 //Int_t mcm = pmdddl->GetMCM();
182 //Int_t chno = pmdddl->GetChannel();
183 //Int_t row = pmdddl->GetRow();
184 //Int_t col = pmdddl->GetColumn();
185 Int_t sig = pmdddl->GetSignal();
188 if (iddl == 0) GetRawsData(0)->Fill(sig);
189 if (iddl == 1) GetRawsData(1)->Fill(sig);
190 if (iddl == 2) GetRawsData(2)->Fill(sig);
191 if (iddl == 3) GetRawsData(3)->Fill(sig);
192 if (iddl == 4) GetRawsData(4)->Fill(sig);
193 if (iddl == 5) GetRawsData(5)->Fill(sig);
201 //____________________________________________________________________________
202 void AliPMDQADataMakerRec::MakeRecPoints(TTree * clustersTree)
204 // makes data from RecPoints
206 Int_t premul = 0, cpvmul = 0;
207 AliPMDrecpoint1 * recpoint;
209 TClonesArray * recpoints = new TClonesArray("AliPMDrecpoint1", 1000) ;
211 TBranch * branch = clustersTree->GetBranch("PMDRecpoint") ;
212 branch->SetAddress(&recpoints) ;
216 AliWarning("PMD branch in SDigit Tree not found") ;
220 for (Int_t imod = 0; imod < branch->GetEntries(); imod++)
222 branch->GetEntry(imod) ;
224 TIter next(recpoints) ;
226 while ( (recpoint = dynamic_cast<AliPMDrecpoint1 *>(next())) )
228 //Float_t xpos = recpoint->GetClusX();
229 //Float_t ypos = recpoint->GetClusY();
230 if(recpoint->GetDetector() == 0)
232 GetRecPointsData(0)->Fill(recpoint->GetClusADC());
235 if(recpoint->GetDetector() == 1)
237 GetRecPointsData(1)->Fill(recpoint->GetClusADC());
246 GetRecPointsData(2)->Fill(premul);
247 GetRecPointsData(3)->Fill(cpvmul);
250 //____________________________________________________________________________
252 void AliPMDQADataMakerRec::MakeESDs(AliESDEvent * esd)
254 // make QA data from ESDs
256 Int_t premul = 0, cpvmul = 0;
257 for (Int_t icl = 0; icl < esd->GetNumberOfPmdTracks(); icl++)
259 AliESDPmdTrack *pmdtr = esd->GetPmdTrack(icl);
261 //Int_t det = pmdtr->GetDetector();
262 //Float_t clsX = pmdtr->GetClusterX();
263 //Float_t clsY = pmdtr->GetClusterY();
264 //Float_t clsZ = pmdtr->GetClusterZ();
265 //Float_t ncell = pmdtr->GetClusterCells();
266 Float_t adc = pmdtr->GetClusterADC();
267 //Float_t pid = pmdtr->GetClusterPID();
269 if (pmdtr->GetDetector() == 0)
271 GetESDsData(0)->Fill(adc);
274 if (pmdtr->GetDetector() == 1)
276 GetESDsData(1)->Fill(adc) ;
281 GetESDsData(2)->Fill(premul) ;
282 GetESDsData(3)->Fill(cpvmul) ;
285 //____________________________________________________________________________
287 void AliPMDQADataMakerRec::StartOfDetectorCycle()
289 //Detector specific actions at start of cycle
292 //____________________________________________________________________________
293 void AliPMDQADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list)
295 //Detector specific actions at end of cycle
296 // do the QA checking
297 AliQAChecker::Instance()->Run(AliQA::kPMD, task, list) ;