]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSQADataMakerRec.cxx
Usage of all components of mag field
[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)) ;
88 if(GetRawsData(kHGqualMod1) && GetRawsData(kHGmod1))
89 GetRawsData(kHGqualMod1)->Divide( GetRawsData(kHGmod1) ) ;
90 if(GetRawsData(kHGqualMod2) && GetRawsData(kHGmod2))
91 GetRawsData(kHGqualMod2)->Divide( GetRawsData(kHGmod2) ) ;
92 if(GetRawsData(kHGqualMod3) && GetRawsData(kHGmod3))
93 GetRawsData(kHGqualMod3)->Divide( GetRawsData(kHGmod3) ) ;
94 if(GetRawsData(kHGqualMod4) && GetRawsData(kHGmod4))
95 GetRawsData(kHGqualMod4)->Divide( GetRawsData(kHGmod4) ) ;
96 if(GetRawsData(kHGqualMod5) && GetRawsData(kHGmod5))
97 GetRawsData(kHGqualMod5)->Divide( GetRawsData(kHGmod5) ) ;
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
44ed7a66 129//____________________________________________________________________________
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
04236e67 143//____________________________________________________________________________
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
db72ff3b 186 TH2I * h0 = new TH2I("hHighPHOSxyMod1","High Gain Rows x Columns for PHOS module 1;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7d297381 187 Add2RawsList(h0,kHGmod1, expert, !image, !saveCorr) ;
db72ff3b 188 TH2I * h1 = new TH2I("hHighPHOSxyMod2","High Gain Rows x Columns for PHOS module 2;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7d297381 189 Add2RawsList(h1,kHGmod2, expert, !image, !saveCorr) ;
db72ff3b 190 TH2I * h2 = new TH2I("hHighPHOSxyMod3","High Gain Rows x Columns for PHOS module 3;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7d297381 191 Add2RawsList(h2,kHGmod3, expert, !image, !saveCorr) ;
db72ff3b 192 TH2I * h3 = new TH2I("hHighPHOSxyMod4","High Gain Rows x Columns for PHOS module 4;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7d297381 193 Add2RawsList(h3,kHGmod4, expert, !image, !saveCorr) ;
db72ff3b 194 TH2I * h4 = new TH2I("hHighPHOSxyMod5","High Gain Rows x Columns for PHOS module 5;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7d297381 195 Add2RawsList(h4,kHGmod5, expert, !image, !saveCorr) ;
db72ff3b 196 TH2I * h5 = new TH2I("hLowPHOSxyMod1","Low Gain Rows x Columns for PHOS module 1;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7d297381 197 Add2RawsList(h5,kLGmod1, expert, !image, !saveCorr) ;
db72ff3b 198 TH2I * h6 = new TH2I("hLowPHOSxyMod2","Low Gain Rows x Columns for PHOS module 2;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7d297381 199 Add2RawsList(h6,kLGmod2, expert, !image, !saveCorr) ;
db72ff3b 200 TH2I * h7 = new TH2I("hLowPHOSxyMod3","Low Gain Rows x Columns for PHOS module 3;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7d297381 201 Add2RawsList(h7,kLGmod3, expert, !image, !saveCorr) ;
db72ff3b 202 TH2I * h8 = new TH2I("hLowPHOSxyMod4","Low Gain Rows x Columns for PHOS module 4;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7d297381 203 Add2RawsList(h8,kLGmod4, expert, !image, !saveCorr) ;
db72ff3b 204 TH2I * h9 = new TH2I("hLowPHOSxyMod5","Low Gain Rows x Columns for PHOS module 5;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7d297381 205 Add2RawsList(h9,kLGmod5, expert, !image, !saveCorr) ;
98e3f48c 206
db72ff3b 207 TH1I * h10 = new TH1I("hLowPhosModules", "Low Gain Hits in EMCA PHOS modules;# of hit modules;Counts", 6, 0, 6) ;
98e3f48c 208 h10->Sumw2() ;
7d297381 209 Add2RawsList(h10, kNmodLG, !expert, image, !saveCorr) ;
db72ff3b 210 TH1I * h11 = new TH1I("hHighPhosModules", "High Gain Hits in EMCA PHOS modules;# of hit modules;Counts", 6, 0, 6) ;
98e3f48c 211 h11->Sumw2() ;
7d297381 212 Add2RawsList(h11, kNmodHG, !expert, image, !saveCorr) ;
98e3f48c 213
db72ff3b 214 TH1F * h12 = new TH1F("hLowPhosRawtime", "Low Gain Time of raw hits in PHOS;Time [ns];Counts", 500, -50., 200.) ;
98e3f48c 215 h12->Sumw2() ;
7d297381 216 Add2RawsList(h12, kLGtime, !expert, image, !saveCorr) ;
db72ff3b 217 TH1F * h13 = new TH1F("hHighPhosRawtime", "High Gain Time of raw hits in PHOS;Time [ns];Counts", 500, -50., 200.) ;
98e3f48c 218 h13->Sumw2() ;
7d297381 219 Add2RawsList(h13, kHGtime, !expert, image, !saveCorr) ;
98e3f48c 220
db72ff3b 221 TH1F * h14 = new TH1F("hLowPhosRawEnergy", "Low Gain Energy of raw hits in PHOS;Energy [MeV];Counts", 500, 0., 1000.) ;
98e3f48c 222 h14->Sumw2() ;
7d297381 223 Add2RawsList(h14, kSpecLG, !expert, image, !saveCorr) ;
db72ff3b 224 TH1F * h15 = new TH1F("hHighPhosRawEnergy", "High Gain Energy of raw hits in PHOS;Energy [MeV];Counts",500,0., 1000.) ;
98e3f48c 225 h15->Sumw2() ;
7d297381 226 Add2RawsList(h15, kSpecHG, !expert, image, !saveCorr) ;
98e3f48c 227
db72ff3b 228 TH1F * h16 = new TH1F("hLowNtot", "Low Gain Total Number of raw hits in PHOS;# of hits;Counts", 500, 0., 5000.) ;
98e3f48c 229 h16->Sumw2() ;
7d297381 230 Add2RawsList(h16, kNtotLG, !expert, saveCorr, image) ;
db72ff3b 231 TH1F * h17 = new TH1F("hHighNtot", "High Gain Total Number of raw hits in PHOS;# of hits;Counts",500,0., 5000.) ;
98e3f48c 232 h17->Sumw2() ;
7d297381 233 Add2RawsList(h17, kNtotHG, !expert, saveCorr, image) ;
98e3f48c 234
db72ff3b 235 TH1F * h18 = new TH1F("hLowEtot", "Low Gain Total Energy of raw hits in PHOS;Energy [MeV];Counts", 500, 0., 5000.) ;
98e3f48c 236 h18->Sumw2() ;
7d297381 237 Add2RawsList(h18, kEtotLG, !expert, saveCorr, image) ;
db72ff3b 238 TH1F * h19 = new TH1F("hHighEtot", "High Gain Total Energy of raw hits in PHOS;Energy [MeV];Counts",500,0., 100000.) ;
98e3f48c 239 h19->Sumw2() ;
7d297381 240 Add2RawsList(h19, kEtotHG, !expert, saveCorr, image) ;
7285e69f 241
db72ff3b 242 TH2F * h20 = new TH2F("hQualHGxyMod1","High Gain signal quality Rows x Columns module 1;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
98e3f48c 243 h20->SetOption("colz");
7d297381 244 Add2RawsList(h20,kHGqualMod1, expert, !image, !saveCorr) ;
db72ff3b 245 TH2F * h21 = new TH2F("hQualHGxyMod2","High Gain signal quality Rows x Columns module 2;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
98e3f48c 246 h21->SetOption("colz");
7d297381 247 Add2RawsList(h21,kHGqualMod2, expert, !image, !saveCorr) ;
db72ff3b 248 TH2F * h22 = new TH2F("hQualHGxyMod3","High Gain signal quality Rows x Columns module 3;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
98e3f48c 249 h22->SetOption("colz");
7d297381 250 Add2RawsList(h22,kHGqualMod3, expert, !image, !saveCorr) ;
db72ff3b 251 TH2F * h23 = new TH2F("hQualHGxyMod4","High Gain signal quality Rows x Columns module 4;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
98e3f48c 252 h23->SetOption("colz");
7d297381 253 Add2RawsList(h23,kHGqualMod4, expert, !image, !saveCorr) ;
db72ff3b 254 TH2F * h24 = new TH2F("hQualHGxyMod5","High Gain signal quality Rows x Columns module 5;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7285e69f 255 h24->SetOption("colz");
7d297381 256 Add2RawsList(h24,kHGqualMod5, expert, !image, !saveCorr) ;
db72ff3b 257 TH2F * h25 = new TH2F("hQualLGxyMod1","Low Gain signal quality Rows x Columns module 1;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7285e69f 258 h25->SetOption("colz");
7d297381 259 Add2RawsList(h25,kLGqualMod1, expert, !image, !saveCorr) ;
db72ff3b 260 TH2F * h26 = new TH2F("hQualLGxyMod2","Low Gain signal quality Rows x Columns module 2;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7285e69f 261 h26->SetOption("colz");
7d297381 262 Add2RawsList(h26,kLGqualMod2, expert, !image, !saveCorr) ;
db72ff3b 263 TH2F * h27 = new TH2F("hQualLGxyMod3","Low Gain signal quality Rows x Columns module 3;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7285e69f 264 h27->SetOption("colz");
7d297381 265 Add2RawsList(h27,kLGqualMod3, expert, !image, !saveCorr) ;
db72ff3b 266 TH2F * h28 = new TH2F("hQualLGxyMod4","Low Gain signal quality Rows x Columns module 4;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7285e69f 267 h28->SetOption("colz");
7d297381 268 Add2RawsList(h28,kLGqualMod4, expert, !image, !saveCorr) ;
db72ff3b 269 TH2F * h29 = new TH2F("hQualLGxyMod5","Low Gain signal quality Rows x Columns module 5;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7285e69f 270 h29->SetOption("colz");
7d297381 271 Add2RawsList(h29,kLGqualMod5, expert, !image, !saveCorr) ;
7285e69f 272
db72ff3b 273 TH1F * h30 = new TH1F("hLGpedRMS","Low Gain pedestal RMS;Width [ADC counts];Counts",200,0.,20.) ;
7285e69f 274 h30->Sumw2() ;
7d297381 275 Add2RawsList(h30,kLGpedRMS, !expert, image, !saveCorr) ;
db72ff3b 276 TH1F * h31 = new TH1F("hHGpedRMS","High Gain pedestal RMS;Width [ADC counts];Counts",200,0.,20.) ;
7285e69f 277 h31->Sumw2() ;
7d297381 278 Add2RawsList(h31,kHGpedRMS, !expert, image, !saveCorr) ;
7285e69f 279
db72ff3b 280 TH2F * h32 = new TH2F("hpedRMSHGxyMod1","High Gain pedestal RMS Rows x Columns module 1;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7285e69f 281 h32->SetOption("colz");
7d297381 282 Add2RawsList(h32,kHGpedRMSMod1, expert, !image, !saveCorr) ;
db72ff3b 283 TH2F * h33 = new TH2F("hpedRMSHGxyMod2","High Gain pedestal RMS Rows x Columns module 2;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7285e69f 284 h33->SetOption("colz");
7d297381 285 Add2RawsList(h33,kHGpedRMSMod2, expert, !image, !saveCorr) ;
db72ff3b 286 TH2F * h34 = new TH2F("hpedRMSHGxyMod3","High Gain pedestal RMS Rows x Columns module 3;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7285e69f 287 h34->SetOption("colz");
7d297381 288 Add2RawsList(h34,kHGpedRMSMod3, expert, !image, !saveCorr) ;
db72ff3b 289 TH2F * h35 = new TH2F("hpedRMSHGxyMod4","High Gain pedestal RMS Rows x Columns module 4;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7285e69f 290 h35->SetOption("colz");
7d297381 291 Add2RawsList(h35,kHGpedRMSMod4, expert, !image, !saveCorr) ;
db72ff3b 292 TH2F * h36 = new TH2F("hpedRMSHGxyMod5","High Gain pedestal RMS Rows x Columns module 5;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7285e69f 293 h36->SetOption("colz");
7d297381 294 Add2RawsList(h36,kHGpedRMSMod5, expert, !image, !saveCorr) ;
db72ff3b 295 TH2F * h37 = new TH2F("hpedRMSLGxyMod1","Low Gain pedestal RMS Rows x Columns module 1;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7285e69f 296 h37->SetOption("colz");
7d297381 297 Add2RawsList(h37,kLGpedRMSMod1, expert, !image, !saveCorr) ;
db72ff3b 298 TH2F * h38 = new TH2F("hpedRMSLGxyMod2","Low Gain pedestal RMS Rows x Columns module 2;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7285e69f 299 h38->SetOption("colz");
7d297381 300 Add2RawsList(h38,kLGpedRMSMod2, expert, !image, !saveCorr) ;
db72ff3b 301 TH2F * h39 = new TH2F("hpedRMSLGxyMod3","Low Gain pedestal RMS Rows x Columns module 3;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7285e69f 302 h39->SetOption("colz");
7d297381 303 Add2RawsList(h39,kLGpedRMSMod3, expert, !image, !saveCorr) ;
db72ff3b 304 TH2F * h40 = new TH2F("hpedRMSLGxyMod4","Low Gain pedestal RMS Rows x Columns module 4;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7285e69f 305 h40->SetOption("colz");
7d297381 306 Add2RawsList(h40,kLGpedRMSMod4, expert, !image, !saveCorr) ;
db72ff3b 307 TH2F * h41 = new TH2F("hpedRMSLGxyMod5","Low Gain pedestal RMS Rows x Columns module 5;Row #;Column #", 64, 0, 64, 56, 0, 56) ;
7285e69f 308 h41->SetOption("colz");
7d297381 309 Add2RawsList(h41,kLGpedRMSMod5, expert, !image, !saveCorr) ;
7285e69f 310
311 /*
312 TH1F * h42 = new TH1F("hLGpedMean","Low Gain pedestal Mean",200,0.,20.) ;
313 h42->Sumw2() ;
7d297381 314 Add2RawsList(h42,kLGpedMean, !expert, image, !saveCorr) ;
7285e69f 315 TH1F * h43 = new TH1F("hHGpedMean","High Gain pedestal Mean",200,0.,20.) ;
316 h43->Sumw2() ;
7d297381 317 Add2RawsList(h43,kHGpedMean, !expert, image, !saveCorr) ;
7285e69f 318
319 TH2F * h44 = new TH2F("hpedMeanHGxyMod1","High Gain pedestal Mean Rows x Columns module 1", 64, 0, 64, 56, 0, 56) ;
320 h44->SetOption("colz");
7d297381 321 Add2RawsList(h44,kHGpedMeanMod1, expert, !image, !saveCorr) ;
7285e69f 322 TH2F * h45 = new TH2F("hpedMeanHGxyMod2","High Gain pedestal Mean Rows x Columns module 2", 64, 0, 64, 56, 0, 56) ;
323 h45->SetOption("colz");
7d297381 324 Add2RawsList(h45,kHGpedMeanMod2, expert, !image, !saveCorr) ;
7285e69f 325 TH2F * h46 = new TH2F("hpedMeanHGxyMod3","High Gain pedestal Mean Rows x Columns module 3", 64, 0, 64, 56, 0, 56) ;
326 h46->SetOption("colz");
7d297381 327 Add2RawsList(h46,kHGpedMeanMod3, expert, !image, !saveCorr) ;
7285e69f 328 TH2F * h47 = new TH2F("hpedMeanHGxyMod4","High Gain pedestal Mean Rows x Columns module 4", 64, 0, 64, 56, 0, 56) ;
329 h47->SetOption("colz");
7d297381 330 Add2RawsList(h47,kHGpedMeanMod4, expert, !image, !saveCorr) ;
7285e69f 331 TH2F * h48 = new TH2F("hpedMeanHGxyMod5","High Gain pedestal Mean Rows x Columns module 5", 64, 0, 64, 56, 0, 56) ;
332 h48->SetOption("colz");
7d297381 333 Add2RawsList(h48,kHGpedMeanMod5, expert, !image, !saveCorr) ;
7285e69f 334 TH2F * h49 = new TH2F("hpedMeanLGxyMod1","Low Gain pedestal Mean Rows x Columns module 1", 64, 0, 64, 56, 0, 56) ;
335 h49->SetOption("colz");
7d297381 336 Add2RawsList(h49,kLGpedMeanMod1, expert, !image, !saveCorr) ;
7285e69f 337 TH2F * h50 = new TH2F("hpedMeanLGxyMod2","Low Gain pedestal Mean Rows x Columns module 2", 64, 0, 64, 56, 0, 56) ;
338 h50->SetOption("colz");
7d297381 339 Add2RawsList(h50,kLGpedMeanMod2, expert, !image, !saveCorr) ;
7285e69f 340 TH2F * h51 = new TH2F("hpedMeanLGxyMod3","Low Gain pedestal Mean Rows x Columns module 3", 64, 0, 64, 56, 0, 56) ;
341 h51->SetOption("colz");
7d297381 342 Add2RawsList(h51,kLGpedMeanMod3, expert, !image, !saveCorr) ;
7285e69f 343 TH2F * h52 = new TH2F("hpedMeanLGxyMod4","Low Gain pedestal Mean Rows x Columns module 4", 64, 0, 64, 56, 0, 56) ;
344 h52->SetOption("colz");
7d297381 345 Add2RawsList(h52,kLGpedMeanMod4, expert, !image, !saveCorr) ;
7285e69f 346 TH2F * h53 = new TH2F("hpedMeanLGxyMod5","Low Gain pedestal Mean Rows x Columns module 5", 64, 0, 64, 56, 0, 56) ;
347 h53->SetOption("colz");
7d297381 348 Add2RawsList(h53,kLGpedMeanMod5, expert, !image, !saveCorr) ;
7285e69f 349 */
04236e67 350}
351
04236e67 352//____________________________________________________________________________
353void AliPHOSQADataMakerRec::MakeESDs(AliESDEvent * esd)
354{
355 // make QA data from ESDs
6252ceeb 356
ebde5500 357 Int_t nTot = 0 ;
358 Double_t eTot = 0 ;
04236e67 359 for ( Int_t index = 0; index < esd->GetNumberOfCaloClusters() ; index++ ) {
ebde5500 360 AliESDCaloCluster * clu = esd->GetCaloCluster(index) ;
361 if( clu->IsPHOS() ) {
362 GetESDsData(kESDSpec)->Fill(clu->E()) ;
363 Double_t *pid=clu->GetPid() ;
364 GetESDsData(kESDpid)->Fill(pid[AliPID::kPhoton]) ;
365 eTot+=clu->E() ;
366 nTot++ ;
367 }
04236e67 368 }
ebde5500 369 GetESDsData(kESDNtot)->Fill(nTot) ;
370 GetESDsData(kESDEtot)->Fill(eTot) ;
04236e67 371}
372
04236e67 373//____________________________________________________________________________
374void AliPHOSQADataMakerRec::MakeRaws(AliRawReader* rawReader)
375{
39569d36 376 //Fill prepared histograms with Raw digit properties
eca4fa66 377
ebde5500 378 rawReader->Reset() ;
379c5c09 379
380 const TObjArray* maps = AliPHOSRecoParam::GetMappings();
381 if(!maps) AliFatal("Cannot retrieve ALTRO mappings!!");
382
176f6510 383 AliAltroMapping *mapping[20];
384 for(Int_t i = 0; i < 20; i++) {
379c5c09 385 mapping[i] = (AliAltroMapping*)maps->At(i);
386 }
387
388 AliCaloRawStreamV3 *fRawStream = new AliCaloRawStreamV3(rawReader,"PHOS",mapping);
389
390 AliPHOSRawFitterv0 * fitter ;
391 if (strcmp(GetRecoParam()->EMCFitterVersion(),"v1")==0)
392 fitter=new AliPHOSRawFitterv1();
393 else if(strcmp(GetRecoParam()->EMCFitterVersion(),"v2")==0)
394 fitter=new AliPHOSRawFitterv2();
ebde5500 395 else
379c5c09 396 fitter=new AliPHOSRawFitterv0();
397 fitter->SubtractPedestals(GetRecoParam()->EMCSubtractPedestals());
398// fitter->SubtractPedestals(kTRUE);
ebde5500 399 Double_t lgEtot=0. ;
400 Double_t hgEtot=0. ;
379c5c09 401 Int_t lgNtot=0 ;
402 Int_t hgNtot=0 ;
403
404 while (fRawStream->NextDDL()) { // !!!!!!!!!!! YK
405 while (fRawStream->NextChannel()) {
406 Int_t module = fRawStream->GetModule();
407 Int_t cellX = fRawStream->GetCellX();
408 Int_t cellZ = fRawStream->GetCellZ();
409 Int_t caloFlag = fRawStream->GetCaloFlag(); // 0=LG, 1=HG, 2=TRU
410
e10f780e 411 if(caloFlag!=0 && caloFlag!=1) continue; //TRU data!
412
413 fitter->SetChannelGeo(module+1,cellX+1,cellZ+1,caloFlag);
414
415 if(fitter->GetAmpOffset()==0 && fitter->GetAmpThreshold()==0) {
416 Short_t value = fRawStream->GetAltroCFG1();
417 Bool_t ZeroSuppressionEnabled = (value >> 15) & 0x1;
418 if(ZeroSuppressionEnabled) {
419 Short_t offset = (value >> 10) & 0xf;
420 Short_t threshold = value & 0x3ff;
421 fitter->SubtractPedestals(kFALSE);
422 fitter->SetAmpOffset(offset);
423 fitter->SetAmpThreshold(threshold);
424 }
425 }
426
379c5c09 427 Int_t nBunches = 0;
428 while (fRawStream->NextBunch()) {
429 nBunches++;
430 if (nBunches > 1) continue;
431 const UShort_t *sig = fRawStream->GetSignals();
432 Int_t sigStart = fRawStream->GetStartTimeBin();
433 Int_t sigLength = fRawStream->GetBunchLength();
92236b27 434 fitter->Eval(sig,sigStart,sigLength);
379c5c09 435 } // End of NextBunch()
436
379c5c09 437 Double_t energy = fitter->GetEnergy() ;
438 Double_t time = fitter->GetTime() ;
439
440 if (caloFlag == 0) { // LG
441 //if(GetRecoParam()->EMCSubtractPedestals())
442 GetRawsData(kLGpedRMS)->Fill(fitter->GetPedestalRMS()) ;
443 if(energy<2.)
444 continue ;
445 switch(module){
446 case 1: GetRawsData(kLGmod1)->Fill(cellX-0.5,cellZ-0.5) ; break ;
447 case 2: GetRawsData(kLGmod2)->Fill(cellX-0.5,cellZ-0.5) ; break ;
448 case 3: GetRawsData(kLGmod3)->Fill(cellX-0.5,cellZ-0.5) ; break ;
449 case 4: GetRawsData(kLGmod4)->Fill(cellX-0.5,cellZ-0.5) ; break ;
450 case 5: GetRawsData(kLGmod5)->Fill(cellX-0.5,cellZ-0.5) ; break ;
451 }
452 switch (module){
453 case 1: ((TH2F*)GetRawsData(kLGpedRMSMod1))->Fill(cellX-0.5,cellZ-0.5,fitter->GetPedestalRMS()) ; break ;
454 case 2: ((TH2F*)GetRawsData(kLGpedRMSMod2))->Fill(cellX-0.5,cellZ-0.5,fitter->GetPedestalRMS()) ; break ;
455 case 3: ((TH2F*)GetRawsData(kLGpedRMSMod3))->Fill(cellX-0.5,cellZ-0.5,fitter->GetPedestalRMS()) ; break ;
456 case 4: ((TH2F*)GetRawsData(kLGpedRMSMod4))->Fill(cellX-0.5,cellZ-0.5,fitter->GetPedestalRMS()) ; break ;
457 case 5: ((TH2F*)GetRawsData(kLGpedRMSMod5))->Fill(cellX-0.5,cellZ-0.5,fitter->GetPedestalRMS()) ; break ;
458 }
459 //if quality was evaluated, fill histo
460 if(strcmp(GetRecoParam()->EMCFitterVersion(),"v1")==0){
461 switch (module){
462 case 1: ((TH2F*)GetRawsData(kLGqualMod1))->Fill(cellX-0.5,cellZ-0.5,fitter->GetSignalQuality()) ; break ;
463 case 2: ((TH2F*)GetRawsData(kLGqualMod2))->Fill(cellX-0.5,cellZ-0.5,fitter->GetSignalQuality()) ; break ;
464 case 3: ((TH2F*)GetRawsData(kLGqualMod3))->Fill(cellX-0.5,cellZ-0.5,fitter->GetSignalQuality()) ; break ;
465 case 4: ((TH2F*)GetRawsData(kLGqualMod4))->Fill(cellX-0.5,cellZ-0.5,fitter->GetSignalQuality()) ; break ;
466 case 5: ((TH2F*)GetRawsData(kLGqualMod5))->Fill(cellX-0.5,cellZ-0.5,fitter->GetSignalQuality()) ; break ;
467 }
468 }
469 GetRawsData(kNmodLG)->Fill(module) ;
470 GetRawsData(kLGtime)->Fill(time) ;
471 GetRawsData(kSpecLG)->Fill(energy) ;
472 lgEtot+=energy ;
473 lgNtot++ ;
474 } else if (caloFlag == 1) { // HG
475 //if this isnon-ZS run - fill pedestal RMS
476 //if(GetRecoParam()->EMCSubtractPedestals())
477 GetRawsData(kHGpedRMS)->Fill(fitter->GetPedestalRMS()) ;
478 if(energy<8.)
479 continue ;
480 switch (module){
481 case 1: GetRawsData(kHGmod1)->Fill(cellX-0.5,cellZ-0.5) ; break ;
482 case 2: GetRawsData(kHGmod2)->Fill(cellX-0.5,cellZ-0.5) ; break ;
483 case 3: GetRawsData(kHGmod3)->Fill(cellX-0.5,cellZ-0.5) ; break ;
484 case 4: GetRawsData(kHGmod4)->Fill(cellX-0.5,cellZ-0.5) ; break ;
485 case 5: GetRawsData(kHGmod5)->Fill(cellX-0.5,cellZ-0.5) ; break ;
486 }
487 switch (module){
488 case 1: ((TH2F*)GetRawsData(kHGpedRMSMod1))->Fill(cellX-0.5,cellZ-0.5,fitter->GetPedestalRMS()) ; break ;
489 case 2: ((TH2F*)GetRawsData(kHGpedRMSMod2))->Fill(cellX-0.5,cellZ-0.5,fitter->GetPedestalRMS()) ; break ;
490 case 3: ((TH2F*)GetRawsData(kHGpedRMSMod3))->Fill(cellX-0.5,cellZ-0.5,fitter->GetPedestalRMS()) ; break ;
491 case 4: ((TH2F*)GetRawsData(kHGpedRMSMod4))->Fill(cellX-0.5,cellZ-0.5,fitter->GetPedestalRMS()) ; break ;
492 case 5: ((TH2F*)GetRawsData(kHGpedRMSMod5))->Fill(cellX-0.5,cellZ-0.5,fitter->GetPedestalRMS()) ; break ;
493 }
494 //if quality was evaluated, fill histo
495 if(strcmp(GetRecoParam()->EMCFitterVersion(),"v1")==0){
496 switch (module){
497 case 1: ((TH2F*)GetRawsData(kHGqualMod1))->Fill(cellX-0.5,cellZ-0.5,fitter->GetSignalQuality()) ; break ;
498 case 2: ((TH2F*)GetRawsData(kHGqualMod2))->Fill(cellX-0.5,cellZ-0.5,fitter->GetSignalQuality()) ; break ;
499 case 3: ((TH2F*)GetRawsData(kHGqualMod3))->Fill(cellX-0.5,cellZ-0.5,fitter->GetSignalQuality()) ; break ;
500 case 4: ((TH2F*)GetRawsData(kHGqualMod4))->Fill(cellX-0.5,cellZ-0.5,fitter->GetSignalQuality()) ; break ;
501 case 5: ((TH2F*)GetRawsData(kHGqualMod5))->Fill(cellX-0.5,cellZ-0.5,fitter->GetSignalQuality()) ; break ;
502 }
503 }
504 GetRawsData(kNmodHG)->Fill(module) ;
505 GetRawsData(kHGtime)->Fill(time) ;
506 GetRawsData(kSpecHG)->Fill(energy) ;
507 hgEtot+=energy ;
508 hgNtot++ ;
509 }
510 } // End of NextChannel
511 } // End of NextDDL
512 delete fitter;
513
a5997872 514 GetRawsData(kEtotLG)->Fill(lgEtot) ;
379c5c09 515 TParameter<double> * p;
516 p = dynamic_cast<TParameter<double>*>(GetParameterList()->
517 FindObject(Form("%s_%s_%s", GetName(),
518 AliQAv1::GetTaskName(AliQAv1::kRAWS).Data(),
519 GetRawsData(kEtotLG)->GetName()))) ;
719e870c 520 if (p) p->SetVal(lgEtot) ;
a5997872 521 GetRawsData(kEtotHG)->Fill(hgEtot) ;
379c5c09 522 p = dynamic_cast<TParameter<double>*>(GetParameterList()->
523 FindObject(Form("%s_%s_%s", GetName(),
524 AliQAv1::GetTaskName(AliQAv1::kRAWS).Data(),
525 GetRawsData(kEtotHG)->GetName()))) ;
719e870c 526 if (p) p->SetVal(hgEtot) ;
a5997872 527 GetRawsData(kNtotLG)->Fill(lgNtot) ;
379c5c09 528 p = dynamic_cast<TParameter<double>*>(GetParameterList()->
529 FindObject(Form("%s_%s_%s", GetName(),
530 AliQAv1::GetTaskName(AliQAv1::kRAWS).Data(),
531 GetRawsData(kNtotLG)->GetName()))) ;
719e870c 532 if (p) p->SetVal(lgNtot) ;
a5997872 533 GetRawsData(kNtotHG)->Fill(hgNtot) ;
379c5c09 534 p = dynamic_cast<TParameter<double>*>(GetParameterList()->
535 FindObject(Form("%s_%s_%s",
536 GetName(), AliQAv1::GetTaskName(AliQAv1::kRAWS).Data(),
537 GetRawsData(kNtotHG)->GetName()))) ;
719e870c 538 if (p) p->SetVal(hgNtot) ;
04236e67 539}
44ed7a66 540
541//____________________________________________________________________________
6252ceeb 542void AliPHOSQADataMakerRec::MakeDigits()
44ed7a66 543{
544 // makes data from Digits
eca4fa66 545
546 TH1 * hist = GetDigitsData(kDigitsMul) ;
547 if ( ! hist )
548 InitDigits() ;
6252ceeb 549 GetDigitsData(kDigitsMul)->Fill(fDigitsArray->GetEntriesFast()) ;
550 TIter next(fDigitsArray) ;
44ed7a66 551 AliPHOSDigit * digit ;
552 while ( (digit = dynamic_cast<AliPHOSDigit *>(next())) ) {
553 GetDigitsData(kDigits)->Fill( digit->GetEnergy()) ;
554 }
555}
556
557//____________________________________________________________________________
558void AliPHOSQADataMakerRec::MakeDigits(TTree * digitTree)
559{
560 // makes data from Digit Tree
6252ceeb 561 if (fDigitsArray)
562 fDigitsArray->Clear() ;
563 else
564 fDigitsArray = new TClonesArray("AliPHOSDigit", 1000) ;
44ed7a66 565
566 TBranch * branch = digitTree->GetBranch("PHOS") ;
567 if ( ! branch ) {
568 AliWarning("PHOS branch in Digit Tree not found") ;
569 } else {
6252ceeb 570 branch->SetAddress(&fDigitsArray) ;
44ed7a66 571 branch->GetEntry(0) ;
6252ceeb 572 MakeDigits() ;
44ed7a66 573 }
574}
575
04236e67 576//____________________________________________________________________________
577void AliPHOSQADataMakerRec::MakeRecPoints(TTree * clustersTree)
578{
579 {
580 // makes data from RecPoints
581 TBranch *emcbranch = clustersTree->GetBranch("PHOSEmcRP");
582 if (!emcbranch) {
583 AliError("can't get the branch with the PHOS EMC clusters !");
584 return;
585 }
eca4fa66 586
04236e67 587 TObjArray * emcrecpoints = new TObjArray(100) ;
588 emcbranch->SetAddress(&emcrecpoints);
589 emcbranch->GetEntry(0);
590
ebde5500 591 GetRecPointsData(kRPNtot)->Fill(emcrecpoints->GetEntriesFast()) ;
04236e67 592 TIter next(emcrecpoints) ;
593 AliPHOSEmcRecPoint * rp ;
ebde5500 594 Double_t eTot = 0. ;
eca4fa66 595 while ( (rp = static_cast<AliPHOSEmcRecPoint *>(next())) ) {
ebde5500 596 GetRecPointsData(kRPSpec)->Fill( rp->GetEnergy()) ;
597 Int_t mod = rp->GetPHOSMod() ;
598 TVector3 pos ;
599 rp->GetLocalPosition(pos) ;
600 switch(mod){
601 case 1: GetRecPointsData(kRPmod1)->Fill(pos.X(),pos.Z()) ; break ;
602 case 2: GetRecPointsData(kRPmod2)->Fill(pos.X(),pos.Z()) ; break ;
603 case 3: GetRecPointsData(kRPmod3)->Fill(pos.X(),pos.Z()) ; break ;
604 case 4: GetRecPointsData(kRPmod4)->Fill(pos.X(),pos.Z()) ; break ;
605 case 5: GetRecPointsData(kRPmod5)->Fill(pos.X(),pos.Z()) ; break ;
606 }
607 eTot+= rp->GetEnergy() ;
04236e67 608 }
ebde5500 609 GetRecPointsData(kRPEtot)->Fill(eTot) ;
04236e67 610 emcrecpoints->Delete();
611 delete emcrecpoints;
612 }
613 {
614 TBranch *cpvbranch = clustersTree->GetBranch("PHOSCpvRP");
615 if (!cpvbranch) {
616 AliError("can't get the branch with the PHOS CPV clusters !");
617 return;
618 }
619 TObjArray *cpvrecpoints = new TObjArray(100) ;
620 cpvbranch->SetAddress(&cpvrecpoints);
621 cpvbranch->GetEntry(0);
622
ebde5500 623 GetRecPointsData(kRPNcpv)->Fill(cpvrecpoints->GetEntriesFast()) ;
04236e67 624 cpvrecpoints->Delete();
625 delete cpvrecpoints;
626 }
627}
628
04236e67 629//____________________________________________________________________________
630void AliPHOSQADataMakerRec::StartOfDetectorCycle()
631{
632 //Detector specific actions at start of cycle
633
634}