fixed typo for setting fraction of shared clusters
[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>
02d51eff 30#include <TMath.h>
04236e67 31// --- Standard library ---
32
33// --- AliRoot header files ---
34#include "AliESDEvent.h"
35#include "AliLog.h"
36#include "AliT0digit.h"
37#include "AliT0hit.h"
38#include "AliT0RecPoint.h"
39#include "AliT0QADataMakerRec.h"
40#include "AliQAChecker.h"
41#include "AliT0RawReader.h"
332b9234 42#include "AliT0RecoParam.h"
703bbd47 43#include "THnSparse.h"
04236e67 44
1d7681da 45#include "Riostream.h"
04236e67 46ClassImp(AliT0QADataMakerRec)
47
48//____________________________________________________________________________
49 AliT0QADataMakerRec::AliT0QADataMakerRec() :
4e25ac79 50AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kT0),
3c85c814 51 "T0 Quality Assurance Data Maker"),
332b9234 52 fnEventCal(0),
53 fnEventPhys(0)
04236e67 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;
be3ada9f 68 feffPhysC[i]=0;
f7350425 69 feffPhysA[i]=0;
70 feffqtcPhys[i]=0;
851f960f 71 fMeans[i]=2500;
394c1a6d 72 }
02d51eff 73
74 // for(Int_t ic=0; ic<24; ic++)
faca085d 75 // fMeans[ic] = new TH1F(Form("CFD1minCFD%d",ic+1),"CFD-CFD",100,-250,250);
04236e67 76}
77
f7350425 78
04236e67 79//____________________________________________________________________________
80AliT0QADataMakerRec::AliT0QADataMakerRec(const AliT0QADataMakerRec& qadm) :
3c85c814 81 AliQADataMakerRec(),
332b9234 82 fnEventCal(0),
83 fnEventPhys(0)
04236e67 84{
85 //copy ctor
1d7681da 86 SetName((const char*)qadm.GetName()) ;
04236e67 87 SetTitle((const char*)qadm.GetTitle());
88}
89
90//__________________________________________________________________
91AliT0QADataMakerRec& AliT0QADataMakerRec::operator = (const AliT0QADataMakerRec& qadm )
92{
93 // Equal operator.
94 this->~AliT0QADataMakerRec();
95 new(this) AliT0QADataMakerRec(qadm);
96 return *this;
97}
59f47540 98//__________________________________________________________________
99AliT0QADataMakerRec::~AliT0QADataMakerRec()
100{
101 //destructor
59f47540 102}
04236e67 103//____________________________________________________________________________
4e25ac79 104void AliT0QADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
04236e67 105{
106 //Detector specific actions at end of cycle
107 // do the QA checking
4e25ac79 108 AliQAChecker::Instance()->Run(AliQAv1::kT0, task, list) ;
8825d145 109
57acd2d2 110 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
6252ceeb 111 if (! IsValidEventSpecie(specie, list))
eca4fa66 112 continue ;
8825d145 113 SetEventSpecie(AliRecoParam::ConvertIndex(specie)) ;
4e25ac79 114 if ( task == AliQAv1::kRAWS ) {
332b9234 115 GetRawsData(0)->SetLabelSize(0.02);
57acd2d2 116 const Char_t *triggers[6] = {"mean", "vertex","ORA","ORC","central","semi-central"};
117 for (Int_t itr=0; itr<6; itr++) {
332b9234 118 if ( fnEventCal>0)
119 fTrEffCal[itr] = Float_t (fNumTriggersCal[itr])/Float_t (fnEventCal);
120 if ( fnEventPhys>0)
121 fTrEffPhys[itr] = Float_t (fNumTriggers[itr])/Float_t (fnEventPhys);
122
59f47540 123 GetRawsData(169+250)->Fill(triggers[itr], fTrEffCal[itr]);
124 GetRawsData(169+250)->SetBinContent(itr+1, fTrEffCal[itr]);
be3ada9f 125 GetRawsData(169)->Fill(triggers[itr], fTrEffPhys[itr]);
126 GetRawsData(169)->SetBinContent(itr+1, fTrEffPhys[itr]);
332b9234 127 }
128 Float_t effic=0;
129 for(Int_t ik=0; ik<24; ik++)
130 {
131 effic=0;
6755a766 132 if ( fnEventCal>0) effic = Float_t(feffC[ik])/Float_t(fnEventCal);
59f47540 133 GetRawsData(207+250)->SetBinContent(ik+1,effic) ;
332b9234 134 effic=0;
6755a766 135 if ( fnEventCal>0) effic = Float_t(feffA[ik])/Float_t(fnEventCal);
59f47540 136 GetRawsData(208+250)->SetBinContent(ik+1,effic );
332b9234 137 effic=0;
6755a766 138 if ( fnEventCal>0) effic = Float_t(feffqtc[ik])/Float_t(fnEventCal);
59f47540 139 GetRawsData(209+250)->SetBinContent(ik+1, effic);
be3ada9f 140
141 effic=0;
142 if ( fnEventPhys>0) effic = Float_t(feffPhysC[ik])/Float_t(fnEventPhys);
332b9234 143 GetRawsData(207)->SetBinContent(ik+1, effic);
be3ada9f 144
332b9234 145 }
8825d145 146
147
57acd2d2 148 }
8825d145 149
57acd2d2 150 }
04236e67 151
8825d145 152}
04236e67 153//____________________________________________________________________________
154void AliT0QADataMakerRec::StartOfDetectorCycle()
155{
156 //Detector specific actions at start of cycle
157
158}
159
160//____________________________________________________________________________
161void AliT0QADataMakerRec::InitRaws()
162{
163 // create Raw histograms in Raw subdir
7d297381 164 const Bool_t expert = kTRUE ;
165 const Bool_t saveCorr = kTRUE ;
166 const Bool_t image = kTRUE ;
a46b18e9 167 Float_t low[500];
168 Float_t high[500];
8825d145 169
7d297381 170
a46b18e9 171 for (Int_t i=0; i<500; i++){
703bbd47 172 low[i] = 0;
be3ada9f 173 high[i] = 30000;
a46b18e9 174
175 }
176
1d7681da 177 TString timename, ampname, qtcname, ledname;
178 TString timeCalname, ampCalname, ledCalname, qtcCalname;
332b9234 179 TString qt1name, qt0name, qt1Calname, qt0Calname;
426a778b 180 TString nhits;
04236e67 181
be3ada9f 182 TH1F* fhRefPoint = new TH1F("hRefPoint","Ref Point", 10000, 0 ,50000);
8825d145 183 Add2RawsList( fhRefPoint,0, expert, !image, !saveCorr);
703bbd47 184
be3ada9f 185 TH1F* fhRefPointcal = new TH1F("hRefPointcal","Ref Point laser", 5000, 0 ,20000);
186 Add2RawsList( fhRefPointcal,250, expert, !image, !saveCorr);
703bbd47 187
188 TH1F *fhRawCFD[24];
189 TH1F * fhRawLEDamp[24];
1d7681da 190 TH1F *fhRawQTC[24]; TH1F * fhRawLED[24];
191 TH1F *fhRawCFDcal[24]; TH1F * fhRawLEDampcal[24];
be3ada9f 192 TH1F *fhRawQTCcal[24]; TH1F * fhRawLEDcal[24];
332b9234 193 TH1F *fhRawQT0cal[24]; TH1F *fhRawQT1cal[24];
194 TH1F *fhRawQT1[24]; TH1F *fhRawQT0[24];
426a778b 195 TH1F* fhRawNhits[24];
703bbd47 196
04236e67 197 for (Int_t i=0; i<24; i++)
198 {
199 timename ="hRawCFD";
1d7681da 200 ledname = "hRawLED";
04236e67 201 qtcname = "hRawQTC";
332b9234 202 qt0name = "hRawQT0_";
203 qt1name = "hRawQT1_";
1d7681da 204 ampname = "hRawLEDminCFD";
426a778b 205 nhits = "hRawNhits";
332b9234 206 timename += i+1;
207 ampname += i+1;
208 qtcname += i+1;
209 qt0name += i+1;
210 qt1name += i+1;
211 ledname += i+1;
426a778b 212 nhits += i+1;
be3ada9f 213 fhRawCFD[i] = new TH1F(timename.Data(), Form("%s;CFD [#channels];Counts", timename.Data()),Int_t((high[i+1]-low[i+1])/4),low[i+1],high[i+1]);
214 Add2RawsList( fhRawCFD[i],i+1, expert, !image, !saveCorr);
215 fhRawLED[i] = new TH1F(ledname.Data(), Form("%s;LED[#channels];Counts", ledname.Data()),Int_t((high[i+25]-low[i+25])/4),low[i+25],high[i+25]);
216 Add2RawsList( fhRawLED[i],i+25, expert, !image, !saveCorr);
332b9234 217 fhRawLEDamp[i] = new TH1F(ampname.Data(), Form("%s;LED-CFD [#channels];Counts", ampname.Data()),1000,0,1000);
be3ada9f 218 Add2RawsList( fhRawLEDamp[i],i+49, expert, !image, !saveCorr);
332b9234 219 fhRawQTC[i] = new TH1F(qtcname.Data(), Form("%s;QTC[#channels];Counts", qtcname.Data()),10000,0,10000);
be3ada9f 220 Add2RawsList( fhRawQTC[i],i+73, expert, !image, !saveCorr);
221 fhRawQT1[i] = new TH1F(qt1name.Data(), Form("%s;QT1[#channels];Counts", qt1name.Data()),Int_t((high[97+i]-low[97+i])/4),low[97+i],high[97+i]);
222 Add2RawsList( fhRawQT1[i],97+i, expert, !image, !saveCorr);
223 fhRawQT0[i] = new TH1F(qt0name.Data(), Form("%s;QT0[#channels];Counts", qt0name.Data()),Int_t((high[121+i]-low[121+i])/4),low[121+i],high[121+i]);
224 Add2RawsList( fhRawQT0[i],121+i, expert, !image, !saveCorr);
225
226 fhRawNhits[i] = new TH1F(nhits.Data(), Form("%s;#Hits;Events", nhits.Data()),20, 0, 20);
227 Add2RawsList( fhRawNhits[i],176+i, expert, !image, !saveCorr);
228
229
5ed41460 230 timeCalname ="hRawCFDcal";
1d7681da 231 ledCalname = "hRawLEDcal";
232 ampCalname = "hRawLEDminCFDcal";
5ed41460 233 qtcCalname = "hRawQTCcal";
332b9234 234 qt0Calname = "hRawQT0cal";
235 qt1Calname = "hRawQT1cal";
236 timeCalname += i+1;
237 ledCalname += i+1;
238 ampCalname += i+1;
239 qtcCalname += i+1;
240 qt0Calname += i+1;
241 qt1Calname += i+1;
be3ada9f 242 fhRawCFDcal[i] = new TH1F(timeCalname.Data(), Form("LASER: %s;Time ;Counts", timeCalname.Data()),Int_t((high[251+i]-low[251+i])/4),low[251+i],high[251+i]);
243 Add2RawsList( fhRawCFDcal[i],251+i, expert, !image, !saveCorr);
244
245 fhRawLEDcal[i] = new TH1F(ledCalname.Data(), Form("LASER: %s;Time ;Counts", ledCalname.Data()),Int_t((high[251+i+24]-low[251+i+24])/4),low[251+i+24],high[251+i+24]);
246 Add2RawsList( fhRawLEDcal[i],251+i+24, expert, !image, !saveCorr);
247
248 fhRawLEDampcal[i] = new TH1F(ampCalname.Data(), Form("LASER: %s;Amplitude [ADC counts];Counts", ampCalname.Data()),1000,0,1000);
249 Add2RawsList( fhRawLEDampcal[i],251+i+48, expert, !image, !saveCorr);
250
251 fhRawQTCcal[i] = new TH1F(qtcCalname.Data(), Form("LASER: %s;QTC[#channels]; ;Counts",qtcCalname.Data()),10000,0,10000);
252 Add2RawsList( fhRawQTCcal[i],251+i+72, expert, !image, !saveCorr);
253
254 fhRawQT0cal[i] = new TH1F(qt0Calname.Data(), Form("LASER: %s;QT0[#channels] ;Counts",qt0Calname.Data()),Int_t((high[251+96+i]-low[251+96+i])/4),low[251+96+i],high[251+96+i]);
255 Add2RawsList( fhRawQT0cal[i],251+96+i, expert, !image, !saveCorr);
256
257 fhRawQT1cal[i] = new TH1F(qt1Calname.Data(), Form("LASER: %s;QT1[#channels] ;Counts",qt1Calname.Data()),Int_t((high[i+251+120]-low[i+251+120])/4),low[i+251+120],high[i+251+120]);
258 Add2RawsList( fhRawQT1cal[i],i+251+120, expert, !image, !saveCorr);
259
260 }
261
262
263 TH1F* fhRawTrigger = new TH1F("hRawTrigger"," phys triggers;Trigger ;Counts",6,0,6);
264 Add2RawsList(fhRawTrigger ,169, expert, image, !saveCorr);
265
266 TH1F* fhRawMean = new TH1F("hRawMean","online mean signal, physics event;",Int_t((high[170]-low[170])/4),low[170],high[170]);
267 Add2RawsList( fhRawMean,170, expert, !image, !saveCorr);
a46b18e9 268
be3ada9f 269 TH1F* fhRawVertex = new TH1F("hRawVertex","online vertex signal; counts",Int_t((high[171]-low[171])/4),low[171],high[171]);
270 Add2RawsList( fhRawVertex,171, expert, image, !saveCorr);
1d7681da 271
be3ada9f 272 TH1F* fhRawORA = new TH1F("hRawORA","online OR A; counts",Int_t((high[172]-low[172])/4),low[172],high[172]);
273 Add2RawsList( fhRawORA,172, expert, !image, !saveCorr);
274 TH1F* fhRawORC = new TH1F("hRawORC","online OR C;counts",Int_t(( high[173]-low[173])/4),low[173],high[173]);
275 Add2RawsList( fhRawORC,173, expert, !image, !saveCorr);
276 TH1F* fhMultCentr = new TH1F("hMultCentr","online trigger Central;counts ",Int_t(( high[174]-low[174])/4),low[174],high[174]);
277 Add2RawsList( fhMultCentr,174, expert, !image, !saveCorr);
278 TH1F* fhMultSeCentr = new TH1F("hMultSemiCentr","online trigger SemiCentral;counts ",Int_t(( high[175]-low[175])/4),low[175],high[175]);
279 Add2RawsList( fhMultSeCentr,175, expert, !image, !saveCorr);
332b9234 280
332b9234 281
1d7681da 282 TH1F* fhRawTriggerCal = new TH1F("hRawTriggerCal"," laser triggers",6,0,6);
213e2f96 283 Add2RawsList(fhRawTriggerCal ,169+250 , !expert, image, !saveCorr);
be3ada9f 284
213e2f96 285 TH1F* fhRawMeanCal = new TH1F("hRawMeanCal","online mean signal, calibration event",Int_t((high[170+250]-low[170+250])/4),low[170+250],high[170+250]);
286 Add2RawsList( fhRawMeanCal,170+250, expert, !image, !saveCorr);
be3ada9f 287
213e2f96 288 TH1F* fhRawVertexCal = new TH1F("hRawVertexCal","online vertex signal, calibration event ",Int_t((high[171+250]-low[171+250])/4),low[171+250],high[171+250] );
289 Add2RawsList( fhRawVertexCal,171+250, expert, !image, !saveCorr);
be3ada9f 290
291
213e2f96 292 TH1F* fhRawORAcal = new TH1F("hRawORAcal","laser OR A; counts",Int_t((high[172+250]-low[172+250])/4),low[172+250],high[172+250]);
293 Add2RawsList( fhRawORAcal,172+250, expert, !image, !saveCorr );
be3ada9f 294
295
296 TH1F* fhRawORCcal = new TH1F("hRawORCcal","laserOR C;counts ",Int_t(( high[173]-low[173])/4),low[173],high[173]);
213e2f96 297 Add2RawsList( fhRawORCcal,173+250, expert, !image, !saveCorr);
be3ada9f 298
299 TH1F* fhMultCentrcal = new TH1F("hMultCentrcal","laser trigger Central;counts ",Int_t(( high[174]-low[174])/4),low[174],high[174]);
213e2f96 300 Add2RawsList( fhMultCentrcal,174+250, expert, !image, !saveCorr);
be3ada9f 301 TH1F* fhMultSeCentrcal = new TH1F("hMultSemiCentrcal","laser trigger SemiCentral;counts ",Int_t(( high[175]-low[175])/4),low[175],high[175]);
213e2f96 302 Add2RawsList( fhMultSeCentrcal,175+250, expert, !image, !saveCorr);
be3ada9f 303
332b9234 304 //multiplicity trigger
be3ada9f 305 //side A
306 TH1F* fhMultAcal = new TH1F("hMultAcal","laser: full mulltiplicity;Multiplicity A side;Entries",Int_t((high[201]-low[201])/4),low[201],high[201]);
213e2f96 307 Add2RawsList( fhMultAcal,201+250, expert, !image, !saveCorr );
be3ada9f 308 TH1F* fhMultAScal = new TH1F("hMultASemical","laser:full multiplicity with semi-central trigger A side;Multiplicity;Entries",
309 Int_t((high[202]-low[202])/4),low[202],high[202] );
213e2f96 310 Add2RawsList( fhMultAScal,202+250, expert, !image, !saveCorr);
be3ada9f 311 TH1F* fhMultACcal = new TH1F("hMultACentrcal","laser:full multiplicity with central trigger A side;Multiplicity;Entries",
312 Int_t((high[203]-low[203])/4),low[203],high[203]);
213e2f96 313 Add2RawsList( fhMultACcal,203+250, expert, !image, !saveCorr);
a46b18e9 314
be3ada9f 315 TH1F* fhMultA = new TH1F("hMultA","full mulltiplicity A side;Multiplicity;Entries", Int_t((high[201]-low[201])/4) ,low[201],high[201]);
316 Add2RawsList( fhMultA,201, expert, image, !saveCorr );
317
318 TH1F* fhMultAS = new TH1F("hMultASemi","full multiplicity with semi-central trigger A side ;Multiplicity;Entries",
319 Int_t((high[202]-low[202])/4),low[202],high[202] );
320 Add2RawsList( fhMultAS, 202, expert, !image, !saveCorr);
321 TH1F* fhMultAC = new TH1F("hMultACentr","full multiplicity with central trigger;Multiplicity;Entries",
322 Int_t((high[203]-low[203])/4),low[203],high[203]);
323 Add2RawsList( fhMultAC, 203, expert, !image, !saveCorr);
324
325
326 //side C
327 TH1F* fhMultCcal = new TH1F("hMultCcal","laser:full mulltiplicity C side;Multiplicity;Entries",Int_t((high[204]-low[204])/4),low[204],high[204]);
213e2f96 328 Add2RawsList( fhMultCcal,204+250, expert, !image, !saveCorr );
be3ada9f 329 TH1F* fhMultCScal = new TH1F("hMultCSemical","laser:full multiplicity with semi-central trigger C side;Multiplicity;Entries",
330 Int_t((high[205]-low[205])/4),low[205],high[205] );
213e2f96 331 Add2RawsList( fhMultCScal,205+250, expert, !image, !saveCorr);
be3ada9f 332 TH1F* fhMultCCcal = new TH1F("hMultCCentrcal","laser:full multiplicity with central trigger C side;Multiplicity;Entries",
333 Int_t((high[206]-low[206])/4),low[206],high[206]);
213e2f96 334 Add2RawsList( fhMultCCcal,206+250, expert, !image, !saveCorr);
be3ada9f 335
d5fa4835 336 TH1F* fhMultC = new TH1F("hMultC","full mulltiplicity C side;Multiplicity;Entries", Int_t(high[204]-low[204]/4) ,low[204],high[204]);
be3ada9f 337 Add2RawsList( fhMultC,204, expert, image, !saveCorr );
338 TH1F* fhMultCS = new TH1F("hMultCSemi","full multiplicity with semi-central trigger C side;Multiplicity;Entries",
339 Int_t((high[205]-low[205])/4),low[205],high[205] );
340 Add2RawsList( fhMultCS,205, expert, !image, !saveCorr);
341 TH1F* fhMultCC = new TH1F("hMultCentr","full multiplicity with central trigger C side;Multiplicity;Entries",
342 Int_t((high[206]-low[206])/4),low[206],high[206]);
343 Add2RawsList( fhMultCC,206, expert, !image, !saveCorr);
344
345
346 //efficiency
347 TH1F* fhEffCFD = new TH1F("hEffCFDcal","CFD efficiecy laser ;#PMT; #CFD counts/nEvents",24, 0 ,24);
213e2f96 348 Add2RawsList( fhEffCFD,207+250, !expert, image, !saveCorr);
be3ada9f 349
350 TH1F* fhCFDeffpsys= new TH1F("fhCFDeffpsys"," CFD efficiency; #PMT; #CFD counts/nEvents",24, 0 ,24);
351 // fhCFDeffpsys->SetMaximum(2);
352 Add2RawsList( fhCFDeffpsys, 207, expert, image, !saveCorr);
353
354 TH1F* fhEffLED = new TH1F("hEffLEDcal","LEDefficiecy; #PMT; #LED counts/nEvent",24, 0 ,24);
213e2f96 355 Add2RawsList( fhEffLED,208+250, !expert, image, !saveCorr);
be3ada9f 356
357 TH1F* fhEffQTC = new TH1F("hEffQTCcal","QTC efficiecy; #PMT; QTC efficiency%s;",24, 0 ,24);
213e2f96 358 Add2RawsList( fhEffQTC,209+250, !expert, image, !saveCorr);
be3ada9f 359
360
361 TH2F* fhCFD = new TH2F("hCFD","CFD phys; #PMT; CFD {#channnels}",25, 0 ,25,Int_t((high[210]-low[210])/4),low[210],high[210]);
362 fhCFD->SetOption("COLZ");
363 Add2RawsList( fhCFD,210, expert, image, !saveCorr);
364
365 TH2F* fhLED = new TH2F("hLED","LED phys; #PMT; LED [#channnels]",25, 0 ,25,Int_t((high[211]-low[211])/4),low[211],high[211]);
366 fhLED->SetOption("COLZ");
367 Add2RawsList( fhLED,211, expert, image, !saveCorr);
a46b18e9 368
be3ada9f 369 TH2F* fhQTC = new TH2F("hQTC","QTC phys; #PMT; QTC [#channnels]",25, 0 ,25,Int_t( high[212]-low[212]),low[212],high[212]);
370 fhQTC->SetOption("COLZ");
371 Add2RawsList( fhQTC,212, expert, image, !saveCorr);
a46b18e9 372
be3ada9f 373 TH2F* fhCFDcal = new TH2F("hCFDcal","CFD laser; #PMT; CFD {#channnels}",25, 0 ,25,Int_t((high[210]-low[210])/4),low[210],high[210]);
374 fhCFDcal->SetOption("COLZ");
213e2f96 375 Add2RawsList( fhCFDcal,210+250, expert, image, !saveCorr);
be3ada9f 376
377
378 TH2F* fhLEDcal = new TH2F("hLEDcal","LED laser; #PMT; LED [#channnels]",25, 0 ,25,Int_t((high[211]-low[211])/4),low[211],high[211]);
394c1a6d 379 fhLEDcal->SetOption("COLZ");
213e2f96 380 Add2RawsList( fhLEDcal,211+250, expert, image, !saveCorr);
be3ada9f 381
382 TH2F* fhQTCcal = new TH2F("hQTCcal","QTC laser; #PMT; QTC [#channnels]",25, 0 ,25,Int_t( high[212]-low[212]),low[212],high[212]);
703bbd47 383 fhQTCcal->SetOption("COLZ");
213e2f96 384 Add2RawsList( fhQTCcal,212+250, expert, image, !saveCorr);
be3ada9f 385
386
703bbd47 387 TH1F* fhNumPMTA= new TH1F("hNumPMTA","number of PMT hitted per event",13, 0 ,13);
be3ada9f 388 Add2RawsList(fhNumPMTA ,213, expert, image, !saveCorr);
389
703bbd47 390 TH1F* fhNumPMTC= new TH1F("hNumPMTC","number of PMT hitted per event",13, 0 ,13);
be3ada9f 391 Add2RawsList(fhNumPMTC ,214, expert, image, !saveCorr);
392
393 TH1F* fhHitsOrA= new TH1F("fhHitsOrA","T0_OR A hit multiplicitie",20, 0 ,20);
394 Add2RawsList( fhHitsOrA,215, expert, !image, !saveCorr);
395
396 TH1F* fhHitsOrC= new TH1F("fhHitsOrC","T0_OR C hit multiplicitie",20, 0 ,20);
397 Add2RawsList(fhHitsOrC ,216, expert, !image, !saveCorr);
398
399
fce2006a 400 TH1F* fhOrCminOrA= new TH1F("fhOrCminOrA","T0_OR C - T0_OR A",10000,-5000,5000);
be3ada9f 401 Add2RawsList( fhOrCminOrA,219, expert, !image, !saveCorr);
402
fce2006a 403 TH1F* fhOrCminOrAcal= new TH1F("fhOrCminOrAcal","T0_OR C - T0_OR A",10000,-5000,5000);
213e2f96 404 Add2RawsList( fhOrCminOrAcal,219+250, expert, !image, !saveCorr);
703bbd47 405
fce2006a 406 TH1F* fhOrCminOrATvdcOn= new TH1F("fhOrCminOrATvdcOn","T0_OR C - T0_OR A TVDC on",10000,-5000,5000);
be3ada9f 407 Add2RawsList( fhOrCminOrATvdcOn,217, expert, !image, !saveCorr);
408
fce2006a 409 TH1F* fhOrCminOrATvdcOncal= new TH1F("fhOrCminOrATvdcOncal","T0_OR C - T0_OR A TVDC on laser",10000,-5000,5000);
213e2f96 410 Add2RawsList( fhOrCminOrATvdcOncal,217+250, expert, !image, !saveCorr);
703bbd47 411
fce2006a 412 TH1F* fhOrCminOrATvdcOff= new TH1F("fhOrCminOrATvdcOff","T0_OR C - T0_OR A TVDC off",10000,-5000,5000);
be3ada9f 413 Add2RawsList( fhOrCminOrATvdcOff,218, expert, !image, !saveCorr);
b2acd28d 414
b2acd28d 415
be3ada9f 416 TH1F* fhOrCminOrATvdcOffcal= new TH1F("fhOrCminOrATvdcOffcal","T0_OR C - T0_OR ATVDC off laser",10000,-5000,5000);
213e2f96 417 Add2RawsList( fhOrCminOrATvdcOffcal,218+250, expert, !image, !saveCorr);
02d51eff 418
faca085d 419 //satellite & beam background
ea78e01b 420 TH2F* fhBeam = new TH2F("fhBeam", " Mean vs Vertex ", 120, -30, 30, 120, -30, 30);
421 fhBeam->SetOption("COLZ");
422 fhBeam->GetXaxis()->SetTitle("(T0C-T0A/2, ns");
423 fhBeam->GetYaxis()->SetTitle("(T0C+T0A/2, ns");
424 Add2RawsList( fhBeam,220, !expert, image, !saveCorr);
425 TH2F* fhBeamTVDCon = new TH2F("fhBeamTVDCon", " Mean vs Vertex TVDC on ",50, -5, 5, 50, -5, 5) ;
426 fhBeamTVDCon->SetOption("COLZ");
427 fhBeamTVDCon->GetXaxis()->SetTitle("(T0C-T0A/2, ns");
428 fhBeamTVDCon->GetYaxis()->SetTitle("(T0C+T0A/2, ns");
02d51eff 429 Add2RawsList( fhBeamTVDCon,221, expert, image, !saveCorr);
ea78e01b 430 TH2F* fhBeamTVDCoff = new TH2F("fhBeamTVDCoff", " Mean vs Vertex TVDC off", 120, -30, 30, 120, -30, 30);
431 fhBeamTVDCoff->GetXaxis()->SetTitle("(T0C-T0A/2, ns");
432 fhBeamTVDCoff->GetYaxis()->SetTitle("(T0C+T0A/2, ns");
433 fhBeamTVDCoff->SetOption("COLZ");
02d51eff 434 Add2RawsList( fhBeamTVDCoff,222, expert, image, !saveCorr);
ea78e01b 435 TH1F* fhMean = new TH1F("fhMean", " (T0A+T0C)/2, ns ", 200, -2000, 2000);
faca085d 436 Add2RawsList( fhMean,223, !expert, image, !saveCorr);
437
ea78e01b 438 TH2F* fhBCID = new TH2F("fhBCID", "header BCID vs TRM BC ID ", 500, 0, 5000, 500, 0, 5000);
439 fhBCID->SetOption("COLZ");
440 fhBCID->GetXaxis()->SetTitle("TRM BC ID");
441 fhBCID->GetYaxis()->SetTitle("event header BC ID");
442 Add2RawsList(fhBCID ,224, !expert, image, !saveCorr);
443
faca085d 444 //triggers
be3ada9f 445 const Char_t *triggers[6] = {"mean", "vertex","ORA","ORC","central","semi-central"};
446 for (Int_t itr=0; itr<6; itr++) {
447 GetRawsData(169)->Fill(triggers[itr], fNumTriggersCal[itr]);
448 GetRawsData(169)->SetBinContent(itr+1, fNumTriggersCal[itr]);
213e2f96 449 GetRawsData(169+250)->Fill(triggers[itr], fNumTriggers[itr]);
450 GetRawsData(169+250)->SetBinContent(itr+1, fNumTriggers[itr]);
be3ada9f 451 }
59f47540 452
453
04236e67 454}
be3ada9f 455
04236e67 456//____________________________________________________________________________
44ed7a66 457void AliT0QADataMakerRec::InitDigits()
458{
459 // create Digits histograms in Digits subdir
460 const Bool_t expert = kTRUE ;
461 const Bool_t image = kTRUE ;
462
f628b9d2 463 TH2F * fhDigCFD = new TH2F("fhDigCFD", " CFD digits; #PMT; CFD digits[#channels]",25,-0.5,24.5,100,0,1000);
eca4fa66 464 fhDigCFD->SetOption("COLZ");
f628b9d2 465 Add2DigitsList( fhDigCFD,0, !expert, image);
466 TH2F *fhDigLEDamp = new TH2F("fhDigLEDamp", " LED-CFD digits; #PMT; LED-CFD amplitude ",25,-0.5,24.5,100,100,1000);
eca4fa66 467 fhDigLEDamp->SetOption("COLZ");
394c1a6d 468 Add2DigitsList( fhDigLEDamp,1, !expert, !image);
f628b9d2 469 TH2F * fhDigQTC = new TH2F("fhDigQTC", " QTC digits; #PMT; QTC amplitude",25,-0.5,24.5,100,100,10000);
eca4fa66 470 fhDigQTC->SetOption("COLZ");
b2acd28d 471 Add2DigitsList( fhDigQTC,2, !expert, !image);
472
473
474}
44ed7a66 475
476//____________________________________________________________________________
04236e67 477
478void AliT0QADataMakerRec::InitRecPoints()
479{
480 // create cluster histograms in RecPoint subdir
7d297381 481 const Bool_t expert = kTRUE ;
482 const Bool_t image = kTRUE ;
1d7681da 483
703bbd47 484 TH2F* fhRecCFD = new TH2F("hRecCFD"," CFD time;#PMT; CFD Time [ns];",24, 0 ,24,
b9024d69 485 100,-50,50);
eca4fa66 486 fhRecCFD->SetOption("COLZ");
7d297381 487 Add2RecPointsList ( fhRecCFD,0, !expert, image);
b9024d69 488
703bbd47 489 TH2F* fhRecAmpDiff = new TH2F("hRecAmpDiff"," LED-CFD min QTC amplitude;#PMT; difference [MIPs];",
b9024d69 490 24, 0 ,24, 200,-10,10);
eca4fa66 491 fhRecAmpDiff->SetOption("COLZ");
7d297381 492 Add2RecPointsList (fhRecAmpDiff, 1, !expert, image);
04236e67 493
f628b9d2 494 TH1F *fhMean = new TH1F("hMean","online - rec mean;online - rec mean[#channels];",2000, -1000, 1000);
7d297381 495 Add2RecPointsList ( fhMean,2, !expert, image);
eca4fa66 496
497}
04236e67 498
499//____________________________________________________________________________
500void AliT0QADataMakerRec::InitESDs()
501{
502 //create ESDs histograms in ESDs subdir
7d297381 503 const Bool_t expert = kTRUE ;
504 const Bool_t image = kTRUE ;
505
be3ada9f 506 TH1F *fhESDMean = new TH1F("hESDmean"," ESD mean; mean time[%channels]",1000, -5, 5);
a581ca38 507 Add2ESDsList(fhESDMean, 0, expert, !image) ;
f628b9d2 508 TH1F * fhESDVertex = new TH1F("hESDvertex","ESDvertex; vertex[cm];",82,-30,30);
a581ca38 509 Add2ESDsList(fhESDVertex, 1, expert, !image) ;
c724dd64 510
be3ada9f 511 TH1F * fhESDResolution = new TH1F("hESDResolution","(T0A-T0C)/2 corrected by SPD vertex; ns",800,-2,2);
a581ca38 512 Add2ESDsList(fhESDResolution, 2, !expert, image) ;
04236e67 513
514}
515
516//____________________________________________________________________________
517void AliT0QADataMakerRec::MakeRaws( AliRawReader* rawReader)
518{
02d51eff 519 Int_t time[24] ;
520 for(Int_t i=0; i<24; i++) time[i] = 0;
9e289a53 521
332b9234 522 rawReader->Reset() ;
04236e67 523 //fills QA histos for RAW
5ed41460 524 Int_t shift=0;
45c5ba2d 525 // Int_t refPointParam = GetRecoParam()->GetRefPoint();
332b9234 526 Int_t refpoint = 0;
45c5ba2d 527 Int_t refPointParam = 0;
02d51eff 528
86c020af 529 AliT0RawReader *start = new AliT0RawReader(rawReader);
332b9234 530
86c020af 531 if (! start->Next())
5379c4a3 532 AliDebug(AliQAv1::GetQADebugLevel(),Form(" no raw data found!!"));
86c020af 533 else
534 {
ea78e01b 535
5ed41460 536 UInt_t type =rawReader->GetType();
213e2f96 537 if (type == 8){ shift=250; fnEventCal++;}
332b9234 538 if (type == 7){ shift=0; fnEventPhys++;}
ea78e01b 539 //BC ID
540 if (type == 7){
541 UInt_t bcid = rawReader->GetBCID();
542 UInt_t trmbcid = start->GetTRMBunchID();
543 GetRawsData(224)->Fill(trmbcid, bcid);
544 }
545 // if (type == 7){ shift=1; fnEventPhys++;}
86c020af 546 Int_t allData[110][5];
be3ada9f 547 for (Int_t i0=0; i0<110; i0++)
86c020af 548 {
549 for (Int_t j0=0; j0<5; j0++) allData[i0][j0]=0;
04236e67 550 }
be3ada9f 551 for (Int_t i=0; i<107; i++)
86c020af 552 for (Int_t iHit=0; iHit<5; iHit++)
553 allData[i][iHit]= start->GetData(i,iHit);
554
be3ada9f 555 if ( allData[0][0] > 0 && (type == 7))
556 GetRawsData(0) -> Fill( allData[0][0]);
557 if ( allData[0][0] > 0 && (type == 8))
558 GetRawsData(250) -> Fill( allData[0][0]);
559
a46b18e9 560 refpoint = allData[refPointParam][0];
561 if (refPointParam < 0 ) refpoint=0;
562 if (refPointParam == 0 ) refpoint = allData[0][0] - 5000;
be3ada9f 563
564 Int_t sideshift, sideshiftqtc;
426a778b 565 Int_t numPmtC=0;
be3ada9f 566 Int_t numPmtA=0;
567 for (Int_t ik = 0; ik<24; ik++)
426a778b 568 {
be3ada9f 569 if(ik<12) {
570 sideshift=1;
571 sideshiftqtc=1;
572 if(allData[ik+sideshift][0]>0 && type == 7 ) numPmtC++;
332b9234 573 }
be3ada9f 574 else {
575 if(allData[ik+45][0]>0 && type == 7 ) numPmtA++;
576 sideshift=45;
577 sideshiftqtc=33;
426a778b 578
394c1a6d 579 }
be3ada9f 580 Int_t nhitsPMT=0;
581
582 for (Int_t iHt=0; iHt<5; iHt++){
583 //cfd
584 if(allData[ik+sideshift][iHt]>0) {
d5fa4835 585 GetRawsData(shift+ik+1) -> Fill(allData[ik+sideshift][iHt]);
be3ada9f 586 GetRawsData(210+shift)->Fill(ik+1, allData[ik+sideshift][iHt]);
587 if(type == 8 ) feffC[ik]++;
02d51eff 588 AliDebug(50,Form("%i CFD %i data %s",ik, ik+sideshift, GetRawsData(shift+ik+1)->GetName()));
be3ada9f 589 if(type == 7 ) {
590 nhitsPMT++;
591 feffPhysC[ik]++;
332b9234 592 }
be3ada9f 593
1d7681da 594 }
be3ada9f 595 //led
596 if(allData[ik+12+sideshift][iHt] > 0) {
d5fa4835 597 GetRawsData(shift+ik+24+1)-> Fill(allData[ik+12+sideshift][iHt]);
be3ada9f 598 GetRawsData(211+shift)->Fill(ik+1, allData[ik+12+sideshift][iHt]);
02d51eff 599 AliDebug(50,Form("%i LED %i data %s",ik, ik+12+sideshift, GetRawsData(shift+ik+1+24)->GetName()));
be3ada9f 600 if(type == 8 ) {
601 feffA[ik]++;
602 }
b2acd28d 603 }
be3ada9f 604 //led -cfd
426a778b 605
be3ada9f 606 if(allData[ik+12+sideshift][iHt] > 0 && allData[ik+sideshift][iHt] >0 )
d5fa4835 607 GetRawsData(shift+ik+48+1)->
be3ada9f 608 Fill(allData[ik+12+sideshift][iHt]-allData[ik+sideshift][iHt]);
b2acd28d 609
be3ada9f 610 //qtc
611 if(allData[2*ik+sideshiftqtc+24][iHt] > 0 &&
612 allData[2*ik+sideshiftqtc+25][iHt] > 0) {
d5fa4835 613 GetRawsData(shift+ik+72+1)->
be3ada9f 614 Fill(allData[2*ik+sideshiftqtc+24][iHt]-allData[2*ik+sideshiftqtc+25][iHt]);
615 GetRawsData(212+shift)->Fill(ik+1, allData[2*ik+sideshiftqtc+24][iHt]-allData[2*ik+sideshiftqtc+25][iHt]);
616 if(type == 8) feffqtc[ik]++;
02d51eff 617 AliDebug(50,Form("%i QTC %i data %s",ik, 2*ik+sideshiftqtc+24, GetRawsData(shift+ik+1+72)->GetName()));
213e2f96 618
619 }
620 if(allData[2*ik+sideshiftqtc+24][iHt] > 0) {
02d51eff 621 AliDebug(50,Form("%i QT0 %i data %s",ik, 2*ik+sideshiftqtc+24, GetRawsData(shift+ik+1+96)->GetName()));
213e2f96 622 GetRawsData(shift+ik+96+1)->Fill(allData[2*ik+sideshiftqtc+24][iHt]);
623 }
624 if(allData[2*ik+sideshiftqtc+25][iHt] > 0) {
02d51eff 625 AliDebug(50,Form("%i QT0 %i data %s",ik, 2*ik+sideshiftqtc+25, GetRawsData(shift+ik+1+120)->GetName()));
213e2f96 626 GetRawsData(shift+ik+120+1)->Fill(allData[2*ik+sideshiftqtc+25][iHt]);
be3ada9f 627 }
f6c2d5e2 628 }
be3ada9f 629
630 if(type == 7 ) {
631 GetRawsData(ik+176)->Fill(nhitsPMT);
632 GetRawsData(213)->Fill(numPmtC);
633 GetRawsData(214)->Fill(numPmtA);
634 }
635 }
636
637 Int_t trChannel[6] = {49,50,51,52,55,56};
638 Float_t ch2cm = 24.4*0.029979;
639 Int_t nhitsOrA=0;
640 Int_t nhitsOrC=0;
641 for (Int_t iHt=0; iHt<5; iHt++) {
642
643 //orA-orC phys tvdc 1
644 if((allData[51][iHt]>0 && allData[52][iHt]>0) && allData[50][iHt]>0)
332b9234 645 {
213e2f96 646 AliDebug(10,Form("orA-orC phys tvdc 1 %i data %s", 217+shift, GetRawsData(shift+217)->GetName()));
647
be3ada9f 648 GetRawsData(217+shift)->Fill((allData[52][iHt]-allData[51][iHt])*ch2cm);
649 // GetRawsData(345) ->Fill((allData[51][iHt]+allData[52][iHt])/2.);
650 }
651 //orA-orC phys tvdc 0
652 if((allData[51][iHt]>0 && allData[52][iHt]>0) && allData[50][iHt]<=0)
213e2f96 653 {
654 AliDebug(10,Form("orA-orC phys tvdc 0 %i data %s", 218+shift, GetRawsData(shift+218)->GetName()));
655
656 GetRawsData(218+shift)->Fill((allData[52][iHt]-allData[51][iHt])*ch2cm);
657 }
658 if(allData[51][iHt]>0 && allData[52][iHt]>0) {
02d51eff 659 AliDebug(50,Form("orA-orC phys tvdc all %i data %s", 219+shift, GetRawsData(shift+219)->GetName()));
213e2f96 660 GetRawsData(219+shift)->Fill((allData[52][iHt]-allData[51][iHt])*ch2cm);
661 }
be3ada9f 662 for (Int_t itr=0; itr<6; itr++) {
663 if (allData[trChannel[itr]][iHt] >0) {
664 if(type == 7 )fNumTriggers[itr]++;
665 if(type == 8 )fNumTriggersCal[itr]++;
851f960f 666 AliDebug(50,Form(" hit %i channel %i triggers %i data %s",iHt, trChannel[itr], 170+itr+shift, GetRawsData(170+itr+shift)->GetName()));
213e2f96 667
be3ada9f 668 GetRawsData(170+itr+shift)->Fill(allData[trChannel[itr]][iHt]);
669 }
670 }
b2acd28d 671
be3ada9f 672 if(type == 7) if(allData[51][iHt] >0) nhitsOrA++;
851f960f 673 if(type == 7) if(allData[52][iHt] >0) nhitsOrC++;
be3ada9f 674
675 //mult trigger signals phys
676 //C side
677 if(allData[53][iHt]>0 && allData[54][iHt]>0) {
02d51eff 678 AliDebug(50,Form(" mpdA %i data %s", 201+shift, GetRawsData(201+shift)->GetName()));
213e2f96 679
be3ada9f 680 GetRawsData(201+shift)->Fill(allData[53][iHt]-allData[54][iHt]);
681 if(allData[56][iHt]>0) GetRawsData(202+shift)->Fill(allData[53][iHt]-allData[54][iHt]);
682 if(allData[55][iHt]>0) GetRawsData(203+shift)->Fill(allData[53][iHt]-allData[54][iHt]);
683 }
684
685 //A side
686 if(allData[105][iHt]>0 && allData[106][iHt]>0) {
02d51eff 687 AliDebug(50,Form(" mpdC %i data %s", 204+shift, GetRawsData(204+shift)->GetName()));
213e2f96 688
689 GetRawsData(204+shift)->Fill(allData[105][iHt]-allData[106][iHt]);
690 if(allData[56][iHt]>0) GetRawsData(205+shift)->Fill(allData[105][iHt]-allData[106][iHt]);
691 if(allData[55][iHt]>0) GetRawsData(206+shift)->Fill(allData[105][iHt]-allData[106][iHt]);
be3ada9f 692 }
693 }
213e2f96 694
be3ada9f 695 GetRawsData(215)->Fill(nhitsOrA);
696 GetRawsData(216)->Fill(nhitsOrC);
59f47540 697
698 //draw satellite
faca085d 699 if(type == 7){
700 if(fnEventPhys == 1000) {
701 for (Int_t ik=0; ik<24; ik++)
702 {
703 GetRawsData(ik+1)->GetXaxis()->SetRangeUser(2000, 3000);
704 int maxBin = GetRawsData(ik+1) ->GetMaximumBin();
705 double meanEstimate = GetRawsData(ik+1)->GetBinCenter( maxBin);
706 TF1* fit= new TF1("fit","gaus", meanEstimate - 40, meanEstimate + 40);
707 fit->SetParameters (GetRawsData(ik+1)->GetBinContent(maxBin), meanEstimate, 80);
708 GetRawsData(ik+1) -> Fit("fit","RQ","Q", meanEstimate-40, meanEstimate+40);
851f960f 709 if(fit->GetParameter(1)>2000 && fit->GetParameter(1)<3000)
710 fMeans[ik]= (Int_t) fit->GetParameter(1);
faca085d 711 GetRawsData(ik+1)->GetXaxis()->SetRangeUser(0, 30000);
712
713 }
59f47540 714 }
faca085d 715
716 if( fnEventPhys > 1000) {
717 Int_t besttimeA=9999999;
718 Int_t besttimeC=9999999;
719 for (Int_t ipmt=0; ipmt<12; ipmt++){
720 if(allData[ipmt+1][0] > 1 ) {
721 // time[ipmt] = allData[ipmt+1][0] - Int_t(GetRawsData(1)->GetMean());
722 time[ipmt] = allData[ipmt+1][0] - fMeans[ipmt];
723 if(TMath::Abs(time[ipmt]) < TMath::Abs(besttimeC))
724 besttimeC=time[ipmt]; //timeC
725 }
59f47540 726 }
faca085d 727 for ( Int_t ipmt=12; ipmt<24; ipmt++){
851f960f 728 if(allData[ipmt+45][0] > 1) {
faca085d 729 time[ipmt] = allData[ipmt+45][0] - fMeans[ipmt] ;
ea78e01b 730 if(TMath::Abs(time[ipmt]) < TMath::Abs(besttimeA) )
faca085d 731 besttimeA=time[ipmt]; //timeA
732 }
733 }
734 if(besttimeA<99999 &&besttimeC< 99999) {
735 Float_t t0 = 24.4 * (Float_t( besttimeA+besttimeC)/2. );
ea78e01b 736 Float_t ver = 24.4 * Float_t( besttimeC-besttimeA)/2.;
faca085d 737 GetRawsData(220)->Fill(0.001*ver, 0.001*(t0));
738 if(allData[50][0] > 0) GetRawsData(221)->Fill(0.001*ver, 0.001*(t0));
739 if(allData[50][0] <= 0) GetRawsData(222)->Fill(0.001*ver, 0.001*(t0));
740 GetRawsData(223) ->Fill(t0);
741 }
742 } //event >100
59f47540 743 } //type 7
744 } //next
02d51eff 745
746
59f47540 747
be3ada9f 748 delete start;
332b9234 749}
750
1d7681da 751
04236e67 752
be3ada9f 753
04236e67 754//____________________________________________________________________________
44ed7a66 755void AliT0QADataMakerRec::MakeDigits( TTree *digitsTree)
756{
757 //fills QA histos for Digits
eca4fa66 758
44ed7a66 759 TArrayI *digCFD = new TArrayI(24);
760 TArrayI *digLED = new TArrayI(24);
761 TArrayI *digQT0 = new TArrayI(24);
762 TArrayI *digQT1 = new TArrayI(24);
763 Int_t refpoint=0;
764
765 TBranch *brDigits=digitsTree->GetBranch("T0");
766 AliT0digit *fDigits = new AliT0digit() ;
767 if (brDigits) {
768 brDigits->SetAddress(&fDigits);
769 }else{
770 AliError(Form("EXEC Branch T0 digits not found"));
771 return;
772 }
773 digitsTree->GetEvent(0);
774 digitsTree->GetEntry(0);
775 brDigits->GetEntry(0);
776 fDigits->GetTimeCFD(*digCFD);
777 fDigits->GetTimeLED(*digLED);
778 fDigits->GetQT0(*digQT0);
779 fDigits->GetQT1(*digQT1);
780 refpoint = fDigits->RefPoint();
781 for (Int_t i=0; i<24; i++)
782 {
783 if (digCFD->At(i)>0) {
784 Int_t cfd=digCFD->At(i)- refpoint;
785 GetDigitsData(0) ->Fill(i,cfd);
f628b9d2 786 GetDigitsData(1) -> Fill(i, (digLED->At(i) - digCFD->At(i)));
44ed7a66 787 GetDigitsData(2) -> Fill(i, (digQT1->At(i) - digQT0->At(i)));
788 }
789 }
790
791 delete digCFD;
792 delete digLED;
793 delete digQT0;
794 delete digQT1;
795
796}
797
798//____________________________________________________________________________
04236e67 799void AliT0QADataMakerRec::MakeRecPoints(TTree * clustersTree)
800{
801 //fills QA histos for clusters
802
446d6ec4 803 AliT0RecPoint* frecpoints= new AliT0RecPoint ();
f628b9d2 804 if (!frecpoints) {
394c1a6d 805 AliError(":MakeRecPoints >> no recpoints found");
04236e67 806 return;
807 }
808 TBranch *brRec =clustersTree ->GetBranch("T0");
809 if (brRec) {
810 brRec->SetAddress(&frecpoints);
811 }else{
f628b9d2 812 AliError(Form("EXEC Branch T0 rec not found "));
813 return;
04236e67 814 }
eca4fa66 815
04236e67 816 brRec->GetEntry(0);
f628b9d2 817
04236e67 818 for ( Int_t i=0; i<24; i++) {
1d7681da 819 if(i<12)
b9024d69 820 GetRecPointsData(0) -> Fill(i, frecpoints -> GetTime(i) - frecpoints -> GetTime(0));
1d7681da 821 if(i>11)
b9024d69 822 GetRecPointsData(0) -> Fill(i, frecpoints -> GetTime(i) - frecpoints -> GetTime(12));
823 GetRecPointsData(1) -> Fill( i, frecpoints -> GetAmp(i) - frecpoints->AmpLED(i));
04236e67 824 }
b9024d69 825 Double_t mmm=frecpoints->GetOnlineMean()- frecpoints->GetMeanTime();
f628b9d2 826 GetRecPointsData(2) ->Fill(mmm);
04236e67 827
828}
829
830//____________________________________________________________________________
831void AliT0QADataMakerRec::MakeESDs(AliESDEvent * esd)
832{
833 //fills QA histos for ESD
f628b9d2 834
a581ca38 835 const Double32_t *mean;
836 mean = esd->GetT0TOF();
837 Double32_t t0time= 0.001*mean[0];
838 Double32_t orA= 0.001*mean[1];
839 Double32_t orC=0.001* mean[2];
840
be3ada9f 841 if (t0time<99) GetESDsData(0) -> Fill(t0time);
842 if( esd->GetT0zVertex() <99) GetESDsData(1)-> Fill(esd->GetT0zVertex());
843 if( orA<99 && orC<99) GetESDsData(2)-> Fill((orA-orC)/2.);
f628b9d2 844
04236e67 845}
02d51eff 846//____________________________________________________________________________
847
848/*
849void AliT0QADataMakerRec::GetMeanAndSigma(TH1F* hist, Float_t &mean, Float_t &sigma)
850{
851
852 const double window = 3.; //fit window
853
854 double meanEstimate, sigmaEstimate;
855 int maxBin;
856 maxBin = hist->GetMaximumBin(); //position of maximum
857 meanEstimate = hist->GetBinCenter( maxBin); // mean of gaussian sitting in maximum
858 sigmaEstimate = hist->GetRMS();
859 TF1* fit= new TF1("fit","gaus", meanEstimate - window*sigmaEstimate, meanEstimate + window*sigmaEstimate);
860 fit->SetParameters(hist->GetBinContent(maxBin), meanEstimate, sigmaEstimate);
861 hist->Fit("fit","RQ","Q");
862
863 mean = (Float_t) fit->GetParameter(1);
864 sigma = (Float_t) fit->GetParameter(2);
865
866 delete fit;
867}
868*/