Move the selection of the fitting algorithm from Raw2Digits to FitRaw
[u/mrichter/AliRoot.git] / ITS / AliITSQASPDDataMakerRec.cxx
CommitLineData
096292ae 1/**************************************************************************
2 * Copyright(c) 2007-2009, 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 **************************************************************************/
3f905799 15/* $Id$ */
096292ae 16// *************************************************************
17// Checks the quality assurance
18// by comparing with reference data
19// contained in a DB
20// -------------------------------------------------------------
21// W. Ferrarese + P. Cerello Feb 2008
22// INFN Torino
23// M. Nicassio D. Elia INFN Bari March 2008
24// maria.nicassio@ba.infn.it
25
26
27// --- ROOT system ---
28#include <TTree.h>
29#include <TH1.h>
30#include <TH2.h>
31#include <TMath.h>
32// --- Standard library ---
33
34// --- AliRoot header files ---
35#include "AliITSQADataMakerRec.h"
36#include "AliITSQASPDDataMakerRec.h"
37#include "AliLog.h"
4e25ac79 38#include "AliQAv1.h"
096292ae 39#include "AliRawReader.h"
379510c2 40#include "AliITSRawStreamSPD.h"
41#include "AliITSRawStreamSPDErrorLog.h"
33626263 42#include "AliITSdigitSPD.h"
096292ae 43#include "AliITSRecPoint.h"
e62fe478 44#include "AliITSRecPointContainer.h"
379510c2 45
096292ae 46ClassImp(AliITSQASPDDataMakerRec)
47
48//____________________________________________________________________________
379510c2 49AliITSQASPDDataMakerRec::AliITSQASPDDataMakerRec(AliITSQADataMakerRec *aliITSQADataMakerRec, Bool_t kMode, Short_t ldc, AliITSRawStreamSPDErrorLog *aliITSRawStreamSPDErrorLog) :
096292ae 50TObject(),
51fAliITSQADataMakerRec(aliITSQADataMakerRec),
52fkOnline(kMode),
53fLDC(ldc),
7a0e5776 54fSPDhRawsTask(0),
44ed7a66 55fSPDhDigitsTask(0),
7a0e5776 56fSPDhRecPointsTask(0),
57fGenRawsOffset(0),
44ed7a66 58fGenDigitsOffset(0),
7a0e5776 59fGenRecPointsOffset(0),
379510c2 60fAdvLogger(aliITSRawStreamSPDErrorLog)
096292ae 61{
62 //ctor used to discriminate OnLine-Offline analysis
8b7e858c 63 //AliInfo(Form("AliRecoParam::kNSpecies %d\n",AliRecoParam::kNSpecies));
64 fGenRawsOffset = new Int_t[AliRecoParam::kNSpecies];
65 fGenRecPointsOffset = new Int_t[AliRecoParam::kNSpecies];
4a903927 66 fGenDigitsOffset = new Int_t[AliRecoParam::kNSpecies];
8b7e858c 67 for(Int_t i=0; i<AliRecoParam::kNSpecies;i++) {
68 fGenRawsOffset[i] = 0;
69 fGenRecPointsOffset[i] = 0;
4a903927 70 fGenDigitsOffset[i]=0;
8b7e858c 71 }
096292ae 72}
73
74//____________________________________________________________________________
75AliITSQASPDDataMakerRec::AliITSQASPDDataMakerRec(const AliITSQASPDDataMakerRec& qadm) :
76TObject(),
77fAliITSQADataMakerRec(qadm.fAliITSQADataMakerRec),
78fkOnline(qadm.fkOnline),
79fLDC(qadm.fLDC),
7a0e5776 80fSPDhRawsTask(qadm.fSPDhRawsTask),
44ed7a66 81fSPDhDigitsTask(qadm.fSPDhDigitsTask),
7a0e5776 82fSPDhRecPointsTask(qadm.fSPDhRecPointsTask),
83fGenRawsOffset(qadm.fGenRawsOffset),
44ed7a66 84fGenDigitsOffset(qadm.fGenDigitsOffset),
7a0e5776 85fGenRecPointsOffset(qadm.fGenRecPointsOffset),
379510c2 86fAdvLogger(qadm.fAdvLogger)
096292ae 87{
88 //copy ctor
89 fAliITSQADataMakerRec->SetName((const char*)qadm.fAliITSQADataMakerRec->GetName()) ;
90 fAliITSQADataMakerRec->SetTitle((const char*)qadm.fAliITSQADataMakerRec->GetTitle());
91 }
92
93//__________________________________________________________________
94AliITSQASPDDataMakerRec::~AliITSQASPDDataMakerRec(){
95 // destructor
379510c2 96// delete fAdvLogger;
096292ae 97}
98//__________________________________________________________________
99
100AliITSQASPDDataMakerRec& AliITSQASPDDataMakerRec::operator = (const AliITSQASPDDataMakerRec& qac )
101{
102 // Equal operator.
103 this->~AliITSQASPDDataMakerRec();
104 new(this) AliITSQASPDDataMakerRec(qac);
105 return *this;
106}
107
108//____________________________________________________________________________
109void AliITSQASPDDataMakerRec::StartOfDetectorCycle()
110{
111 //Detector specific actions at start of cycle
5379c4a3 112 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Start of SPD Cycle\n");
096292ae 113}
114
115//____________________________________________________________________________
4e25ac79 116void AliITSQASPDDataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t /*task*/, TObjArray* /*list*/)
096292ae 117{
118 // launch the QA checking
5379c4a3 119 AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n");
096292ae 120
4e25ac79 121 //AliQAChecker::Instance()->Run( AliQAv1::kITS , task, list);
096292ae 122}
123
124//____________________________________________________________________________
eca4fa66 125Int_t AliITSQASPDDataMakerRec::InitRaws()
096292ae 126{
127 // Initialization for RAW data - SPD -
7d297381 128 const Bool_t expert = kTRUE ;
129 const Bool_t saveCorr = kTRUE ;
130 const Bool_t image = kTRUE ;
eca4fa66 131 Int_t rv = 0 ;
132// fGenRawsOffset = (fAliITSQADataMakerRec->fRawsQAList[AliRecoParam::kDefault])->GetEntries();
8bab7823 133 if(!fAdvLogger) fAdvLogger = new AliITSRawStreamSPDErrorLog();
5379c4a3 134 AliDebug(AliQAv1::GetQADebugLevel(), "Book Offline Histograms for SPD\n ");
439e7a8a 135
379510c2 136 Char_t name[50];
137 Char_t title[50];
096292ae 138
26ee9565 139 TH1F *hlayer = new TH1F("SPDLayPattern_SPD","Layer map - SPD",6,0.,6.);
379510c2 140 hlayer->GetXaxis()->SetTitle("Layer number");
141 hlayer->GetYaxis()->SetTitle("Entries");
8b7e858c 142 rv = fAliITSQADataMakerRec->Add2RawsList(hlayer, 0+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
7a0e5776 143 fSPDhRawsTask++;
379510c2 144
145 TH1F **hmod = new TH1F*[2];
146 TH2F **hhitMap = new TH2F*[20];
147 TH1F **herrors = new TH1F*[20];
148 for (Int_t iLay=0; iLay<2; iLay++) {
26ee9565 149 sprintf(name,"SPDModPattern_SPD%d",iLay+1);
379510c2 150 sprintf(title,"Module map - SPD Layer %d",iLay+1);
151 hmod[iLay]=new TH1F(name,title,fgknSPDmodules,0,fgknSPDmodules);
152 hmod[iLay]->GetXaxis()->SetTitle("Module number");
153 hmod[iLay]->GetYaxis()->SetTitle("Entries");
8ec28eb2 154 rv = fAliITSQADataMakerRec->Add2RawsList(hmod[iLay], 1+iLay+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
7a0e5776 155 fSPDhRawsTask++;
379510c2 156 }
8ec28eb2 157
158 TH2F *hHitMapHalfStaveChipSideA
159 = new TH2F("SPDHitMapHalfStaveChipSideA_SPD","Hit map per HalfStave per Chip Side A - SPD",60,0.,60.,10,0.,10.);
160 hHitMapHalfStaveChipSideA->GetXaxis()->SetTitle("HalfStave");
161 hHitMapHalfStaveChipSideA->GetYaxis()->SetTitle("Chip");
162 rv = fAliITSQADataMakerRec->Add2RawsList(hHitMapHalfStaveChipSideA, 3+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
163 fSPDhRawsTask++;
164
165 TH2F *hHitMapHalfStaveChipSideC
166 = new TH2F("SPDHitMapHalfStaveChipSideC_SPD","Hit map per HalfStave per Chip Side C - SPD",60,0.,60.,10,0.,10.);
167 hHitMapHalfStaveChipSideC->GetXaxis()->SetTitle("HalfStave");
168 hHitMapHalfStaveChipSideC->GetYaxis()->SetTitle("Chip");
169 rv = fAliITSQADataMakerRec->Add2RawsList(hHitMapHalfStaveChipSideC, 4+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
170 fSPDhRawsTask++;
171
172 TH1F *herrorsAll = new TH1F("SPDErrorsAll_SPD","Error codes - SPD",20,0.,20.);
173 herrorsAll->GetXaxis()->SetTitle("DDL");
174 herrorsAll->GetYaxis()->SetTitle("Entries");
175 rv = fAliITSQADataMakerRec->Add2RawsList(herrorsAll, 5+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr);
176 fSPDhRawsTask++;
177
379510c2 178 for (Int_t iDDL=0; iDDL<20; iDDL++) {
26ee9565 179 sprintf(name,"SPDHitMap_SPD_DDL%d",iDDL+1);
379510c2 180 sprintf(title,"Hit map - SPD DDL %d",iDDL+1);
181 hhitMap[iDDL]=new TH2F(name,title,320,0,10*32,1536,0,6*256);
182 hhitMap[iDDL]->GetXaxis()->SetTitle("Column");
183 hhitMap[iDDL]->GetYaxis()->SetTitle("Row");
8ec28eb2 184 rv = fAliITSQADataMakerRec->Add2RawsList(hhitMap[iDDL], 6+(2*iDDL)+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
7a0e5776 185 fSPDhRawsTask++;
26ee9565 186 sprintf(name,"SPDErrors_SPD_DDL%d",iDDL+1);
379510c2 187 sprintf(title,"Error codes - SPD DDL %d",iDDL+1);
b467364b 188 herrors[iDDL] = new TH1F (name,title,fAdvLogger->GetNrErrorCodes(),0,fAdvLogger->GetNrErrorCodes());
379510c2 189 herrors[iDDL]->SetXTitle("Error Code");
190 herrors[iDDL]->SetYTitle("Nr of errors");
8ec28eb2 191 rv = fAliITSQADataMakerRec->Add2RawsList(herrors[iDDL], 7+(2*iDDL)+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
7a0e5776 192 fSPDhRawsTask++;
379510c2 193 }
096292ae 194
379510c2 195 TH1F** hMultSPDhits = new TH1F*[2];
196 for (Int_t iLay=0; iLay<2; iLay++) {
26ee9565 197 sprintf(name,"SPDHitsMultiplicity_SPD%d",iLay+1);
379510c2 198 sprintf(title,"Hit multiplicity - SPD Layer %d",iLay+1);
199 hMultSPDhits[iLay]=new TH1F(name,title,200,0.,200.);
200 hMultSPDhits[iLay]->GetXaxis()->SetTitle("Hit multiplicity");
201 hMultSPDhits[iLay]->GetYaxis()->SetTitle("Entries");
8ec28eb2 202 rv = fAliITSQADataMakerRec->Add2RawsList(hMultSPDhits[iLay], 46+iLay+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
7a0e5776 203 fSPDhRawsTask++;
379510c2 204 }
205
954ef57a 206 TH2F *hMultSPDhits2MultSPDhits1
26ee9565 207 = new TH2F("SPDHitMultCorrelation_SPD","Hit multiplicity correlation - SPD",200,0.,200.,200,0.,200.);
379510c2 208 hMultSPDhits2MultSPDhits1->GetXaxis()->SetTitle("Hit multiplicity (Layer 1)");
209 hMultSPDhits2MultSPDhits1->GetYaxis()->SetTitle("Hit multiplicity (Layer 2)");
8ec28eb2 210 rv = fAliITSQADataMakerRec->Add2RawsList(hMultSPDhits2MultSPDhits1, 48+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr);
211 fSPDhRawsTask++;
212
213 TH2F *hFastOrMapHalfStaveChip
214 = new TH2F("SPDFastOrMapHalfStaveChip_SPD","FastOr map per HalfStave per Chip - SPD",120,0.,120.,10,0.,10.);
215 hFastOrMapHalfStaveChip->GetXaxis()->SetTitle("HalfStave");
216 hFastOrMapHalfStaveChip->GetYaxis()->SetTitle("Chip");
217 rv = fAliITSQADataMakerRec->Add2RawsList(hFastOrMapHalfStaveChip, 49+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr);
218 fSPDhRawsTask++;
219
220 TH1F *hFastOrFiredMap = new TH1F("SPDFastOrPattern_SPD","FastOrFiredChip map - SPD",1200,0.,1200.);
221 hFastOrFiredMap->GetXaxis()->SetTitle("Chip number");
222 hFastOrFiredMap->GetYaxis()->SetTitle("Entries");
223 rv = fAliITSQADataMakerRec->Add2RawsList(hFastOrFiredMap, 50+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
224 fSPDhRawsTask++;
225
226 TH2F *hHitMapHalfStaveChipInner
227 = new TH2F("SPDHitMapHalfStaveChipInner_SPD","Hit map per HalfStave per Chip Inner - SPD",20,0.,20.,20,0.,20.);
228 hHitMapHalfStaveChipInner->GetXaxis()->SetTitle("Chip");
229 hHitMapHalfStaveChipInner->GetYaxis()->SetTitle("HalfStave");
230 rv = fAliITSQADataMakerRec->Add2RawsList(hHitMapHalfStaveChipInner, 51+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr);
231 fSPDhRawsTask++;
232
233 TH2F *hHitMapHalfStaveChipOuter
234 = new TH2F("SPDHitMapHalfStaveChipOuter_SPD","Hit map per HalfStave per Chip Outer - SPD",20,0.,20.,40,0.,40.);
235 hHitMapHalfStaveChipOuter->GetXaxis()->SetTitle("Chip");
236 hHitMapHalfStaveChipOuter->GetYaxis()->SetTitle("HalfStave");
237 rv = fAliITSQADataMakerRec->Add2RawsList(hHitMapHalfStaveChipOuter, 52+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr);
238 fSPDhRawsTask++;
239
240 TH1F *hHitMapChipInnerZ = new TH1F("SPDHitMapChipInnerZ_SPD","Hit map per ChipZ Inner - SPD",20,0.,20.);
241 hHitMapChipInnerZ->GetXaxis()->SetTitle("Chip");
242 hHitMapChipInnerZ->GetYaxis()->SetTitle("Entries");
243 rv = fAliITSQADataMakerRec->Add2RawsList(hHitMapChipInnerZ, 53+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr);
244 fSPDhRawsTask++;
245
246 TH1F *hHitMapChipOuterZ = new TH1F("SPDHitMapChipOuterZ_SPD","Hit map per ChipZ Outer - SPD",20,0.,20.);
247 hHitMapChipOuterZ->GetXaxis()->SetTitle("Chip");
248 hHitMapChipOuterZ->GetYaxis()->SetTitle("Entries");
249 rv = fAliITSQADataMakerRec->Add2RawsList(hHitMapChipOuterZ, 54+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr);
250 fSPDhRawsTask++;
251
252 TH1F *hHitMapHalfStaveInnerPhi = new TH1F("SPDHitMapChipInnerPhi_SPD","Hit map per HalfStavePhi Inner - SPD",20,0.,20.);
253 hHitMapHalfStaveInnerPhi->GetXaxis()->SetTitle("HalfStave");
254 hHitMapHalfStaveInnerPhi->GetYaxis()->SetTitle("Entries");
255 rv = fAliITSQADataMakerRec->Add2RawsList(hHitMapHalfStaveInnerPhi, 55+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr);
256 fSPDhRawsTask++;
257
258 TH1F *hHitMapHalfStaveOuterPhi = new TH1F("SPDHitMapChipOuterPhi_SPD","Hit map per HalfStavePhi Outer - SPD",40,0.,40.);
259 hHitMapHalfStaveOuterPhi->GetXaxis()->SetTitle("HalfStave");
260 hHitMapHalfStaveOuterPhi->GetYaxis()->SetTitle("Entries");
261 rv = fAliITSQADataMakerRec->Add2RawsList(hHitMapHalfStaveOuterPhi, 56+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr);
262 fSPDhRawsTask++;
263
264 TH1F *hFastOrFiredChips = new TH1F("SPDFastOrFiredChips_SPD","FastOrFiredChips - SPD",20,0.,20.);
265 hFastOrFiredChips->GetXaxis()->SetTitle("DDL");
266 hFastOrFiredChips->GetYaxis()->SetTitle("nFastOrFiredChips");
267 rv = fAliITSQADataMakerRec->Add2RawsList(hFastOrFiredChips, 57+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
268 fSPDhRawsTask++;
269
270 TH1F *hFiredChips = new TH1F("SPDFiredChips_SPD","FiredChips - SPD",20,0.,20.);
271 hFiredChips->GetXaxis()->SetTitle("DDL");
272 hFiredChips->GetYaxis()->SetTitle("nFiredChips");
273 rv = fAliITSQADataMakerRec->Add2RawsList(hFiredChips, 58+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
7a0e5776 274 fSPDhRawsTask++;
8bab7823 275
8ec28eb2 276 TH1F *hFastOrEff = new TH1F("SPDFastOrEff_SPD","FastOr efficiency - SPD",20,0.,20.);
277 hFastOrEff->GetXaxis()->SetTitle("DDL");
278 hFastOrEff->GetYaxis()->SetTitle("Efficiency");
279 rv = fAliITSQADataMakerRec->Add2RawsList(hFastOrEff, 59+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr);
8bab7823 280 fSPDhRawsTask++;
281
5379c4a3 282 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SPD Raws histograms booked\n",fSPDhRawsTask));
eca4fa66 283 return rv ;
096292ae 284}
285
096292ae 286//____________________________________________________________________________
eca4fa66 287Int_t AliITSQASPDDataMakerRec::MakeRaws(AliRawReader* rawReader)
096292ae 288{
289 // Fill QA for RAW - SPD -
eca4fa66 290 Int_t rv = 0 ;
eca4fa66 291
379510c2 292 rawReader->Reset();
66eae3f0 293 AliITSRawStreamSPD rawStreamSPD(rawReader);
294 rawStreamSPD.ActivateAdvancedErrorLog(kTRUE,fAdvLogger);
379510c2 295
296 Int_t nDigitsL1 = 0;
297 Int_t nDigitsL2 = 0;
298 Int_t iEq;
299 Int_t iLayer;
300 Int_t iHalfStave, iChip;
8bab7823 301 Int_t chipKey;
379510c2 302 Int_t col, row;
303 UInt_t module, colM, rowM;
8ec28eb2 304 Bool_t isFiredChip[1200];
305 for(Int_t ichK=0; ichK<1200; ichK++) isFiredChip[ichK] = kFALSE;
306
66eae3f0 307 while(rawStreamSPD.Next()) {
379510c2 308
309 iEq = rawReader->GetDDLID();
310 if (iEq>=0 && iEq<20) {
66eae3f0 311 iHalfStave = rawStreamSPD.GetHalfStaveNr();
312 iChip = rawStreamSPD.GetChipAddr();
313 col = rawStreamSPD.GetChipCol();
314 row = rawStreamSPD.GetChipRow();
379510c2 315
8ec28eb2 316 chipKey = rawStreamSPD.GetOfflineChipKeyFromOnline(iEq,iHalfStave,iChip);
317 isFiredChip[chipKey] = kTRUE;
318
66eae3f0 319 rawStreamSPD.OnlineToOffline(iEq, iHalfStave, iChip, col, row, module, colM, rowM);
379510c2 320
321 if (iHalfStave>=0 && iHalfStave<2) iLayer=0;
322 else iLayer=1;
323
8b7e858c 324 fAliITSQADataMakerRec->GetRawsData(0+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(iLayer);
379510c2 325 if (iLayer==0) {
8b7e858c 326 fAliITSQADataMakerRec->GetRawsData(1+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(module);
379510c2 327 nDigitsL1++;
328 } else {
8b7e858c 329 fAliITSQADataMakerRec->GetRawsData(2+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(module);
379510c2 330 nDigitsL2++;
331 }
332
8ec28eb2 333 if(iEq<10) {
334 fAliITSQADataMakerRec->GetRawsData(3+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(iHalfStave+iEq*6,iChip);
335 }
336 else {
337 fAliITSQADataMakerRec->GetRawsData(4+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(iHalfStave+(iEq-10)*6,iChip);
338 }
8bab7823 339
8ec28eb2 340 if(iLayer==0) {
341 if(iEq<10) {
342 fAliITSQADataMakerRec->GetRawsData(51+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(19-iChip,1-iHalfStave+iEq*2);
343 fAliITSQADataMakerRec->GetRawsData(53+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(19-iChip);
344 fAliITSQADataMakerRec->GetRawsData(55+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(1-iHalfStave+iEq*2);
345 }
346 else {
347 fAliITSQADataMakerRec->GetRawsData(51+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(iChip,1-iHalfStave+(iEq-10)*2);
348 fAliITSQADataMakerRec->GetRawsData(53+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(iChip);
349 fAliITSQADataMakerRec->GetRawsData(55+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(1-iHalfStave+(iEq-10)*2);
350 }
351 }
352 else {
353 if(iEq<10) {
354 fAliITSQADataMakerRec->GetRawsData(52+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(19-iChip,iHalfStave-2+iEq*4);
355 fAliITSQADataMakerRec->GetRawsData(54+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(19-iChip);
356 fAliITSQADataMakerRec->GetRawsData(56+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(iHalfStave-2+iEq*4);
357 }
358 else {
359 fAliITSQADataMakerRec->GetRawsData(52+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(iChip,iHalfStave-2+(iEq-10)*4);
360 fAliITSQADataMakerRec->GetRawsData(54+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(iChip);
361 fAliITSQADataMakerRec->GetRawsData(56+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(iHalfStave-2+(iEq-10)*4);
362 }
363 }
364 fAliITSQADataMakerRec->GetRawsData(6+(2*iEq)+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(colM+(module%2)*160,rowM+iHalfStave*256);
379510c2 365 }
379510c2 366 }
8bab7823 367
8ec28eb2 368 UInt_t nErrorsDDL[20];
369 UInt_t nFiredChipsDDL[20];
370 UInt_t nFastOrFiredChipsDDL[20];
8b7e858c 371 for (Int_t ieq=0; ieq<20; ieq++) {
8ec28eb2 372 nErrorsDDL[ieq] = 0;
373 nFiredChipsDDL[ieq] = 0;
374 nFastOrFiredChipsDDL[ieq] = 0;
375 for (UInt_t ierr=0; ierr<fAdvLogger->GetNrErrorCodes(); ierr++) {
376 fAliITSQADataMakerRec->GetRawsData(7+(2*ieq)+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(ierr,fAdvLogger->GetNrErrors(ierr,ieq));
377 if(ierr>0) nErrorsDDL[ieq] = nErrorsDDL[ieq] + fAdvLogger->GetNrErrors(ierr,ieq);
378 }
379 fAliITSQADataMakerRec->GetRawsData(5+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(ieq,nErrorsDDL[ieq]);
8bab7823 380
381 for (Int_t ihs=0; ihs<6; ihs++) {
382 for (Int_t ichip=0; ichip<10; ichip++) {
8ec28eb2 383 chipKey = rawStreamSPD.GetOfflineChipKeyFromOnline(ieq,ihs,ichip);
384 if(isFiredChip[chipKey]) nFiredChipsDDL[ieq]++;
66eae3f0 385 if(rawStreamSPD.GetFastOrSignal(ieq,ihs,ichip)) {
8ec28eb2 386 nFastOrFiredChipsDDL[ieq]++;
387 fAliITSQADataMakerRec->GetRawsData(49+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(ihs+ieq*6,ichip);
388 fAliITSQADataMakerRec->GetRawsData(50+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(chipKey);
8bab7823 389 }
390 }
391 }
8ec28eb2 392 fAliITSQADataMakerRec->GetRawsData(57+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(ieq,nFastOrFiredChipsDDL[ieq]);
393 fAliITSQADataMakerRec->GetRawsData(58+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(ieq,nFiredChipsDDL[ieq]);
394 fAliITSQADataMakerRec->GetRawsData(59+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Divide(fAliITSQADataMakerRec->GetRawsData(57+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),fAliITSQADataMakerRec->GetRawsData(58+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]));
8bab7823 395 }
379510c2 396
397 fAdvLogger->Reset();
8ec28eb2 398 fAliITSQADataMakerRec->GetRawsData(46+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(nDigitsL1);
399 fAliITSQADataMakerRec->GetRawsData(47+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(nDigitsL2);
400 fAliITSQADataMakerRec->GetRawsData(48+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(nDigitsL1,nDigitsL2);
379510c2 401
5379c4a3 402 AliDebug(AliQAv1::GetQADebugLevel(),Form("Event completed, %d raw digits read",nDigitsL1+nDigitsL2));
eca4fa66 403 return rv ;
096292ae 404}
405
406//____________________________________________________________________________
eca4fa66 407Int_t AliITSQASPDDataMakerRec::InitDigits()
44ed7a66 408{
409 // Initialization for DIGIT data - SPD -
410 const Bool_t expert = kTRUE ;
411 const Bool_t image = kTRUE ;
eca4fa66 412 Int_t rv = 0 ;
413// fGenDigitsOffset = (fAliITSQADataMakerRec->fDigitsQAList[AliRecoParam::kDefault])->GetEntries();
44ed7a66 414 //fSPDhDigitsTask must be incremented by one unit every time a histogram is ADDED to the QA List
415
416 Char_t name[50];
417 Char_t title[50];
418
419 TH1F *hlayer = new TH1F("SPDLayPattern_SPD","Layer map - SPD",6,0.,6.);
420 hlayer->GetXaxis()->SetTitle("Layer number");
421 hlayer->GetYaxis()->SetTitle("Entries");
4a903927 422 rv = fAliITSQADataMakerRec->Add2DigitsList(hlayer,fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
44ed7a66 423 fSPDhDigitsTask++;
424
425 TH1F **hmod = new TH1F*[2];
426 for (Int_t iLay=0; iLay<2; iLay++) {
427 sprintf(name,"SPDModPattern_SPD%d",iLay+1);
428 sprintf(title,"Module map - SPD Layer %d",iLay+1);
429 hmod[iLay]=new TH1F(name,title,240,0,240);
430 hmod[iLay]->GetXaxis()->SetTitle("Module number");
431 hmod[iLay]->GetYaxis()->SetTitle("Entries");
4a903927 432 rv = fAliITSQADataMakerRec->Add2DigitsList(hmod[iLay],1+iLay+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
44ed7a66 433 fSPDhDigitsTask++;
434 }
435
436 TH1F *hcolumns = new TH1F("SPDColumns_SPD","Columns - SPD",160,0.,160.);
437 hcolumns->GetXaxis()->SetTitle("Column number");
438 hcolumns->GetYaxis()->SetTitle("Entries");
4a903927 439 rv = fAliITSQADataMakerRec->Add2DigitsList(hcolumns,3+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
44ed7a66 440 fSPDhDigitsTask++;
441
442 TH1F *hrows = new TH1F("SPDRows_SPD","Rows - SPD",256,0.,256.);
443 hrows->GetXaxis()->SetTitle("Row number");
444 hrows->GetYaxis()->SetTitle("Entries");
4a903927 445 rv = fAliITSQADataMakerRec->Add2DigitsList(hrows,4+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
44ed7a66 446 fSPDhDigitsTask++;
447
448 TH1F** hMultSPDdigits = new TH1F*[2];
449 for (Int_t iLay=0; iLay<2; ++iLay) {
450 sprintf(name,"SPDDigitMultiplicity_SPD%d",iLay+1);
451 sprintf(title,"Digit multiplicity - SPD Layer %d",iLay+1);
452 hMultSPDdigits[iLay]=new TH1F(name,title,200,0.,200.);
453 hMultSPDdigits[iLay]->GetXaxis()->SetTitle("Digit multiplicity");
454 hMultSPDdigits[iLay]->GetYaxis()->SetTitle("Entries");
4a903927 455 rv = fAliITSQADataMakerRec->Add2DigitsList(hMultSPDdigits[iLay], 5+iLay+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
44ed7a66 456 fSPDhDigitsTask++;
457 }
458
459 TH2F *hMultSPDdig2MultSPDdig1
460 = new TH2F("SPDDigitMultCorrelation_SPD","Digit multiplicity correlation - SPD",200,0.,200.,200,0.,200.);
461 hMultSPDdig2MultSPDdig1->GetXaxis()->SetTitle("Digit multiplicity (Layer 1)");
462 hMultSPDdig2MultSPDdig1->GetYaxis()->SetTitle("Digit multiplicity (Layer 2)");
4a903927 463 rv = fAliITSQADataMakerRec->Add2DigitsList(hMultSPDdig2MultSPDdig1,7+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
44ed7a66 464 fSPDhDigitsTask++;
465
466 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SPD Digits histograms booked\n",fSPDhDigitsTask));
eca4fa66 467 return rv ;
44ed7a66 468}
469
470//____________________________________________________________________________
eca4fa66 471Int_t AliITSQASPDDataMakerRec::MakeDigits(TTree *digits)
44ed7a66 472{
473 // Fill QA for DIGIT - SPD -
eca4fa66 474 Int_t rv = 0 ;
eca4fa66 475
44ed7a66 476// AliITS *fITS = (AliITS*)gAlice->GetModule("ITS");
477// fITS->SetTreeAddress();
478// TClonesArray *iITSdigits = fITS->DigitsAddress(0); // 0->SPD
33626263 479 TBranch *branchD = digits->GetBranch("ITSDigitsSPD");
44ed7a66 480 if (!branchD) {
33626263 481 AliError("can't get the branch with the SPD ITS digits !");
eca4fa66 482 return rv;
44ed7a66 483 }
33626263 484 static TClonesArray statDigits("AliITSdigitSPD");
44ed7a66 485 TClonesArray *iITSdigits = &statDigits;
486 branchD->SetAddress(&iITSdigits);
487 Int_t nDigitsL1=0;
488 Int_t nDigitsL2=0;
489
490 for (Int_t imod=0; imod<240; ++imod){
491 digits->GetEvent(imod);
492 Int_t ndigits = iITSdigits->GetEntries();
493 if (imod<80) {
4a903927 494 fAliITSQADataMakerRec->GetDigitsData(0+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(0.5,ndigits);
495 fAliITSQADataMakerRec->GetDigitsData(1+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(imod,ndigits);
44ed7a66 496 nDigitsL1+=ndigits;
497 }
498 else {
4a903927 499 fAliITSQADataMakerRec->GetDigitsData(0+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(1,ndigits);
500 fAliITSQADataMakerRec->GetDigitsData(2+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(imod,ndigits);
44ed7a66 501 nDigitsL2+=ndigits;
502 }
503 for (Int_t idig=0; idig<ndigits; ++idig) {
504 AliITSdigit *dig=(AliITSdigit*)iITSdigits->UncheckedAt(idig);
505 Int_t col=dig->GetCoord1(); // cell number z
506 Int_t row=dig->GetCoord2(); // cell number x
4a903927 507 fAliITSQADataMakerRec->GetDigitsData(3+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(col);
508 fAliITSQADataMakerRec->GetDigitsData(4+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(row);
44ed7a66 509 }
510 }
4a903927 511 fAliITSQADataMakerRec->GetDigitsData(5+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(nDigitsL1);
512 fAliITSQADataMakerRec->GetDigitsData(6+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(nDigitsL2);
513 fAliITSQADataMakerRec->GetDigitsData(7+fGenDigitsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(nDigitsL1,nDigitsL2);
eca4fa66 514 return rv ;
44ed7a66 515}
516
517//____________________________________________________________________________
eca4fa66 518Int_t AliITSQASPDDataMakerRec::InitRecPoints()
096292ae 519{
520 // Initialization for RECPOINTS - SPD -
7d297381 521 const Bool_t expert = kTRUE ;
522 const Bool_t image = kTRUE ;
eca4fa66 523 Int_t rv = 0 ;
8b7e858c 524 //AliInfo(Form("fAliITSQADataMakerRec->GetEventSpecie() %d\n",fAliITSQADataMakerRec->GetEventSpecie()));
525 //AliInfo(Form("fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] %d\n",fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]));
eca4fa66 526// fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList[AliRecoParam::kDefault])->GetEntries();
26ee9565 527 TH1F* hlayer= new TH1F("SPDLayPattern_SPD","Layer map - SPD",6,0.,6.);
096292ae 528 hlayer->GetXaxis()->SetTitle("Layer number");
529 hlayer->GetYaxis()->SetTitle("Entries");
8b7e858c 530 rv = fAliITSQADataMakerRec->Add2RecPointsList(hlayer, 0+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
7a0e5776 531 fSPDhRecPointsTask++;
096292ae 532
533 TH1F** hmod = new TH1F*[2];
534 TH1F** hxl = new TH1F*[2];
535 TH1F** hzl = new TH1F*[2];
536 TH1F** hxg = new TH1F*[2];
537 TH1F** hyg = new TH1F*[2];
538 TH1F** hzg = new TH1F*[2];
539 TH1F** hr = new TH1F*[2];
540 TH1F** hphi = new TH1F*[2];
541 TH1F** hMultSPDcl = new TH1F*[2];
8bab7823 542 TH2F** hNyNz = new TH2F*[2]; // y and z cluster length
543 TH1F** hNpixels = new TH1F*[2]; // cluster size in number of pixels
544 TH1F** hType = new TH1F*[2]; // cluster type according to conventional table
545 TH2F** hPhiZ = new TH2F*[2];
096292ae 546
547 Float_t xlim[2]={4.5,8.};
548 Float_t zlim[2]={15.,15.};
549
550 Char_t name[50];
551 Char_t title[50];
552 for (Int_t iLay=0;iLay<2;iLay++) {
26ee9565 553 sprintf(name,"SPDModPattern_SPD%d",iLay+1);
096292ae 554 sprintf(title,"Module map - SPD Layer %d",iLay+1);
555 hmod[iLay]=new TH1F(name,title,fgknSPDmodules,0,fgknSPDmodules);
556 hmod[iLay]->GetXaxis()->SetTitle("Module number");
557 hmod[iLay]->GetYaxis()->SetTitle("Entries");
8bab7823 558 rv = fAliITSQADataMakerRec->Add2RecPointsList(hmod[iLay], 1+(12*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
7a0e5776 559 fSPDhRecPointsTask++;
096292ae 560
26ee9565 561 sprintf(name,"SPDxLoc_SPD%d",iLay+1);
096292ae 562 sprintf(title,"Local x coordinate - SPD Layer %d",iLay+1);
563 hxl[iLay]=new TH1F(name,title,100,-4.,4.);
564 hxl[iLay]->GetXaxis()->SetTitle("Local x [cm]");
565 hxl[iLay]->GetYaxis()->SetTitle("Entries");
8bab7823 566 rv = fAliITSQADataMakerRec->Add2RecPointsList(hxl[iLay], 2+(12*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
7a0e5776 567 fSPDhRecPointsTask++;
096292ae 568
26ee9565 569 sprintf(name,"SPDzLoc_SPD%d",iLay+1);
096292ae 570 sprintf(title,"Local z coordinate - SPD Layer %d",iLay+1);
571 hzl[iLay]=new TH1F(name,title,100,-4.,4.);
572 hzl[iLay]->GetXaxis()->SetTitle("Local z [cm]");
573 hzl[iLay]->GetYaxis()->SetTitle("Entries");
8bab7823 574 rv = fAliITSQADataMakerRec->Add2RecPointsList(hzl[iLay], 3+(12*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
7a0e5776 575 fSPDhRecPointsTask++;
096292ae 576
26ee9565 577 sprintf(name,"SPDxGlob_SPD%d",iLay+1);
096292ae 578 sprintf(title,"Global x coordinate - SPD Layer %d",iLay+1);
579 hxg[iLay]=new TH1F(name,title,100,-xlim[iLay],xlim[iLay]);
580 hxg[iLay]->GetXaxis()->SetTitle("Global x [cm]");
581 hxg[iLay]->GetYaxis()->SetTitle("Entries");
8bab7823 582 rv = fAliITSQADataMakerRec->Add2RecPointsList(hxg[iLay],4+(12*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
7a0e5776 583 fSPDhRecPointsTask++;
096292ae 584
26ee9565 585 sprintf(name,"SPDyGlob_SPD%d",iLay+1);
096292ae 586 sprintf(title,"Global y coordinate - SPD Layer %d",iLay+1);
587 hyg[iLay]=new TH1F(name,title,100,-xlim[iLay],xlim[iLay]);
588 hyg[iLay]->GetXaxis()->SetTitle("Global y [cm]");
589 hyg[iLay]->GetYaxis()->SetTitle("Entries");
8bab7823 590 rv = fAliITSQADataMakerRec->Add2RecPointsList(hyg[iLay], 5+(12*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
7a0e5776 591 fSPDhRecPointsTask++;
096292ae 592
26ee9565 593 sprintf(name,"SPDzGlob_SPD%d",iLay+1);
096292ae 594 sprintf(title,"Global z coordinate - SPD Layer %d",iLay+1);
595 hzg[iLay]=new TH1F(name,title,150,-zlim[iLay],zlim[iLay]);
596 hzg[iLay]->GetXaxis()->SetTitle("Global z [cm]");
597 hzg[iLay]->GetYaxis()->SetTitle("Entries");
8bab7823 598 rv = fAliITSQADataMakerRec->Add2RecPointsList(hzg[iLay], 6+(12*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
7a0e5776 599 fSPDhRecPointsTask++;
096292ae 600
26ee9565 601 sprintf(name,"SPDr_SPD%d",iLay+1);
096292ae 602 sprintf(title,"Radius - SPD Layer %d",iLay+1);
603 hr[iLay]=new TH1F(name,title,100,0.,10.);
604 hr[iLay]->GetXaxis()->SetTitle("r [cm]");
605 hr[iLay]->GetYaxis()->SetTitle("Entries");
8bab7823 606 rv = fAliITSQADataMakerRec->Add2RecPointsList(hr[iLay], 7+(12*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
7a0e5776 607 fSPDhRecPointsTask++;
096292ae 608
26ee9565 609 sprintf(name,"SPDphi_SPD%d",iLay+1);
096292ae 610 sprintf(title,"#varphi - SPD Layer %d",iLay+1);
439e7a8a 611 hphi[iLay]=new TH1F(name,title,1000,0.,2*TMath::Pi());
096292ae 612 hphi[iLay]->GetXaxis()->SetTitle("#varphi [rad]");
613 hphi[iLay]->GetYaxis()->SetTitle("Entries");
8bab7823 614 rv = fAliITSQADataMakerRec->Add2RecPointsList(hphi[iLay], 8+(12*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
7a0e5776 615 fSPDhRecPointsTask++;
096292ae 616
26ee9565 617 sprintf(name,"SPDSizeYvsZ_SPD%d",iLay+1);
096292ae 618 sprintf(title,"Cluster dimension - SPD Layer %d",iLay+1);
619 hNyNz[iLay]=new TH2F(name,title,100,0.,100.,100,0.,100.);
620 hNyNz[iLay]->GetXaxis()->SetTitle("z length");
621 hNyNz[iLay]->GetYaxis()->SetTitle("y length");
8bab7823 622 rv = fAliITSQADataMakerRec->Add2RecPointsList(hNyNz[iLay], 9+(12*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
623 fSPDhRecPointsTask++;
624
625 sprintf(name,"SPDSizeTot_SPD%d",iLay+1);
626 sprintf(title,"Cluster size - SPD Layer %d",iLay+1);
627 hNpixels[iLay]=new TH1F(name,title,100,0.,100.);
628 hNpixels[iLay]->GetXaxis()->SetTitle("Cluster size");
629 hNpixels[iLay]->GetYaxis()->SetTitle("Entries");
630 rv = fAliITSQADataMakerRec->Add2RecPointsList(hNpixels[iLay], 10+(12*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
631 fSPDhRecPointsTask++;
632
633 sprintf(name,"SPDType_SPD%d",iLay+1);
634 sprintf(title,"Cluster type - SPD Layer %d",iLay+1);
635 hType[iLay]=new TH1F(name,title,20,0.,20.);
636 hType[iLay]->GetXaxis()->SetTitle("Cluster type");
637 hType[iLay]->GetYaxis()->SetTitle("Entries");
638 rv = fAliITSQADataMakerRec->Add2RecPointsList(hType[iLay], 11+(12*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
7a0e5776 639 fSPDhRecPointsTask++;
096292ae 640
26ee9565 641 sprintf(name,"SPDphi_z_SPD%d",iLay+1);
096292ae 642 sprintf(title,"#varphi vs z - SPD Layer %d",iLay+1);
439e7a8a 643 hPhiZ[iLay]=new TH2F(name,title,150,-zlim[iLay],zlim[iLay],200,0.,2*TMath::Pi());
096292ae 644 hPhiZ[iLay]->GetXaxis()->SetTitle("Global z [cm]");
645 hPhiZ[iLay]->GetYaxis()->SetTitle("#varphi [rad]");
8bab7823 646 rv = fAliITSQADataMakerRec->Add2RecPointsList(hPhiZ[iLay], 12+(12*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
7a0e5776 647 fSPDhRecPointsTask++;
096292ae 648
649 }
650
26ee9565 651 TH2F *hrPhi=new TH2F("SPDr_phi_SPD","#varphi vs r - SPD",100,0.,10.,100,0.,2*TMath::Pi());
096292ae 652 hrPhi->GetXaxis()->SetTitle("r [cm]");
653 hrPhi->GetYaxis()->SetTitle("#varphi [rad]");
8bab7823 654 rv = fAliITSQADataMakerRec->Add2RecPointsList(hrPhi, 25+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
7a0e5776 655 fSPDhRecPointsTask++;
096292ae 656
26ee9565 657 TH2F *hxy=new TH2F("SPDx_y_SPD","Global y vs x - SPD",200,-10.,10.,200,-10.,10.);
096292ae 658 hxy->GetXaxis()->SetTitle("Global x [cm]");
659 hxy->GetYaxis()->SetTitle("Global y [cm]");
8bab7823 660 rv = fAliITSQADataMakerRec->Add2RecPointsList(hxy, 26+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
7a0e5776 661 fSPDhRecPointsTask++;
096292ae 662
663 for (Int_t iLay=0;iLay<2;iLay++) {
26ee9565 664 sprintf(name,"SPDMultiplicity_SPD%d",iLay+1);
096292ae 665 sprintf(title,"Cluster multiplicity - SPD Layer %d",iLay+1);
666 hMultSPDcl[iLay]=new TH1F(name,title,200,0.,200.);
667 hMultSPDcl[iLay]->GetXaxis()->SetTitle("Cluster multiplicity");
668 hMultSPDcl[iLay]->GetYaxis()->SetTitle("Entries");
8bab7823 669 rv = fAliITSQADataMakerRec->Add2RecPointsList(hMultSPDcl[iLay], 27+iLay+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
7a0e5776 670 fSPDhRecPointsTask++;
096292ae 671 }
672
673 TH2F *hMultSPDcl2MultSPDcl1 =
26ee9565 674 new TH2F("SPDMultCorrelation_SPD","Cluster multiplicity correlation - SPD",200,0.,200.,200,0.,200.);
096292ae 675 hMultSPDcl2MultSPDcl1->GetXaxis()->SetTitle("Clusters multiplicity (Layer 1)");
676 hMultSPDcl2MultSPDcl1->GetYaxis()->SetTitle("Clusters multiplicity (Layer 2)");
8bab7823 677 rv = fAliITSQADataMakerRec->Add2RecPointsList(hMultSPDcl2MultSPDcl1, 29+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
7a0e5776 678 fSPDhRecPointsTask++;
096292ae 679
5379c4a3 680 AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SPD Recs histograms booked\n",fSPDhRecPointsTask));
096292ae 681
eca4fa66 682 return rv ;
096292ae 683}
684
685//____________________________________________________________________________
eca4fa66 686Int_t AliITSQASPDDataMakerRec::MakeRecPoints(TTree * clusterTree)
096292ae 687{
688 // Fill QA for RecPoints - SPD -
8ec28eb2 689 Int_t rv = 0 ;
e62fe478 690 AliITSRecPointContainer* rpcont=AliITSRecPointContainer::Instance();
8ec28eb2 691 TClonesArray *recpoints = rpcont->FetchClusters(0,clusterTree);
e62fe478 692 if(!rpcont->GetStatusOK() || !rpcont->IsSPDActive()){
693 AliError("can't get SPD clusters !");
eca4fa66 694 return rv;
3647765c 695 }
8ec28eb2 696
8b7e858c 697 //AliInfo(Form("fAliITSQADataMakerRec->GetEventSpecie() %d\n",fAliITSQADataMakerRec->GetEventSpecie()));
698 //AliInfo(Form("fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] %d\n",fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]));
e62fe478 699 Int_t nSPDmod = AliITSgeomTGeo::GetModuleIndex(3,1,1);
8ec28eb2 700
3647765c 701 Float_t cluGlo[3] = {0.,0.,0.};
702 Int_t nClusters[2] = {0,0};
8ec28eb2 703
e62fe478 704 for (Int_t iIts=0; iIts < nSPDmod; iIts++) {
705 recpoints = rpcont->UncheckedGetClusters(iIts);
706 Int_t nCluster = recpoints->GetEntriesFast();
707 if(nCluster == 0)continue;
3647765c 708 // loop over clusters
709 while(nCluster--) {
8ec28eb2 710 AliITSRecPoint* cluster =
e62fe478 711 (AliITSRecPoint*)recpoints->UncheckedAt(nCluster);
712 if (cluster->GetLayer()>1)continue;
3647765c 713 Int_t lay=cluster->GetLayer();
8b7e858c 714 fAliITSQADataMakerRec->GetRecPointsData(0 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(lay);
3647765c 715 cluster->GetGlobalXYZ(cluGlo);
716 Float_t rad=TMath::Sqrt(cluGlo[0]*cluGlo[0]+cluGlo[1]*cluGlo[1]);
096292ae 717 Float_t phi= TMath::Pi() + TMath::ATan2(-cluGlo[1],-cluGlo[0]);
718 if (lay==0) {
8ec28eb2 719 fAliITSQADataMakerRec->GetRecPointsData(1 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(iIts);
720 fAliITSQADataMakerRec->GetRecPointsData(2 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluster->GetDetLocalX());
721 fAliITSQADataMakerRec->GetRecPointsData(3 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluster->GetDetLocalZ());
722 fAliITSQADataMakerRec->GetRecPointsData(4 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluGlo[0]);
723 fAliITSQADataMakerRec->GetRecPointsData(5 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluGlo[1]);
724 fAliITSQADataMakerRec->GetRecPointsData(6 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluGlo[2]);
725 fAliITSQADataMakerRec->GetRecPointsData(7 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(rad);
726 fAliITSQADataMakerRec->GetRecPointsData(8 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(phi);
727 fAliITSQADataMakerRec->GetRecPointsData(9 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluster->GetNz(),cluster->GetNy());
728 fAliITSQADataMakerRec->GetRecPointsData(10 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluster->GetNpixels());
729 fAliITSQADataMakerRec->GetRecPointsData(11 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluster->GetSPDclusterType());
730 fAliITSQADataMakerRec->GetRecPointsData(12 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluGlo[2],phi);
731 } else {
8bab7823 732 fAliITSQADataMakerRec->GetRecPointsData(13 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(iIts);
733 fAliITSQADataMakerRec->GetRecPointsData(14 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluster->GetDetLocalX());
734 fAliITSQADataMakerRec->GetRecPointsData(15 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluster->GetDetLocalZ());
735 fAliITSQADataMakerRec->GetRecPointsData(16 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluGlo[0]);
736 fAliITSQADataMakerRec->GetRecPointsData(17 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluGlo[1]);
737 fAliITSQADataMakerRec->GetRecPointsData(18 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluGlo[2]);
738 fAliITSQADataMakerRec->GetRecPointsData(19 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(rad);
739 fAliITSQADataMakerRec->GetRecPointsData(20 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(phi);
740 fAliITSQADataMakerRec->GetRecPointsData(21 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluster->GetNz(),cluster->GetNy());
741 fAliITSQADataMakerRec->GetRecPointsData(22 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluster->GetNpixels());
742 fAliITSQADataMakerRec->GetRecPointsData(23 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluster->GetSPDclusterType());
743 fAliITSQADataMakerRec->GetRecPointsData(24 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluGlo[2],phi);
096292ae 744 }
8bab7823 745 fAliITSQADataMakerRec->GetRecPointsData(25 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(rad,phi);
746 fAliITSQADataMakerRec->GetRecPointsData(26 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluGlo[0],cluGlo[1]);
8ec28eb2 747
748 nClusters[lay]++;
3647765c 749 } // end of cluster loop
750 } // end of its "subdetector" loop
8ec28eb2 751
3647765c 752 for (Int_t iLay=0; iLay<2; iLay++)
8bab7823 753 fAliITSQADataMakerRec->GetRecPointsData(27 +iLay +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(nClusters[iLay]);
8ec28eb2 754
8bab7823 755 fAliITSQADataMakerRec->GetRecPointsData(29 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(nClusters[0],nClusters[1]);
8ec28eb2 756
eca4fa66 757 return rv ;
096292ae 758}
7a0e5776 759
760
761
762//_______________________________________________________________
763
80b9610c 764Int_t AliITSQASPDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task,Int_t specie) {
7a0e5776 765 // Returns offset number according to the specified task
766 Int_t offset=0;
4e25ac79 767 if( task == AliQAv1::kRAWS ) {
80b9610c 768 offset=fGenRawsOffset[specie];
7a0e5776 769 }
eca4fa66 770 else if( task == AliQAv1::kDIGITSR ) {
80b9610c 771 offset=fGenDigitsOffset[specie];
eca4fa66 772 }
4e25ac79 773 else if( task == AliQAv1::kRECPOINTS ) {
80b9610c 774 offset=fGenRecPointsOffset[specie];
7a0e5776 775 }
7a0e5776 776
777 return offset;
778}
779
780//_______________________________________________________________
781
8b7e858c 782void AliITSQASPDDataMakerRec::SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset, Int_t specie) {
eca4fa66 783 // Returns offset number according to the specified task
784 if( task == AliQAv1::kRAWS ) {
8b7e858c 785 fGenRawsOffset[specie]=offset;
eca4fa66 786 }
787 else if( task == AliQAv1::kDIGITSR ) {
4a903927 788 fGenDigitsOffset[specie]=offset;
eca4fa66 789 }
790 else if( task == AliQAv1::kRECPOINTS ) {
8b7e858c 791 fGenRecPointsOffset[specie]=offset;
eca4fa66 792 }
793}
794
795//_______________________________________________________________
796
4e25ac79 797Int_t AliITSQASPDDataMakerRec::GetTaskHisto(AliQAv1::TASKINDEX_t task) {
7a0e5776 798 // Returns the number of histograms associated to the specified task
eca4fa66 799
7a0e5776 800 Int_t histotot=0;
801
4e25ac79 802 if( task == AliQAv1::kRAWS ) {
7a0e5776 803 histotot=fSPDhRawsTask;
804 }
eca4fa66 805 else if( task == AliQAv1::kDIGITSR ) {
806 histotot=fSPDhDigitsTask;
807 }
4e25ac79 808 else if( task == AliQAv1::kRECPOINTS ){
7a0e5776 809 histotot=fSPDhRecPointsTask;
810 }
4a903927 811
a1287af5 812 return histotot;
7a0e5776 813}