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>
31 // --- Standard library ---
33 // --- AliRoot header files ---
36 #include "AliPMDhit.h"
37 #include "AliPMDsdigit.h"
38 #include "AliPMDdigit.h"
39 #include "AliPMDQADataMakerSim.h"
40 #include "AliQAChecker.h"
42 ClassImp(AliPMDQADataMakerSim)
44 //____________________________________________________________________________
45 AliPMDQADataMakerSim::AliPMDQADataMakerSim() :
46 AliQADataMakerSim(AliQAv1::GetDetName(AliQAv1::kPMD), "PMD Quality Assurance Data Maker")
51 //____________________________________________________________________________
52 AliPMDQADataMakerSim::AliPMDQADataMakerSim(const AliPMDQADataMakerSim& qadm) :
56 SetName((const char*)qadm.GetName()) ;
57 SetTitle((const char*)qadm.GetTitle());
60 //__________________________________________________________________
61 AliPMDQADataMakerSim& AliPMDQADataMakerSim::operator = (const AliPMDQADataMakerSim& qadm )
64 this->~AliPMDQADataMakerSim();
65 new(this) AliPMDQADataMakerSim(qadm);
69 //____________________________________________________________________________
70 void AliPMDQADataMakerSim::InitHits()
72 // create Hits histograms in Hits subdir
73 const Bool_t expert = kTRUE ;
74 const Bool_t image = kTRUE ;
76 TH1F *h0 = new TH1F("hPreHitsEdep","Hits energy distribution PRE(PMD);Energy [keV];Counts", 500, 0., 500.);
78 Add2HitsList(h0, 0, !expert, image) ;
80 TH1F *h1 = new TH1F("hCpvHitsEdep","Hits energy distribution CPV(PMD);Energy [keV];Counts", 500, 0., 500.);
82 Add2HitsList(h1, 1, !expert, image) ;
84 TH1I *h2 = new TH1I("hPreHitsMult","Hits multiplicity distribution in PRE(PMD);# of Hits;Entries", 500, 0, 3000) ;
86 Add2HitsList(h2, 2, !expert, image) ;
88 TH1I *h3 = new TH1I("hCpvHitsMult","Hits multiplicity distribution in PRE(PMD);# of Hits;Entries", 500, 0, 3000) ;
90 Add2HitsList(h3, 3, !expert, image) ;
92 ClonePerTrigClass(AliQAv1::kHITS); // this should be the last line
95 //____________________________________________________________________________
96 void AliPMDQADataMakerSim::InitSDigits()
98 // create SDigits histograms in SDigits subdir
99 const Bool_t expert = kTRUE ;
100 const Bool_t image = kTRUE ;
102 TH1F *h0 = new TH1F("hPreSDigitsEdep","SDigits energy distribution in(keV) PRE(PMD);Energy [keV];Counts", 500, 0., 500.);
104 Add2SDigitsList(h0, 0, !expert, image);
106 TH1F *h1 = new TH1F("hCpvSDigitsEdep","SDigits energy distribution in (keV)CPV(PMD);Energy [keV];Counts", 500, 0., 500.);
108 Add2SDigitsList(h1, 1, !expert, image);
110 TH1I *h2 = new TH1I("hPreSDigitsMult","SDigits multiplicity distribution in PRE(PMD);# of SDigits;Entries", 500, 0., 1000.);
112 Add2SDigitsList(h2, 2, !expert, image);
114 TH1I *h3 = new TH1I("hCpvSDigitsMult","SDigits multiplicity distribution in CPV(PMD);# of SDigits;Entries", 500, 0., 1000.);
116 Add2SDigitsList(h3, 3, !expert, image);
118 ClonePerTrigClass(AliQAv1::kSDIGITS); // this should be the last line
121 //____________________________________________________________________________
122 void AliPMDQADataMakerSim::InitDigits()
124 // create Digits histograms in Digits subdir
125 const Bool_t expert = kTRUE ;
126 const Bool_t image = kTRUE ;
128 TH1F *h0 = new TH1F("hPreDigitsEdep","Digits energy distribution in PRE(PMD);Amplitude [ADC counts];Counts", 100, 0., 2000.);
130 Add2DigitsList(h0, 0, !expert, image);
132 TH1F *h1 = new TH1F("hCpvDigitsEdep","Digits energy distribution in CPV(PMD);Amplitude [ADC counts];Counts", 100, 0., 2000.);
134 Add2DigitsList(h1, 1, !expert, image);
136 TH1I *h2 = new TH1I("hPreDigitsMult","Digits multiplicity distribution in PRE(PMD);# of Digits;Entries", 500, 0, 1000) ;
138 Add2DigitsList(h2, 2, !expert, image);
140 TH1I *h3 = new TH1I("hCpvDigitsMult","Digits multiplicity distribution in CPV(PMD);# of Digits;Entries", 500, 0, 1000);
142 Add2DigitsList(h3, 3, !expert, image);
144 ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line
147 //____________________________________________________________________________
148 void AliPMDQADataMakerSim::MakeHits()
150 //make QA data from Hits
152 Int_t premul = 0, cpvmul = 0;
153 Float_t edepkev = 0.;
154 TIter next(fHitsArray);
157 while ( (hit = dynamic_cast<AliPMDhit *>(next())) )
159 if (hit->Z() > 361.5)
161 edepkev = (hit->GetEnergy())/1000.;
162 FillHitsData(0,edepkev);
165 else if (hit->Z() < 361.5)
167 edepkev = (hit->GetEnergy())/1000.;
168 FillHitsData(1,edepkev);
179 FillHitsData(2,premul);
188 FillHitsData(3,cpvmul);
193 //____________________________________________________________________________
194 void AliPMDQADataMakerSim::MakeHits(TTree * hitTree)
196 // make QA data from Hit Tree
198 TBranch * branch = hitTree->GetBranch("PMD") ;
201 AliWarning("PMD branch in Hit Tree not found") ;
206 fHitsArray->Clear() ;
208 fHitsArray = new TClonesArray("AliPMDhit", 1000);
210 branch->SetAddress(&fHitsArray);
212 for (Int_t ientry = 0 ; ientry < branch->GetEntries() ; ientry++) {
213 branch->GetEntry(ientry) ;
215 fHitsArray->Clear() ;
218 IncEvCountCycleHits();
219 IncEvCountTotalHits();
222 //____________________________________________________________________________
223 void AliPMDQADataMakerSim::MakeSDigits()
225 // makes data from SDigits
227 Int_t cpvmul = 0, premul = 0;
228 Float_t edepkev = 0.;
230 TIter next(fSDigitsArray) ;
231 AliPMDsdigit * sdigit ;
232 while ( (sdigit = dynamic_cast<AliPMDsdigit *>(next())) )
234 if(sdigit->GetDetector() == 0)
236 edepkev = (sdigit->GetCellEdep())/1000.;
237 FillSDigitsData(0,edepkev);
240 if(sdigit->GetDetector() == 1)
242 edepkev = (sdigit->GetCellEdep())/1000.;
243 FillSDigitsData(1,edepkev);
248 if (premul > 0) FillSDigitsData(2,premul);
249 if (cpvmul > 0) FillSDigitsData(3,cpvmul);
253 //____________________________________________________________________________
254 void AliPMDQADataMakerSim::MakeSDigits(TTree * sdigitTree)
256 // makes data from SDigit Tree
259 fSDigitsArray->Clear() ;
261 fSDigitsArray = new TClonesArray("AliPMDsdigit", 1000) ;
263 TBranch * branch = sdigitTree->GetBranch("PMDSDigit") ;
266 AliWarning("PMD branch in SDigit Tree not found") ;
270 branch->SetAddress(&fSDigitsArray) ;
271 branch->GetEntry(0) ;
275 IncEvCountCycleSDigits();
276 IncEvCountTotalSDigits();
280 //____________________________________________________________________________
281 void AliPMDQADataMakerSim::MakeDigits()
283 // makes data from Digits
285 Int_t cpvmul = 0, premul = 0;
287 TIter next(fDigitsArray) ;
288 AliPMDdigit * digit ;
289 while ( (digit = dynamic_cast<AliPMDdigit *>(next())) )
291 if(digit->GetDetector() == 0)
293 FillDigitsData(0, digit->GetADC()) ;
296 if(digit->GetDetector() == 1)
298 FillDigitsData(1, digit->GetADC());
303 if (premul > 0) FillDigitsData(2,premul);
304 if (cpvmul > 0) FillDigitsData(3,cpvmul);
309 //____________________________________________________________________________
310 void AliPMDQADataMakerSim::MakeDigits(TTree * digitTree)
312 // makes data from Digit Tree
315 fDigitsArray->Clear() ;
317 fDigitsArray = new TClonesArray("AliPMDdigit", 1000) ;
319 TBranch * branch = digitTree->GetBranch("PMDDigit") ;
323 AliWarning("PMD branch in Digit Tree not found") ;
327 branch->SetAddress(&fDigitsArray) ;
328 for (Int_t ient = 0; ient < branch->GetEntries(); ient++)
330 branch->GetEntry(ient) ;
332 fDigitsArray->Clear() ;
338 IncEvCountCycleDigits();
339 IncEvCountTotalDigits();
344 //____________________________________________________________________________
346 void AliPMDQADataMakerSim::StartOfDetectorCycle()
348 //Detector specific actions at start of cycle
351 //____________________________________________________________________________
353 void AliPMDQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
355 //Detector specific actions at end of cycle
356 // do the QA checking
357 AliQAChecker::Instance()->Run(AliQAv1::kPMD, task, list) ;