]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSQADataMakerSim.cxx
AltroMapping corrected for Raw2SDigits
[u/mrichter/AliRoot.git] / PHOS / AliPHOSQADataMakerSim.cxx
CommitLineData
04236e67 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#include <TH2F.h>
31#include <TTree.h>
32
33// --- Standard library ---
34
35// --- AliRoot header files ---
36#include "AliESDCaloCluster.h"
37#include "AliLog.h"
38#include "AliPHOSDigit.h"
39#include "AliPHOSHit.h"
40#include "AliPHOSQADataMakerSim.h"
41#include "AliQAChecker.h"
42
43ClassImp(AliPHOSQADataMakerSim)
44
45//____________________________________________________________________________
8d8258f6 46AliPHOSQADataMakerSim::AliPHOSQADataMakerSim() :
6252ceeb 47 AliQADataMakerSim(AliQAv1::GetDetName(AliQAv1::kPHOS), "PHOS Quality Assurance Data Maker")
04236e67 48{
49 // ctor
50}
51
52//____________________________________________________________________________
53AliPHOSQADataMakerSim::AliPHOSQADataMakerSim(const AliPHOSQADataMakerSim& qadm) :
6252ceeb 54 AliQADataMakerSim()
04236e67 55{
56 //copy ctor
57 SetName((const char*)qadm.GetName()) ;
58 SetTitle((const char*)qadm.GetTitle());
59}
60
61//__________________________________________________________________
62AliPHOSQADataMakerSim& AliPHOSQADataMakerSim::operator = (const AliPHOSQADataMakerSim& qadm )
63{
64 // Assign operator.
65 this->~AliPHOSQADataMakerSim();
66 new(this) AliPHOSQADataMakerSim(qadm);
67 return *this;
68}
69
70//____________________________________________________________________________
4e25ac79 71void AliPHOSQADataMakerSim::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
04236e67 72{
73 //Detector specific actions at end of cycle
74 // do the QA checking
4e25ac79 75 AliQAChecker::Instance()->Run(AliQAv1::kPHOS, task, list) ;
04236e67 76}
77
78//____________________________________________________________________________
79void AliPHOSQADataMakerSim::InitHits()
80{
81 // create Hits histograms in Hits subdir
7d297381 82 const Bool_t expert = kTRUE ;
83 const Bool_t image = kTRUE ;
db72ff3b 84 TH1F * h0 = new TH1F("hPhosHits", "Hits energy distribution in PHOS;Energy [MeV];Counts", 100, 0., 100.) ;
04236e67 85 h0->Sumw2() ;
7d297381 86 Add2HitsList(h0, kHits, !expert, image) ;
db72ff3b 87 TH1I * h1 = new TH1I("hPhosHitsMul", "Hits multiplicity distribution in PHOS;# of Hits;Entries", 500, 0., 10000) ;
04236e67 88 h1->Sumw2() ;
7d297381 89 Add2HitsList(h1, kHitsMul, !expert, image) ;
57acd2d2 90
04236e67 91}
92
93//____________________________________________________________________________
94void AliPHOSQADataMakerSim::InitDigits()
95{
96 // create Digits histograms in Digits subdir
7d297381 97 const Bool_t expert = kTRUE ;
98 const Bool_t image = kTRUE ;
db72ff3b 99 TH1I * h0 = new TH1I("hPhosDigits", "Digits amplitude distribution in PHOS;Amplitude [ADC counts];Counts", 500, 0, 1000) ;
04236e67 100 h0->Sumw2() ;
7d297381 101 Add2DigitsList(h0, kDigits, !expert, image) ;
db72ff3b 102 TH1I * h1 = new TH1I("hPhosDigitsMul", "Digits multiplicity distribution in PHOS;# of Digits;Entries", 2000, 0, 10000) ;
04236e67 103 h1->Sumw2() ;
7d297381 104 Add2DigitsList(h1, kDigitsMul, !expert, image) ;
04236e67 105}
106
107//____________________________________________________________________________
108void AliPHOSQADataMakerSim::InitSDigits()
109{
110 // create SDigits histograms in SDigits subdir
7d297381 111 const Bool_t expert = kTRUE ;
112 const Bool_t image = kTRUE ;
db72ff3b 113 TH1F * h0 = new TH1F("hPhosSDigits", "SDigits energy distribution in PHOS; Energy [MeV];Counts", 500, 0., 1000.) ;
04236e67 114 h0->Sumw2() ;
7d297381 115 Add2SDigitsList(h0, kSDigits, !expert, image) ;
db72ff3b 116 TH1I * h1 = new TH1I("hPhosSDigitsMul", "SDigits multiplicity distribution in PHOS;# of SDigits;Entries", 500, 0, 1000) ;
04236e67 117 h1->Sumw2() ;
7d297381 118 Add2SDigitsList(h1, kSDigitsMul, !expert, image) ;
04236e67 119}
120
121//____________________________________________________________________________
8d8258f6 122void AliPHOSQADataMakerSim::MakeHits()
04236e67 123{
8d8258f6 124 //make QA data from Hits
125
6252ceeb 126 TIter next(fHitsArray) ;
8d8258f6 127 AliPHOSHit * hit ;
128 while ( (hit = dynamic_cast<AliPHOSHit *>(next())) ) {
57acd2d2 129 GetHitsData(kHits)->Fill( hit->GetEnergy()) ;
8d8258f6 130 }
04236e67 131}
132
133//____________________________________________________________________________
134void AliPHOSQADataMakerSim::MakeHits(TTree * hitTree)
135{
8d8258f6 136 // make QA data from Hit Tree
137
6252ceeb 138 if (fHitsArray)
139 fHitsArray->Clear() ;
140 else
141 fHitsArray = new TClonesArray("AliPHOSHit", 1000);
142
8d8258f6 143 TBranch * branch = hitTree->GetBranch("PHOS") ;
144 if ( ! branch ) {
145 AliWarning("PHOS branch in Hit Tree not found") ;
146 } else {
147 Int_t nHits = 0;
6252ceeb 148 branch->SetAddress(&fHitsArray) ;
8d8258f6 149 for (Int_t ientry = 0 ; ientry < branch->GetEntries() ; ientry++) {
150 branch->GetEntry(ientry) ;
6252ceeb 151 nHits += fHitsArray->GetEntriesFast();
8d8258f6 152 MakeHits() ;
6252ceeb 153 fHitsArray->Clear();
8d8258f6 154 }
155 GetHitsData(1)->Fill(nHits) ;
156 }
04236e67 157}
158
159//____________________________________________________________________________
6252ceeb 160void AliPHOSQADataMakerSim::MakeDigits()
04236e67 161{
162 // makes data from Digits
6252ceeb 163
164 GetDigitsData(1)->Fill(fDigitsArray->GetEntriesFast()) ;
165 TIter next(fDigitsArray) ;
166 AliPHOSDigit * digit ;
167 while ( (digit = dynamic_cast<AliPHOSDigit *>(next())) ) {
168 GetDigitsData(kDigits)->Fill( digit->GetEnergy()) ;
169 }
04236e67 170}
171
172//____________________________________________________________________________
173void AliPHOSQADataMakerSim::MakeDigits(TTree * digitTree)
174{
175 // makes data from Digit Tree
6252ceeb 176 if (fDigitsArray)
177 fDigitsArray->Clear() ;
178 else
179 fDigitsArray = new TClonesArray("AliPHOSDigit", 1000) ;
04236e67 180
181 TBranch * branch = digitTree->GetBranch("PHOS") ;
182 if ( ! branch ) {
183 AliWarning("PHOS branch in Digit Tree not found") ;
184 } else {
6252ceeb 185 branch->SetAddress(&fDigitsArray) ;
04236e67 186 branch->GetEntry(0) ;
6252ceeb 187 MakeDigits() ;
04236e67 188 }
189}
190
191//____________________________________________________________________________
6252ceeb 192void AliPHOSQADataMakerSim::MakeSDigits()
04236e67 193{
194 // makes data from SDigits
eca4fa66 195
6252ceeb 196 GetSDigitsData(1)->Fill(fSDigitsArray->GetEntriesFast()) ;
197 TIter next(fSDigitsArray) ;
eca4fa66 198 AliPHOSDigit * sdigit ;
199 while ( (sdigit = dynamic_cast<AliPHOSDigit *>(next())) ) {
200 GetSDigitsData(kSDigits)->Fill( sdigit->GetEnergy()) ;
201 }
04236e67 202}
203
204//____________________________________________________________________________
205void AliPHOSQADataMakerSim::MakeSDigits(TTree * sdigitTree)
206{
207 // makes data from SDigit Tree
6252ceeb 208 if (fSDigitsArray)
209 fSDigitsArray->Clear() ;
210 else
211 fSDigitsArray = new TClonesArray("AliPHOSDigit", 1000) ;
212
04236e67 213 TBranch * branch = sdigitTree->GetBranch("PHOS") ;
214 if ( ! branch ) {
215 AliWarning("PHOS branch in SDigit Tree not found") ;
216 } else {
6252ceeb 217 branch->SetAddress(&fSDigitsArray) ;
04236e67 218 branch->GetEntry(0) ;
6252ceeb 219 MakeSDigits() ;
04236e67 220 }
221}
222
223//____________________________________________________________________________
224void AliPHOSQADataMakerSim::StartOfDetectorCycle()
225{
226 //Detector specific actions at start of cycle
227
228}