]> git.uio.no Git - u/mrichter/AliRoot.git/blame - T0/T0rec/AliT0QADataMakerRec.cxx
Cleaning MONITOR
[u/mrichter/AliRoot.git] / T0 / T0rec / 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 ---
52ee500c 34
04236e67 35#include "AliESDEvent.h"
36#include "AliLog.h"
37#include "AliT0digit.h"
38#include "AliT0hit.h"
39#include "AliT0RecPoint.h"
40#include "AliT0QADataMakerRec.h"
41#include "AliQAChecker.h"
42#include "AliT0RawReader.h"
332b9234 43#include "AliT0RecoParam.h"
0353488e 44#include "AliQAThresholds.h"
45#include "AliDAQ.h"
46#include "AliCDBEntry.h"
47#include "AliQAManager.h"
703bbd47 48#include "THnSparse.h"
04236e67 49
f3d2feeb 50#include "TFitResultPtr.h"
51
1d7681da 52#include "Riostream.h"
04236e67 53ClassImp(AliT0QADataMakerRec)
54
55//____________________________________________________________________________
56 AliT0QADataMakerRec::AliT0QADataMakerRec() :
4e25ac79 57AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kT0),
0353488e 58 "T0 Quality Assurance Data Maker"),
59 fMeanRawVertexParam(0),
60 fMeanORAParam(0),
61 fMeanORCParam(0),
62 fCFDEffSubRangeLowParam(0),
63 fCFDEffSubRangeHighParam(3000),
64 fLEDEffSubRangeLowParam(0),
65 fLEDEffSubRangeHighParam(3000)
92664bc8 66// fnEventCal(0),
67// fnEventPhys(0)
04236e67 68{
69 // ctor
92664bc8 70 // RS: There is some inconsistency here: the separation of physics and calib. events/histos is done by
71 // fEventSpecie. Why do we book separate histos on different slots for calib and physics ?
72 // I am changing this in such way that we don't need local counters like fNumTriggers (the corresponding
73 // histos now incremented in the MakeRaws, and for the normalization I will use the framework's counters
74 // AliQADataMaker::GetEvCountCycle(...), AliQADataMaker::GetEvCountTotal(...)
75 // All these fTrEff.. feff.. will by directly filled in corresponding histos
332b9234 76
0353488e 77 for(Int_t i=0; i<24; i++){
78 fMeanCFDFromGoodRunParam[i]=0;
79 }
04236e67 80}
81
f7350425 82
04236e67 83//____________________________________________________________________________
84AliT0QADataMakerRec::AliT0QADataMakerRec(const AliT0QADataMakerRec& qadm) :
0353488e 85 AliQADataMakerRec(),
86 fMeanRawVertexParam(qadm.fMeanRawVertexParam),
87 fMeanORAParam(qadm.fMeanORAParam),
88 fMeanORCParam(qadm.fMeanORCParam),
89 fCFDEffSubRangeLowParam(qadm.fCFDEffSubRangeLowParam),
90 fCFDEffSubRangeHighParam(qadm.fCFDEffSubRangeHighParam),
91 fLEDEffSubRangeLowParam(qadm.fLEDEffSubRangeLowParam),
92 fLEDEffSubRangeHighParam(qadm.fLEDEffSubRangeHighParam)
04236e67 93{
94 //copy ctor
105ff51c 95 SetName((const char*)qadm.GetName()) ;
96 SetTitle((const char*)qadm.GetTitle());
0353488e 97 for(Int_t i=0; i<24; i++){
98 fMeanCFDFromGoodRunParam[i]=qadm.fMeanCFDFromGoodRunParam[i];
99 }
04236e67 100}
101
102//__________________________________________________________________
103AliT0QADataMakerRec& AliT0QADataMakerRec::operator = (const AliT0QADataMakerRec& qadm )
104{
105 // Equal operator.
106 this->~AliT0QADataMakerRec();
107 new(this) AliT0QADataMakerRec(qadm);
108 return *this;
109}
59f47540 110//__________________________________________________________________
111AliT0QADataMakerRec::~AliT0QADataMakerRec()
112{
113 //destructor
59f47540 114}
04236e67 115//____________________________________________________________________________
4e25ac79 116void AliT0QADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
92664bc8 117{
118 //Detector specific actions at end of cycle
119 // do the QA checking
120 AliInfo(Form("Task: %d",task));
121 ResetEventTrigClasses();
0353488e 122
123 TH1* hcounter = 0;
124 TH1* heff = 0;
92664bc8 125 TH1* htmp = 0;
0353488e 126 TH1F* hEventCounter=NULL;
92664bc8 127 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
128 //
129 // RS: There is some inconsistency here: the separation of physics and calib. events/histos is done by
130 // fEventSpecie. Why do we book separate histos on different slots for calib and physics ?
131 // I am changing this in such way that we don't need local counters like fNumTriggers (the corresponding
132 // histos now incremented in the MakeRaws, and for the normalization I will use the framework's counters
133 // AliQADataMaker::GetEvCountCycle(...), AliQADataMaker::GetEvCountTotal(...)
134 //
135 // I think the histos xx+250 should be suppressed (the xx calib histos of specie==calibration will be
136 // used automatically)
137 //
138 if (! IsValidEventSpecie(specie, list)) continue;
139 SetEventSpecie(AliRecoParam::ConvertIndex(specie));
140 //
141 for (int itc=-1;itc<GetNTrigClasses();itc++) { // RS: loop over eventual clones per trigger class
142 //
143 if ( task == AliQAv1::kRAWS ) {
144 //
145 float nEvent = GetEvCountCycleRaws(itc); // counted events for given trigger class
0353488e 146 if(nEvent>0) {
147 Float_t numberOfEventsAllCycles = 0.0;
148 if((hEventCounter=(TH1F*) GetRawsData(240,itc))){
149 numberOfEventsAllCycles = hEventCounter->Integral() + nEvent;// count all events upto now
150 hEventCounter->SetBinContent(1,numberOfEventsAllCycles); // increase counter
151 }
152
153 SetEfficiency(169, 241, itc, numberOfEventsAllCycles);
154 SetEfficiency(207, 242, itc, numberOfEventsAllCycles);
155 SetEfficiency(208, 243, itc, numberOfEventsAllCycles);
156 SetEfficiency(237, 244, itc, numberOfEventsAllCycles);
157 SetEfficiency(238, 245, itc, numberOfEventsAllCycles);
158
159
160 //fk// orA and orC for given specie and trigger class
161 Float_t numberOfORAEndOfCycle = 0.0;
162 Float_t numberOfORCEndOfCycle = 0.0;
163 if((htmp=GetRawsData(172,itc))) numberOfORAEndOfCycle = htmp->Integral(); //ORA
164 if((htmp=GetRawsData(173,itc))) numberOfORCEndOfCycle = htmp->Integral(); //ORC
165
166 if((heff=GetRawsData(209,itc))){ //QTC efficiency
167 if((hcounter=GetRawsData(246,itc))){ //QTC counter
168 if(numberOfORCEndOfCycle>0){
169 for(int ipmt=0; ipmt<12; ipmt++){
170 Float_t val = hcounter->GetBinContent(ipmt+1); //first bin has consequtive number 1
171 heff->SetBinContent(ipmt+1,val/numberOfORCEndOfCycle);
172
173 }
174 }else{
175 for(int ipmt=0;ipmt<12; ipmt++)
176 heff->SetBinContent(ipmt+1,0);
177 }
178 if(numberOfORAEndOfCycle>0){
179 for(int ipmt=12;ipmt<24; ipmt++){
180 Float_t val = hcounter->GetBinContent(ipmt+1);
181 heff->SetBinContent(ipmt+1,val/numberOfORAEndOfCycle);
182 }
183 }else{
184 for(int ipmt=0;ipmt<12; ipmt++)
185 heff->SetBinContent(ipmt+1,0);
186 }
187 }
188 }
189 }//Evt >0
92664bc8 190 } // kRAWS
191 } // RS: loop over eventual clones per trigger class
192 } // loop over species
193 //
0353488e 194 AliQAChecker::Instance()->Run(AliQAv1::kT0, task, list); //FK
92664bc8 195}
196
92664bc8 197
04236e67 198//____________________________________________________________________________
199void AliT0QADataMakerRec::StartOfDetectorCycle()
200{
201 //Detector specific actions at start of cycle
0353488e 202 AliCDBManager* man = AliCDBManager::Instance();
203 //man->SetDefaultStorage(gSystem->Getenv("AMORE_CDB_URI"));
204 if(!man) return;
205 AliCDBEntry* entry = man->Get("GRP/Calib/QAThresholds");
fdb86583 206 if(!entry) return;
0353488e 207 TObjArray* t0branch = (TObjArray*) entry->GetObject();
208 AliQAThresholds* thresholds = (AliQAThresholds*) t0branch->FindObject("T00");
209 // here you should test that you got a non-null pointer
210
211
212if(!thresholds) return;
213 if(AliDAQ::DetectorID("T0")!= thresholds->GetDetectorId()){
214 AliInfo(Form("DETECTOR ID %d DOES NOT MATCH TO TZERO",thresholds->GetDetectorId()));
215 return;
216 }
217
218 int iparam = 0;
219 if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean raw vertex
220 fMeanRawVertexParam = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
221 }
222
223 iparam = 76;
224 if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean raw vertex
225 fMeanORAParam = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
226 }
227
228 iparam = 77;
229 if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean raw vertex
230 fMeanORCParam = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
231 }
232
233 iparam = 78;
234 if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean raw vertex
235 fCFDEffSubRangeLowParam = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
236 }
237
238 iparam = 79;
239 if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean raw vertex
240 fCFDEffSubRangeHighParam = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
241 }
242
243 iparam = 80;
244 if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean raw vertex
245 fLEDEffSubRangeLowParam = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
246 }
247
248 iparam = 81;
249 if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean raw vertex
250 fLEDEffSubRangeHighParam = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
251 }
04236e67 252
0353488e 253 for(int ipmt=0; ipmt<24;ipmt++){
254 iparam = ipmt + 1; //current consecutive number of parameter
255 if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean CFD from a good run
256 fMeanCFDFromGoodRunParam[ipmt] = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
257 }
258 }
04236e67 259}
260
261//____________________________________________________________________________
262void AliT0QADataMakerRec::InitRaws()
263{
0353488e 264
04236e67 265 // create Raw histograms in Raw subdir
7d297381 266 const Bool_t expert = kTRUE ;
267 const Bool_t saveCorr = kTRUE ;
268 const Bool_t image = kTRUE ;
a46b18e9 269 Float_t low[500];
270 Float_t high[500];
eadb337a 271 //new QTC
272 // 00,01, 10, 11; C1,C2,C3, A1, A2, A3
273 Float_t lowqt[100] = {
274 17500, 17500, 18500, 18500, //C1
275 17500, 17500, 18500, 18500, //C2
276 18500, 18500, 17500, 17500, //c3
277 17500, 17500, 18500, 18500, //c4
278 17500, 17500, 18500, 18500, //c5
279 18500, 18500, 17500, 17500, //c6
280 17500, 17500, 18500, 18500, //c7
281 18500, 18500, 17500, 17500, //c8
282 18500, 18500, 17500, 17500, //c9
283 17500, 17500, 18500, 18500, //c10
284 18500, 18500, 17500, 17500, //c11
285 18500, 18500, 17500, 17500, //c12
286 22000, 22000, 21000, 21000, //a1
287 21000, 21000, 22000, 22000, //a2
288 21000, 21000, 22000, 22000, //a3
289 22000, 22000, 21000, 21000, //a4
290 21000, 21000, 22000, 22000, //a5
291 21000, 21000, 22000, 22000, //a6
292 22000, 22000, 21000, 21000, //a7
293 21000, 21000, 22000, 22000, //a8
294 21000, 21000, 22000, 22000, //a9
295 22000, 22000, 21000, 21000, //a10
296 21000, 21000, 22000, 22000, //a11
297 21000, 21000, 22000, 22000//a12
298 };
92664bc8 299 //triggers
0353488e 300 const Char_t *triggers[6] = {"T0 OR", "vertex","ORA","ORC","central","semi-central"};
92664bc8 301
7d297381 302
a46b18e9 303 for (Int_t i=0; i<500; i++){
703bbd47 304 low[i] = 0;
be3ada9f 305 high[i] = 30000;
a46b18e9 306
307 }
308
1d7681da 309 TString timename, ampname, qtcname, ledname;
310 TString timeCalname, ampCalname, ledCalname, qtcCalname;
332b9234 311 TString qt1name, qt0name, qt1Calname, qt0Calname;
426a778b 312 TString nhits;
04236e67 313
0353488e 314 TH1F* hRefPoint = new TH1F("hRefPoint","Ref Point", 10000, 0 ,50000);
315 hRefPoint->SetLabelSize(0.02);
316 Add2RawsList( hRefPoint,0, expert, !image, !saveCorr);
703bbd47 317
0353488e 318 TH1F *hRefPointcal = new TH1F("hRefPointcal","Ref Point laser", 5000, 0 ,20000);
319 Add2RawsList( hRefPointcal,250, expert, !image, !saveCorr);
703bbd47 320
0353488e 321 TH1F *hRawCFD[24];
322 TH1F *hRawLEDamp[24];
323 TH1F *hRawQTC[24]; TH1F *hRawLED[24];
324 TH1F *hRawQT1[24]; TH1F *hRawQT0[24];
325 TH1F* hRawNhits[24];
eadb337a 326 TH1F* hRawNewQT00[24], *hRawNewQT01[24], *hRawNewQT10[24], *hRawNewQT11[24];
327 TH1F* hRawNewQTC0[24], *hRawNewQTC1[24];
0353488e 328 for(Int_t i=0; i<24; i++){
eadb337a 329 timename ="hRawCFD";
330 ledname = "hRawLED";
331 qtcname = "hRawQTC";
332 qt0name = "hRawQT0_";
333 qt1name = "hRawQT1_";
334 ampname = "hRawLEDminCFD";
335 nhits = "hRawNhits";
336 timename += i+1;
337 ampname += i+1;
338 qtcname += i+1;
339 qt0name += i+1;
340 qt1name += i+1;
341 ledname += i+1;
342 nhits += i+1;
343
344 hRawCFD[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]);
345 // ForbidCloning(hRawCFD[i]); //RS I don't know how histos 1-24 should be processed in MakeRaws, for the moment forbidding the cloning
346 Add2RawsList( hRawCFD[i],i+1, expert, !image, !saveCorr);
347 hRawLED[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]);
348 Add2RawsList( hRawLED[i],i+25, expert, !image, !saveCorr);
349 hRawLEDamp[i] = new TH1F(ampname.Data(), Form("%s;LED-CFD [#channels]; Counts", ampname.Data()),1000,0,1000);
350 Add2RawsList( hRawLEDamp[i],i+49, expert, !image, !saveCorr);
351 hRawQTC[i] = new TH1F(qtcname.Data(), Form("%s;QTC[#channels]; Counts", qtcname.Data()), 2500,0,10000); //fk
352 //QT0
353 Add2RawsList( hRawQTC[i],i+73, expert, !image, !saveCorr);
354 hRawQT0[i] = new TH1F(qt0name.Data(), Form("%s; QT0 [#channels]; Counts", qt0name.Data()),Int_t((high[97+i]-low[97+i])/4),low[97+i],high[97+i]);
355 Add2RawsList( hRawQT0[i],97+i, expert, !image, !saveCorr);
356 //QT1
357 hRawQT1[i] = new TH1F(qt1name.Data(), Form("%s; QT1 [#channels]; Counts", qt1name.Data()),Int_t((high[121+i]-low[121+i])/4),low[121+i],high[121+i]);
358 Add2RawsList( hRawQT1[i],121+i, expert, !image, !saveCorr);
0353488e 359
eadb337a 360 hRawNhits[i] = new TH1F(nhits.Data(), Form("%s;#Hits;Events", nhits.Data()),20, 0, 20);
361 Add2RawsList( hRawNhits[i],176+i, expert, !image, !saveCorr);
362 }
363 // new QTC
364 Int_t ihist=0;
365 for (Int_t i=0; i<12; i++)
366 {
367 hRawNewQT00[i] = new TH1F(Form("hnewRawQT00_C%i",i+1), Form("hRawQTnew00_%i; #channels;Events",i+1),1000, lowqt[ihist], lowqt[ihist]+1000);
368 Add2RawsList(hRawNewQT00[i],1000+ihist, expert, !image, !saveCorr);
369 ihist++;
370 hRawNewQT01[i] = new TH1F(Form("hnewRawQT01_C%i",i+1), Form("hRawQTnew01_%i ;#channels;Events",i+1),1000, lowqt[ihist], lowqt[ihist]+1000);
371 Add2RawsList(hRawNewQT01[i],1000+ihist, expert, !image, !saveCorr);
372 ihist++;
373 hRawNewQT10[i] = new TH1F(Form("hnewRawQT10_C%i",i+1), Form("hRawQTnew10_%i ;#channels;Events",i+1),1000, lowqt[ihist], lowqt[ihist]+1000);
374 Add2RawsList(hRawNewQT10[i],1000+ihist, expert, !image, !saveCorr);
375 ihist++;
376 hRawNewQT11[i] = new TH1F(Form("hnewRawQT11_C%i",i+1), Form("hRawQTnew11_%i ;#channels;Events",i+1),1000, lowqt[ihist], lowqt[ihist]+1000);
377 Add2RawsList(hRawNewQT11[i],1000+ihist, expert, !image, !saveCorr);
378 ihist++;
379 }
380 for (Int_t i=12; i<24; i++)
381 {
382 hRawNewQT00[i] = new TH1F(Form("hnewRawQT00_A%i",i+1), Form("hRawQTnew 00_A %i; #channels;Events",i+1-12),1000, lowqt[ihist], lowqt[ihist]+1000);
383 Add2RawsList(hRawNewQT00[i],1000+ihist, expert, !image, !saveCorr);
384 ihist++;
385 hRawNewQT01[i] = new TH1F(Form("hnewRawQT01_A%i",i+1), Form("hRawQTnew01_A %i ;#channels;Events",i+1-12),1000, lowqt[ihist], lowqt[ihist]+1000);
386 Add2RawsList(hRawNewQT01[i],1000+ihist, expert, !image, !saveCorr);
387 ihist++;
388 hRawNewQT10[i] = new TH1F(Form("hnewRawQT10_A%i",i+1), Form("hRawQTnew10_A %i ;#channels;Events",i+1-12),1000, lowqt[ihist], lowqt[ihist]+1000);
389 Add2RawsList(hRawNewQT10[i],1000+ihist, expert, !image, !saveCorr);
390 ihist++;
391 hRawNewQT11[i] = new TH1F(Form("hnewRawQT11_A%i",i+1), Form("hRawQTnew11_A %i ;#channels;Events",i+1-12),1000, lowqt[ihist], lowqt[ihist]+1000);
392 Add2RawsList(hRawNewQT11[i],1000+ihist, expert, !image, !saveCorr);
393 ihist++;
394 }
395 for (Int_t i=0; i<24; i++)
396 {
397 hRawNewQTC0[i] = new TH1F(Form("hnewRawQTC0_%i",i+1), Form("hRawQTC new 0_%i;#channels;Events",i+1),500, -10, 510);
398 Add2RawsList(hRawNewQTC0[i],1096+i, expert, !image, !saveCorr);
be3ada9f 399
52ee500c 400
eadb337a 401 hRawNewQTC1[i] = new TH1F(Form("hnewRawQTC1_%i",i+1), Form("hRawQTC new 1 %i ;#channels;Events",i+1),500, -10, 510);
402 Add2RawsList(hRawNewQTC1[i],1120+i, expert, !image, !saveCorr);
403
404 }
0353488e 405 TH1F* hRawTrigger = new TH1F("hRawTrigger"," triggers;Trigger ;Counts",6,0,6);
eadb337a 406 for (Int_t itr=0; itr<6; itr++) hRawTrigger->Fill(triggers[itr], 0); // RS Modified to allow cloning (no fNumTriggers member anymore)
0353488e 407 Add2RawsList(hRawTrigger ,169, !expert, image, !saveCorr);
408 TH1F* hRawMean = new TH1F("hRawMean","online timer mean signal, physics event;",Int_t((high[170]-low[170])/4),low[170],high[170]);
409 Add2RawsList( hRawMean,170, expert, !image, !saveCorr);
410
411 TH1F* hRawVertex = new TH1F("hRawVertex","online 0TVX vertex signal; counts",Int_t((high[171]-low[171])/4),low[171],high[171]);
412 Add2RawsList( hRawVertex,171, expert, !image, !saveCorr);//FK
413
414 TH1F* hRawORA = new TH1F("hRawORA","online OR A; counts",Int_t((high[172]-low[172])/4),low[172],high[172]);
415 Add2RawsList( hRawORA,172, expert, !image, !saveCorr);
416 TH1F* hRawORC = new TH1F("hRawORC","online OR C;counts",Int_t(( high[173]-low[173])/4),low[173],high[173]);
417 Add2RawsList( hRawORC,173, expert, !image, !saveCorr);
418 TH1F* hMultCentr = new TH1F("hMultCentr","online trigger Central;counts ",Int_t(( high[174]-low[174])/4),low[174],high[174]);
419 Add2RawsList( hMultCentr,174, expert, !image, !saveCorr);
420 TH1F* hMultSeCentr = new TH1F("hMultSemiCentr","online trigger SemiCentral;counts ",Int_t(( high[175]-low[175])/4),low[175],high[175]);
421 Add2RawsList( hMultSeCentr,175, expert, !image, !saveCorr);
422
423 TH1F* hMultA = new TH1F("hMultA","full mulltiplicity A side;Multiplicity;Entries", Int_t((high[201]-low[201])/4) ,low[201],high[201]);
424 Add2RawsList( hMultA,201, expert, !image, !saveCorr );//FK
425
426 TH1F* hMultAS = new TH1F("hMultASemi","full multiplicity with semi-central trigger A side ;Multiplicity;Entries",
be3ada9f 427 Int_t((high[202]-low[202])/4),low[202],high[202] );
0353488e 428 Add2RawsList( hMultAS, 202, expert, !image, !saveCorr);
429 TH1F* hMultAC = new TH1F("hMultACentr","full multiplicity with central trigger;Multiplicity;Entries",
be3ada9f 430 Int_t((high[203]-low[203])/4),low[203],high[203]);
0353488e 431 Add2RawsList( hMultAC, 203, expert, !image, !saveCorr);
be3ada9f 432
433
434 //side C
0353488e 435 TH1F* hMultC = new TH1F("hMultC","full mulltiplicity C side;Multiplicity;Entries", Int_t(high[204]-low[204]/4) ,low[204],high[204]);
436 Add2RawsList( hMultC,204, expert, !image, !saveCorr );//FK
437 TH1F* hMultCS = new TH1F("hMultCSemi","full multiplicity with semi-central trigger C side;Multiplicity;Entries",
be3ada9f 438 Int_t((high[205]-low[205])/4),low[205],high[205] );
0353488e 439 Add2RawsList( hMultCS,205, expert, !image, !saveCorr);
440 TH1F* hMultCC = new TH1F("hMultCCentr","full multiplicity with central trigger C side;Multiplicity;Entries",
be3ada9f 441 Int_t((high[206]-low[206])/4),low[206],high[206]);
0353488e 442 Add2RawsList( hMultCC,206, expert, !image, !saveCorr);
be3ada9f 443
444
445 //efficiency
0353488e 446 TH1F* hCFDeff= new TH1F("hCFDeff"," CFD efficiency; #PMT; #CFD counts/nEvents",24, 0 ,24);
447 hCFDeff->SetMinimum(0);
448 hCFDeff->SetMaximum(2);
449 hCFDeff->SetMarkerStyle(20);//fk
450 hCFDeff->SetMarkerColor(2);//fk
451 hCFDeff->SetOption("p");//fk
452 Add2RawsList( hCFDeff, 207, expert, image, !saveCorr);//FK
453 TH1F* hEffLED = new TH1F("hEffLED","LED efficiency; #PMT; #LED counts/nEvent",24, 0 ,24);
454 hEffLED ->SetMinimum(0);
455 hEffLED->SetMaximum(2);
456 hEffLED->SetMarkerStyle(28);//fk
457 hEffLED->SetMarkerColor(1);//fk
458 hEffLED->SetOption("p,same");//fk
459 Add2RawsList( hEffLED, 208, expert, !image, !saveCorr);//FK is published attahced to the CFD efficiency
460
461 TH1F* hEffQTC = new TH1F("hEffQTC","QTC efficiency; #PMT; QTC efficiency%s;",24, 0 ,24);
462 hEffQTC->SetMinimum(0);
463 hEffQTC->SetMaximum(2);
464 Add2RawsList( hEffQTC,209, !expert, image, !saveCorr);
52ee500c 465
0353488e 466 TH2F* hCFD = new TH2F("hCFD","CFD ; #PMT; CFD {#channnels}", 24, 0 , 24,Int_t((high[210]-low[210])/4),low[210],high[210]);
467 hCFD->SetOption("COLZ");
468 Add2RawsList( hCFD,210, expert, !image, !saveCorr);//fk
be3ada9f 469
0353488e 470 TH2F* hLED = new TH2F("hLED","LED ; #PMT; LED [#channnels]", 24, 0 , 24,Int_t((high[211]-low[211])/4),low[211],high[211]);
471 hLED->SetOption("COLZ");
472 Add2RawsList( hLED,211, expert, !image, !saveCorr);//fk
a46b18e9 473
0353488e 474 TH2F* hQTC = new TH2F("hQTC","QTC ; #PMT; QTC [#channnels]", 24, 0, 24,Int_t( (high[212]-low[212])/4),low[212],high[212]);
475 hQTC->SetOption("COLZ");
476 Add2RawsList( hQTC,212, expert, !image, !saveCorr);//fk
be3ada9f 477
0353488e 478 TH1F* hNumPMTA= new TH1F("hNumPMTA","number of PMT hitted per event A side",13, 0 ,13);
479 Add2RawsList(hNumPMTA ,213, expert, image, !saveCorr);
be3ada9f 480
0353488e 481 TH1F* hNumPMTC= new TH1F("hNumPMTC","number of PMT hitted per event C side",13, 0 ,13);
482 Add2RawsList(hNumPMTC ,214, expert, image, !saveCorr);
be3ada9f 483
0353488e 484 TH1F* hHitsOrA= new TH1F("hHitsOrA","T0_OR A hit multiplicity",20, 0 ,20);
485 Add2RawsList( hHitsOrA,215, expert, !image, !saveCorr);
be3ada9f 486
0353488e 487 TH1F* hHitsOrC= new TH1F("hHitsOrC","T0_OR C hit multiplicity",20, 0 ,20);
488 Add2RawsList(hHitsOrC ,216, expert, !image, !saveCorr);
be3ada9f 489
490
0353488e 491 TH1F* hOrCminOrA= new TH1F("hOrCminOrA","T0_OR C - T0_OR A [cm]",10000,-5000,5000);
492 Add2RawsList( hOrCminOrA,219, expert, !image, !saveCorr); //FK
703bbd47 493
0353488e 494 TH1F* hOrCminOrATvdcOn= new TH1F("hOrCminOrATvdcOn","T0_OR C - T0_OR A TVDC on [cm]",10000,-5000,5000);
495 Add2RawsList( hOrCminOrATvdcOn,217, expert, !image, !saveCorr);//FK
be3ada9f 496
703bbd47 497
0353488e 498 TH1F* hOrCminOrATvdcOff= new TH1F("hOrCminOrATvdcOff","T0_OR C - T0_OR A TVDC off [cm]",10000,-5000,5000);
499 Add2RawsList( hOrCminOrATvdcOff,218, expert, !image, !saveCorr);//FK
b2acd28d 500
faca085d 501 //satellite & beam background
0353488e 502 TH2F* hBeam = new TH2F("hBeam", "Mean vs Vertex from 1st hit", 120, -30, 30, 120, -30, 30);
503 hBeam->SetOption("COLZ");
504 hBeam->GetXaxis()->SetTitle("(T0C-T0A)/2, ns from 1st"); //vtx
505 hBeam->GetYaxis()->SetTitle("(T0C+T0A)/2, ns"); //time
506 Add2RawsList( hBeam,220, !expert, image, !saveCorr);
507
508 TH2F* hBeamTVDCon = new TH2F("hBeamTVDCon", "Mean vs Vertex TVDC on from 1st hit",50, -5, 5, 50, -5, 5);//FK
509 hBeamTVDCon->SetOption("COLZ");
510 hBeamTVDCon->GetXaxis()->SetTitle("(T0C-T0A)/2, ns from 1st hit");
511 hBeamTVDCon->GetYaxis()->SetTitle("(T0C+T0A)/2, ns");
512 Add2RawsList( hBeamTVDCon,221, expert, image, !saveCorr);
513
514 TH2F* hBeamTVDCoff = new TH2F("hBeamTVDCoff", "Mean vs Vertex TVDC off from 1st hit", 120, -30, 30, 120, -30, 30);
515 hBeamTVDCoff->GetXaxis()->SetTitle("(T0C-T0A)/2, ns from 1st hit");
516 hBeamTVDCoff->GetYaxis()->SetTitle("(T0C+T0A)/2, ns");
517 hBeamTVDCoff->SetOption("COLZ");
518 Add2RawsList( hBeamTVDCoff,222, expert, image, !saveCorr);
519
520 //vertex 1st
521 TH1F* hVertex1stTVDCon = new TH1F("hVertex1stTVDCon", "(T0A-T0C)/2, ps, from 1st hit TVDC on", 200, -2000, 2000); //FK
522 Add2RawsList(hVertex1stTVDCon ,223, !expert, image, !saveCorr);
523 TH1F* hVertex1stTVDCoff = new TH1F("hVertex1stTVDCoff", "(T0A-T0C)/2, ps, from 1st hit TVDC off", 500, -2000, 2000);//FK
524 Add2RawsList( hVertex1stTVDCoff,225, !expert, image, !saveCorr);
525 TH1F* hMean1stTVDCon = new TH1F("hMean1stTVDCon", "(T0A+T0C)/2, ps, from 1st hit TVDC on", 200, -2000, 2000);//FK
526 Add2RawsList( hMean1stTVDCon, 226, !expert, image, !saveCorr);
527 TH1F* hMean1stTVDCoff = new TH1F("hMean1stTVDCoff", "(T0A+T0C)/2, ps, from 1st hit TVDC off", 200, -2000, 2000);//FK
528 Add2RawsList( hMean1stTVDCoff, 227, !expert, image, !saveCorr);
529
530
531 //FK histograms start from 230
532 TH1F* hRawVertexMinMean = new TH1F("hRawVertexMinMean","online 0TVX vertex signal minus mean; counts",200,-1000,1000);
533 Add2RawsList(hRawVertexMinMean,230, expert, image, !saveCorr);//FK
534
535 TH1F* hCFDSubtrMean = new TH1F("hCFDSubtrMean","CFD minus mean; #PMT; CFD - mean {#channnels}", 24, 0, 24);
536 hCFDSubtrMean->SetMarkerStyle(20);
537 hCFDSubtrMean->SetOption("p");
538 Add2RawsList( hCFDSubtrMean,231, !expert, image, !saveCorr);//fk filled in Checker
539
540 TH1F* hLEDSubtrMean = new TH1F("hLEDSubtrMean","LED minus mean; #PMT; LED - mean [#channnels]", 24, 0, 24);
541 hLEDSubtrMean->SetMarkerStyle(20);
542 hLEDSubtrMean->SetOption("p");
543 Add2RawsList( hLEDSubtrMean,232, expert, image, !saveCorr);//fk filled in Checker
544
545 TH1F* hQTCSubtrMean = new TH1F("hQTCSubtrMean","QTC minus mean; #PMT; QTC - mean [#channnels]", 24, 0, 24);
546 hQTCSubtrMean->SetMarkerStyle(20);
547 hQTCSubtrMean->SetOption("p");
548 Add2RawsList( hQTCSubtrMean,233, expert, image, !saveCorr);//fk filled in Checker
549
550 TH2F* hDiffOrCVersusDiffOrATvdcOn= new TH2F("hDiffOrCVersusDiffOrATvdcOn","ORC-meanORC versus ORA-meanORA (TVDC on)",50,-200,200,50,-200,200);
551 hDiffOrCVersusDiffOrATvdcOn->SetOption("COLZ");
552 hDiffOrCVersusDiffOrATvdcOn->GetXaxis()->SetTitle("ORA - mean ORA [channel]");
553 hDiffOrCVersusDiffOrATvdcOn->GetYaxis()->SetTitle("ORC - mean ORC [channel]");
554 Add2RawsList(hDiffOrCVersusDiffOrATvdcOn, 234, expert, image, !saveCorr);//FK
555
556 TH2F* hDiffOrCVersusDiffOrATvdcOff= new TH2F("hDiffOrCVersusDiffOrATvdcOff","ORC-meanORC vetsus ORA-meanORA (TVDC off)",50,-200,200,50,-200,200);
557 hDiffOrCVersusDiffOrATvdcOff->SetOption("COLZ");
558 hDiffOrCVersusDiffOrATvdcOff->GetXaxis()->SetTitle("ORA - mean ORA [channel]");
559 hDiffOrCVersusDiffOrATvdcOff->GetYaxis()->SetTitle("ORC - mean ORC [channel]");
560 Add2RawsList(hDiffOrCVersusDiffOrATvdcOff, 235, expert, image, !saveCorr);//FK
561
562 TH2F* hBCID = new TH2F("hBCID", "header BCID vs TRM BC ID ", 500, 0, 5000, 500, 0, 5000);
563 hBCID->SetOption("COLZ");
564 hBCID->GetXaxis()->SetTitle("TRM BC ID");
565 hBCID->GetYaxis()->SetTitle("event header BC ID");
566 Add2RawsList(hBCID ,236, !expert, image, !saveCorr);
567
568 //CFD and LED efficiency in range ~2000- ~3000
569 TH1F* hCFDeffSubRange = new TH1F("hCFDeffSubRange"," CFD eff in subrange; #PMT; #CFD counts/nEvents",24, 0 ,24);
570 Add2RawsList( hCFDeffSubRange, 237, expert, !image, !saveCorr);//FK
571
572
573 TH1F* hEffLEDSubRange = new TH1F("hEffLEDSubRange","LED eff in subrange; #PMT; #LED counts/nEvent",24, 0 ,24);
574 Add2RawsList( hEffLEDSubRange,238, expert, !image, !saveCorr);//FK
575 // ratio CDF eff /LEF eff in subragne
576 TH1F* hRatioCFDLEDeff = new TH1F("hRatioCFDLEDeff","Ratio CFD/LED eff in subrange; #PMT; ratio CDF/LED eff",24, 0 ,24);
577 hRatioCFDLEDeff->SetMinimum(0);
578 hRatioCFDLEDeff->SetMaximum(2);
579 Add2RawsList( hRatioCFDLEDeff, 239, !expert, image, !saveCorr);//FK
580
581 TH1F* hEventCounter = new TH1F("hEventCounter","Event counter for eff histos; X; number of events",1, 0 ,1);
582 Add2RawsList( hEventCounter, 240, expert, !image, !saveCorr);//FK
583
584 //counters
585 TH1F* hRawTriggerCounter = new TH1F("hRawTriggerCounter"," triggers;Trigger ;Counts",6,0,6);
586 for (Int_t itr=0; itr<6; itr++) hRawTriggerCounter->Fill(triggers[itr], 0);
587 Add2RawsList(hRawTriggerCounter ,241, expert, !image, !saveCorr);
588
589 TH1F* hCFDCounter= new TH1F("hCFDCounter"," CFD counter #PMT; #CFD counts",24, 0 ,24);
590 Add2RawsList( hCFDCounter, 242, expert, !image, !saveCorr);//FK
591 TH1F* hLEDCounter = new TH1F("hLEDCounter","LED counter; #PMT; #LED counts",24, 0 ,24);
592 Add2RawsList( hLEDCounter, 243, expert, !image, !saveCorr);//FK
593
594 TH1F* hCFDeffSubRangeCounter = new TH1F("hCFDeffSubRangeCounter"," CFD eff in subrange counter; #PMT; #CFD counts",24, 0 ,24);
595 Add2RawsList( hCFDeffSubRangeCounter, 244, expert, !image, !saveCorr);//FK
596 TH1F* hEffLEDSubRangeCounter = new TH1F("hEffLEDSubRangeCounter","LED eff in subrange counter; #PMT; #LED counts",24, 0 ,24);
597 Add2RawsList( hEffLEDSubRangeCounter,245, expert, !image, !saveCorr);//FK
598
599 TH1F* hQTCCounter = new TH1F("hQTCCounter","QTC counter; #PMT; QTC counts;",24, 0 ,24);
600 Add2RawsList( hQTCCounter,246, expert, !image, !saveCorr);
601
602 ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line
44ed7a66 603}
be3ada9f 604
44ed7a66 605//____________________________________________________________________________
606void AliT0QADataMakerRec::InitDigits()
607{
608 // create Digits histograms in Digits subdir
609 const Bool_t expert = kTRUE ;
610 const Bool_t image = kTRUE ;
611
f628b9d2 612 TH2F * fhDigCFD = new TH2F("fhDigCFD", " CFD digits; #PMT; CFD digits[#channels]",25,-0.5,24.5,100,0,1000);
eca4fa66 613 fhDigCFD->SetOption("COLZ");
f628b9d2 614 Add2DigitsList( fhDigCFD,0, !expert, image);
615 TH2F *fhDigLEDamp = new TH2F("fhDigLEDamp", " LED-CFD digits; #PMT; LED-CFD amplitude ",25,-0.5,24.5,100,100,1000);
eca4fa66 616 fhDigLEDamp->SetOption("COLZ");
394c1a6d 617 Add2DigitsList( fhDigLEDamp,1, !expert, !image);
f628b9d2 618 TH2F * fhDigQTC = new TH2F("fhDigQTC", " QTC digits; #PMT; QTC amplitude",25,-0.5,24.5,100,100,10000);
eca4fa66 619 fhDigQTC->SetOption("COLZ");
b2acd28d 620 Add2DigitsList( fhDigQTC,2, !expert, !image);
92664bc8 621 //
622 ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line
b2acd28d 623}
04236e67 624
625//____________________________________________________________________________
626
627void AliT0QADataMakerRec::InitRecPoints()
628{
629 // create cluster histograms in RecPoint subdir
7d297381 630 const Bool_t expert = kTRUE ;
631 const Bool_t image = kTRUE ;
1d7681da 632
703bbd47 633 TH2F* fhRecCFD = new TH2F("hRecCFD"," CFD time;#PMT; CFD Time [ns];",24, 0 ,24,
b9024d69 634 100,-50,50);
eca4fa66 635 fhRecCFD->SetOption("COLZ");
7d297381 636 Add2RecPointsList ( fhRecCFD,0, !expert, image);
b9024d69 637
703bbd47 638 TH2F* fhRecAmpDiff = new TH2F("hRecAmpDiff"," LED-CFD min QTC amplitude;#PMT; difference [MIPs];",
b9024d69 639 24, 0 ,24, 200,-10,10);
eca4fa66 640 fhRecAmpDiff->SetOption("COLZ");
7d297381 641 Add2RecPointsList (fhRecAmpDiff, 1, !expert, image);
04236e67 642
f628b9d2 643 TH1F *fhMean = new TH1F("hMean","online - rec mean;online - rec mean[#channels];",2000, -1000, 1000);
7d297381 644 Add2RecPointsList ( fhMean,2, !expert, image);
92664bc8 645 //
646 ClonePerTrigClass(AliQAv1::kRECPOINTS); // this should be the last line
eca4fa66 647}
04236e67 648
649//____________________________________________________________________________
650void AliT0QADataMakerRec::InitESDs()
651{
652 //create ESDs histograms in ESDs subdir
7d297381 653 const Bool_t expert = kTRUE ;
654 const Bool_t image = kTRUE ;
655
be3ada9f 656 TH1F *fhESDMean = new TH1F("hESDmean"," ESD mean; mean time[%channels]",1000, -5, 5);
a581ca38 657 Add2ESDsList(fhESDMean, 0, expert, !image) ;
f628b9d2 658 TH1F * fhESDVertex = new TH1F("hESDvertex","ESDvertex; vertex[cm];",82,-30,30);
a581ca38 659 Add2ESDsList(fhESDVertex, 1, expert, !image) ;
c724dd64 660
be3ada9f 661 TH1F * fhESDResolution = new TH1F("hESDResolution","(T0A-T0C)/2 corrected by SPD vertex; ns",800,-2,2);
a581ca38 662 Add2ESDsList(fhESDResolution, 2, !expert, image) ;
92664bc8 663 //
664 ClonePerTrigClass(AliQAv1::kESDS); // this should be the last line
04236e67 665}
666
667//____________________________________________________________________________
668void AliT0QADataMakerRec::MakeRaws( AliRawReader* rawReader)
669{
0353488e 670 //indices in lookup table lookUpTable_tanay.txt
671 enum { kTZeroRefPoint=0, kTZeroFirstCfdC=1, kTZeroFirstLedC=13, kTZeroFirstQT0C=25,kTZeroFirstQT1C=26,
672 kTZeroVertex=50, kTZeroOrA=51, kTZeroOrC=52, kT0multAQ0=53, kT0multAQ1=54, kTZeroMultCent=55, kTZeroMultSemi=56,
673 kTZeroFirstCfdA=57, kTZeroFirstLedA=69, kTZeroFirstQT0A=81,kTZeroFirstQT1A=82,
674 kT0multCQ0=105, kT0multCQ1=106
675 };
676
02d51eff 677 Int_t time[24] ;
678 for(Int_t i=0; i<24; i++) time[i] = 0;
332b9234 679 rawReader->Reset() ;
04236e67 680 //fills QA histos for RAW
0353488e 681 //Int_t shift=0;
45c5ba2d 682 // Int_t refPointParam = GetRecoParam()->GetRefPoint();
332b9234 683 Int_t refpoint = 0;
45c5ba2d 684 Int_t refPointParam = 0;
52ee500c 685
86c020af 686 AliT0RawReader *start = new AliT0RawReader(rawReader);
332b9234 687
f542cc56 688 if (! start->Next()) {
5379c4a3 689 AliDebug(AliQAv1::GetQADebugLevel(),Form(" no raw data found!!"));
f542cc56 690 delete start;
691 return;
692 }
693 UInt_t type =rawReader->GetType();
694 if (GetEventSpecie()==AliRecoParam::kCalib && type!=8) {
52ee500c 695 delete start;
f542cc56 696 return;
697 }
698 //
699 // RS: Don't use custom counters, they create problems with trigger cloning
700 // Use instead framework counters, incremented in the end of this routine
701 // RS: There is some inconsistency here: the separation of physics and calib. events/histos is done by
702 // fEventSpecie. Why do we book separate histos on different slots for calib and physics ?
703 // I am changing this in such way that we don't need local counters like fNumTriggers (the corresponding
704 // histos now incremented in the MakeRaws, and for the normalization I will use the framework's counters
705 // AliQADataMaker::GetEvCountCycle(...), AliQADataMaker::GetEvCountTotal(...)
706 //
707 // I think the histos xx+250 should be suppressed (the xx calib histos of specie==calibration will be
708 // used automatically)
be3ada9f 709
52ee500c 710 //
f542cc56 711 //BC ID
52ee500c 712 // if (type == 7){
713 UInt_t bcid = rawReader->GetBCID();
714 UInt_t trmbcid = start->GetTRMBunchID();
0353488e 715
716 FillRawsData(236,trmbcid, bcid);
717 //FillRawsData(236,100, bcid); fake error for testing
718
719 // }
f542cc56 720 // if (type == 7){ shift=1; fnEventPhys++;}
eadb337a 721 Int_t allData[220][5];
722 for(Int_t i0=0; i0<220; i0++){
0353488e 723 for(Int_t j0=0; j0<5; j0++){
724 allData[i0][j0]=0;
725 }
726 }
727
eadb337a 728 for(Int_t i=0; i<=202; i++){
0353488e 729 for(Int_t iHit=0; iHit<5; iHit++){
f542cc56 730 allData[i][iHit]= start->GetData(i,iHit);
0353488e 731 }
732 }
733
734 if( allData[kTZeroRefPoint][0] > 0 /*&& (type == 7)*/){
735 FillRawsData(0, allData[kTZeroRefPoint][0]); //Reference point
736 }
f542cc56 737 refpoint = allData[refPointParam][0];
0353488e 738 if(refPointParam < 0 ) refpoint=0;
739 if(refPointParam == 0 ) refpoint = allData[kTZeroRefPoint][0] - 5000;
52ee500c 740
0353488e 741 Int_t offsetCDF, offsetLED, offsetQT0, offsetQT1;
f542cc56 742 Int_t numPmtC=0;
0353488e 743 Int_t numPmtA=0;
744
745 for(Int_t ik = 0; ik<24; ik++){
746 Int_t ipmt = ik; //C side
f542cc56 747 if(ik<12) {
0353488e 748 offsetCDF = kTZeroFirstCfdC;
749 offsetLED = kTZeroFirstLedC;
750 offsetQT0 = kTZeroFirstQT0C;
751 offsetQT1 = kTZeroFirstQT1C;
752 if(allData[ipmt+offsetCDF][0]>0 /*&& type == 7 */ ) numPmtC++;
753 }else{
754 ipmt = ik - 12; //A side
755 offsetCDF = kTZeroFirstCfdA;
756 offsetLED = kTZeroFirstLedA;
757 offsetQT0 = kTZeroFirstQT0A;
758 offsetQT1 = kTZeroFirstQT1A;
759 if(allData[ipmt + offsetCDF][0]>0 /*&& type == 7 */) numPmtA++;
f542cc56 760 }
0353488e 761 Int_t nhitsPMT=0; //count hits for this pmt
762
f542cc56 763 for (Int_t iHt=0; iHt<5; iHt++) {
764 //cfd
0353488e 765 if(allData[ipmt+offsetCDF][iHt]>0){
766 FillRawsData(ik+1, allData[ipmt+offsetCDF][iHt]); //CFD for each PMT
767 FillRawsData(210, ik, allData[ipmt+offsetCDF][iHt]); //CFD vs PMT
768 FillRawsData(242,ik,1.); // CFD counter for efficiency
769 if( fCFDEffSubRangeLowParam<allData[ipmt+offsetCDF][iHt] && allData[ipmt+offsetCDF][iHt]<fCFDEffSubRangeHighParam){
770 FillRawsData(244,ik,1.); //count CDF entries in given subrange for CDF/LED eff ratio
771 }
772 AliDebug(50,Form("%i CFD %i data %s",ik, ipmt+offsetCDF, GetRawsData(ik+1)->GetName()));
52ee500c 773 nhitsPMT++;
f542cc56 774 }
775 //led
0353488e 776 if(allData[ipmt+offsetLED][iHt] > 0){
777 FillRawsData(ik+25,allData[ipmt+offsetLED][iHt]);
778 FillRawsData(211,ik, allData[ipmt+offsetLED][iHt]);
779 FillRawsData(243,ik,1.); //LED counter for LED efficiency
780 if(fLEDEffSubRangeLowParam < allData[ipmt+offsetLED][iHt] && allData[ipmt+offsetLED][iHt]<fLEDEffSubRangeHighParam){
781 FillRawsData(245,ik,1.); //count LED entries in given subrange for CDF/LED eff ratio
782 }
783 AliDebug(50,Form("%i LED %i data %s",ik, ipmt+offsetLED, GetRawsData(ik+25)->GetName()));
f542cc56 784 }
0353488e 785
f542cc56 786 //led -cfd
0353488e 787 if(allData[ipmt+offsetLED][iHt] > 0 && allData[ipmt+offsetCDF][iHt] > 0 )
788 FillRawsData(ik+49, allData[ipmt+offsetLED][iHt]-allData[ipmt+offsetCDF][iHt]);
52ee500c 789
f542cc56 790 //qtc
0353488e 791 if(allData[2*ipmt+offsetQT0][iHt] > 0 &&
792 allData[2*ipmt+offsetQT1][iHt] > 0 ) {
793
794 FillRawsData(ik+73, allData[2*ipmt+offsetQT0][iHt]-allData[2*ipmt+offsetQT1][iHt]); //QTC = QT0 - QT1 for each channel
795 FillRawsData(212,ik, allData[2*ipmt+offsetQT0][iHt]-allData[2*ipmt+offsetQT1][iHt]); //QTC vs pmt
52ee500c 796
0353488e 797 FillRawsData(246,ik,1.); // QTC counter for QTC efficiency
52ee500c 798
0353488e 799 AliDebug(50,Form("%i QTC %i data %s",ik, 2*ipmt+offsetQT0, GetRawsData(ik+73)->GetName()));
52ee500c 800
f542cc56 801 }
0353488e 802 if(allData[2*ipmt+offsetQT0][iHt] > 0) { //QT0
803 AliDebug(50,Form("%i QT0 %i data %s",ik, 2*ipmt+offsetQT0, GetRawsData(ik+97)->GetName()));
804 FillRawsData(ik+97,allData[2*ipmt+offsetQT0][iHt]);
f542cc56 805 }
0353488e 806 if(allData[2*ipmt+offsetQT1][iHt] > 0) {//QT1
807 AliDebug(50,Form("%i QT1 %i data %s",ik, 2*ipmt+offsetQT1, GetRawsData(ik+121)->GetName()));
808 FillRawsData(ik+121,allData[2*ipmt+offsetQT1][iHt]);
92664bc8 809 }
f542cc56 810 }
92664bc8 811
0353488e 812 FillRawsData(ik+176, nhitsPMT);
813 }
814 FillRawsData(213, numPmtA);
815 FillRawsData(214, numPmtC);
816
817
818 Int_t trChannel[6] = {kTZeroRefPoint, kTZeroVertex, kTZeroOrA, kTZeroOrC, kTZeroMultCent, kTZeroMultSemi};
f542cc56 819 Float_t ch2cm = 24.4*0.029979;
820 Int_t nhitsOrA=0;
821 Int_t nhitsOrC=0;
0353488e 822
f542cc56 823 for (Int_t iHt=0; iHt<5; iHt++) {
f542cc56 824 //orA-orC phys tvdc 1
0353488e 825 if((allData[kTZeroOrA][iHt]>0 && allData[kTZeroOrC][iHt]>0) && allData[kTZeroVertex][iHt]>0) {
826 AliDebug(10,Form("orA-orC phys tvdc 1 %i data %s", 217, GetRawsData(217)->GetName()));
52ee500c 827
0353488e 828 FillRawsData(217,(allData[kTZeroOrC][iHt] - allData[kTZeroOrA][iHt])*ch2cm);
f542cc56 829 }
830 //orA-orC phys tvdc 0
0353488e 831 if((allData[kTZeroOrA][iHt]>0 && allData[kTZeroOrC][iHt]>0) && allData[kTZeroVertex][iHt]<=0) {
832 AliDebug(10,Form("orA-orC phys tvdc 0 %i data %s", 218, GetRawsData(218)->GetName()));
92664bc8 833
0353488e 834 FillRawsData(218,(allData[kTZeroOrC][iHt] - allData[kTZeroOrA][iHt])*ch2cm);
f542cc56 835 }
0353488e 836 if(allData[kTZeroOrA][iHt]>0 && allData[kTZeroOrC][iHt]>0) {
837 AliDebug(50,Form("orA-orC phys tvdc all %i data %s", 219, GetRawsData(219)->GetName()));
838 FillRawsData(219,(allData[kTZeroOrC][iHt] - allData[kTZeroOrA][iHt])*ch2cm);
f542cc56 839 }
0353488e 840
841
842 for (Int_t itr=0; itr<6; itr++) {//T0_MEAN,TO_VERTX,ORA,ORC,T0_mult,T0_mult
f542cc56 843 if (allData[trChannel[itr]][iHt] >0) {
844 //
845 // RS instead of incremented custom counters, fill directly the specie-specific histos
52ee500c 846 // FillRawsData(169+shift, 0.5+itr, 1.); // RS: increment counters
0353488e 847 // FillRawsData(169+shift, itr, 1.); //hRawTrigger RS: increment counters
848 FillRawsData(241, itr, 1.); // fill trigger counter
849 AliDebug(50,Form(" triggers %i data %s", 170+itr, GetRawsData(170+itr)->GetName()));
52ee500c 850
0353488e 851 FillRawsData(170+itr,allData[trChannel[itr]][iHt]);
852
853 if( trChannel[itr] == kTZeroVertex){ //T0_VERTEX minus mean from config files
854 FillRawsData(230, allData[kTZeroVertex][iHt] - fMeanRawVertexParam );
855 }
856 }
857 }
858
859 if(allData[kTZeroOrA][iHt] > 0 && allData[kTZeroOrC][iHt] > 0 ){ //FK// ORC-mean ORA -mean
860 Float_t diffORA = allData[kTZeroOrA][iHt] - fMeanORAParam;
861 Float_t diffORC = allData[kTZeroOrC][iHt] - fMeanORCParam;
862 if(allData[kTZeroVertex][iHt]>0){ //TVDC on
863 FillRawsData(234, diffORA, diffORC);
864 //Estimate mean orA and orC based on these
eadb337a 865
0353488e 866 }else{//TVDC off
867 FillRawsData(235, diffORA, diffORC);
be3ada9f 868 }
f542cc56 869 }
52ee500c 870
0353488e 871 /* if(type == 7) */if(allData[kTZeroOrA][iHt] >0){
872 nhitsOrA++;
873 }
874 /* if(type == 7) */if(allData[kTZeroOrC][iHt] >0){
875 nhitsOrC++;
876 }
f542cc56 877 //mult trigger signals phys
0353488e 878 //A side
879 if(allData[kT0multAQ0][iHt]>0 && allData[kT0multAQ1][iHt]>0) {
880 AliDebug(50,Form(" mpdA %i data %s", 201, GetRawsData(201)->GetName()));
52ee500c 881
0353488e 882 FillRawsData(201,allData[kT0multAQ0][iHt]-allData[kT0multAQ1][iHt]);
883 if(allData[kTZeroMultSemi][iHt]>0) FillRawsData(202,allData[kT0multAQ0][iHt]-allData[kT0multAQ1][iHt]);
884 if(allData[kTZeroMultCent][iHt]>0) FillRawsData(203,allData[kT0multAQ0][iHt]-allData[kT0multAQ1][iHt]);
f542cc56 885 }
52ee500c 886
0353488e 887 //C side
888 if(allData[kT0multCQ0][iHt]>0 && allData[kT0multCQ1][iHt]>0) {
889 AliDebug(50,Form(" mpdC %i data %s", 204, GetRawsData(204)->GetName()));
92664bc8 890
0353488e 891 FillRawsData(204,allData[kT0multCQ0][iHt]-allData[kT0multCQ1][iHt]);
892 if(allData[kTZeroMultSemi][iHt]>0) FillRawsData(205,allData[kT0multCQ0][iHt]-allData[kT0multCQ1][iHt]);
893 if(allData[kTZeroMultCent][iHt]>0) FillRawsData(206,allData[kT0multCQ0][iHt]-allData[kT0multCQ1][iHt]);
92664bc8 894 }
f542cc56 895 }
92664bc8 896
f542cc56 897 FillRawsData(215,nhitsOrA);
898 FillRawsData(216,nhitsOrC);
eadb337a 899
900 // new QTC
901 for(Int_t iHt = 0; iHt<5; iHt++) {
902 for(Int_t ik = 0; ik<96; ik++)
903 {
904 FillRawsData(ik+1000, allData[107+ik][iHt]);
905 Int_t pmt= ik/4;
906 FillRawsData(pmt+1096, allData[107+pmt*4][iHt] - allData[107+pmt*4+1][iHt]);
907 FillRawsData(pmt+371, allData[107+pmt*4+2][iHt] - allData[107+pmt*4+3][iHt]);
908 }
909 }
910
f542cc56 911 //draw satellite
912 for (int itr=-1;itr<GetNEventTrigClasses();itr++) { //RS loop over all active trigger classes, including the global one
d5008ebd 913 int itrID = itr==-1 ? -1 : int( GetEventTrigClass(itr)->GetUniqueID());
0353488e 914
915 TH2 *hBeam = (TH2*)GetRawsData(220,itrID);
916 TH2 *hBeamTVDCon = (TH2*)GetRawsData(221,itrID);
917 TH2 *hBeamTVDCoff = (TH2*)GetRawsData(222,itrID);
918 TH1 *hVertex1stTVDCon = (TH1*)GetRawsData(223,itrID);
919 TH1 *hVertex1stTVDCoff = (TH1*)GetRawsData(225,itrID);
920 TH1 *hMean1stTVDCon = (TH1*)GetRawsData(226,itrID);
921 TH1 *hMean1stTVDCoff = (TH1*)GetRawsData(227,itrID);
922 if(hBeam || hBeamTVDCon || hBeamTVDCoff || hVertex1stTVDCon || hVertex1stTVDCoff || hMean1stTVDCon || hMean1stTVDCoff){
923
b9dd81a7 924 Int_t time1stA=9999999;
925 Int_t time1stC=9999999;
0353488e 926 for(Int_t ipmt=0; ipmt<12; ipmt++){
927 if(allData[ipmt+kTZeroFirstCfdC][0] > 1 ) {
928 time[ipmt] = allData[ipmt+kTZeroFirstCfdC][0] - (Int_t) fMeanCFDFromGoodRunParam[ipmt]; //fk
b9dd81a7 929 if(time[ipmt] < time1stC) time1stC=time[ipmt]; //timeC
f542cc56 930 }
52ee500c 931 }
0353488e 932 for( Int_t ipmt=12; ipmt<24; ipmt++){
933 if(allData[ipmt-12+kTZeroFirstCfdA][0] > 0) {
934 time[ipmt] = allData[ipmt-12+kTZeroFirstCfdA][0] - (Int_t) fMeanCFDFromGoodRunParam[ipmt];//fk
b9dd81a7 935 if(time[ipmt] < time1stA) time1stA=time[ipmt]; //timeC
f542cc56 936 }
52ee500c 937 }
0353488e 938 if(time1stA<99999 && time1stC< 99999) { //From First
939 Float_t t01st = 24.4 * (Float_t) (( time1stA + time1stC)/2.0);
940 Float_t ver1st = 24.4 * (Float_t) (( time1stC - time1stA)/2.0);
941 if(hBeam) hBeam->Fill(0.001*ver1st, 0.001*(t01st)); //Mean versus vertex
942 if(allData[kTZeroVertex][0] > 0){//TVDC on
943 if(hBeamTVDCon) hBeamTVDCon->Fill(0.001*ver1st, 0.001*(t01st));//Mean versus TVDC on from first
944 if(hVertex1stTVDCon) hVertex1stTVDCon->Fill(ver1st);
945 //if(hVertex1stTVDCon) hVertex1stTVDCon->Fill(1500);//for testing AM
946
947 if(hMean1stTVDCon) hMean1stTVDCon->Fill(t01st);
948 // if(hMean1stTVDCon) hMean1stTVDCon->Fill(1800);//testing AM
949 }else{//TVDC off
950 if(hBeamTVDCoff) hBeamTVDCoff->Fill(0.001*ver1st, 0.001*(t01st));//FK// TVDC off from first
951 if(hVertex1stTVDCoff) hVertex1stTVDCoff->Fill(ver1st);
952 if(hMean1stTVDCoff) hMean1stTVDCoff->Fill(t01st);
953 }
52ee500c 954 }
0353488e 955 } //
f542cc56 956 } // RS loop over all active trigger classes, including the global one
52ee500c 957 //
958 IncEvCountCycleRaws();
959 IncEvCountTotalRaws();
960 //
5435cbd2 961 delete start;
332b9234 962}
52ee500c 963
44ed7a66 964//____________________________________________________________________________
965void AliT0QADataMakerRec::MakeDigits( TTree *digitsTree)
966{
967 //fills QA histos for Digits
eca4fa66 968
44ed7a66 969 TArrayI *digCFD = new TArrayI(24);
970 TArrayI *digLED = new TArrayI(24);
971 TArrayI *digQT0 = new TArrayI(24);
972 TArrayI *digQT1 = new TArrayI(24);
973 Int_t refpoint=0;
974
975 TBranch *brDigits=digitsTree->GetBranch("T0");
976 AliT0digit *fDigits = new AliT0digit() ;
977 if (brDigits) {
978 brDigits->SetAddress(&fDigits);
979 }else{
980 AliError(Form("EXEC Branch T0 digits not found"));
92664bc8 981 delete digCFD;
982 delete digLED;
983 delete digQT0;
984 delete digQT1;
44ed7a66 985 return;
986 }
987 digitsTree->GetEvent(0);
988 digitsTree->GetEntry(0);
989 brDigits->GetEntry(0);
990 fDigits->GetTimeCFD(*digCFD);
991 fDigits->GetTimeLED(*digLED);
992 fDigits->GetQT0(*digQT0);
993 fDigits->GetQT1(*digQT1);
994 refpoint = fDigits->RefPoint();
92664bc8 995 for (Int_t i=0; i<24; i++) {
44ed7a66 996 if (digCFD->At(i)>0) {
997 Int_t cfd=digCFD->At(i)- refpoint;
92664bc8 998 FillDigitsData(0,i,cfd);
999 FillDigitsData(1,i, (digLED->At(i) - digCFD->At(i)));
1000 FillDigitsData(2,i, (digQT1->At(i) - digQT0->At(i)));
44ed7a66 1001 }
92664bc8 1002 }
44ed7a66 1003
1004 delete digCFD;
1005 delete digLED;
1006 delete digQT0;
1007 delete digQT1;
92664bc8 1008 //
1009 IncEvCountCycleDigits();
5435cbd2 1010 IncEvCountTotalDigits();
1011 delete fDigits;
92664bc8 1012 //
44ed7a66 1013}
1014
04236e67 1015//____________________________________________________________________________
1016void AliT0QADataMakerRec::MakeRecPoints(TTree * clustersTree)
1017{
1018 //fills QA histos for clusters
1019
446d6ec4 1020 AliT0RecPoint* frecpoints= new AliT0RecPoint ();
f628b9d2 1021 if (!frecpoints) {
394c1a6d 1022 AliError(":MakeRecPoints >> no recpoints found");
04236e67 1023 return;
1024 }
1025 TBranch *brRec =clustersTree ->GetBranch("T0");
1026 if (brRec) {
1027 brRec->SetAddress(&frecpoints);
1028 }else{
f628b9d2 1029 AliError(Form("EXEC Branch T0 rec not found "));
1030 return;
04236e67 1031 }
eca4fa66 1032
04236e67 1033 brRec->GetEntry(0);
f628b9d2 1034
04236e67 1035 for ( Int_t i=0; i<24; i++) {
1d7681da 1036 if(i<12)
92664bc8 1037 FillRecPointsData(0, i, frecpoints -> GetTime(i) - frecpoints -> GetTime(0));
1d7681da 1038 if(i>11)
92664bc8 1039 FillRecPointsData(0, i, frecpoints -> GetTime(i) - frecpoints -> GetTime(12));
1040 FillRecPointsData(1, i, frecpoints -> GetAmp(i) - frecpoints->AmpLED(i));
04236e67 1041 }
b9024d69 1042 Double_t mmm=frecpoints->GetOnlineMean()- frecpoints->GetMeanTime();
92664bc8 1043 FillRecPointsData(2,mmm);
1044 //
1045 IncEvCountCycleRecPoints();
1046 IncEvCountTotalRecPoints();
1047 //
5435cbd2 1048 delete frecpoints;
04236e67 1049}
1050
1051//____________________________________________________________________________
1052void AliT0QADataMakerRec::MakeESDs(AliESDEvent * esd)
1053{
1054 //fills QA histos for ESD
f628b9d2 1055
a581ca38 1056 const Double32_t *mean;
1057 mean = esd->GetT0TOF();
1058 Double32_t t0time= 0.001*mean[0];
1059 Double32_t orA= 0.001*mean[1];
1060 Double32_t orC=0.001* mean[2];
1061
92664bc8 1062 if (t0time<99) FillESDsData(0,t0time);
1063 if( esd->GetT0zVertex() <99) FillESDsData(1, esd->GetT0zVertex());
1064 if( orA<99 && orC<99) FillESDsData(2,(orA-orC)/2.);
1065 //
1066 IncEvCountCycleESDs();
1067 IncEvCountTotalESDs();
1068 //
04236e67 1069}
02d51eff 1070//____________________________________________________________________________
345c3cf8 1071//____________________________________________________________________________
1072void AliT0QADataMakerRec::ResetDetector(AliQAv1::TASKINDEX_t task)
1073{
1074
1075 //reset the detector histograms for a given task
1076 AliQADataMakerRec::ResetDetector(task);
0353488e 1077
1078 for(int ih=0; ih<=250; ih++){
1079 for(int itr=-1; itr < GetNEventTrigClasses(); itr++){
1080 int itrID = itr==-1 ? -1 : int( GetEventTrigClass(itr)->GetUniqueID());
1081
1082 TH1 *htmp = (TH1*) GetRawsData(ih,itrID);
1083 if(htmp) htmp->Reset();
1084 }
1085 }
345c3cf8 1086}
1087
02d51eff 1088
1089/*
1090void AliT0QADataMakerRec::GetMeanAndSigma(TH1F* hist, Float_t &mean, Float_t &sigma)
1091{
1092
1093 const double window = 3.; //fit window
1094
1095 double meanEstimate, sigmaEstimate;
1096 int maxBin;
1097 maxBin = hist->GetMaximumBin(); //position of maximum
1098 meanEstimate = hist->GetBinCenter( maxBin); // mean of gaussian sitting in maximum
1099 sigmaEstimate = hist->GetRMS();
1100 TF1* fit= new TF1("fit","gaus", meanEstimate - window*sigmaEstimate, meanEstimate + window*sigmaEstimate);
1101 fit->SetParameters(hist->GetBinContent(maxBin), meanEstimate, sigmaEstimate);
1102 hist->Fit("fit","RQ","Q");
1103
1104 mean = (Float_t) fit->GetParameter(1);
1105 sigma = (Float_t) fit->GetParameter(2);
1106
1107 delete fit;
1108}
1109*/
0353488e 1110
1111void AliT0QADataMakerRec::SetEfficiency(Int_t idxEffHisto, Int_t idxCounterHisto, Int_t trigger, Float_t totNumOfEvts){
1112 //calculate efficiency = counts/number of events
1113 TH1* heff = GetRawsData(idxEffHisto,trigger);
1114 TH1* hcounter = GetRawsData(idxCounterHisto,trigger);
1115 if(heff && hcounter && (totNumOfEvts>0.0)){
1116 int nb = heff->GetNbinsX();
1117 for(int ib=1;ib<=nb;ib++){
1118 heff->SetBinContent(ib,((Float_t) hcounter->GetBinContent(ib))/((Float_t) totNumOfEvts));
1119 }
1120 }
1121 return;
1122}