]> git.uio.no Git - u/mrichter/AliRoot.git/blame - T0/AliT0QADataMakerRec.cxx
Updated AliZDCRawStream class - decoding of SOR completed
[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.
21// All data must be mergeable objects.
22// A. Mastroserio
23//---
24
25// --- ROOT system ---
26#include <TClonesArray.h>
27#include <TFile.h>
28#include <TH1F.h>
29#include <TDirectory.h>
30// --- Standard library ---
31
32// --- AliRoot header files ---
33#include "AliESDEvent.h"
34#include "AliLog.h"
35#include "AliT0digit.h"
36#include "AliT0hit.h"
37#include "AliT0RecPoint.h"
38#include "AliT0QADataMakerRec.h"
39#include "AliQAChecker.h"
40#include "AliT0RawReader.h"
41
42ClassImp(AliT0QADataMakerRec)
43
44//____________________________________________________________________________
45 AliT0QADataMakerRec::AliT0QADataMakerRec() :
46 AliQADataMakerRec(AliQA::GetDetName(AliQA::kT0), "T0 Quality Assurance Data Maker")
47
48{
49 // ctor
50 /*
51 for(Int_t i=0; i<24; i++) {
52 fhHitsTime[i]=0x0;
53 fhDigCFD[i]=0x0;
54 fhDigLEDamp[i]=0x0;
55 fhRecCFD[i]=0x0;
56 fhRecLEDamp[i]=0x0;
57 fhRecQTC[i]=0x0;
58 }
59 */
60 // fDetectorDir = fOutput->GetDirectory(GetName()) ;
61// if (!fDetectorDir)
62// fDetectorDir = fOutput->mkdir(GetName()) ;
63}
64
65//____________________________________________________________________________
66AliT0QADataMakerRec::AliT0QADataMakerRec(const AliT0QADataMakerRec& qadm) :
67 AliQADataMakerRec()
68{
69 //copy ctor
70 /*
71 for(Int_t i=0; i<24; i++) {
72 fhHitsTime[i]=0x0;
73 fhDigCFD[i]=0x0;
74 fhDigLEDamp[i]=0x0;
75 fhRecCFD[i]=0x0;
76 fhRecLEDamp[i]=0x0;
77 fhRecQTC[i]=0x0;
78 }
79 */
80 SetName((const char*)qadm.GetName()) ;
81 SetTitle((const char*)qadm.GetTitle());
82}
83
84//__________________________________________________________________
85AliT0QADataMakerRec& AliT0QADataMakerRec::operator = (const AliT0QADataMakerRec& qadm )
86{
87 // Equal operator.
88 this->~AliT0QADataMakerRec();
89 new(this) AliT0QADataMakerRec(qadm);
90 return *this;
91}
92//____________________________________________________________________________
92a357bf 93void AliT0QADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list)
04236e67 94{
95 //Detector specific actions at end of cycle
96 // do the QA checking
97 AliQAChecker::Instance()->Run(AliQA::kT0, task, list) ;
98}
99
100//____________________________________________________________________________
101void AliT0QADataMakerRec::StartOfDetectorCycle()
102{
103 //Detector specific actions at start of cycle
104
105}
106
107//____________________________________________________________________________
108void AliT0QADataMakerRec::InitRaws()
109{
110 // create Raw histograms in Raw subdir
446d6ec4 111 // printf(" AliT0QADataMakerRec::InitRaws() started\n");
04236e67 112 TString timename, ampname, qtcname;
5ed41460 113 TString timeCalname, ampCalname, qtcCalname;
04236e67 114
86c020af 115 TH1F* fhRefPoint = new TH1F("hRefPoint","Ref Point", 10,1252170, 1252180);
116 Add2RawsList( fhRefPoint,0);
117
04236e67 118 TH1F *fhRawCFD[24]; TH1F * fhRawLEDamp[24]; TH1F *fhRawQTC[24];
5ed41460 119 TH1F *fhRawCFDcal[24]; TH1F * fhRawLEDampcal[24]; TH1F *fhRawQTCcal[24];
86c020af 120
04236e67 121 for (Int_t i=0; i<24; i++)
122 {
123 timename ="hRawCFD";
124 ampname = "hRawLED";
125 qtcname = "hRawQTC";
126 timename += i;
127 ampname += i;
128 qtcname += i;
86c020af 129 fhRawCFD[i] = new TH1F(timename.Data(), timename.Data(),500,2100,2800);
130 Add2RawsList( fhRawCFD[i],i+1);
446d6ec4 131 fhRawLEDamp[i] = new TH1F(ampname.Data(), ampname.Data(),100,300,600);
86c020af 132 Add2RawsList( fhRawLEDamp[i],i+24+1);
133 fhRawQTC[i] = new TH1F(qtcname.Data(), qtcname.Data(),1500,1000,7000);
134 Add2RawsList( fhRawQTC[i],i+48+1);
04236e67 135 }
136
86c020af 137 TH1F* fhRawMean = new TH1F("hRawMean","online mean signal", 100,2400,2500);
138 Add2RawsList( fhRawMean,73);
139 TH1F* fhRawVertex = new TH1F("hRawVertex","online vertex signal", 100,0,600);
140 Add2RawsList( fhRawVertex,74);
141 TH1F* fhRawORA = new TH1F("hRawORA","online OR A", 100,2500,2800);
142 Add2RawsList( fhRawORA,75);
143 TH1F* fhRawORC = new TH1F("hRawORC","online OR C", 100,2000,2300);
144 Add2RawsList( fhRawORC,76);
5ed41460 145 for (Int_t i=0; i<24; i++)
146 {
147 // for events with trigger CALIBRATION_EVENT
148 timeCalname ="hRawCFDcal";
149 ampCalname = "hRawLEDcal";
150 qtcCalname = "hRawQTCcal";
151 timeCalname += i;
152 ampCalname += i;
153 qtcCalname += i;
154 fhRawCFDcal[i] = new TH1F(timeCalname.Data(), timeCalname.Data(),1000,4000,6000);
155 Add2RawsList( fhRawCFDcal[i],76+i+1);
156 fhRawLEDampcal[i] = new TH1F(ampCalname.Data(), ampCalname.Data(),100,300,600);
157 Add2RawsList( fhRawLEDampcal[i],76+i+24+1);
158 fhRawQTCcal[i] = new TH1F(qtcCalname.Data(), qtcCalname.Data(),1000,0,7000);
159 Add2RawsList( fhRawQTCcal[i],76+i+48+1);
160 }
161 TH1F* fhRawMeanCal = new TH1F("hRawMeanCal","online mean signal, calibration event",
162 1000,7000,8000);
163 Add2RawsList( fhRawMeanCal,149);
164 TH1F* fhRawVertexCal = new TH1F("hRawVertexCal","online vertex signal, calibration even ",
165 1000,7000,8000);
166 Add2RawsList( fhRawVertexCal,150);
167 TH1F* fhRawORAcal = new TH1F("hRawORAcal","online OR A", 200,5000,7000);
168 Add2RawsList( fhRawORAcal,151);
169 TH1F* fhRawORCcal = new TH1F("hRawORCcal","online OR C", 200,5000,7000);
170 Add2RawsList( fhRawORCcal,152);
171 TH1F* fhMultcal = new TH1F("hMultcal","full mulltiplicity", 1000,0,10000);
172 Add2RawsList( fhMultcal,153);
173 TH1F* fhMultScal = new TH1F("hMultScal","full multiplicity with semi-central trigger",
174 1000,0,10000);
175 Add2RawsList( fhMultScal,154);
176 TH1F* fhMultCcal = new TH1F("hMultCcal","full multiplicity with central trigger",
177 1000,0,10000);
178 Add2RawsList( fhMultCcal,155);
04236e67 179}
180
181//____________________________________________________________________________
182
183void AliT0QADataMakerRec::InitRecPoints()
184{
185 // create cluster histograms in RecPoint subdir
186 /*
187 TH2F * fhRecCFD = new TH2F("fhRecCFD", " CFD reconstructed",25,-0.5,24.5,100,12,13);
188 Add2DigitsList( fhRecCFD,0);
189 TH2F *fhRecLEDamp = new TH2F("fhRecLEDamp", " amplitude LED reconstructed",25,-0.5,24.5,100,1000,1000);
190 Add2DigitsList( fhRecLEDamp,1);
191 TH2F * fhRecQTC = new TH2F("fhRecQTC", " amplitude QTC reconstructed",25,-0.5,24.5,100,1000,1000);
192 Add2DigitsList( fhRecQTC,2);
193 TH1F * fhRecMean = new TH1F("hRecMean"," reconstructed mean signal",100,500,600);
194 Add2DigitsList( fhRecMean,3);
195 */
196
446d6ec4 197 // printf(" !!!!! AliT0QADataMakerRec::InitRecPoints() started\n");
04236e67 198 TString timename,ampname, qtcname;
199 TH1F *fhRecCFD[24]; TH1F *fhRecLEDAmp[24]; TH1F * fhRecQTC[24];
200 for (Int_t i=0; i<24; i++)
201 {
202 timename ="hRecCFD";
203 ampname = "hRecLED";
204 qtcname = "hRecQTC";
205 timename += i;
206 ampname += i;
207 qtcname += i;
446d6ec4 208 fhRecCFD[i] = new TH1F(timename.Data(), timename.Data(),100,2100,2800);
04236e67 209 Add2RecPointsList ( fhRecCFD[i],i);
c724dd64 210 fhRecLEDAmp[i] = new TH1F(ampname.Data(), ampname.Data(),100,0, 100);
04236e67 211 Add2RecPointsList ( fhRecLEDAmp[i],i+24);
c724dd64 212 fhRecQTC[i] = new TH1F(qtcname.Data(), qtcname.Data(),100,0,100);
04236e67 213 Add2RecPointsList ( fhRecQTC[i],i+48);
214 }
215
c724dd64 216 TH1F *fhOnlineMean = new TH1F("hOnlineMean","online mean",100,2400,2500);
217 Add2RecPointsList ( fhOnlineMean,72);
446d6ec4 218 TH1F * fhRecMean = new TH1F("hRecMean"," reconstructed mean signal",100,2400,2500);
219 Add2RecPointsList( fhRecMean,73);
220 // printf(" !!!!!! AliT0QADataMakerRec::InitRecPoints() ended\n");
04236e67 221
222}
223
224//____________________________________________________________________________
225void AliT0QADataMakerRec::InitESDs()
226{
227 //create ESDs histograms in ESDs subdir
c724dd64 228 printf(" !!!!! AliT0QADataMakerESD::InitESD() started\n");
446d6ec4 229 TH1F *fhESDMean = new TH1F("hESDmean"," ESD mean",100,2400,2500);
04236e67 230 Add2ESDsList(fhESDMean, 0) ;
c724dd64 231 TH1F * fhESDVertex = new TH1F("hESDvertex","EAD vertex",100,-50,50);
04236e67 232 Add2ESDsList(fhESDVertex, 1) ;
c724dd64 233
234 printf(" !!!!!! AliT0QADataMakerRec::InitESD() ended\n");
04236e67 235
236}
237
238//____________________________________________________________________________
239void AliT0QADataMakerRec::MakeRaws( AliRawReader* rawReader)
240{
04236e67 241 //fills QA histos for RAW
5ed41460 242 Int_t shift=0;
86c020af 243 AliT0RawReader *start = new AliT0RawReader(rawReader);
244 // start->Next();
245 if (! start->Next())
246 AliDebug(1,Form(" no raw data found!!"));
247 else
248 {
5ed41460 249
250 UInt_t type =rawReader->GetType();
251 // cout<<" !!!!! new event type = "<<type<<endl;
86c020af 252 Int_t allData[110][5];
253 for (Int_t i0=0; i0<105; i0++)
254 {
255 for (Int_t j0=0; j0<5; j0++) allData[i0][j0]=0;
04236e67 256 }
86c020af 257 for (Int_t i=0; i<105; i++)
258 for (Int_t iHit=0; iHit<5; iHit++)
259 allData[i][iHit]= start->GetData(i,iHit);
260
446d6ec4 261 GetRawsData(0) -> Fill( allData[0][0]);
86c020af 262 allData[0][0] = allData[0][0] - 5000;
5ed41460 263 if (type == 8) shift=76;
264 if (type == 10) shift=0;
265
86c020af 266 for (Int_t ik = 0; ik<12; ik++){
267 for (Int_t iHt=0; iHt<5; iHt++){
268 if(allData[ik+1][iHt]>0){
5ed41460 269 GetRawsData(shift+ik+1) -> Fill(allData[ik+1][iHt]-allData[0][0]);
270 // cout<<" type "<<type<<" shift "<<shift<<" koef "<<ik<<" index "<<shift+ik<<
271 // " time "<<allData[ik+1][iHt]-allData[0][0]<<endl;
272 if(allData[2*ik+25][iHt] > 0 && allData[2*ik+26][iHt] > 0)
273 GetRawsData(shift+ik+48+1)->Fill(allData[2*ik+25][iHt]-allData[2*ik+26][iHt]);
274 if(allData[ik+13][iHt]!=0 )
275 GetRawsData(shift+ik+24+1)->Fill(allData[ik+13][iHt]-allData[ik+1][iHt]);
276
04236e67 277 }
86c020af 278 }
5ed41460 279 }
86c020af 280 for (Int_t ik = 12; ik<24; ik++) {
281 for (Int_t iHt=0; iHt<5; iHt++) {
282 if(allData[ik+45][iHt]>0) {
5ed41460 283 GetRawsData(shift+ik+1)->Fill(allData[ik+45][iHt]-allData[0][0]);
284 // cout<<" type "<<type<<" shift "<<shift<<" index "<<shift+ik<<
285 // " time "<<allData[ik+1][iHt]-allData[0][0]<<endl;
286
86c020af 287 if(allData[2*ik+57][iHt]!=0 && allData[2*ik+58][iHt]!=0)
5ed41460 288 GetRawsData(shift+ik+48+1)->Fill(allData[2*ik+57][iHt]-allData[2*ik+58][iHt]);
86c020af 289 if(allData[ik+57][iHt] > 0 )
5ed41460 290 GetRawsData(shift+ik+24+1)->Fill(allData[ik+57][iHt]-allData[ik+45][iHt]);
86c020af 291 }
292 }
293 }
294
04236e67 295
5ed41460 296 if(type == 10)
297 {
298 GetRawsData(73)->Fill(allData[49][0]-allData[0][0]);
299 GetRawsData(74)->Fill(allData[50][0]-allData[0][0]);
300 GetRawsData(75)->Fill(allData[51][0]-allData[0][0]);
301 GetRawsData(76)->Fill(allData[52][0]-allData[0][0]);
302 }
303 if(type == 8)
304 {
305 GetRawsData(149)->Fill(allData[49][0]-allData[0][0]);
306 GetRawsData(150)->Fill(allData[50][0]-allData[0][0]);
307 GetRawsData(151)->Fill(allData[51][0]-allData[0][0]);
308 GetRawsData(152)->Fill(allData[52][0]-allData[0][0]);
309 /* cout<<" and "<<allData[49][0]-allData[0][0]<<
310 " vertex "<<allData[50][0]-allData[0][0]<<
311 " ORA "<<allData[51][0]-allData[0][0]<<
312 " ORC "<<allData[52][0]-allData[0][0]<<endl;*/
86c020af 313
5ed41460 314 GetRawsData(153)->Fill(allData[53][0]-allData[54][0]);
315 if(allData[55][0]) GetRawsData(154)->Fill(allData[53][0]-allData[54][0]);
316 if(allData[55][0]) GetRawsData(155)->Fill(allData[53][0]-allData[54][0]);
317
318 }
86c020af 319 delete start;
320 }
86c020af 321
04236e67 322}
323
324//____________________________________________________________________________
325void AliT0QADataMakerRec::MakeRecPoints(TTree * clustersTree)
326{
327 //fills QA histos for clusters
328
446d6ec4 329 // printf(" !!!!! AliT0QADataMakerRec::MakeRecPoints() started\n");
330 AliT0RecPoint* frecpoints= new AliT0RecPoint ();
04236e67 331 if (!frecpoints) {
332 AliError("Reconstruct Fill ESD >> no recpoints found");
333 return;
334 }
335 TBranch *brRec =clustersTree ->GetBranch("T0");
336 if (brRec) {
337 brRec->SetAddress(&frecpoints);
338 }else{
339 AliError(Form("EXEC Branch T0 rec not found "));
340 return;
341 }
342
343 brRec->GetEntry(0);
344
345 for ( Int_t i=0; i<24; i++) {
446d6ec4 346
04236e67 347 GetRecPointsData(i) -> Fill(frecpoints -> GetTime(i));
348 GetRecPointsData(i+24) -> Fill(frecpoints -> GetAmp(i));
349 GetRecPointsData(i+48) -> Fill(frecpoints->AmpLED(i));
446d6ec4 350
04236e67 351 // if(frecpoints -> GetTime(i) > 0) fhRecEff->Fill(i);
352 }
c724dd64 353 GetRecPointsData(72) ->Fill(frecpoints->GetOnlineMean());
354 GetRecPointsData(73) ->Fill(frecpoints->GetMeanTime());
446d6ec4 355 // printf(" !!!!! AliT0QADataMakerRec::MakeRecPoints() end\n");
04236e67 356
357}
358
359//____________________________________________________________________________
360void AliT0QADataMakerRec::MakeESDs(AliESDEvent * esd)
361{
362 //fills QA histos for ESD
c724dd64 363 printf(" !!!!! AliT0QADataMakerRec::MakeESD() started\n");
04236e67 364
365 GetESDsData(0) -> Fill(esd->GetT0());
366 GetESDsData(1)-> Fill(esd->GetT0zVertex());
367
368}
369