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