correction needed to include HLT in QA
[u/mrichter/AliRoot.git] / T0 / AliT0QADataMakerRec.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.
1d7681da 21// Alla.Maevskaya@cern.ch
04236e67 22//---
23
24// --- ROOT system ---
25#include <TClonesArray.h>
26#include <TFile.h>
27#include <TH1F.h>
1d7681da 28#include <TH2F.h>
04236e67 29#include <TDirectory.h>
30// --- Standard library ---
31
32// --- AliRoot header files ---
33#include "AliESDEvent.h"
34#include "AliLog.h"
35#include "AliT0digit.h"
36#include "AliT0hit.h"
37#include "AliT0RecPoint.h"
38#include "AliT0QADataMakerRec.h"
39#include "AliQAChecker.h"
40#include "AliT0RawReader.h"
332b9234 41#include "AliT0RecoParam.h"
703bbd47 42#include "THnSparse.h"
04236e67 43
1d7681da 44#include "Riostream.h"
04236e67 45ClassImp(AliT0QADataMakerRec)
46
47//____________________________________________________________________________
48 AliT0QADataMakerRec::AliT0QADataMakerRec() :
4e25ac79 49AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kT0),
3c85c814 50 "T0 Quality Assurance Data Maker"),
332b9234 51 fnEventCal(0),
52 fnEventPhys(0)
04236e67 53
54{
55 // ctor
1d7681da 56 for (Int_t i=0; i<6; i++) {
57 fNumTriggers[i]=0;
58 fNumTriggersCal[i]=0;
332b9234 59 fTrEffCal[i] = 0;
60 fTrEffPhys[i] = 0;
61
04236e67 62 }
b9024d69 63 for (Int_t i=0; i<24; i++)
64 {
65 feffC[i]=0;
66 feffA[i]=0;
394c1a6d 67 feffqtc[i]=0;
68 }
04236e67 69}
70
71//____________________________________________________________________________
72AliT0QADataMakerRec::AliT0QADataMakerRec(const AliT0QADataMakerRec& qadm) :
3c85c814 73 AliQADataMakerRec(),
332b9234 74 fnEventCal(0),
75 fnEventPhys(0)
76
3c85c814 77
04236e67 78{
79 //copy ctor
1d7681da 80 SetName((const char*)qadm.GetName()) ;
04236e67 81 SetTitle((const char*)qadm.GetTitle());
82}
83
84//__________________________________________________________________
85AliT0QADataMakerRec& AliT0QADataMakerRec::operator = (const AliT0QADataMakerRec& qadm )
86{
87 // Equal operator.
88 this->~AliT0QADataMakerRec();
89 new(this) AliT0QADataMakerRec(qadm);
90 return *this;
91}
92//____________________________________________________________________________
4e25ac79 93void AliT0QADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
04236e67 94{
95 //Detector specific actions at end of cycle
96 // do the QA checking
4e25ac79 97 AliQAChecker::Instance()->Run(AliQAv1::kT0, task, list) ;
8825d145 98
57acd2d2 99 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
6252ceeb 100 if (! IsValidEventSpecie(specie, list))
eca4fa66 101 continue ;
8825d145 102 SetEventSpecie(AliRecoParam::ConvertIndex(specie)) ;
4e25ac79 103 if ( task == AliQAv1::kRAWS ) {
332b9234 104 GetRawsData(0)->SetLabelSize(0.02);
57acd2d2 105 const Char_t *triggers[6] = {"mean", "vertex","ORA","ORC","central","semi-central"};
106 for (Int_t itr=0; itr<6; itr++) {
332b9234 107 if ( fnEventCal>0)
108 fTrEffCal[itr] = Float_t (fNumTriggersCal[itr])/Float_t (fnEventCal);
109 if ( fnEventPhys>0)
110 fTrEffPhys[itr] = Float_t (fNumTriggers[itr])/Float_t (fnEventPhys);
111
a46b18e9 112 GetRawsData(420)->Fill(triggers[itr], fTrEffCal[itr]);
113 GetRawsData(420)->SetBinContent(itr+1, fTrEffCal[itr]);
332b9234 114 GetRawsData(97)->Fill(triggers[itr], fTrEffPhys[itr]);
115 GetRawsData(97)->SetBinContent(itr+1, fTrEffPhys[itr]);
332b9234 116 }
117 Float_t effic=0;
118 for(Int_t ik=0; ik<24; ik++)
119 {
120 effic=0;
6755a766 121 if ( fnEventCal>0) effic = Float_t(feffC[ik])/Float_t(fnEventCal);
332b9234 122 GetRawsData(205)->SetBinContent(ik+1,effic) ;
123 effic=0;
6755a766 124 if ( fnEventCal>0) effic = Float_t(feffA[ik])/Float_t(fnEventCal);
332b9234 125 GetRawsData(206)->SetBinContent(ik+1,effic );
126 effic=0;
6755a766 127 if ( fnEventCal>0) effic = Float_t(feffqtc[ik])/Float_t(fnEventCal);
332b9234 128 GetRawsData(207)->SetBinContent(ik+1, effic);
129 }
8825d145 130
131
57acd2d2 132 }
8825d145 133
57acd2d2 134 }
04236e67 135
8825d145 136}
04236e67 137//____________________________________________________________________________
138void AliT0QADataMakerRec::StartOfDetectorCycle()
139{
140 //Detector specific actions at start of cycle
332b9234 141
04236e67 142
143}
144
145//____________________________________________________________________________
146void AliT0QADataMakerRec::InitRaws()
147{
148 // create Raw histograms in Raw subdir
7d297381 149 const Bool_t expert = kTRUE ;
150 const Bool_t saveCorr = kTRUE ;
151 const Bool_t image = kTRUE ;
a46b18e9 152 Float_t low[500];
153 Float_t high[500];
8825d145 154
7d297381 155
a46b18e9 156 for (Int_t i=0; i<500; i++){
45c5ba2d 157 // low[i] = GetRecoParam()->GetLow(i);
158 /// high[i] = GetRecoParam()->GetHigh(i);
703bbd47 159 low[i] = 0;
160 high[i] = 10000;
a46b18e9 161
162 }
163
1d7681da 164 TString timename, ampname, qtcname, ledname;
165 TString timeCalname, ampCalname, ledCalname, qtcCalname;
332b9234 166 TString qt1name, qt0name, qt1Calname, qt0Calname;
426a778b 167 TString nhits;
04236e67 168
703bbd47 169 TH1F* fhRefPoint = new TH1F("hRefPoint","Ref Point", 20000, 575000 ,595000);
8825d145 170 Add2RawsList( fhRefPoint,0, expert, !image, !saveCorr);
703bbd47 171
172 TH1F* fhRefPointcal = new TH1F("hRefPointcal","Ref Point laser", 10000, 18000 ,28000);
173 Add2RawsList( fhRefPointcal,358, expert, !image, !saveCorr);
174
175 TH1F *fhRawCFD[24];
176 TH1F * fhRawLEDamp[24];
1d7681da 177 TH1F *fhRawQTC[24]; TH1F * fhRawLED[24];
178 TH1F *fhRawCFDcal[24]; TH1F * fhRawLEDampcal[24];
426a778b 179 TH1F *fhRawCFDcalpmt[24];
180 TH1F *fhRawCFDpmt[24];
1d7681da 181 TH1F *fhRawQTCcal[24]; TH1F * fhRawLEDcal[24];
332b9234 182 TH1F *fhRawQT0cal[24]; TH1F *fhRawQT1cal[24];
183 TH1F *fhRawQT1[24]; TH1F *fhRawQT0[24];
426a778b 184 TH1F* fhRawNhits[24];
703bbd47 185
04236e67 186 for (Int_t i=0; i<24; i++)
187 {
188 timename ="hRawCFD";
1d7681da 189 ledname = "hRawLED";
04236e67 190 qtcname = "hRawQTC";
332b9234 191 qt0name = "hRawQT0_";
192 qt1name = "hRawQT1_";
1d7681da 193 ampname = "hRawLEDminCFD";
426a778b 194 nhits = "hRawNhits";
332b9234 195 timename += i+1;
196 ampname += i+1;
197 qtcname += i+1;
198 qt0name += i+1;
199 qt1name += i+1;
200 ledname += i+1;
426a778b 201 nhits += i+1;
703bbd47 202 // fhRawCFD[i] = new THnSparseF(timename.Data(), Form("%s;CFD [#channels];Counts", timename.Data()),1,spabins,spaxmin,spaxmax);
203 fhRawCFD[i] = new TH1F(timename.Data(), Form("%s;CFD [#channels];Counts", timename.Data()),Int_t(high[i+1]-low[i+1]),low[i+1],high[i+1]);
a46b18e9 204 Add2RawsList( fhRawCFD[i],i+1, expert, !image, !saveCorr);
703bbd47 205 fhRawLED[i] = new TH1F(ledname.Data(), Form("%s;LED[#channels];Counts", ledname.Data()),Int_t(high[i+24+1]-low[i+24+1]),low[i+24+1],high[i]);
394c1a6d 206 Add2RawsList( fhRawLED[i],i+24+1, expert, !image, !saveCorr);
332b9234 207 fhRawLEDamp[i] = new TH1F(ampname.Data(), Form("%s;LED-CFD [#channels];Counts", ampname.Data()),1000,0,1000);
a46b18e9 208 Add2RawsList( fhRawLEDamp[i],i+48+1, expert, !image, !saveCorr);
332b9234 209 fhRawQTC[i] = new TH1F(qtcname.Data(), Form("%s;QTC[#channels];Counts", qtcname.Data()),10000,0,10000);
210 Add2RawsList( fhRawQTC[i],i+72+1, expert, !image, !saveCorr);
703bbd47 211 fhRawQT1[i] = new TH1F(qt1name.Data(), Form("%s;QT1[#channels];Counts", qtcname.Data()),Int_t(high[270+i]-low[270+i]),low[270+i],high[270+i]);
a46b18e9 212 Add2RawsList( fhRawQT1[i],270+i, expert, !image, !saveCorr);
703bbd47 213 fhRawQT0[i] = new TH1F(qt0name.Data(), Form("%s;QT0[#channels];Counts", qtcname.Data()),Int_t(high[270+24+i]-low[270+24+i]),low[270+24+i],high[270+24+i]);
a46b18e9 214 Add2RawsList( fhRawQT0[i],270+24+i, expert, !image, !saveCorr);
426a778b 215
216 fhRawNhits[i] = new TH1F(nhits.Data(), Form("%s;#Hits;Events", nhits.Data()),10, 0, 10);
217 Add2RawsList( fhRawNhits[i],244+i, expert, !image, !saveCorr);
218
a46b18e9 219 }
db72ff3b 220 TH1F* fhRawTrigger = new TH1F("hRawTrigger"," phys triggers;Trigger #;Counts",5,0,5);
8825d145 221 Add2RawsList(fhRawTrigger ,97, expert, !image, !saveCorr);
426a778b 222
703bbd47 223 TH1F* fhRawMean = new TH1F("hRawMean","online mean signal, physics event;",Int_t(high[98]-low[98]),low[98],high[98]);
394c1a6d 224 Add2RawsList( fhRawMean,98, expert, !image, !saveCorr);
a46b18e9 225
703bbd47 226 TH1F* fhRawVertex = new TH1F("hRawVertex","online vertex signal; counts",Int_t(high[100]-low[99]),low[99],high[99]);
394c1a6d 227 Add2RawsList( fhRawVertex,99, expert, !image, !saveCorr);
a46b18e9 228
703bbd47 229 TH1F* fhRawORA = new TH1F("hRawORA","online OR A; counts",Int_t(high[100]-low[100]),low[100],high[100]);
394c1a6d 230 Add2RawsList( fhRawORA,100, expert, !image, !saveCorr);
703bbd47 231 TH1F* fhRawORC = new TH1F("hRawORC","online OR C;counts",Int_t( high[101]-low[101]),low[101],high[101]);
394c1a6d 232 Add2RawsList( fhRawORC,101, expert, !image, !saveCorr);
a46b18e9 233
234
5ed41460 235 for (Int_t i=0; i<24; i++)
236 {
237 // for events with trigger CALIBRATION_EVENT
238 timeCalname ="hRawCFDcal";
1d7681da 239 ledCalname = "hRawLEDcal";
240 ampCalname = "hRawLEDminCFDcal";
5ed41460 241 qtcCalname = "hRawQTCcal";
332b9234 242 qt0Calname = "hRawQT0cal";
243 qt1Calname = "hRawQT1cal";
244 timeCalname += i+1;
245 ledCalname += i+1;
246 ampCalname += i+1;
247 qtcCalname += i+1;
248 qt0Calname += i+1;
249 qt1Calname += i+1;
a46b18e9 250
703bbd47 251 fhRawCFDcal[i] = new TH1F(timeCalname.Data(), Form("%s;Time ;Counts", timeCalname.Data()),Int_t(high[101+i+1]-low[101+i+1]),low[101+i+1],high[101+i+1]);
332b9234 252 Add2RawsList( fhRawCFDcal[i],101+i+1, expert, !image, !saveCorr);
a46b18e9 253
703bbd47 254 fhRawLEDcal[i] = new TH1F(ledCalname.Data(), Form("%s;Time ;Counts", ledCalname.Data()),Int_t(high[101+i+24+1]-low[101+i+24+1]),low[101+i+24+1],high[101+i+24+1]);
332b9234 255 Add2RawsList( fhRawLEDcal[i],101+i+24+1, expert, !image, !saveCorr);
a46b18e9 256
394c1a6d 257 fhRawLEDampcal[i] = new TH1F(ampCalname.Data(), Form("%s;Amplitude [ADC counts];Counts", ampCalname.Data()),1000,0,1000);
332b9234 258 Add2RawsList( fhRawLEDampcal[i],101+i+48+1, expert, !image, !saveCorr);
a46b18e9 259
332b9234 260 fhRawQTCcal[i] = new TH1F(qtcCalname.Data(), Form("%s;Charge ;Counts",qtcCalname.Data()),10000,0,10000);
261 Add2RawsList( fhRawQTCcal[i],101+i+72+1, expert, !image, !saveCorr);
a46b18e9 262
703bbd47 263 fhRawQT0cal[i] = new TH1F(qt0Calname.Data(), Form("%s;Charge ;Counts",qt0Calname.Data()),Int_t(high[371+i]-low[371+i]),low[371+i],high[371+i]);
332b9234 264 Add2RawsList( fhRawQT0cal[i],371+i, expert, !image, !saveCorr);
a46b18e9 265
703bbd47 266 fhRawQT1cal[i] = new TH1F(qt1Calname.Data(), Form("%s;Charge ;Counts",qt1Calname.Data()),Int_t(high[i+371+24]-low[i+371+24]),low[i+371+24],high[i+371+24]);
332b9234 267 Add2RawsList( fhRawQT1cal[i],i+371+24, expert, !image, !saveCorr);
a46b18e9 268
269 }
1d7681da 270
332b9234 271 //from PMT1 (equalizing)
272 for (Int_t i=0; i<24; i++)
273 {
274 // for events with trigger CALIBRATION_EVENT
275 timeCalname ="hRawCFDcalpmt";
276 timename ="hRawCFDpmt";
277 timeCalname += i+1;
278 ledCalname += i+1;
279 timename += i+1;
280 ledname += i+1;
281 fhRawCFDcalpmt[i] = new TH1F(timeCalname.Data(), Form("%s;Time;Counts", timeCalname.Data()),2000,-1000,1000);
a46b18e9 282 Add2RawsList( fhRawCFDcalpmt[i],321+i , expert, !image, !saveCorr);
332b9234 283
284 fhRawCFDpmt[i] = new TH1F(timename.Data(), Form("%s;Time;Counts", timename.Data()),2000,-1000,1000);
a46b18e9 285 Add2RawsList( fhRawCFDpmt[i],220+i, expert, !image, !saveCorr);
286 }
332b9234 287
1d7681da 288 TH1F* fhRawTriggerCal = new TH1F("hRawTriggerCal"," laser triggers",6,0,6);
a46b18e9 289 Add2RawsList(fhRawTriggerCal ,420 , !expert, image, !saveCorr);
290
703bbd47 291 TH1F* fhRawMeanCal = new TH1F("hRawMeanCal","online mean signal, calibration event",Int_t(high[198]-low[198]),low[198],high[198]);
332b9234 292 Add2RawsList( fhRawMeanCal,198, expert, !image, !saveCorr);
a46b18e9 293
703bbd47 294 TH1F* fhRawVertexCal = new TH1F("hRawVertexCal","online vertex signal, calibration event ",Int_t( high[199]-low[199]),low[199],high[199] );
a46b18e9 295 Add2RawsList( fhRawVertexCal,199, expert, !image, !saveCorr);
296
297
703bbd47 298 TH1F* fhRawORAcal = new TH1F("hRawORAcal","laser OR A; counts",Int_t( high[200]-low[200]),low[200],high[200]);
a46b18e9 299 Add2RawsList( fhRawORAcal,200, expert, !image, !saveCorr );
300
301
703bbd47 302 TH1F* fhRawORCcal = new TH1F("hRawORCcal","laserOR C;counts ",Int_t( high[201]-low[201]),low[201],high[201]);
a46b18e9 303 Add2RawsList( fhRawORCcal,201, expert, !image, !saveCorr);
304
332b9234 305
306 //multiplicity trigger
703bbd47 307 TH1F* fhMultcal = new TH1F("hMultcal","full mulltiplicity;Multiplicity;Entries",Int_t( high[202]-low[202]),low[202],high[202]);
394c1a6d 308 Add2RawsList( fhMultcal,202, expert, !image, !saveCorr );
a46b18e9 309 TH1F* fhMultScal = new TH1F("hMultSemical","full multiplicity with semi-central trigger;Multiplicity;Entries",
703bbd47 310 Int_t( high[203]-low[203]),low[203],high[203] );
394c1a6d 311 Add2RawsList( fhMultScal,203, expert, !image, !saveCorr);
8825d145 312 TH1F* fhMultCcal = new TH1F("hMultCentrcal","full multiplicity with central trigger;Multiplicity;Entries",
703bbd47 313 Int_t( high[204]-low[204]),low[204],high[204]);
394c1a6d 314 Add2RawsList( fhMultCcal,204, expert, !image, !saveCorr);
a46b18e9 315
426a778b 316 TH1F* fhMult = new TH1F("hMult","full mulltiplicity;Multiplicity;Entries", high[216]-low[216],low[216],high[216]);
317 Add2RawsList( fhMult,216, expert, !image, !saveCorr );
318 TH1F* fhMultS = new TH1F("hMultSemi","full multiplicity with semi-central trigger;Multiplicity;Entries",
703bbd47 319 Int_t( high[217]-low[217]),low[217],high[217] );
426a778b 320 Add2RawsList( fhMultS,217, expert, !image, !saveCorr);
321 TH1F* fhMultC = new TH1F("hMultCentr","full multiplicity with central trigger;Multiplicity;Entries",
322 high[218]-low[218],low[218],high[218]);
323 Add2RawsList( fhMultC,218, expert, !image, !saveCorr);
324
a46b18e9 325 TH1F* fhEffCFD = new TH1F("hEffCFD","#PMT; #CFD counts/nEvents",24, 0 ,24);
332b9234 326 Add2RawsList( fhEffCFD,205, !expert, image, !saveCorr);
a46b18e9 327
328 TH1F* fhEffLED = new TH1F("hEffLED","#PMT; #LED counts/nEvent",24, 0 ,24);
332b9234 329 Add2RawsList( fhEffLED,206, !expert, image, !saveCorr);
a46b18e9 330
332b9234 331 TH1F* fhEffQTC = new TH1F("hEffQTC","#PMT; QTC efficiency%s;",24, 0 ,24);
332 Add2RawsList( fhEffQTC,207, !expert, image, !saveCorr);
333
a46b18e9 334
703bbd47 335 TH2F* fhCFDcal = new TH2F("hCFDcal","CFD laser; #PMT; CFD {#channnels}",25, 0 ,25,Int_t(high[208]-low[208]),low[208],high[208]);
394c1a6d 336 fhCFDcal->SetOption("COLZ");
8825d145 337 Add2RawsList( fhCFDcal,208, !expert, image, !saveCorr);
a46b18e9 338
339
703bbd47 340 TH2F* fhLEDcal = new TH2F("hLEDcal","LED laser; #PMT; LED [#channnels]",25, 0 ,25,Int_t( high[209]-low[209]),low[209],high[209]);
394c1a6d 341 fhLEDcal->SetOption("COLZ");
8825d145 342 Add2RawsList( fhLEDcal,209, !expert, image, !saveCorr);
394c1a6d 343
703bbd47 344 TH2F* fhQTCcal = new TH2F("hQTCcal","QTC laser; #PMT; QTC [#channnels]",25, 0 ,25,Int_t( high[209]-low[209]),low[209],high[209]);
345 fhQTCcal->SetOption("COLZ");
346 Add2RawsList( fhQTCcal,210, !expert, image, !saveCorr);
347
a46b18e9 348
703bbd47 349 TH1F* fhNumPMTA= new TH1F("hNumPMTA","number of PMT hitted per event",13, 0 ,13);
426a778b 350 Add2RawsList(fhNumPMTA ,211, expert, !image, !saveCorr);
351
703bbd47 352 TH1F* fhNumPMTC= new TH1F("hNumPMTC","number of PMT hitted per event",13, 0 ,13);
426a778b 353 Add2RawsList(fhNumPMTC ,212, expert, !image, !saveCorr);
354
355 TH1F* fhHitsOrA= new TH1F("fhHitsOrA","T0_OR A hit multiplicitie",10, 0 ,10);
356 Add2RawsList( fhHitsOrA,213, expert, !image, !saveCorr);
357
358 TH1F* fhHitsOrC= new TH1F("fhHitsOrC","T0_OR C hit multiplicitie",10, 0 ,10);
359 Add2RawsList(fhHitsOrC ,214, expert, !image, !saveCorr);
360
703bbd47 361 TH1F* fhOrCminOrA= new TH1F("fhOrCminOrA","T0_OR C - T0_OR A",Int_t( high[215]-low[215]),low[215],high[215]);
426a778b 362 Add2RawsList( fhOrCminOrA,215, expert, !image, !saveCorr);
363
703bbd47 364 TH1F* fhOrCminOrAcal= new TH1F("fhOrCminOrAcal","T0_OR C - T0_OR A",Int_t( high[219]-low[219]),low[219],high[219]);
365 Add2RawsList( fhOrCminOrAcal,219, expert, !image, !saveCorr);
366
367 TH1F* fhOrCminOrATvdcOn= new TH1F("fhOrCminOrATvdcOn","T0_OR C - T0_OR A TVDC on",Int_t( high[350]-low[350]),low[350],high[350]);
368 Add2RawsList( fhOrCminOrATvdcOn,350, expert, !image, !saveCorr);
369
370 TH1F* fhOrCminOrATvdcOncal= new TH1F("fhOrCminOrATvdcOncal","T0_OR C - T0_OR A TVDC on laser",Int_t( high[351]-low[351]),low[351],high[351]);
371 Add2RawsList( fhOrCminOrATvdcOncal,351, expert, !image, !saveCorr);
372
373 TH1F* fhOrCminOrATvdcOff= new TH1F("fhOrCminOrATvdcOff","T0_OR C - T0_OR A TVDC off",Int_t( high[352]-low[352]),low[352],high[352]);
374 Add2RawsList( fhOrCminOrATvdcOff,352, expert, !image, !saveCorr);
375
376 TH1F* fhOrCminOrATvdcOffcal= new TH1F("fhOrCminOrATvdcOffcal","T0_OR C - T0_OR ATVDC off laser",Int_t( high[353]-low[353]),low[353],high[353]);
377 Add2RawsList( fhOrCminOrATvdcOffcal,353, expert, !image, !saveCorr);
378
379 TH1F* fhCFD1abs= new TH1F("fhCFD1abs"," CFD 1 pure ( L1) ", 20000, 575000, 595000 );
380 Add2RawsList(fhCFD1abs ,354, expert, !image, !saveCorr);
381
382 TH1F* fhCFD2abs= new TH1F("fhCFD2abs"," CFD 2 pure ( L1) ", 20000, 575000, 595000 );
383 Add2RawsList( fhCFD2abs,355, expert, !image, !saveCorr);
384
385 TH1F* fhCFD1abscal= new TH1F("fhCFD1abscal"," CFD 1 pure ( L1)laser ", 10000, 18000 ,28000 );
386 Add2RawsList(fhCFD1abscal,356, expert, !image, !saveCorr);
387
388 TH1F* fhCFD2abscal= new TH1F("fhCFD2abscal"," CFD 2 pure ( L1)laser ", 10000, 18000 ,28000 );
389 Add2RawsList( fhCFD2abscal,357, expert, !image, !saveCorr);
390
394c1a6d 391 const Char_t *triggers[6] = {"mean", "vertex","ORA","ORC","central","semi-central"};
eca4fa66 392 for (Int_t itr=0; itr<6; itr++) {
a46b18e9 393 GetRawsData(420)->Fill(triggers[itr], fNumTriggersCal[itr]);
394 GetRawsData(420)->SetBinContent(itr+1, fNumTriggersCal[itr]);
332b9234 395 GetRawsData(97)->Fill(triggers[itr], fNumTriggers[itr]);
396 GetRawsData(97)->SetBinContent(itr+1, fNumTriggers[itr]);
eca4fa66 397 }
04236e67 398}
399
400//____________________________________________________________________________
44ed7a66 401void AliT0QADataMakerRec::InitDigits()
402{
403 // create Digits histograms in Digits subdir
404 const Bool_t expert = kTRUE ;
405 const Bool_t image = kTRUE ;
406
f628b9d2 407 TH2F * fhDigCFD = new TH2F("fhDigCFD", " CFD digits; #PMT; CFD digits[#channels]",25,-0.5,24.5,100,0,1000);
eca4fa66 408 fhDigCFD->SetOption("COLZ");
f628b9d2 409 Add2DigitsList( fhDigCFD,0, !expert, image);
410 TH2F *fhDigLEDamp = new TH2F("fhDigLEDamp", " LED-CFD digits; #PMT; LED-CFD amplitude ",25,-0.5,24.5,100,100,1000);
eca4fa66 411 fhDigLEDamp->SetOption("COLZ");
394c1a6d 412 Add2DigitsList( fhDigLEDamp,1, !expert, !image);
f628b9d2 413 TH2F * fhDigQTC = new TH2F("fhDigQTC", " QTC digits; #PMT; QTC amplitude",25,-0.5,24.5,100,100,10000);
eca4fa66 414 fhDigQTC->SetOption("COLZ");
394c1a6d 415 Add2DigitsList( fhDigQTC,2, !expert, !image);}
44ed7a66 416
417//____________________________________________________________________________
04236e67 418
419void AliT0QADataMakerRec::InitRecPoints()
420{
421 // create cluster histograms in RecPoint subdir
7d297381 422 const Bool_t expert = kTRUE ;
423 const Bool_t image = kTRUE ;
1d7681da 424
703bbd47 425 TH2F* fhRecCFD = new TH2F("hRecCFD"," CFD time;#PMT; CFD Time [ns];",24, 0 ,24,
b9024d69 426 100,-50,50);
eca4fa66 427 fhRecCFD->SetOption("COLZ");
7d297381 428 Add2RecPointsList ( fhRecCFD,0, !expert, image);
b9024d69 429
703bbd47 430 TH2F* fhRecAmpDiff = new TH2F("hRecAmpDiff"," LED-CFD min QTC amplitude;#PMT; difference [MIPs];",
b9024d69 431 24, 0 ,24, 200,-10,10);
eca4fa66 432 fhRecAmpDiff->SetOption("COLZ");
7d297381 433 Add2RecPointsList (fhRecAmpDiff, 1, !expert, image);
04236e67 434
f628b9d2 435 TH1F *fhMean = new TH1F("hMean","online - rec mean;online - rec mean[#channels];",2000, -1000, 1000);
7d297381 436 Add2RecPointsList ( fhMean,2, !expert, image);
eca4fa66 437
438}
04236e67 439
440//____________________________________________________________________________
441void AliT0QADataMakerRec::InitESDs()
442{
443 //create ESDs histograms in ESDs subdir
7d297381 444 const Bool_t expert = kTRUE ;
445 const Bool_t image = kTRUE ;
446
f628b9d2 447 TH1F *fhESDMean = new TH1F("hESDmean"," ESD mean; mean time[%channels]",1000,0,1000);
7d297381 448 Add2ESDsList(fhESDMean, 0, !expert, image) ;
f628b9d2 449 TH1F * fhESDVertex = new TH1F("hESDvertex","ESDvertex; vertex[cm];",82,-30,30);
7d297381 450 Add2ESDsList(fhESDVertex, 1, !expert, image) ;
c724dd64 451
04236e67 452
453}
454
455//____________________________________________________________________________
456void AliT0QADataMakerRec::MakeRaws( AliRawReader* rawReader)
457{
eca4fa66 458
332b9234 459 rawReader->Reset() ;
04236e67 460 //fills QA histos for RAW
5ed41460 461 Int_t shift=0;
45c5ba2d 462 // Int_t refPointParam = GetRecoParam()->GetRefPoint();
332b9234 463 Int_t refpoint = 0;
45c5ba2d 464 Int_t refPointParam = 0;
b9024d69 465
86c020af 466 AliT0RawReader *start = new AliT0RawReader(rawReader);
332b9234 467
86c020af 468 if (! start->Next())
5379c4a3 469 AliDebug(AliQAv1::GetQADebugLevel(),Form(" no raw data found!!"));
86c020af 470 else
471 {
332b9234 472
5ed41460 473 UInt_t type =rawReader->GetType();
332b9234 474 if (type == 8){ shift=101; fnEventCal++;}
475 if (type == 7){ shift=0; fnEventPhys++;}
86c020af 476 Int_t allData[110][5];
477 for (Int_t i0=0; i0<105; i0++)
478 {
479 for (Int_t j0=0; j0<5; j0++) allData[i0][j0]=0;
04236e67 480 }
86c020af 481 for (Int_t i=0; i<105; i++)
482 for (Int_t iHit=0; iHit<5; iHit++)
483 allData[i][iHit]= start->GetData(i,iHit);
484
703bbd47 485 if ( type == 7 && allData[0][0] > 0 ) GetRawsData(0) -> Fill( allData[0][0]);
486 if ( type == 8 && allData[0][0] > 0 ) GetRawsData(358) -> Fill( allData[0][0]);
332b9234 487
a46b18e9 488 refpoint = allData[refPointParam][0];
489 if (refPointParam < 0 ) refpoint=0;
490 if (refPointParam == 0 ) refpoint = allData[0][0] - 5000;
426a778b 491
492 Int_t numPmtC=0;
493 for (Int_t ik = 0; ik<12; ik++)
494 {
8825d145 495 // for (Int_t iHt=0; iHt<1; iHt++){
426a778b 496
497 Int_t nhitsPMT=0;
498 if(allData[ik+1][0]>0 && type == 7 ) numPmtC++;
332b9234 499 for (Int_t iHt=0; iHt<5; iHt++){
1d7681da 500 //cfd
394c1a6d 501 if(allData[ik+1][iHt]>0) {
332b9234 502 GetRawsData(shift+ik+1) -> Fill(allData[ik+1][iHt]-refpoint);
45c5ba2d 503 if(allData[1][0]>0)
332b9234 504 GetRawsData(shift+ik+220) -> Fill(allData[ik+1][iHt]-allData[1][0]);
8825d145 505 // cout<<"C cfd "<<ik<<" "<<iHt<<" "<<allData[ik+1][iHt]<<" -RF "<<refpoint<<" "<<allData[ik+1][iHt]-refpoint<<endl;
703bbd47 506 if(type == 8 && iHt==0 ) {
394c1a6d 507 feffC[ik]++;
508 GetRawsData(208)->Fill(ik+1, allData[ik+1][iHt]-refpoint);
509 }
426a778b 510 if(type == 7 ) nhitsPMT++;
511
332b9234 512 }
513 //led
394c1a6d 514 if(allData[ik+13][iHt] > 0) {
332b9234 515 GetRawsData(shift+ik+24+1)-> Fill(allData[ik+13][iHt]-refpoint);
8825d145 516 // cout<<"C led "<<ik<<" "<<iHt<<" "<<allData[ik+1][iHt]<<" -RF "<<refpoint<<" "<<allData[ik+13][iHt]-refpoint<<endl;
703bbd47 517 if(type == 8 && iHt==0) {
394c1a6d 518 feffA[ik]++;
519 GetRawsData(209)->Fill(ik+1, allData[ik+13][iHt]-refpoint);
520 }
521 }
1d7681da 522 //led -cfd
523
524 if(allData[ik+13][iHt] > 0 && allData[ik+1][iHt] >0 )
525 GetRawsData(shift+ik+48+1)->
526 Fill(allData[ik+13][iHt]-allData[ik+1][iHt]);
8825d145 527
1d7681da 528 //qtc
394c1a6d 529 if(allData[2*ik+25][iHt] > 0 || allData[2*ik+26][iHt] > 0) {
1d7681da 530 GetRawsData(shift+ik+72+1)->
8825d145 531 Fill(allData[2*ik+25][iHt]-allData[2*ik+26][iHt]);
532 GetRawsData(shift+ik+270)->Fill(allData[2*ik+26][iHt] - refpoint);
533 GetRawsData(shift+ik+24+270)->Fill(allData[2*ik+25][iHt] - refpoint);
332b9234 534
703bbd47 535 if(type == 8 && iHt==0 ) {
536 feffqtc[ik]++;
537 GetRawsData(210)->Fill(allData[2*ik+25][iHt]-allData[2*ik+26][iHt]);
538 }
394c1a6d 539 }
04236e67 540 }
426a778b 541 if(type == 7 ) GetRawsData(ik+244)->Fill(nhitsPMT);
86c020af 542 }
82111185 543 if(type == 7 ) GetRawsData(212)->Fill(numPmtC);
426a778b 544 Int_t numPmtA=0;
545 for (Int_t ik = 12; ik<24; ik++) {
8825d145 546 // for (Int_t iHt=0; iHt<1; iHt++) {
82111185 547 if(allData[ik+45][0]>0 && type == 7 ) numPmtA++;
426a778b 548 Int_t nhitsPMT=0;
332b9234 549 for (Int_t iHt=0; iHt<5; iHt++) {
394c1a6d 550 if(allData[ik+45][iHt]>0) {
1d7681da 551 //cfd
552 GetRawsData(shift+ik+1)->
394c1a6d 553 Fill(allData[ik+45][iHt]-refpoint);
45c5ba2d 554 if(allData[57][0]>0)
332b9234 555 GetRawsData(shift+ik+220) -> Fill(allData[ik+45][iHt]-allData[57][0]);
8825d145 556
557 // cout<<"A cfd "<<ik<<" "<<iHt<<" "<<allData[ik+1][iHt]<<" -RF "<<refpoint<<" "<<allData[ik+1][iHt]-refpoint<<endl;
394c1a6d 558 if(type == 8 ) {
559 feffC[ik]++;
560 GetRawsData(208)->Fill(ik+1, allData[ik+45][iHt]-refpoint);
561 }
426a778b 562 if(type == 7 ) nhitsPMT++;
563
564
394c1a6d 565 }
1d7681da 566 //led
394c1a6d 567 if(allData[ik+57][iHt] > 0 ) {
332b9234 568 GetRawsData(shift+ik+24+1)->Fill(allData[ik+57][iHt]-refpoint);
8825d145 569 // cout<<"C led "<<ik<<" "<<iHt<<" "<<allData[ik+1][iHt]<<" -RF "<<refpoint<<" "<<allData[ik+13][iHt]-refpoint<<endl;
394c1a6d 570 if(type == 8 ) {
571 feffA[ik]++;
572 GetRawsData(209)->Fill(ik+1, allData[ik+57][iHt]-refpoint);
573 }
574 }
575 //qtc
576 if(allData[2*ik+57][iHt]>0 || allData[2*ik+58][iHt]>0)
577 {
8825d145 578 GetRawsData(shift+ik+72+1)-> Fill(allData[2*ik+57][iHt]-allData[2*ik+58][iHt]);
579 GetRawsData(shift+ik+270)->Fill(allData[2*ik+58][iHt]-refpoint);
580 GetRawsData(shift+ik+24+270)->Fill(allData[2*ik+57][iHt]-refpoint);
703bbd47 581 if(type == 8 ){
582 feffqtc[ik]++;
583 GetRawsData(210)->Fill(allData[2*ik+57][iHt]-allData[2*ik+58][iHt]);
584 }
394c1a6d 585 }
586 //led-cfd
1d7681da 587 if(allData[ik+57][iHt] > 0 &&allData[ik+45][iHt]>0)
588 GetRawsData(shift+ik+48+1)->
589 Fill(allData[ik+57][iHt]-allData[ik+45][iHt]);
86c020af 590 }
426a778b 591 if(type == 7 ) GetRawsData(ik+244)->Fill(nhitsPMT);
592
86c020af 593 }
82111185 594 if(type == 7 ) GetRawsData(211)->Fill(numPmtA);
595
1d7681da 596 Int_t trChannel[6] = {49,50,51,52,55,56};
394c1a6d 597
332b9234 598 if(type == 7)
5ed41460 599 {
426a778b 600 Int_t nhitsOrA=0;
601 Int_t nhitsOrC=0;
602 for (Int_t iHt=0; iHt<5; iHt++) {
703bbd47 603 // pure CFD1 & CFD2 for trigger needs
604 if(allData[1][iHt]>0) GetRawsData(354)->Fill(allData[1][iHt]);
605 if(allData[2][iHt]>0) GetRawsData(355)->Fill(allData[2][iHt]);
606
607 //orA-orC phys tvdc 1
608 if((allData[51][iHt]>0 && allData[52][iHt]>0) && allData[50][iHt]>0)
609 GetRawsData(350)->Fill(allData[52][iHt]-allData[51][iHt]);
610 //orA-orC phys tvdc 0
611 if((allData[51][iHt]>0 && allData[52][iHt]>0) && allData[50][iHt]<=0)
612 GetRawsData(352)->Fill(allData[52][iHt]-allData[51][iHt]);
1d7681da 613 for (Int_t itr=0; itr<6; itr++) {
426a778b 614 if (allData[trChannel[itr]][iHt] >0) {
332b9234 615 fNumTriggers[itr]++;
8825d145 616 GetRawsData(98+itr)->Fill(allData[trChannel[itr]][iHt]-refpoint);
332b9234 617 }
1d7681da 618 }
426a778b 619
620 if(allData[51][iHt] >0) nhitsOrA++;
621 if(allData[52][iHt] >0) nhitsOrC++;
622
623 if(allData[53][iHt]>0 && allData[54][iHt]>0) {
624 GetRawsData(216)->Fill(allData[53][iHt]-allData[54][iHt]);
625 if(allData[55][iHt]>0) GetRawsData(216)->Fill(allData[53][iHt]-allData[54][iHt]);
626 if(allData[56][iHt]>0) GetRawsData(218)->Fill(allData[53][iHt]-allData[54][iHt]);
627 }
628 if(allData[51][iHt]>0 && allData[52][iHt]>0)
45c5ba2d 629 GetRawsData(215)->Fill(allData[52][iHt]-allData[51][iHt]);
f6c2d5e2 630 }
426a778b 631 GetRawsData(213)->Fill(nhitsOrA);
632 GetRawsData(214)->Fill(nhitsOrC);
633
5ed41460 634 }
394c1a6d 635
426a778b 636 if(type == 8)
332b9234 637 {
638 for (Int_t iHt=0; iHt<5; iHt++) {
703bbd47 639 //pure CFD 1 & 2
640 if(allData[1][iHt]>0) GetRawsData(356)->Fill(allData[1][iHt]);
641 if(allData[2][iHt]>0) GetRawsData(357)->Fill(allData[2][iHt]);
642
643 //orA-orC laser
644 if(allData[51][iHt]>0 && allData[52][iHt]>0)
645 GetRawsData(219)->Fill(allData[52][iHt]-allData[51][iHt]);
646 //orA-orC laser tvdc 1
647 if((allData[51][iHt]>0 && allData[52][iHt]>0) && allData[50][iHt]>0)
648 GetRawsData(351)->Fill(allData[52][iHt]-allData[51][iHt]);
649 //orA-orC laser tvdc 0
650 if((allData[51][iHt]>0 && allData[52][iHt]>0) && allData[50][iHt]<=0)
651 GetRawsData(353)->Fill(allData[52][iHt]-allData[51][iHt]);
652 //trigger laser
332b9234 653 for (Int_t itr=0; itr<6; itr++) {
654 if(allData[trChannel[itr]][iHt]>0)
655 {
656
426a778b 657 GetRawsData(198+itr)->
658 Fill(allData[trChannel[itr]][iHt]-refpoint);
332b9234 659 fNumTriggersCal[itr]++;
660 }
661 }
703bbd47 662 //mult trigger signals laser
332b9234 663 if(allData[53][iHt]>0 && allData[54][iHt]>0) {
426a778b 664 GetRawsData(202)->Fill(allData[53][iHt]-allData[54][iHt]);
332b9234 665 if(allData[55][iHt]>0) GetRawsData(202)->Fill(allData[53][iHt]-allData[54][iHt]);
426a778b 666 if(allData[56][iHt]>0) GetRawsData(204)->Fill(allData[53][iHt]-allData[54][iHt]);
332b9234 667 }
1d7681da 668 }
332b9234 669 }
426a778b 670
f628b9d2 671 delete start;
86c020af 672 }
332b9234 673}
674
1d7681da 675
04236e67 676
677//____________________________________________________________________________
44ed7a66 678void AliT0QADataMakerRec::MakeDigits( TTree *digitsTree)
679{
680 //fills QA histos for Digits
eca4fa66 681
44ed7a66 682 TArrayI *digCFD = new TArrayI(24);
683 TArrayI *digLED = new TArrayI(24);
684 TArrayI *digQT0 = new TArrayI(24);
685 TArrayI *digQT1 = new TArrayI(24);
686 Int_t refpoint=0;
687
688 TBranch *brDigits=digitsTree->GetBranch("T0");
689 AliT0digit *fDigits = new AliT0digit() ;
690 if (brDigits) {
691 brDigits->SetAddress(&fDigits);
692 }else{
693 AliError(Form("EXEC Branch T0 digits not found"));
694 return;
695 }
696 digitsTree->GetEvent(0);
697 digitsTree->GetEntry(0);
698 brDigits->GetEntry(0);
699 fDigits->GetTimeCFD(*digCFD);
700 fDigits->GetTimeLED(*digLED);
701 fDigits->GetQT0(*digQT0);
702 fDigits->GetQT1(*digQT1);
703 refpoint = fDigits->RefPoint();
704 for (Int_t i=0; i<24; i++)
705 {
706 if (digCFD->At(i)>0) {
707 Int_t cfd=digCFD->At(i)- refpoint;
708 GetDigitsData(0) ->Fill(i,cfd);
f628b9d2 709 GetDigitsData(1) -> Fill(i, (digLED->At(i) - digCFD->At(i)));
44ed7a66 710 GetDigitsData(2) -> Fill(i, (digQT1->At(i) - digQT0->At(i)));
711 }
712 }
713
714 delete digCFD;
715 delete digLED;
716 delete digQT0;
717 delete digQT1;
718
719}
720
721//____________________________________________________________________________
04236e67 722void AliT0QADataMakerRec::MakeRecPoints(TTree * clustersTree)
723{
724 //fills QA histos for clusters
725
446d6ec4 726 AliT0RecPoint* frecpoints= new AliT0RecPoint ();
f628b9d2 727 if (!frecpoints) {
394c1a6d 728 AliError(":MakeRecPoints >> no recpoints found");
04236e67 729 return;
730 }
731 TBranch *brRec =clustersTree ->GetBranch("T0");
732 if (brRec) {
733 brRec->SetAddress(&frecpoints);
734 }else{
f628b9d2 735 AliError(Form("EXEC Branch T0 rec not found "));
736 return;
04236e67 737 }
eca4fa66 738
04236e67 739 brRec->GetEntry(0);
f628b9d2 740
04236e67 741 for ( Int_t i=0; i<24; i++) {
1d7681da 742 if(i<12)
b9024d69 743 GetRecPointsData(0) -> Fill(i, frecpoints -> GetTime(i) - frecpoints -> GetTime(0));
1d7681da 744 if(i>11)
b9024d69 745 GetRecPointsData(0) -> Fill(i, frecpoints -> GetTime(i) - frecpoints -> GetTime(12));
746 GetRecPointsData(1) -> Fill( i, frecpoints -> GetAmp(i) - frecpoints->AmpLED(i));
04236e67 747 }
b9024d69 748 Double_t mmm=frecpoints->GetOnlineMean()- frecpoints->GetMeanTime();
f628b9d2 749 GetRecPointsData(2) ->Fill(mmm);
04236e67 750
751}
752
753//____________________________________________________________________________
754void AliT0QADataMakerRec::MakeESDs(AliESDEvent * esd)
755{
756 //fills QA histos for ESD
f628b9d2 757
04236e67 758 GetESDsData(0) -> Fill(esd->GetT0());
759 GetESDsData(1)-> Fill(esd->GetT0zVertex());
f628b9d2 760
04236e67 761}