Reducing the search window used to find the max in the ADC samples. Needed because...
[u/mrichter/AliRoot.git] / PHOS / AliPHOSQADataMakerRec.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>
3bffaa2f 31#include <TParameter.h>
04236e67 32
33// --- Standard library ---
34
35// --- AliRoot header files ---
379c5c09 36#include "AliCaloRawStreamV3.h"
04236e67 37#include "AliESDCaloCluster.h"
38#include "AliESDEvent.h"
39#include "AliLog.h"
40#include "AliPHOSQADataMakerRec.h"
44ed7a66 41#include "AliPHOSDigit.h"
04236e67 42#include "AliPHOSCpvRecPoint.h"
43#include "AliPHOSEmcRecPoint.h"
379c5c09 44#include "AliPHOSRawFitterv0.h"
45#include "AliPHOSRawFitterv1.h"
46#include "AliPHOSRawFitterv2.h"
47#include "AliPHOSReconstructor.h"
04236e67 48#include "AliPHOSRecParticle.h"
49#include "AliPHOSTrackSegment.h"
379c5c09 50#include "AliQAChecker.h"
51#include "AliRawReader.h"
04236e67 52
53ClassImp(AliPHOSQADataMakerRec)
54
55//____________________________________________________________________________
56 AliPHOSQADataMakerRec::AliPHOSQADataMakerRec() :
4e25ac79 57 AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kPHOS), "PHOS Quality Assurance Data Maker")
04236e67 58{
59 // ctor
60}
61
62//____________________________________________________________________________
63AliPHOSQADataMakerRec::AliPHOSQADataMakerRec(const AliPHOSQADataMakerRec& qadm) :
64 AliQADataMakerRec()
65{
66 //copy ctor
67 SetName((const char*)qadm.GetName()) ;
68 SetTitle((const char*)qadm.GetTitle());
69}
70
71//__________________________________________________________________
72AliPHOSQADataMakerRec& AliPHOSQADataMakerRec::operator = (const AliPHOSQADataMakerRec& qadm )
73{
74 // Equal operator.
75 this->~AliPHOSQADataMakerRec();
76 new(this) AliPHOSQADataMakerRec(qadm);
77 return *this;
78}
79
80//____________________________________________________________________________
4e25ac79 81void AliPHOSQADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
04236e67 82{
83 //Detector specific actions at end of cycle
6252ceeb 84 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
85 if (! IsValidEventSpecie(specie, list))
86 continue ;
87 SetEventSpecie(AliRecoParam::ConvertIndex(specie)) ;
80f1c279 88 if(GetRawsData(kHGqualMod0) && GetRawsData(kHGmod0))
89 GetRawsData(kHGqualMod0)->Divide( GetRawsData(kHGmod0) ) ;
6252ceeb 90 if(GetRawsData(kHGqualMod1) && GetRawsData(kHGmod1))
91 GetRawsData(kHGqualMod1)->Divide( GetRawsData(kHGmod1) ) ;
92 if(GetRawsData(kHGqualMod2) && GetRawsData(kHGmod2))
93 GetRawsData(kHGqualMod2)->Divide( GetRawsData(kHGmod2) ) ;
94 if(GetRawsData(kHGqualMod3) && GetRawsData(kHGmod3))
95 GetRawsData(kHGqualMod3)->Divide( GetRawsData(kHGmod3) ) ;
96 if(GetRawsData(kHGqualMod4) && GetRawsData(kHGmod4))
97 GetRawsData(kHGqualMod4)->Divide( GetRawsData(kHGmod4) ) ;
6252ceeb 98 }
04236e67 99 // do the QA checking
4e25ac79 100 AliQAChecker::Instance()->Run(AliQAv1::kPHOS, task, list) ;
04236e67 101}
102
103//____________________________________________________________________________
104void AliPHOSQADataMakerRec::InitESDs()
105{
ebde5500 106 //Create histograms to controll ESD
107
7d297381 108 const Bool_t expert = kTRUE ;
109 const Bool_t image = kTRUE ;
33055c0e 110
db72ff3b 111 TH1F * h1 = new TH1F("hESDPhosSpectrum", "ESDs spectrum in PHOS; Energy [MeV];Counts" , 200, 0., 20.) ;
39569d36 112 h1->Sumw2() ;
7d297381 113 Add2ESDsList(h1, kESDSpec, !expert, image) ;
e862ee5c 114
db72ff3b 115 TH1I * h2 = new TH1I("hESDPhosMul", "ESDs multiplicity distribution in PHOS; # of clusters;Counts", 100, 0, 100 ) ;
39569d36 116 h2->Sumw2() ;
7d297381 117 Add2ESDsList(h2, kESDNtot, !expert, image) ;
ebde5500 118
db72ff3b 119 TH1F * h3 = new TH1F("hESDPhosEtot", "ESDs total energy;Energy [MeV];Counts" , 2000, 0, 200.) ;
39569d36 120 h3->Sumw2() ;
7d297381 121 Add2ESDsList(h3, kESDEtot, !expert, image) ; //Expert histo
ebde5500 122
db72ff3b 123 TH1F * h4 = new TH1F("hESDpid", "ESDs PID distribution in PHOS;Particle Id;Counts" , 100, 0., 1.) ;
39569d36 124 h4->Sumw2() ;
7d297381 125 Add2ESDsList(h4, kESDpid, !expert, image) ; //Expert histo
04236e67 126
04236e67 127}
128
129//____________________________________________________________________________
44ed7a66 130void AliPHOSQADataMakerRec::InitDigits()
131{
132 // create Digits histograms in Digits subdir
133 const Bool_t expert = kTRUE ;
134 const Bool_t image = kTRUE ;
db72ff3b 135 TH1I * h0 = new TH1I("hPhosDigits", "Digits amplitude distribution in PHOS;Amplitude [ADC counts];Counts", 500, 0, 1000) ;
44ed7a66 136 h0->Sumw2() ;
137 Add2DigitsList(h0, kDigits, !expert, image) ;
db72ff3b 138 TH1I * h1 = new TH1I("hPhosDigitsMul", "Digits multiplicity distribution in PHOS;# of Digits;Entries", 2000, 0, 10000) ;
44ed7a66 139 h1->Sumw2() ;
140 Add2DigitsList(h1, kDigitsMul, !expert, image) ;
141}
142
143//____________________________________________________________________________
04236e67 144void AliPHOSQADataMakerRec::InitRecPoints()
145{
146 // create Reconstructed Points histograms in RecPoints subdir
7d297381 147 const Bool_t expert = kTRUE ;
148 const Bool_t image = kTRUE ;
7285e69f 149
db72ff3b 150 TH2I * h0 = new TH2I("hRpPHOSxyMod1","RecPoints Rows x Columns for PHOS module 1;Row #;Column #", 64, -72., 72., 56, -63., 63.) ;
7d297381 151 Add2RecPointsList(h0,kRPmod1, expert, !image) ;
db72ff3b 152 TH2I * h1 = new TH2I("hRpPHOSxyMod2","RecPoints Rows x Columns for PHOS module 2;Row #;Column #", 64, -72., 72., 56, -63., 63.) ;
7d297381 153 Add2RecPointsList(h1,kRPmod2, expert, !image) ;
db72ff3b 154 TH2I * h2 = new TH2I("hRpPHOSxyMod3","RecPoints Rows x Columns for PHOS module 3;Row #;Column #", 64, -72., 72., 56, -63., 63.) ;
7d297381 155 Add2RecPointsList(h2,kRPmod3, expert, !image) ;
db72ff3b 156 TH2I * h3 = new TH2I("hRpPHOSxyMod4","RecPoints Rows x Columns for PHOS module 4;Row #;Column #", 64, -72., 72., 56, -63., 63.) ;
7d297381 157 Add2RecPointsList(h3,kRPmod4, expert, !image) ;
db72ff3b 158 TH2I * h4 = new TH2I("hRpPHOSxyMod5","RecPoints Rows x Columns for PHOS module 5;Row #;Column #", 64, -72., 72., 56, -63., 63.) ;
7d297381 159 Add2RecPointsList(h4,kRPmod5, expert, !image) ;
ebde5500 160
db72ff3b 161 TH1F * h5 = new TH1F("hEmcPhosRecPointsSpectrum", "EMC RecPoints spectrum in PHOS;Energy [MeV];Counts", 2000, 0., 20.) ;
ebde5500 162 h5->Sumw2() ;
7d297381 163 Add2RecPointsList(h5, kRPSpec, !expert, image) ;
ebde5500 164
db72ff3b 165 TH1I * h6 = new TH1I("hEmcPhosRecPointsMul", "EMC RecPoints multiplicity distribution in PHOS;# of EMC Clusters;Entries", 100, 0, 100) ;
ebde5500 166 h6->Sumw2() ;
7d297381 167 Add2RecPointsList(h6, kRPNtot, !expert, image) ;
ebde5500 168
db72ff3b 169 TH1I * h7 = new TH1I("hEmcPhosRecPointsEtot", "EMC RecPoints Etot;Energy [MeV];Counts", 200, 0, 200.) ;
ebde5500 170 h7->Sumw2() ;
7d297381 171 Add2RecPointsList(h7, kRPEtot, !expert, image) ;
04236e67 172
db72ff3b 173 TH1I * h8 = new TH1I("hCpvPhosRecPointsMul", "CPV RecPoints multiplicity distribution in PHOS;# of CPV clusters;Counts", 100, 0, 100) ;
ebde5500 174 h8->Sumw2() ;
7d297381 175 Add2RecPointsList(h8, kRPNcpv, !expert, image) ;
04236e67 176}
177
178//____________________________________________________________________________
179void AliPHOSQADataMakerRec::InitRaws()
180{
181 // create Raws histograms in Raws subdir
7d297381 182 const Bool_t expert = kTRUE ;
183 const Bool_t saveCorr = kTRUE ;
184 const Bool_t image = kTRUE ;
185
80f1c279 186 TH2I * h0 = new TH2I("hHighPHOSxyMod0","High Gain in PHOS module 0", 64, 0, 64, 56, 0, 56) ;
187 h0->SetXTitle("x, cells"); h0->SetYTitle("z, cells");
188 Add2RawsList(h0,kHGmod0, expert, !image, !saveCorr) ;
189 TH2I * h1 = new TH2I("hHighPHOSxyMod1","High Gain in PHOS module 1", 64, 0, 64, 56, 0, 56) ;
190 h1->SetXTitle("x, cells"); h1->SetYTitle("z, cells");
191 Add2RawsList(h1,kHGmod1, expert, !image, !saveCorr) ;
192 TH2I * h2 = new TH2I("hHighPHOSxyMod2","High Gain in PHOS module 2", 64, 0, 64, 56, 0, 56) ;
193 h2->SetXTitle("x, cells"); h2->SetYTitle("z, cells");
194 Add2RawsList(h2,kHGmod2, expert, !image, !saveCorr) ;
195 TH2I * h3 = new TH2I("hHighPHOSxyMod3","High Gain in PHOS module 3", 64, 0, 64, 56, 0, 56) ;
196 h3->SetXTitle("x, cells"); h3->SetYTitle("z, cells");
197 Add2RawsList(h3,kHGmod3, expert, !image, !saveCorr) ;
198 TH2I * h4 = new TH2I("hHighPHOSxyMod4","High Gain in PHOS module 4", 64, 0, 64, 56, 0, 56) ;
199 h4->SetXTitle("x, cells"); h4->SetYTitle("z, cells");
200 Add2RawsList(h4,kHGmod4, expert, !image, !saveCorr) ;
201
202 TH2I * h5 = new TH2I("hLowPHOSxyMod0","Low Gain in PHOS module 0", 64, 0, 64, 56, 0, 56) ;
203 h5->SetXTitle("x, cells"); h5->SetYTitle("z, cells");
204 Add2RawsList(h5,kLGmod0, expert, !image, !saveCorr) ;
205 TH2I * h6 = new TH2I("hLowPHOSxyMod1","Low Gain in PHOS module 1", 64, 0, 64, 56, 0, 56) ;
206 h6->SetXTitle("x, cells"); h6->SetYTitle("z, cells");
207 Add2RawsList(h6,kLGmod1, expert, !image, !saveCorr) ;
208 TH2I * h7 = new TH2I("hLowPHOSxyMod2","Low Gain in PHOS module 2", 64, 0, 64, 56, 0, 56) ;
209 h7->SetXTitle("x, cells"); h7->SetYTitle("z, cells");
210 Add2RawsList(h7,kLGmod2, expert, !image, !saveCorr) ;
211 TH2I * h8 = new TH2I("hLowPHOSxyMod3","Low Gain in PHOS module 3", 64, 0, 64, 56, 0, 56) ;
212 h8->SetXTitle("x, cells"); h8->SetYTitle("z, cells");
213 Add2RawsList(h8,kLGmod3, expert, !image, !saveCorr) ;
214 TH2I * h9 = new TH2I("hLowPHOSxyMod4","Low Gain in PHOS module 4", 64, 0, 64, 56, 0, 56) ;
215 h9->SetXTitle("x, cells"); h9->SetYTitle("z, cells");
216 Add2RawsList(h9,kLGmod4, expert, !image, !saveCorr) ;
217
218 TH1I * h10 = new TH1I("hLowPhosModules", "Low Gain Hits in EMCA PHOS modules", 5, 0, 5) ;
219 h10->SetXTitle("Module number");
7d297381 220 Add2RawsList(h10, kNmodLG, !expert, image, !saveCorr) ;
80f1c279 221 TH1I * h11 = new TH1I("hHighPhosModules", "High Gain Hits in EMCA PHOS modules",5, 0, 5) ;
222 h11->SetXTitle("Module number");
7d297381 223 Add2RawsList(h11, kNmodHG, !expert, image, !saveCorr) ;
98e3f48c 224
80f1c279 225 TH1F * h12 = new TH1F("hLowPhosRawtime" , "Low Gain Time of raw hits in PHOS" , 500, -50., 200.) ;
226 h12->SetXTitle("Time [samples]");
98e3f48c 227 h12->Sumw2() ;
80f1c279 228 Add2RawsList(h12, kLGtime, expert, !image, !saveCorr) ;
229 TH1F * h13 = new TH1F("hHighPhosRawtime", "High Gain Time of raw hits in PHOS", 500, -50., 200.) ;
230 h13->SetXTitle("Time [samples]");
98e3f48c 231 h13->Sumw2() ;
80f1c279 232 Add2RawsList(h13, kHGtime, expert, !image, !saveCorr) ;
98e3f48c 233
80f1c279 234 TH1F * h14 = new TH1F("hLowPhosRawEnergy" , "Low Gain Energy of raw hits in PHOS" , 512, 0., 1024.) ;
235 h14->SetXTitle("Energy [ADC counts]");
98e3f48c 236 h14->Sumw2() ;
7d297381 237 Add2RawsList(h14, kSpecLG, !expert, image, !saveCorr) ;
80f1c279 238 TH1F * h15 = new TH1F("hHighPhosRawEnergy", "High Gain Energy of raw hits in PHOS", 512, 0., 1024.) ;
239 h15->SetXTitle("Energy [ADC counts]");
98e3f48c 240 h15->Sumw2() ;
7d297381 241 Add2RawsList(h15, kSpecHG, !expert, image, !saveCorr) ;
98e3f48c 242
80f1c279 243 TH1F * h16 = new TH1F("hLowNtot" , "Low Gain Total Number of raw hits in PHOS" , 500, 0., 5000.) ;
244 h16->SetXTitle("Number of hits");
98e3f48c 245 h16->Sumw2() ;
80f1c279 246 Add2RawsList(h16, kNtotLG, !expert, image, saveCorr) ;
247 TH1F * h17 = new TH1F("hHighNtot", "High Gain Total Number of raw hits in PHOS", 500, 0., 5000.) ;
248 h17->SetXTitle("Number of hits");
98e3f48c 249 h17->Sumw2() ;
80f1c279 250 Add2RawsList(h17, kNtotHG, !expert, image, saveCorr) ;
98e3f48c 251
80f1c279 252 TH1F * h18 = new TH1F("hLowEtot" , "Low Gain Total Energy of raw hits in PHOS" , 500, 0., 100000.) ;
253 h18->SetXTitle("Energy [ADC counts]");
98e3f48c 254 h18->Sumw2() ;
80f1c279 255 Add2RawsList(h18, kEtotLG, !expert, image, saveCorr) ;
256 TH1F * h19 = new TH1F("hHighEtot", "High Gain Total Energy of raw hits in PHOS", 500, 0., 100000.) ;
257 h19->SetXTitle("Energy [ADC counts]");
98e3f48c 258 h19->Sumw2() ;
80f1c279 259 Add2RawsList(h19, kEtotHG, !expert, image, saveCorr) ;
260
261 TH2F * h20 = new TH2F("hQualHGxyMod0","High Gain signal quality in module 0", 64, 0, 64, 56, 0, 56) ;
262 h20->SetXTitle("x, cells"); h20->SetYTitle("z, cells");
263 Add2RawsList(h20,kHGqualMod0, expert, !image, !saveCorr) ;
264 TH2F * h21 = new TH2F("hQualHGxyMod1","High Gain signal quality in module 1", 64, 0, 64, 56, 0, 56) ;
265 h21->SetXTitle("x, cells"); h21->SetYTitle("z, cells");
266 Add2RawsList(h21,kHGqualMod1, expert, !image, !saveCorr) ;
267 TH2F * h22 = new TH2F("hQualHGxyMod2","High Gain signal quality in module 2", 64, 0, 64, 56, 0, 56) ;
268 h22->SetXTitle("x, cells"); h22->SetYTitle("z, cells");
269 Add2RawsList(h22,kHGqualMod2, expert, !image, !saveCorr) ;
270 TH2F * h23 = new TH2F("hQualHGxyMod3","High Gain signal quality in module 3", 64, 0, 64, 56, 0, 56) ;
271 h23->SetXTitle("x, cells"); h23->SetYTitle("z, cells");
272 Add2RawsList(h23,kHGqualMod3, expert, !image, !saveCorr) ;
273 TH2F * h24 = new TH2F("hQualHGxyMod4","High Gain signal quality in module 4", 64, 0, 64, 56, 0, 56) ;
274 h24->SetXTitle("x, cells"); h24->SetYTitle("z, cells");
275 Add2RawsList(h24,kHGqualMod4, expert, !image, !saveCorr) ;
276
277 TH2F * h25 = new TH2F("hQualLGxyMod0","Low Gain signal quality in module 0", 64, 0, 64, 56, 0, 56) ;
278 h25->SetXTitle("x, cells"); h25->SetYTitle("z, cells");
279 Add2RawsList(h25,kLGqualMod0, expert, !image, !saveCorr) ;
280 TH2F * h26 = new TH2F("hQualLGxyMod1","Low Gain signal quality in module 1", 64, 0, 64, 56, 0, 56) ;
281 h26->SetXTitle("x, cells"); h26->SetYTitle("z, cells");
282 Add2RawsList(h26,kLGqualMod1, expert, !image, !saveCorr) ;
283 TH2F * h27 = new TH2F("hQualLGxyMod2","Low Gain signal quality in module 2", 64, 0, 64, 56, 0, 56) ;
284 h27->SetXTitle("x, cells"); h27->SetYTitle("z, cells");
285 Add2RawsList(h27,kLGqualMod2, expert, !image, !saveCorr) ;
286 TH2F * h28 = new TH2F("hQualLGxyMod3","Low Gain signal quality in module 3", 64, 0, 64, 56, 0, 56) ;
287 h28->SetXTitle("x, cells"); h28->SetYTitle("z, cells");
288 Add2RawsList(h28,kLGqualMod3, expert, !image, !saveCorr) ;
289 TH2F * h29 = new TH2F("hQualLGxyMod4","Low Gain signal quality in module 4", 64, 0, 64, 56, 0, 56) ;
290 h29->SetXTitle("x, cells"); h29->SetYTitle("z, cells");
291 Add2RawsList(h29,kLGqualMod4, expert, !image, !saveCorr) ;
292
293 TH1F * h30 = new TH1F("hLGpedRMS" ,"Low Gain pedestal RMS" ,200,0.,20.) ;
294 h30->SetXTitle("RMS [ADC counts]");
7285e69f 295 h30->Sumw2() ;
80f1c279 296 Add2RawsList(h30,kLGpedRMS, expert, !image, !saveCorr) ;
297 TH1F * h31 = new TH1F("hHGpedRMS" ,"High Gain pedestal RMS",200,0.,20.) ;
298 h31->SetXTitle("RMS [ADC counts]");
7285e69f 299 h31->Sumw2() ;
80f1c279 300 Add2RawsList(h31,kHGpedRMS, expert, !image, !saveCorr) ;
301
302 TH2F * h32 = new TH2F("hpedRMSHGxyMod0","High Gain pedestal RMS in module 0", 64, 0, 64, 56, 0, 56) ;
303 h32->SetXTitle("x, cells"); h32->SetYTitle("z, cells");
304 Add2RawsList(h32,kHGpedRMSMod0, expert, !image, !saveCorr) ;
305 TH2F * h33 = new TH2F("hpedRMSHGxyMod1","High Gain pedestal RMS in module 1", 64, 0, 64, 56, 0, 56) ;
306 h33->SetXTitle("x, cells"); h33->SetYTitle("z, cells");
307 Add2RawsList(h33,kHGpedRMSMod1, expert, !image, !saveCorr) ;
308 TH2F * h34 = new TH2F("hpedRMSHGxyMod2","High Gain pedestal RMS in module 2", 64, 0, 64, 56, 0, 56) ;
309 h34->SetXTitle("x, cells"); h34->SetYTitle("z, cells");
310 Add2RawsList(h34,kHGpedRMSMod2, expert, !image, !saveCorr) ;
311 TH2F * h35 = new TH2F("hpedRMSHGxyMod3","High Gain pedestal RMS in module 3", 64, 0, 64, 56, 0, 56) ;
312 h35->SetXTitle("x, cells"); h35->SetYTitle("z, cells");
313 Add2RawsList(h35,kHGpedRMSMod3, expert, !image, !saveCorr) ;
314 TH2F * h36 = new TH2F("hpedRMSHGxyMod4","High Gain pedestal RMS in module 4", 64, 0, 64, 56, 0, 56) ;
315 h36->SetXTitle("x, cells"); h36->SetYTitle("z, cells");
316 Add2RawsList(h36,kHGpedRMSMod4, expert, !image, !saveCorr) ;
317
318 TH2F * h37 = new TH2F("hpedRMSLGxyMod0","Low Gain pedestal RMS in module 0", 64, 0, 64, 56, 0, 56) ;
319 h37->SetXTitle("x, cells"); h37->SetYTitle("z, cells");
320 Add2RawsList(h37,kLGpedRMSMod0, expert, !image, !saveCorr) ;
321 TH2F * h38 = new TH2F("hpedRMSLGxyMod1","Low Gain pedestal RMS in module 1", 64, 0, 64, 56, 0, 56) ;
322 h38->SetXTitle("x, cells"); h38->SetYTitle("z, cells");
323 Add2RawsList(h38,kLGpedRMSMod1, expert, !image, !saveCorr) ;
324 TH2F * h39 = new TH2F("hpedRMSLGxyMod2","Low Gain pedestal RMS in module 2", 64, 0, 64, 56, 0, 56) ;
325 h39->SetXTitle("x, cells"); h39->SetYTitle("z, cells");
326 Add2RawsList(h39,kLGpedRMSMod2, expert, !image, !saveCorr) ;
327 TH2F * h40 = new TH2F("hpedRMSLGxyMod3","Low Gain pedestal RMS in module 3", 64, 0, 64, 56, 0, 56) ;
328 h40->SetXTitle("x, cells"); h40->SetYTitle("z, cells");
329 Add2RawsList(h40,kLGpedRMSMod3, expert, !image, !saveCorr) ;
330 TH2F * h41 = new TH2F("hpedRMSLGxyMod4","Low Gain pedestal RMS in module 4", 64, 0, 64, 56, 0, 56) ;
331 h41->SetXTitle("x, cells"); h41->SetYTitle("z, cells");
332 Add2RawsList(h41,kLGpedRMSMod4, expert, !image, !saveCorr) ;
333
04236e67 334}
335
04236e67 336//____________________________________________________________________________
337void AliPHOSQADataMakerRec::MakeESDs(AliESDEvent * esd)
338{
339 // make QA data from ESDs
6252ceeb 340
ebde5500 341 Int_t nTot = 0 ;
342 Double_t eTot = 0 ;
04236e67 343 for ( Int_t index = 0; index < esd->GetNumberOfCaloClusters() ; index++ ) {
ebde5500 344 AliESDCaloCluster * clu = esd->GetCaloCluster(index) ;
345 if( clu->IsPHOS() ) {
346 GetESDsData(kESDSpec)->Fill(clu->E()) ;
c8fe2783 347 const Double_t * pid = clu->GetPID() ;
ebde5500 348 GetESDsData(kESDpid)->Fill(pid[AliPID::kPhoton]) ;
349 eTot+=clu->E() ;
350 nTot++ ;
351 }
04236e67 352 }
ebde5500 353 GetESDsData(kESDNtot)->Fill(nTot) ;
354 GetESDsData(kESDEtot)->Fill(eTot) ;
04236e67 355}
356
357//____________________________________________________________________________
04236e67 358void AliPHOSQADataMakerRec::MakeRaws(AliRawReader* rawReader)
359{
39569d36 360 //Fill prepared histograms with Raw digit properties
eca4fa66 361
ebde5500 362 rawReader->Reset() ;
379c5c09 363
364 const TObjArray* maps = AliPHOSRecoParam::GetMappings();
365 if(!maps) AliFatal("Cannot retrieve ALTRO mappings!!");
366
176f6510 367 AliAltroMapping *mapping[20];
368 for(Int_t i = 0; i < 20; i++) {
379c5c09 369 mapping[i] = (AliAltroMapping*)maps->At(i);
370 }
371
66eae3f0 372 AliCaloRawStreamV3 fRawStream(rawReader,"PHOS",mapping);
379c5c09 373
374 AliPHOSRawFitterv0 * fitter ;
375 if (strcmp(GetRecoParam()->EMCFitterVersion(),"v1")==0)
376 fitter=new AliPHOSRawFitterv1();
377 else if(strcmp(GetRecoParam()->EMCFitterVersion(),"v2")==0)
80f1c279 378 fitter=new AliPHOSRawFitterv2();
379 else
380 fitter=new AliPHOSRawFitterv0();
ebde5500 381 Double_t lgEtot=0. ;
382 Double_t hgEtot=0. ;
379c5c09 383 Int_t lgNtot=0 ;
384 Int_t hgNtot=0 ;
385
80f1c279 386 while (fRawStream.NextDDL()) {
66eae3f0 387 while (fRawStream.NextChannel()) {
388 Int_t module = fRawStream.GetModule();
389 Int_t cellX = fRawStream.GetCellX();
390 Int_t cellZ = fRawStream.GetCellZ();
391 Int_t caloFlag = fRawStream.GetCaloFlag(); // 0=LG, 1=HG, 2=TRU
379c5c09 392
e10f780e 393 if(caloFlag!=0 && caloFlag!=1) continue; //TRU data!
394
395 fitter->SetChannelGeo(module+1,cellX+1,cellZ+1,caloFlag);
396
397 if(fitter->GetAmpOffset()==0 && fitter->GetAmpThreshold()==0) {
80f1c279 398 Short_t altroCFG1 = fRawStream.GetAltroCFG1();
399 Bool_t ZeroSuppressionEnabled = (altroCFG1 >> 15) & 0x1;
e10f780e 400 if(ZeroSuppressionEnabled) {
80f1c279 401 Short_t offset = (altroCFG1 >> 10) & 0xf;
402 Short_t threshold = altroCFG1 & 0x3ff;
e10f780e 403 fitter->SubtractPedestals(kFALSE);
404 fitter->SetAmpOffset(offset);
405 fitter->SetAmpThreshold(threshold);
406 }
80f1c279 407 else
408 fitter->SubtractPedestals(kTRUE);
e10f780e 409 }
410
379c5c09 411 Int_t nBunches = 0;
66eae3f0 412 while (fRawStream.NextBunch()) {
379c5c09 413 nBunches++;
414 if (nBunches > 1) continue;
66eae3f0 415 const UShort_t *sig = fRawStream.GetSignals();
416 Int_t sigStart = fRawStream.GetStartTimeBin();
417 Int_t sigLength = fRawStream.GetBunchLength();
92236b27 418 fitter->Eval(sig,sigStart,sigLength);
379c5c09 419 } // End of NextBunch()
420
379c5c09 421 Double_t energy = fitter->GetEnergy() ;
422 Double_t time = fitter->GetTime() ;
423
424 if (caloFlag == 0) { // LG
379c5c09 425 GetRawsData(kLGpedRMS)->Fill(fitter->GetPedestalRMS()) ;
379c5c09 426 switch(module){
80f1c279 427 case 0: GetRawsData(kLGmod0)->Fill(cellX,cellZ) ; break ;
428 case 1: GetRawsData(kLGmod1)->Fill(cellX,cellZ) ; break ;
429 case 2: GetRawsData(kLGmod2)->Fill(cellX,cellZ) ; break ;
430 case 3: GetRawsData(kLGmod3)->Fill(cellX,cellZ) ; break ;
431 case 4: GetRawsData(kLGmod4)->Fill(cellX,cellZ) ; break ;
379c5c09 432 }
433 switch (module){
80f1c279 434 case 0: ((TH2F*)GetRawsData(kLGpedRMSMod0))->Fill(cellX,cellZ,fitter->GetPedestalRMS()) ; break ;
435 case 1: ((TH2F*)GetRawsData(kLGpedRMSMod1))->Fill(cellX,cellZ,fitter->GetPedestalRMS()) ; break ;
436 case 2: ((TH2F*)GetRawsData(kLGpedRMSMod2))->Fill(cellX,cellZ,fitter->GetPedestalRMS()) ; break ;
437 case 3: ((TH2F*)GetRawsData(kLGpedRMSMod3))->Fill(cellX,cellZ,fitter->GetPedestalRMS()) ; break ;
438 case 4: ((TH2F*)GetRawsData(kLGpedRMSMod4))->Fill(cellX,cellZ,fitter->GetPedestalRMS()) ; break ;
379c5c09 439 }
440 //if quality was evaluated, fill histo
441 if(strcmp(GetRecoParam()->EMCFitterVersion(),"v1")==0){
442 switch (module){
80f1c279 443 case 0: ((TH2F*)GetRawsData(kLGqualMod0))->Fill(cellX,cellZ,fitter->GetSignalQuality()) ; break ;
444 case 1: ((TH2F*)GetRawsData(kLGqualMod1))->Fill(cellX,cellZ,fitter->GetSignalQuality()) ; break ;
445 case 2: ((TH2F*)GetRawsData(kLGqualMod2))->Fill(cellX,cellZ,fitter->GetSignalQuality()) ; break ;
446 case 3: ((TH2F*)GetRawsData(kLGqualMod3))->Fill(cellX,cellZ,fitter->GetSignalQuality()) ; break ;
447 case 4: ((TH2F*)GetRawsData(kLGqualMod4))->Fill(cellX,cellZ,fitter->GetSignalQuality()) ; break ;
379c5c09 448 }
449 }
450 GetRawsData(kNmodLG)->Fill(module) ;
451 GetRawsData(kLGtime)->Fill(time) ;
452 GetRawsData(kSpecLG)->Fill(energy) ;
453 lgEtot+=energy ;
454 lgNtot++ ;
80f1c279 455 }
456 else if (caloFlag == 1) { // HG
379c5c09 457 GetRawsData(kHGpedRMS)->Fill(fitter->GetPedestalRMS()) ;
379c5c09 458 switch (module){
80f1c279 459 case 0: GetRawsData(kHGmod0)->Fill(cellX,cellZ) ; break ;
460 case 1: GetRawsData(kHGmod1)->Fill(cellX,cellZ) ; break ;
461 case 2: GetRawsData(kHGmod2)->Fill(cellX,cellZ) ; break ;
462 case 3: GetRawsData(kHGmod3)->Fill(cellX,cellZ) ; break ;
463 case 4: GetRawsData(kHGmod4)->Fill(cellX,cellZ) ; break ;
379c5c09 464 }
465 switch (module){
80f1c279 466 case 0: ((TH2F*)GetRawsData(kHGpedRMSMod0))->Fill(cellX,cellZ,fitter->GetPedestalRMS()) ; break ;
467 case 1: ((TH2F*)GetRawsData(kHGpedRMSMod1))->Fill(cellX,cellZ,fitter->GetPedestalRMS()) ; break ;
468 case 2: ((TH2F*)GetRawsData(kHGpedRMSMod2))->Fill(cellX,cellZ,fitter->GetPedestalRMS()) ; break ;
469 case 3: ((TH2F*)GetRawsData(kHGpedRMSMod3))->Fill(cellX,cellZ,fitter->GetPedestalRMS()) ; break ;
470 case 4: ((TH2F*)GetRawsData(kHGpedRMSMod4))->Fill(cellX,cellZ,fitter->GetPedestalRMS()) ; break ;
379c5c09 471 }
472 //if quality was evaluated, fill histo
473 if(strcmp(GetRecoParam()->EMCFitterVersion(),"v1")==0){
474 switch (module){
80f1c279 475 case 0: ((TH2F*)GetRawsData(kHGqualMod0))->Fill(cellX,cellZ,fitter->GetSignalQuality()) ; break ;
476 case 1: ((TH2F*)GetRawsData(kHGqualMod1))->Fill(cellX,cellZ,fitter->GetSignalQuality()) ; break ;
477 case 2: ((TH2F*)GetRawsData(kHGqualMod2))->Fill(cellX,cellZ,fitter->GetSignalQuality()) ; break ;
478 case 3: ((TH2F*)GetRawsData(kHGqualMod3))->Fill(cellX,cellZ,fitter->GetSignalQuality()) ; break ;
479 case 4: ((TH2F*)GetRawsData(kHGqualMod4))->Fill(cellX,cellZ,fitter->GetSignalQuality()) ; break ;
480 }
379c5c09 481 }
482 GetRawsData(kNmodHG)->Fill(module) ;
483 GetRawsData(kHGtime)->Fill(time) ;
484 GetRawsData(kSpecHG)->Fill(energy) ;
485 hgEtot+=energy ;
486 hgNtot++ ;
487 }
488 } // End of NextChannel
489 } // End of NextDDL
490 delete fitter;
491
a5997872 492 GetRawsData(kEtotLG)->Fill(lgEtot) ;
379c5c09 493 TParameter<double> * p;
494 p = dynamic_cast<TParameter<double>*>(GetParameterList()->
495 FindObject(Form("%s_%s_%s", GetName(),
496 AliQAv1::GetTaskName(AliQAv1::kRAWS).Data(),
497 GetRawsData(kEtotLG)->GetName()))) ;
719e870c 498 if (p) p->SetVal(lgEtot) ;
a5997872 499 GetRawsData(kEtotHG)->Fill(hgEtot) ;
379c5c09 500 p = dynamic_cast<TParameter<double>*>(GetParameterList()->
501 FindObject(Form("%s_%s_%s", GetName(),
502 AliQAv1::GetTaskName(AliQAv1::kRAWS).Data(),
503 GetRawsData(kEtotHG)->GetName()))) ;
719e870c 504 if (p) p->SetVal(hgEtot) ;
a5997872 505 GetRawsData(kNtotLG)->Fill(lgNtot) ;
379c5c09 506 p = dynamic_cast<TParameter<double>*>(GetParameterList()->
507 FindObject(Form("%s_%s_%s", GetName(),
508 AliQAv1::GetTaskName(AliQAv1::kRAWS).Data(),
509 GetRawsData(kNtotLG)->GetName()))) ;
719e870c 510 if (p) p->SetVal(lgNtot) ;
a5997872 511 GetRawsData(kNtotHG)->Fill(hgNtot) ;
379c5c09 512 p = dynamic_cast<TParameter<double>*>(GetParameterList()->
513 FindObject(Form("%s_%s_%s",
514 GetName(), AliQAv1::GetTaskName(AliQAv1::kRAWS).Data(),
515 GetRawsData(kNtotHG)->GetName()))) ;
719e870c 516 if (p) p->SetVal(hgNtot) ;
04236e67 517}
44ed7a66 518
519//____________________________________________________________________________
6252ceeb 520void AliPHOSQADataMakerRec::MakeDigits()
44ed7a66 521{
522 // makes data from Digits
eca4fa66 523
524 TH1 * hist = GetDigitsData(kDigitsMul) ;
525 if ( ! hist )
526 InitDigits() ;
6252ceeb 527 GetDigitsData(kDigitsMul)->Fill(fDigitsArray->GetEntriesFast()) ;
528 TIter next(fDigitsArray) ;
44ed7a66 529 AliPHOSDigit * digit ;
530 while ( (digit = dynamic_cast<AliPHOSDigit *>(next())) ) {
531 GetDigitsData(kDigits)->Fill( digit->GetEnergy()) ;
532 }
533}
534
535//____________________________________________________________________________
536void AliPHOSQADataMakerRec::MakeDigits(TTree * digitTree)
537{
538 // makes data from Digit Tree
6252ceeb 539 if (fDigitsArray)
540 fDigitsArray->Clear() ;
541 else
542 fDigitsArray = new TClonesArray("AliPHOSDigit", 1000) ;
44ed7a66 543
544 TBranch * branch = digitTree->GetBranch("PHOS") ;
545 if ( ! branch ) {
546 AliWarning("PHOS branch in Digit Tree not found") ;
547 } else {
6252ceeb 548 branch->SetAddress(&fDigitsArray) ;
44ed7a66 549 branch->GetEntry(0) ;
6252ceeb 550 MakeDigits() ;
44ed7a66 551 }
552}
553
04236e67 554//____________________________________________________________________________
555void AliPHOSQADataMakerRec::MakeRecPoints(TTree * clustersTree)
556{
557 {
558 // makes data from RecPoints
559 TBranch *emcbranch = clustersTree->GetBranch("PHOSEmcRP");
560 if (!emcbranch) {
561 AliError("can't get the branch with the PHOS EMC clusters !");
562 return;
563 }
eca4fa66 564
04236e67 565 TObjArray * emcrecpoints = new TObjArray(100) ;
566 emcbranch->SetAddress(&emcrecpoints);
567 emcbranch->GetEntry(0);
568
ebde5500 569 GetRecPointsData(kRPNtot)->Fill(emcrecpoints->GetEntriesFast()) ;
04236e67 570 TIter next(emcrecpoints) ;
571 AliPHOSEmcRecPoint * rp ;
ebde5500 572 Double_t eTot = 0. ;
eca4fa66 573 while ( (rp = static_cast<AliPHOSEmcRecPoint *>(next())) ) {
ebde5500 574 GetRecPointsData(kRPSpec)->Fill( rp->GetEnergy()) ;
575 Int_t mod = rp->GetPHOSMod() ;
576 TVector3 pos ;
577 rp->GetLocalPosition(pos) ;
578 switch(mod){
579 case 1: GetRecPointsData(kRPmod1)->Fill(pos.X(),pos.Z()) ; break ;
580 case 2: GetRecPointsData(kRPmod2)->Fill(pos.X(),pos.Z()) ; break ;
581 case 3: GetRecPointsData(kRPmod3)->Fill(pos.X(),pos.Z()) ; break ;
582 case 4: GetRecPointsData(kRPmod4)->Fill(pos.X(),pos.Z()) ; break ;
583 case 5: GetRecPointsData(kRPmod5)->Fill(pos.X(),pos.Z()) ; break ;
584 }
585 eTot+= rp->GetEnergy() ;
04236e67 586 }
ebde5500 587 GetRecPointsData(kRPEtot)->Fill(eTot) ;
04236e67 588 emcrecpoints->Delete();
589 delete emcrecpoints;
590 }
591 {
592 TBranch *cpvbranch = clustersTree->GetBranch("PHOSCpvRP");
593 if (!cpvbranch) {
594 AliError("can't get the branch with the PHOS CPV clusters !");
595 return;
596 }
597 TObjArray *cpvrecpoints = new TObjArray(100) ;
598 cpvbranch->SetAddress(&cpvrecpoints);
599 cpvbranch->GetEntry(0);
600
ebde5500 601 GetRecPointsData(kRPNcpv)->Fill(cpvrecpoints->GetEntriesFast()) ;
04236e67 602 cpvrecpoints->Delete();
603 delete cpvrecpoints;
604 }
605}
606
04236e67 607//____________________________________________________________________________
608void AliPHOSQADataMakerRec::StartOfDetectorCycle()
609{
610 //Detector specific actions at start of cycle
611
612}