1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
20 // Produces the data needed to calculate the quality assurance.
21 // Alla.Maevskaya@cern.ch
24 // --- ROOT system ---
25 #include <TClonesArray.h>
29 #include <TDirectory.h>
31 // --- Standard library ---
33 // --- AliRoot header files ---
35 #include "AliESDEvent.h"
37 #include "AliT0digit.h"
39 #include "AliT0RecPoint.h"
40 #include "AliT0QADataMakerRec.h"
41 #include "AliQAChecker.h"
42 #include "AliT0RawReader.h"
43 #include "AliT0RecoParam.h"
44 #include "AliQAThresholds.h"
46 #include "AliCDBEntry.h"
47 #include "AliQAManager.h"
48 #include "THnSparse.h"
50 #include "TFitResultPtr.h"
52 #include "Riostream.h"
53 ClassImp(AliT0QADataMakerRec)
55 //____________________________________________________________________________
56 AliT0QADataMakerRec::AliT0QADataMakerRec() :
57 AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kT0),
58 "T0 Quality Assurance Data Maker"),
59 fMeanRawVertexParam(0),
62 fCFDEffSubRangeLowParam(0),
63 fCFDEffSubRangeHighParam(3000),
64 fLEDEffSubRangeLowParam(0),
65 fLEDEffSubRangeHighParam(3000)
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
77 for(Int_t i=0; i<24; i++){
78 fMeanCFDFromGoodRunParam[i]=0;
83 //____________________________________________________________________________
84 AliT0QADataMakerRec::AliT0QADataMakerRec(const AliT0QADataMakerRec& qadm) :
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)
95 SetName((const char*)qadm.GetName()) ;
96 SetTitle((const char*)qadm.GetTitle());
97 for(Int_t i=0; i<24; i++){
98 fMeanCFDFromGoodRunParam[i]=qadm.fMeanCFDFromGoodRunParam[i];
102 //__________________________________________________________________
103 AliT0QADataMakerRec& AliT0QADataMakerRec::operator = (const AliT0QADataMakerRec& qadm )
106 this->~AliT0QADataMakerRec();
107 new(this) AliT0QADataMakerRec(qadm);
110 //__________________________________________________________________
111 AliT0QADataMakerRec::~AliT0QADataMakerRec()
115 //____________________________________________________________________________
116 void AliT0QADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list)
118 //Detector specific actions at end of cycle
119 // do the QA checking
120 AliInfo(Form("Task: %d",task));
121 ResetEventTrigClasses();
126 TH1F* hEventCounter=NULL;
127 for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
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(...)
135 // I think the histos xx+250 should be suppressed (the xx calib histos of specie==calibration will be
136 // used automatically)
138 if (! IsValidEventSpecie(specie, list)) continue;
139 SetEventSpecie(AliRecoParam::ConvertIndex(specie));
141 for (int itc=-1;itc<GetNTrigClasses();itc++) { // RS: loop over eventual clones per trigger class
143 if ( task == AliQAv1::kRAWS ) {
145 float nEvent = GetEvCountCycleRaws(itc); // counted events for given trigger class
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
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);
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
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);
175 for(int ipmt=0;ipmt<12; ipmt++)
176 heff->SetBinContent(ipmt+1,0);
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);
184 for(int ipmt=0;ipmt<12; ipmt++)
185 heff->SetBinContent(ipmt+1,0);
191 } // RS: loop over eventual clones per trigger class
192 } // loop over species
194 AliQAChecker::Instance()->Run(AliQAv1::kT0, task, list); //FK
198 //____________________________________________________________________________
199 void AliT0QADataMakerRec::StartOfDetectorCycle()
201 //Detector specific actions at start of cycle
202 AliCDBManager* man = AliCDBManager::Instance();
203 //man->SetDefaultStorage(gSystem->Getenv("AMORE_CDB_URI"));
205 AliCDBEntry* entry = man->Get("GRP/Calib/QAThresholds");
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
212 if(!thresholds) return;
213 if(AliDAQ::DetectorID("T0")!= thresholds->GetDetectorId()){
214 AliInfo(Form("DETECTOR ID %d DOES NOT MATCH TO TZERO",thresholds->GetDetectorId()));
219 if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean raw vertex
220 fMeanRawVertexParam = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
224 if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean raw vertex
225 fMeanORAParam = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
229 if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean raw vertex
230 fMeanORCParam = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
234 if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean raw vertex
235 fCFDEffSubRangeLowParam = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
239 if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean raw vertex
240 fCFDEffSubRangeHighParam = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
244 if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean raw vertex
245 fLEDEffSubRangeLowParam = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
249 if((TParameter<float>*) thresholds->GetThreshold(iparam)){ // mean raw vertex
250 fLEDEffSubRangeHighParam = ((TParameter<float>*) thresholds->GetThreshold(iparam))->GetVal();
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();
261 //____________________________________________________________________________
262 void AliT0QADataMakerRec::InitRaws()
265 // create Raw histograms in Raw subdir
266 const Bool_t expert = kTRUE ;
267 const Bool_t saveCorr = kTRUE ;
268 const Bool_t image = kTRUE ;
272 const Char_t *triggers[6] = {"T0 OR", "vertex","ORA","ORC","central","semi-central"};
275 for (Int_t i=0; i<500; i++){
281 TString timename, ampname, qtcname, ledname;
282 TString timeCalname, ampCalname, ledCalname, qtcCalname;
283 TString qt1name, qt0name, qt1Calname, qt0Calname;
286 TH1F* hRefPoint = new TH1F("hRefPoint","Ref Point", 10000, 0 ,50000);
287 hRefPoint->SetLabelSize(0.02);
288 Add2RawsList( hRefPoint,0, expert, !image, !saveCorr);
290 TH1F *hRefPointcal = new TH1F("hRefPointcal","Ref Point laser", 5000, 0 ,20000);
291 Add2RawsList( hRefPointcal,250, expert, !image, !saveCorr);
294 TH1F *hRawLEDamp[24];
295 TH1F *hRawQTC[24]; TH1F *hRawLED[24];
296 TH1F *hRawQT1[24]; TH1F *hRawQT0[24];
299 for(Int_t i=0; i<24; i++){
304 qt0name = "hRawQT0_";
305 qt1name = "hRawQT1_";
306 ampname = "hRawLEDminCFD";
315 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]);
316 // ForbidCloning(hRawCFD[i]); //RS I don't know how histos 1-24 should be processed in MakeRaws, for the moment forbidding the cloning
317 Add2RawsList( hRawCFD[i],i+1, expert, !image, !saveCorr);
318 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]);
319 Add2RawsList( hRawLED[i],i+25, expert, !image, !saveCorr);
320 hRawLEDamp[i] = new TH1F(ampname.Data(), Form("%s;LED-CFD [#channels]; Counts", ampname.Data()),1000,0,1000);
321 Add2RawsList( hRawLEDamp[i],i+49, expert, !image, !saveCorr);
322 hRawQTC[i] = new TH1F(qtcname.Data(), Form("%s;QTC[#channels]; Counts", qtcname.Data()), 2500,0,10000); //fk
324 Add2RawsList( hRawQTC[i],i+73, expert, !image, !saveCorr);
325 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]);
326 Add2RawsList( hRawQT0[i],97+i, expert, !image, !saveCorr);
328 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]);
329 Add2RawsList( hRawQT1[i],121+i, expert, !image, !saveCorr);
331 hRawNhits[i] = new TH1F(nhits.Data(), Form("%s;#Hits;Events", nhits.Data()),20, 0, 20);
332 Add2RawsList( hRawNhits[i],176+i, expert, !image, !saveCorr);
336 TH1F* hRawTrigger = new TH1F("hRawTrigger"," triggers;Trigger ;Counts",6,0,6);
337 for (Int_t itr=0; itr<6; itr++) hRawTrigger->Fill(triggers[itr], 0); // RS Modified to allow cloning (no fNumTriggers member anymore)
338 Add2RawsList(hRawTrigger ,169, !expert, image, !saveCorr);
339 TH1F* hRawMean = new TH1F("hRawMean","online timer mean signal, physics event;",Int_t((high[170]-low[170])/4),low[170],high[170]);
340 Add2RawsList( hRawMean,170, expert, !image, !saveCorr);
342 TH1F* hRawVertex = new TH1F("hRawVertex","online 0TVX vertex signal; counts",Int_t((high[171]-low[171])/4),low[171],high[171]);
343 Add2RawsList( hRawVertex,171, expert, !image, !saveCorr);//FK
345 TH1F* hRawORA = new TH1F("hRawORA","online OR A; counts",Int_t((high[172]-low[172])/4),low[172],high[172]);
346 Add2RawsList( hRawORA,172, expert, !image, !saveCorr);
347 TH1F* hRawORC = new TH1F("hRawORC","online OR C;counts",Int_t(( high[173]-low[173])/4),low[173],high[173]);
348 Add2RawsList( hRawORC,173, expert, !image, !saveCorr);
349 TH1F* hMultCentr = new TH1F("hMultCentr","online trigger Central;counts ",Int_t(( high[174]-low[174])/4),low[174],high[174]);
350 Add2RawsList( hMultCentr,174, expert, !image, !saveCorr);
351 TH1F* hMultSeCentr = new TH1F("hMultSemiCentr","online trigger SemiCentral;counts ",Int_t(( high[175]-low[175])/4),low[175],high[175]);
352 Add2RawsList( hMultSeCentr,175, expert, !image, !saveCorr);
354 TH1F* hMultA = new TH1F("hMultA","full mulltiplicity A side;Multiplicity;Entries", Int_t((high[201]-low[201])/4) ,low[201],high[201]);
355 Add2RawsList( hMultA,201, expert, !image, !saveCorr );//FK
357 TH1F* hMultAS = new TH1F("hMultASemi","full multiplicity with semi-central trigger A side ;Multiplicity;Entries",
358 Int_t((high[202]-low[202])/4),low[202],high[202] );
359 Add2RawsList( hMultAS, 202, expert, !image, !saveCorr);
360 TH1F* hMultAC = new TH1F("hMultACentr","full multiplicity with central trigger;Multiplicity;Entries",
361 Int_t((high[203]-low[203])/4),low[203],high[203]);
362 Add2RawsList( hMultAC, 203, expert, !image, !saveCorr);
366 TH1F* hMultC = new TH1F("hMultC","full mulltiplicity C side;Multiplicity;Entries", Int_t(high[204]-low[204]/4) ,low[204],high[204]);
367 Add2RawsList( hMultC,204, expert, !image, !saveCorr );//FK
368 TH1F* hMultCS = new TH1F("hMultCSemi","full multiplicity with semi-central trigger C side;Multiplicity;Entries",
369 Int_t((high[205]-low[205])/4),low[205],high[205] );
370 Add2RawsList( hMultCS,205, expert, !image, !saveCorr);
371 TH1F* hMultCC = new TH1F("hMultCCentr","full multiplicity with central trigger C side;Multiplicity;Entries",
372 Int_t((high[206]-low[206])/4),low[206],high[206]);
373 Add2RawsList( hMultCC,206, expert, !image, !saveCorr);
377 TH1F* hCFDeff= new TH1F("hCFDeff"," CFD efficiency; #PMT; #CFD counts/nEvents",24, 0 ,24);
378 hCFDeff->SetMinimum(0);
379 hCFDeff->SetMaximum(2);
380 hCFDeff->SetMarkerStyle(20);//fk
381 hCFDeff->SetMarkerColor(2);//fk
382 hCFDeff->SetOption("p");//fk
383 Add2RawsList( hCFDeff, 207, expert, image, !saveCorr);//FK
384 TH1F* hEffLED = new TH1F("hEffLED","LED efficiency; #PMT; #LED counts/nEvent",24, 0 ,24);
385 hEffLED ->SetMinimum(0);
386 hEffLED->SetMaximum(2);
387 hEffLED->SetMarkerStyle(28);//fk
388 hEffLED->SetMarkerColor(1);//fk
389 hEffLED->SetOption("p,same");//fk
390 Add2RawsList( hEffLED, 208, expert, !image, !saveCorr);//FK is published attahced to the CFD efficiency
392 TH1F* hEffQTC = new TH1F("hEffQTC","QTC efficiency; #PMT; QTC efficiency%s;",24, 0 ,24);
393 hEffQTC->SetMinimum(0);
394 hEffQTC->SetMaximum(2);
395 Add2RawsList( hEffQTC,209, !expert, image, !saveCorr);
397 TH2F* hCFD = new TH2F("hCFD","CFD ; #PMT; CFD {#channnels}", 24, 0 , 24,Int_t((high[210]-low[210])/4),low[210],high[210]);
398 hCFD->SetOption("COLZ");
399 Add2RawsList( hCFD,210, expert, !image, !saveCorr);//fk
401 TH2F* hLED = new TH2F("hLED","LED ; #PMT; LED [#channnels]", 24, 0 , 24,Int_t((high[211]-low[211])/4),low[211],high[211]);
402 hLED->SetOption("COLZ");
403 Add2RawsList( hLED,211, expert, !image, !saveCorr);//fk
405 TH2F* hQTC = new TH2F("hQTC","QTC ; #PMT; QTC [#channnels]", 24, 0, 24,Int_t( (high[212]-low[212])/4),low[212],high[212]);
406 hQTC->SetOption("COLZ");
407 Add2RawsList( hQTC,212, expert, !image, !saveCorr);//fk
409 TH1F* hNumPMTA= new TH1F("hNumPMTA","number of PMT hitted per event A side",13, 0 ,13);
410 Add2RawsList(hNumPMTA ,213, expert, image, !saveCorr);
412 TH1F* hNumPMTC= new TH1F("hNumPMTC","number of PMT hitted per event C side",13, 0 ,13);
413 Add2RawsList(hNumPMTC ,214, expert, image, !saveCorr);
415 TH1F* hHitsOrA= new TH1F("hHitsOrA","T0_OR A hit multiplicity",20, 0 ,20);
416 Add2RawsList( hHitsOrA,215, expert, !image, !saveCorr);
418 TH1F* hHitsOrC= new TH1F("hHitsOrC","T0_OR C hit multiplicity",20, 0 ,20);
419 Add2RawsList(hHitsOrC ,216, expert, !image, !saveCorr);
422 TH1F* hOrCminOrA= new TH1F("hOrCminOrA","T0_OR C - T0_OR A [cm]",10000,-5000,5000);
423 Add2RawsList( hOrCminOrA,219, expert, !image, !saveCorr); //FK
425 TH1F* hOrCminOrATvdcOn= new TH1F("hOrCminOrATvdcOn","T0_OR C - T0_OR A TVDC on [cm]",10000,-5000,5000);
426 Add2RawsList( hOrCminOrATvdcOn,217, expert, !image, !saveCorr);//FK
429 TH1F* hOrCminOrATvdcOff= new TH1F("hOrCminOrATvdcOff","T0_OR C - T0_OR A TVDC off [cm]",10000,-5000,5000);
430 Add2RawsList( hOrCminOrATvdcOff,218, expert, !image, !saveCorr);//FK
432 //satellite & beam background
433 TH2F* hBeam = new TH2F("hBeam", "Mean vs Vertex from 1st hit", 120, -30, 30, 120, -30, 30);
434 hBeam->SetOption("COLZ");
435 hBeam->GetXaxis()->SetTitle("(T0C-T0A)/2, ns from 1st"); //vtx
436 hBeam->GetYaxis()->SetTitle("(T0C+T0A)/2, ns"); //time
437 Add2RawsList( hBeam,220, !expert, image, !saveCorr);
439 TH2F* hBeamTVDCon = new TH2F("hBeamTVDCon", "Mean vs Vertex TVDC on from 1st hit",50, -5, 5, 50, -5, 5);//FK
440 hBeamTVDCon->SetOption("COLZ");
441 hBeamTVDCon->GetXaxis()->SetTitle("(T0C-T0A)/2, ns from 1st hit");
442 hBeamTVDCon->GetYaxis()->SetTitle("(T0C+T0A)/2, ns");
443 Add2RawsList( hBeamTVDCon,221, expert, image, !saveCorr);
445 TH2F* hBeamTVDCoff = new TH2F("hBeamTVDCoff", "Mean vs Vertex TVDC off from 1st hit", 120, -30, 30, 120, -30, 30);
446 hBeamTVDCoff->GetXaxis()->SetTitle("(T0C-T0A)/2, ns from 1st hit");
447 hBeamTVDCoff->GetYaxis()->SetTitle("(T0C+T0A)/2, ns");
448 hBeamTVDCoff->SetOption("COLZ");
449 Add2RawsList( hBeamTVDCoff,222, expert, image, !saveCorr);
452 TH1F* hVertex1stTVDCon = new TH1F("hVertex1stTVDCon", "(T0A-T0C)/2, ps, from 1st hit TVDC on", 200, -2000, 2000); //FK
453 Add2RawsList(hVertex1stTVDCon ,223, !expert, image, !saveCorr);
454 TH1F* hVertex1stTVDCoff = new TH1F("hVertex1stTVDCoff", "(T0A-T0C)/2, ps, from 1st hit TVDC off", 500, -2000, 2000);//FK
455 Add2RawsList( hVertex1stTVDCoff,225, !expert, image, !saveCorr);
456 TH1F* hMean1stTVDCon = new TH1F("hMean1stTVDCon", "(T0A+T0C)/2, ps, from 1st hit TVDC on", 200, -2000, 2000);//FK
457 Add2RawsList( hMean1stTVDCon, 226, !expert, image, !saveCorr);
458 TH1F* hMean1stTVDCoff = new TH1F("hMean1stTVDCoff", "(T0A+T0C)/2, ps, from 1st hit TVDC off", 200, -2000, 2000);//FK
459 Add2RawsList( hMean1stTVDCoff, 227, !expert, image, !saveCorr);
462 //FK histograms start from 230
463 TH1F* hRawVertexMinMean = new TH1F("hRawVertexMinMean","online 0TVX vertex signal minus mean; counts",200,-1000,1000);
464 Add2RawsList(hRawVertexMinMean,230, expert, image, !saveCorr);//FK
466 TH1F* hCFDSubtrMean = new TH1F("hCFDSubtrMean","CFD minus mean; #PMT; CFD - mean {#channnels}", 24, 0, 24);
467 hCFDSubtrMean->SetMarkerStyle(20);
468 hCFDSubtrMean->SetOption("p");
469 Add2RawsList( hCFDSubtrMean,231, !expert, image, !saveCorr);//fk filled in Checker
471 TH1F* hLEDSubtrMean = new TH1F("hLEDSubtrMean","LED minus mean; #PMT; LED - mean [#channnels]", 24, 0, 24);
472 hLEDSubtrMean->SetMarkerStyle(20);
473 hLEDSubtrMean->SetOption("p");
474 Add2RawsList( hLEDSubtrMean,232, expert, image, !saveCorr);//fk filled in Checker
476 TH1F* hQTCSubtrMean = new TH1F("hQTCSubtrMean","QTC minus mean; #PMT; QTC - mean [#channnels]", 24, 0, 24);
477 hQTCSubtrMean->SetMarkerStyle(20);
478 hQTCSubtrMean->SetOption("p");
479 Add2RawsList( hQTCSubtrMean,233, expert, image, !saveCorr);//fk filled in Checker
481 TH2F* hDiffOrCVersusDiffOrATvdcOn= new TH2F("hDiffOrCVersusDiffOrATvdcOn","ORC-meanORC versus ORA-meanORA (TVDC on)",50,-200,200,50,-200,200);
482 hDiffOrCVersusDiffOrATvdcOn->SetOption("COLZ");
483 hDiffOrCVersusDiffOrATvdcOn->GetXaxis()->SetTitle("ORA - mean ORA [channel]");
484 hDiffOrCVersusDiffOrATvdcOn->GetYaxis()->SetTitle("ORC - mean ORC [channel]");
485 Add2RawsList(hDiffOrCVersusDiffOrATvdcOn, 234, expert, image, !saveCorr);//FK
487 TH2F* hDiffOrCVersusDiffOrATvdcOff= new TH2F("hDiffOrCVersusDiffOrATvdcOff","ORC-meanORC vetsus ORA-meanORA (TVDC off)",50,-200,200,50,-200,200);
488 hDiffOrCVersusDiffOrATvdcOff->SetOption("COLZ");
489 hDiffOrCVersusDiffOrATvdcOff->GetXaxis()->SetTitle("ORA - mean ORA [channel]");
490 hDiffOrCVersusDiffOrATvdcOff->GetYaxis()->SetTitle("ORC - mean ORC [channel]");
491 Add2RawsList(hDiffOrCVersusDiffOrATvdcOff, 235, expert, image, !saveCorr);//FK
493 TH2F* hBCID = new TH2F("hBCID", "header BCID vs TRM BC ID ", 500, 0, 5000, 500, 0, 5000);
494 hBCID->SetOption("COLZ");
495 hBCID->GetXaxis()->SetTitle("TRM BC ID");
496 hBCID->GetYaxis()->SetTitle("event header BC ID");
497 Add2RawsList(hBCID ,236, !expert, image, !saveCorr);
499 //CFD and LED efficiency in range ~2000- ~3000
500 TH1F* hCFDeffSubRange = new TH1F("hCFDeffSubRange"," CFD eff in subrange; #PMT; #CFD counts/nEvents",24, 0 ,24);
501 Add2RawsList( hCFDeffSubRange, 237, expert, !image, !saveCorr);//FK
504 TH1F* hEffLEDSubRange = new TH1F("hEffLEDSubRange","LED eff in subrange; #PMT; #LED counts/nEvent",24, 0 ,24);
505 Add2RawsList( hEffLEDSubRange,238, expert, !image, !saveCorr);//FK
506 // ratio CDF eff /LEF eff in subragne
507 TH1F* hRatioCFDLEDeff = new TH1F("hRatioCFDLEDeff","Ratio CFD/LED eff in subrange; #PMT; ratio CDF/LED eff",24, 0 ,24);
508 hRatioCFDLEDeff->SetMinimum(0);
509 hRatioCFDLEDeff->SetMaximum(2);
510 Add2RawsList( hRatioCFDLEDeff, 239, !expert, image, !saveCorr);//FK
512 TH1F* hEventCounter = new TH1F("hEventCounter","Event counter for eff histos; X; number of events",1, 0 ,1);
513 Add2RawsList( hEventCounter, 240, expert, !image, !saveCorr);//FK
516 TH1F* hRawTriggerCounter = new TH1F("hRawTriggerCounter"," triggers;Trigger ;Counts",6,0,6);
517 for (Int_t itr=0; itr<6; itr++) hRawTriggerCounter->Fill(triggers[itr], 0);
518 Add2RawsList(hRawTriggerCounter ,241, expert, !image, !saveCorr);
520 TH1F* hCFDCounter= new TH1F("hCFDCounter"," CFD counter #PMT; #CFD counts",24, 0 ,24);
521 Add2RawsList( hCFDCounter, 242, expert, !image, !saveCorr);//FK
522 TH1F* hLEDCounter = new TH1F("hLEDCounter","LED counter; #PMT; #LED counts",24, 0 ,24);
523 Add2RawsList( hLEDCounter, 243, expert, !image, !saveCorr);//FK
525 TH1F* hCFDeffSubRangeCounter = new TH1F("hCFDeffSubRangeCounter"," CFD eff in subrange counter; #PMT; #CFD counts",24, 0 ,24);
526 Add2RawsList( hCFDeffSubRangeCounter, 244, expert, !image, !saveCorr);//FK
527 TH1F* hEffLEDSubRangeCounter = new TH1F("hEffLEDSubRangeCounter","LED eff in subrange counter; #PMT; #LED counts",24, 0 ,24);
528 Add2RawsList( hEffLEDSubRangeCounter,245, expert, !image, !saveCorr);//FK
530 TH1F* hQTCCounter = new TH1F("hQTCCounter","QTC counter; #PMT; QTC counts;",24, 0 ,24);
531 Add2RawsList( hQTCCounter,246, expert, !image, !saveCorr);
533 ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line
536 //____________________________________________________________________________
537 void AliT0QADataMakerRec::InitDigits()
539 // create Digits histograms in Digits subdir
540 const Bool_t expert = kTRUE ;
541 const Bool_t image = kTRUE ;
543 TH2F * fhDigCFD = new TH2F("fhDigCFD", " CFD digits; #PMT; CFD digits[#channels]",25,-0.5,24.5,100,0,1000);
544 fhDigCFD->SetOption("COLZ");
545 Add2DigitsList( fhDigCFD,0, !expert, image);
546 TH2F *fhDigLEDamp = new TH2F("fhDigLEDamp", " LED-CFD digits; #PMT; LED-CFD amplitude ",25,-0.5,24.5,100,100,1000);
547 fhDigLEDamp->SetOption("COLZ");
548 Add2DigitsList( fhDigLEDamp,1, !expert, !image);
549 TH2F * fhDigQTC = new TH2F("fhDigQTC", " QTC digits; #PMT; QTC amplitude",25,-0.5,24.5,100,100,10000);
550 fhDigQTC->SetOption("COLZ");
551 Add2DigitsList( fhDigQTC,2, !expert, !image);
553 ClonePerTrigClass(AliQAv1::kDIGITS); // this should be the last line
556 //____________________________________________________________________________
558 void AliT0QADataMakerRec::InitRecPoints()
560 // create cluster histograms in RecPoint subdir
561 const Bool_t expert = kTRUE ;
562 const Bool_t image = kTRUE ;
564 TH2F* fhRecCFD = new TH2F("hRecCFD"," CFD time;#PMT; CFD Time [ns];",24, 0 ,24,
566 fhRecCFD->SetOption("COLZ");
567 Add2RecPointsList ( fhRecCFD,0, !expert, image);
569 TH2F* fhRecAmpDiff = new TH2F("hRecAmpDiff"," LED-CFD min QTC amplitude;#PMT; difference [MIPs];",
570 24, 0 ,24, 200,-10,10);
571 fhRecAmpDiff->SetOption("COLZ");
572 Add2RecPointsList (fhRecAmpDiff, 1, !expert, image);
574 TH1F *fhMean = new TH1F("hMean","online - rec mean;online - rec mean[#channels];",2000, -1000, 1000);
575 Add2RecPointsList ( fhMean,2, !expert, image);
577 ClonePerTrigClass(AliQAv1::kRECPOINTS); // this should be the last line
580 //____________________________________________________________________________
581 void AliT0QADataMakerRec::InitESDs()
583 //create ESDs histograms in ESDs subdir
584 const Bool_t expert = kTRUE ;
585 const Bool_t image = kTRUE ;
587 TH1F *fhESDMean = new TH1F("hESDmean"," ESD mean; mean time[%channels]",1000, -5, 5);
588 Add2ESDsList(fhESDMean, 0, expert, !image) ;
589 TH1F * fhESDVertex = new TH1F("hESDvertex","ESDvertex; vertex[cm];",82,-30,30);
590 Add2ESDsList(fhESDVertex, 1, expert, !image) ;
592 TH1F * fhESDResolution = new TH1F("hESDResolution","(T0A-T0C)/2 corrected by SPD vertex; ns",800,-2,2);
593 Add2ESDsList(fhESDResolution, 2, !expert, image) ;
595 ClonePerTrigClass(AliQAv1::kESDS); // this should be the last line
598 //____________________________________________________________________________
599 void AliT0QADataMakerRec::MakeRaws( AliRawReader* rawReader)
601 //indices in lookup table lookUpTable_tanay.txt
602 enum { kTZeroRefPoint=0, kTZeroFirstCfdC=1, kTZeroFirstLedC=13, kTZeroFirstQT0C=25,kTZeroFirstQT1C=26,
603 kTZeroVertex=50, kTZeroOrA=51, kTZeroOrC=52, kT0multAQ0=53, kT0multAQ1=54, kTZeroMultCent=55, kTZeroMultSemi=56,
604 kTZeroFirstCfdA=57, kTZeroFirstLedA=69, kTZeroFirstQT0A=81,kTZeroFirstQT1A=82,
605 kT0multCQ0=105, kT0multCQ1=106
609 for(Int_t i=0; i<24; i++) time[i] = 0;
611 //fills QA histos for RAW
613 // Int_t refPointParam = GetRecoParam()->GetRefPoint();
615 Int_t refPointParam = 0;
617 AliT0RawReader *start = new AliT0RawReader(rawReader);
619 if (! start->Next()) {
620 AliDebug(AliQAv1::GetQADebugLevel(),Form(" no raw data found!!"));
624 UInt_t type =rawReader->GetType();
625 if (GetEventSpecie()==AliRecoParam::kCalib && type!=8) {
630 // RS: Don't use custom counters, they create problems with trigger cloning
631 // Use instead framework counters, incremented in the end of this routine
632 // RS: There is some inconsistency here: the separation of physics and calib. events/histos is done by
633 // fEventSpecie. Why do we book separate histos on different slots for calib and physics ?
634 // I am changing this in such way that we don't need local counters like fNumTriggers (the corresponding
635 // histos now incremented in the MakeRaws, and for the normalization I will use the framework's counters
636 // AliQADataMaker::GetEvCountCycle(...), AliQADataMaker::GetEvCountTotal(...)
638 // I think the histos xx+250 should be suppressed (the xx calib histos of specie==calibration will be
639 // used automatically)
644 UInt_t bcid = rawReader->GetBCID();
645 UInt_t trmbcid = start->GetTRMBunchID();
647 FillRawsData(236,trmbcid, bcid);
648 //FillRawsData(236,100, bcid); fake error for testing
651 // if (type == 7){ shift=1; fnEventPhys++;}
652 Int_t allData[110][5];
653 for(Int_t i0=0; i0<110; i0++){
654 for(Int_t j0=0; j0<5; j0++){
659 for(Int_t i=0; i<=kT0multCQ1; i++){
660 for(Int_t iHit=0; iHit<5; iHit++){
661 allData[i][iHit]= start->GetData(i,iHit);
665 if( allData[kTZeroRefPoint][0] > 0 /*&& (type == 7)*/){
666 FillRawsData(0, allData[kTZeroRefPoint][0]); //Reference point
668 refpoint = allData[refPointParam][0];
669 if(refPointParam < 0 ) refpoint=0;
670 if(refPointParam == 0 ) refpoint = allData[kTZeroRefPoint][0] - 5000;
672 Int_t offsetCDF, offsetLED, offsetQT0, offsetQT1;
676 for(Int_t ik = 0; ik<24; ik++){
677 Int_t ipmt = ik; //C side
679 offsetCDF = kTZeroFirstCfdC;
680 offsetLED = kTZeroFirstLedC;
681 offsetQT0 = kTZeroFirstQT0C;
682 offsetQT1 = kTZeroFirstQT1C;
683 if(allData[ipmt+offsetCDF][0]>0 /*&& type == 7 */ ) numPmtC++;
685 ipmt = ik - 12; //A side
686 offsetCDF = kTZeroFirstCfdA;
687 offsetLED = kTZeroFirstLedA;
688 offsetQT0 = kTZeroFirstQT0A;
689 offsetQT1 = kTZeroFirstQT1A;
690 if(allData[ipmt + offsetCDF][0]>0 /*&& type == 7 */) numPmtA++;
692 Int_t nhitsPMT=0; //count hits for this pmt
694 for (Int_t iHt=0; iHt<5; iHt++) {
696 if(allData[ipmt+offsetCDF][iHt]>0){
697 FillRawsData(ik+1, allData[ipmt+offsetCDF][iHt]); //CFD for each PMT
698 FillRawsData(210, ik, allData[ipmt+offsetCDF][iHt]); //CFD vs PMT
699 FillRawsData(242,ik,1.); // CFD counter for efficiency
700 if( fCFDEffSubRangeLowParam<allData[ipmt+offsetCDF][iHt] && allData[ipmt+offsetCDF][iHt]<fCFDEffSubRangeHighParam){
701 FillRawsData(244,ik,1.); //count CDF entries in given subrange for CDF/LED eff ratio
703 AliDebug(50,Form("%i CFD %i data %s",ik, ipmt+offsetCDF, GetRawsData(ik+1)->GetName()));
707 if(allData[ipmt+offsetLED][iHt] > 0){
708 FillRawsData(ik+25,allData[ipmt+offsetLED][iHt]);
709 FillRawsData(211,ik, allData[ipmt+offsetLED][iHt]);
710 FillRawsData(243,ik,1.); //LED counter for LED efficiency
711 if(fLEDEffSubRangeLowParam < allData[ipmt+offsetLED][iHt] && allData[ipmt+offsetLED][iHt]<fLEDEffSubRangeHighParam){
712 FillRawsData(245,ik,1.); //count LED entries in given subrange for CDF/LED eff ratio
714 AliDebug(50,Form("%i LED %i data %s",ik, ipmt+offsetLED, GetRawsData(ik+25)->GetName()));
718 if(allData[ipmt+offsetLED][iHt] > 0 && allData[ipmt+offsetCDF][iHt] > 0 )
719 FillRawsData(ik+49, allData[ipmt+offsetLED][iHt]-allData[ipmt+offsetCDF][iHt]);
722 if(allData[2*ipmt+offsetQT0][iHt] > 0 &&
723 allData[2*ipmt+offsetQT1][iHt] > 0 ) {
725 FillRawsData(ik+73, allData[2*ipmt+offsetQT0][iHt]-allData[2*ipmt+offsetQT1][iHt]); //QTC = QT0 - QT1 for each channel
726 FillRawsData(212,ik, allData[2*ipmt+offsetQT0][iHt]-allData[2*ipmt+offsetQT1][iHt]); //QTC vs pmt
728 FillRawsData(246,ik,1.); // QTC counter for QTC efficiency
730 AliDebug(50,Form("%i QTC %i data %s",ik, 2*ipmt+offsetQT0, GetRawsData(ik+73)->GetName()));
733 if(allData[2*ipmt+offsetQT0][iHt] > 0) { //QT0
734 AliDebug(50,Form("%i QT0 %i data %s",ik, 2*ipmt+offsetQT0, GetRawsData(ik+97)->GetName()));
735 FillRawsData(ik+97,allData[2*ipmt+offsetQT0][iHt]);
737 if(allData[2*ipmt+offsetQT1][iHt] > 0) {//QT1
738 AliDebug(50,Form("%i QT1 %i data %s",ik, 2*ipmt+offsetQT1, GetRawsData(ik+121)->GetName()));
739 FillRawsData(ik+121,allData[2*ipmt+offsetQT1][iHt]);
743 FillRawsData(ik+176, nhitsPMT);
745 FillRawsData(213, numPmtA);
746 FillRawsData(214, numPmtC);
749 Int_t trChannel[6] = {kTZeroRefPoint, kTZeroVertex, kTZeroOrA, kTZeroOrC, kTZeroMultCent, kTZeroMultSemi};
750 Float_t ch2cm = 24.4*0.029979;
754 for (Int_t iHt=0; iHt<5; iHt++) {
755 //orA-orC phys tvdc 1
756 if((allData[kTZeroOrA][iHt]>0 && allData[kTZeroOrC][iHt]>0) && allData[kTZeroVertex][iHt]>0) {
757 AliDebug(10,Form("orA-orC phys tvdc 1 %i data %s", 217, GetRawsData(217)->GetName()));
759 FillRawsData(217,(allData[kTZeroOrC][iHt] - allData[kTZeroOrA][iHt])*ch2cm);
761 //orA-orC phys tvdc 0
762 if((allData[kTZeroOrA][iHt]>0 && allData[kTZeroOrC][iHt]>0) && allData[kTZeroVertex][iHt]<=0) {
763 AliDebug(10,Form("orA-orC phys tvdc 0 %i data %s", 218, GetRawsData(218)->GetName()));
765 FillRawsData(218,(allData[kTZeroOrC][iHt] - allData[kTZeroOrA][iHt])*ch2cm);
767 if(allData[kTZeroOrA][iHt]>0 && allData[kTZeroOrC][iHt]>0) {
768 AliDebug(50,Form("orA-orC phys tvdc all %i data %s", 219, GetRawsData(219)->GetName()));
769 FillRawsData(219,(allData[kTZeroOrC][iHt] - allData[kTZeroOrA][iHt])*ch2cm);
773 for (Int_t itr=0; itr<6; itr++) {//T0_MEAN,TO_VERTX,ORA,ORC,T0_mult,T0_mult
774 if (allData[trChannel[itr]][iHt] >0) {
776 // RS instead of incremented custom counters, fill directly the specie-specific histos
777 // FillRawsData(169+shift, 0.5+itr, 1.); // RS: increment counters
778 // FillRawsData(169+shift, itr, 1.); //hRawTrigger RS: increment counters
779 FillRawsData(241, itr, 1.); // fill trigger counter
780 AliDebug(50,Form(" triggers %i data %s", 170+itr, GetRawsData(170+itr)->GetName()));
782 FillRawsData(170+itr,allData[trChannel[itr]][iHt]);
784 if( trChannel[itr] == kTZeroVertex){ //T0_VERTEX minus mean from config files
785 FillRawsData(230, allData[kTZeroVertex][iHt] - fMeanRawVertexParam );
790 if(allData[kTZeroOrA][iHt] > 0 && allData[kTZeroOrC][iHt] > 0 ){ //FK// ORC-mean ORA -mean
791 Float_t diffORA = allData[kTZeroOrA][iHt] - fMeanORAParam;
792 Float_t diffORC = allData[kTZeroOrC][iHt] - fMeanORCParam;
793 if(allData[kTZeroVertex][iHt]>0){ //TVDC on
794 FillRawsData(234, diffORA, diffORC);
795 //Estimate mean orA and orC based on these
796 //cout<<"ORA "<<allData[kTZeroOrA][iHt]<<endl;
797 //cout<<"ORC "<<allData[kTZeroOrC][iHt]<<endl;
800 FillRawsData(235, diffORA, diffORC);
804 /* if(type == 7) */if(allData[kTZeroOrA][iHt] >0){
807 /* if(type == 7) */if(allData[kTZeroOrC][iHt] >0){
810 //mult trigger signals phys
812 if(allData[kT0multAQ0][iHt]>0 && allData[kT0multAQ1][iHt]>0) {
813 AliDebug(50,Form(" mpdA %i data %s", 201, GetRawsData(201)->GetName()));
815 FillRawsData(201,allData[kT0multAQ0][iHt]-allData[kT0multAQ1][iHt]);
816 if(allData[kTZeroMultSemi][iHt]>0) FillRawsData(202,allData[kT0multAQ0][iHt]-allData[kT0multAQ1][iHt]);
817 if(allData[kTZeroMultCent][iHt]>0) FillRawsData(203,allData[kT0multAQ0][iHt]-allData[kT0multAQ1][iHt]);
821 if(allData[kT0multCQ0][iHt]>0 && allData[kT0multCQ1][iHt]>0) {
822 AliDebug(50,Form(" mpdC %i data %s", 204, GetRawsData(204)->GetName()));
824 FillRawsData(204,allData[kT0multCQ0][iHt]-allData[kT0multCQ1][iHt]);
825 if(allData[kTZeroMultSemi][iHt]>0) FillRawsData(205,allData[kT0multCQ0][iHt]-allData[kT0multCQ1][iHt]);
826 if(allData[kTZeroMultCent][iHt]>0) FillRawsData(206,allData[kT0multCQ0][iHt]-allData[kT0multCQ1][iHt]);
830 FillRawsData(215,nhitsOrA);
831 FillRawsData(216,nhitsOrC);
834 for (int itr=-1;itr<GetNEventTrigClasses();itr++) { //RS loop over all active trigger classes, including the global one
835 int itrID = itr==-1 ? -1 : int( GetEventTrigClass(itr)->GetUniqueID());
837 TH2 *hBeam = (TH2*)GetRawsData(220,itrID);
838 TH2 *hBeamTVDCon = (TH2*)GetRawsData(221,itrID);
839 TH2 *hBeamTVDCoff = (TH2*)GetRawsData(222,itrID);
840 TH1 *hVertex1stTVDCon = (TH1*)GetRawsData(223,itrID);
841 TH1 *hVertex1stTVDCoff = (TH1*)GetRawsData(225,itrID);
842 TH1 *hMean1stTVDCon = (TH1*)GetRawsData(226,itrID);
843 TH1 *hMean1stTVDCoff = (TH1*)GetRawsData(227,itrID);
844 if(hBeam || hBeamTVDCon || hBeamTVDCoff || hVertex1stTVDCon || hVertex1stTVDCoff || hMean1stTVDCon || hMean1stTVDCoff){
846 Int_t time1stA=9999999;
847 Int_t time1stC=9999999;
848 for(Int_t ipmt=0; ipmt<12; ipmt++){
849 if(allData[ipmt+kTZeroFirstCfdC][0] > 1 ) {
850 time[ipmt] = allData[ipmt+kTZeroFirstCfdC][0] - (Int_t) fMeanCFDFromGoodRunParam[ipmt]; //fk
851 if(time[ipmt] < time1stC) time1stC=time[ipmt]; //timeC
854 for( Int_t ipmt=12; ipmt<24; ipmt++){
855 if(allData[ipmt-12+kTZeroFirstCfdA][0] > 0) {
856 time[ipmt] = allData[ipmt-12+kTZeroFirstCfdA][0] - (Int_t) fMeanCFDFromGoodRunParam[ipmt];//fk
857 if(time[ipmt] < time1stA) time1stA=time[ipmt]; //timeC
860 if(time1stA<99999 && time1stC< 99999) { //From First
861 Float_t t01st = 24.4 * (Float_t) (( time1stA + time1stC)/2.0);
862 Float_t ver1st = 24.4 * (Float_t) (( time1stC - time1stA)/2.0);
863 if(hBeam) hBeam->Fill(0.001*ver1st, 0.001*(t01st)); //Mean versus vertex
864 if(allData[kTZeroVertex][0] > 0){//TVDC on
865 if(hBeamTVDCon) hBeamTVDCon->Fill(0.001*ver1st, 0.001*(t01st));//Mean versus TVDC on from first
866 if(hVertex1stTVDCon) hVertex1stTVDCon->Fill(ver1st);
867 //if(hVertex1stTVDCon) hVertex1stTVDCon->Fill(1500);//for testing AM
869 if(hMean1stTVDCon) hMean1stTVDCon->Fill(t01st);
870 // if(hMean1stTVDCon) hMean1stTVDCon->Fill(1800);//testing AM
872 if(hBeamTVDCoff) hBeamTVDCoff->Fill(0.001*ver1st, 0.001*(t01st));//FK// TVDC off from first
873 if(hVertex1stTVDCoff) hVertex1stTVDCoff->Fill(ver1st);
874 if(hMean1stTVDCoff) hMean1stTVDCoff->Fill(t01st);
878 } // RS loop over all active trigger classes, including the global one
880 IncEvCountCycleRaws();
881 IncEvCountTotalRaws();
886 //____________________________________________________________________________
887 void AliT0QADataMakerRec::MakeDigits( TTree *digitsTree)
889 //fills QA histos for Digits
891 TArrayI *digCFD = new TArrayI(24);
892 TArrayI *digLED = new TArrayI(24);
893 TArrayI *digQT0 = new TArrayI(24);
894 TArrayI *digQT1 = new TArrayI(24);
897 TBranch *brDigits=digitsTree->GetBranch("T0");
898 AliT0digit *fDigits = new AliT0digit() ;
900 brDigits->SetAddress(&fDigits);
902 AliError(Form("EXEC Branch T0 digits not found"));
909 digitsTree->GetEvent(0);
910 digitsTree->GetEntry(0);
911 brDigits->GetEntry(0);
912 fDigits->GetTimeCFD(*digCFD);
913 fDigits->GetTimeLED(*digLED);
914 fDigits->GetQT0(*digQT0);
915 fDigits->GetQT1(*digQT1);
916 refpoint = fDigits->RefPoint();
917 for (Int_t i=0; i<24; i++) {
918 if (digCFD->At(i)>0) {
919 Int_t cfd=digCFD->At(i)- refpoint;
920 FillDigitsData(0,i,cfd);
921 FillDigitsData(1,i, (digLED->At(i) - digCFD->At(i)));
922 FillDigitsData(2,i, (digQT1->At(i) - digQT0->At(i)));
931 IncEvCountCycleDigits();
932 IncEvCountTotalDigits();
937 //____________________________________________________________________________
938 void AliT0QADataMakerRec::MakeRecPoints(TTree * clustersTree)
940 //fills QA histos for clusters
942 AliT0RecPoint* frecpoints= new AliT0RecPoint ();
944 AliError(":MakeRecPoints >> no recpoints found");
947 TBranch *brRec =clustersTree ->GetBranch("T0");
949 brRec->SetAddress(&frecpoints);
951 AliError(Form("EXEC Branch T0 rec not found "));
957 for ( Int_t i=0; i<24; i++) {
959 FillRecPointsData(0, i, frecpoints -> GetTime(i) - frecpoints -> GetTime(0));
961 FillRecPointsData(0, i, frecpoints -> GetTime(i) - frecpoints -> GetTime(12));
962 FillRecPointsData(1, i, frecpoints -> GetAmp(i) - frecpoints->AmpLED(i));
964 Double_t mmm=frecpoints->GetOnlineMean()- frecpoints->GetMeanTime();
965 FillRecPointsData(2,mmm);
967 IncEvCountCycleRecPoints();
968 IncEvCountTotalRecPoints();
973 //____________________________________________________________________________
974 void AliT0QADataMakerRec::MakeESDs(AliESDEvent * esd)
976 //fills QA histos for ESD
978 const Double32_t *mean;
979 mean = esd->GetT0TOF();
980 Double32_t t0time= 0.001*mean[0];
981 Double32_t orA= 0.001*mean[1];
982 Double32_t orC=0.001* mean[2];
984 if (t0time<99) FillESDsData(0,t0time);
985 if( esd->GetT0zVertex() <99) FillESDsData(1, esd->GetT0zVertex());
986 if( orA<99 && orC<99) FillESDsData(2,(orA-orC)/2.);
988 IncEvCountCycleESDs();
989 IncEvCountTotalESDs();
992 //____________________________________________________________________________
993 //____________________________________________________________________________
994 void AliT0QADataMakerRec::ResetDetector(AliQAv1::TASKINDEX_t task)
997 //reset the detector histograms for a given task
998 AliQADataMakerRec::ResetDetector(task);
1000 for(int ih=0; ih<=250; ih++){
1001 for(int itr=-1; itr < GetNEventTrigClasses(); itr++){
1002 int itrID = itr==-1 ? -1 : int( GetEventTrigClass(itr)->GetUniqueID());
1004 TH1 *htmp = (TH1*) GetRawsData(ih,itrID);
1005 if(htmp) htmp->Reset();
1012 void AliT0QADataMakerRec::GetMeanAndSigma(TH1F* hist, Float_t &mean, Float_t &sigma)
1015 const double window = 3.; //fit window
1017 double meanEstimate, sigmaEstimate;
1019 maxBin = hist->GetMaximumBin(); //position of maximum
1020 meanEstimate = hist->GetBinCenter( maxBin); // mean of gaussian sitting in maximum
1021 sigmaEstimate = hist->GetRMS();
1022 TF1* fit= new TF1("fit","gaus", meanEstimate - window*sigmaEstimate, meanEstimate + window*sigmaEstimate);
1023 fit->SetParameters(hist->GetBinContent(maxBin), meanEstimate, sigmaEstimate);
1024 hist->Fit("fit","RQ","Q");
1026 mean = (Float_t) fit->GetParameter(1);
1027 sigma = (Float_t) fit->GetParameter(2);
1033 void AliT0QADataMakerRec::SetEfficiency(Int_t idxEffHisto, Int_t idxCounterHisto, Int_t trigger, Float_t totNumOfEvts){
1034 //calculate efficiency = counts/number of events
1035 TH1* heff = GetRawsData(idxEffHisto,trigger);
1036 TH1* hcounter = GetRawsData(idxCounterHisto,trigger);
1037 if(heff && hcounter && (totNumOfEvts>0.0)){
1038 int nb = heff->GetNbinsX();
1039 for(int ib=1;ib<=nb;ib++){
1040 heff->SetBinContent(ib,((Float_t) hcounter->GetBinContent(ib))/((Float_t) totNumOfEvts));