]> git.uio.no Git - u/mrichter/AliRoot.git/blame - T0/AliT0QADataMakerRec.cxx
Obsolete.
[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
54a263d5 42//#include "iostream.h"
04236e67 43ClassImp(AliT0QADataMakerRec)
44
45//____________________________________________________________________________
46 AliT0QADataMakerRec::AliT0QADataMakerRec() :
47 AliQADataMakerRec(AliQA::GetDetName(AliQA::kT0), "T0 Quality Assurance Data Maker")
48
49{
50 // ctor
51 /*
52 for(Int_t i=0; i<24; i++) {
53 fhHitsTime[i]=0x0;
54 fhDigCFD[i]=0x0;
55 fhDigLEDamp[i]=0x0;
56 fhRecCFD[i]=0x0;
57 fhRecLEDamp[i]=0x0;
58 fhRecQTC[i]=0x0;
59 }
60 */
61 // fDetectorDir = fOutput->GetDirectory(GetName()) ;
62// if (!fDetectorDir)
63// fDetectorDir = fOutput->mkdir(GetName()) ;
64}
65
66//____________________________________________________________________________
67AliT0QADataMakerRec::AliT0QADataMakerRec(const AliT0QADataMakerRec& qadm) :
68 AliQADataMakerRec()
69{
70 //copy ctor
71 /*
72 for(Int_t i=0; i<24; i++) {
73 fhHitsTime[i]=0x0;
74 fhDigCFD[i]=0x0;
75 fhDigLEDamp[i]=0x0;
76 fhRecCFD[i]=0x0;
77 fhRecLEDamp[i]=0x0;
78 fhRecQTC[i]=0x0;
79 }
80 */
81 SetName((const char*)qadm.GetName()) ;
82 SetTitle((const char*)qadm.GetTitle());
83}
84
85//__________________________________________________________________
86AliT0QADataMakerRec& AliT0QADataMakerRec::operator = (const AliT0QADataMakerRec& qadm )
87{
88 // Equal operator.
89 this->~AliT0QADataMakerRec();
90 new(this) AliT0QADataMakerRec(qadm);
91 return *this;
92}
93//____________________________________________________________________________
92a357bf 94void AliT0QADataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjArray * list)
04236e67 95{
96 //Detector specific actions at end of cycle
97 // do the QA checking
98 AliQAChecker::Instance()->Run(AliQA::kT0, task, list) ;
99}
100
101//____________________________________________________________________________
102void AliT0QADataMakerRec::StartOfDetectorCycle()
103{
104 //Detector specific actions at start of cycle
105
106}
107
108//____________________________________________________________________________
109void AliT0QADataMakerRec::InitRaws()
110{
111 // create Raw histograms in Raw subdir
112 printf(" AliT0QADataMakerRec::InitRaws() started\n");
113 TString timename, ampname, qtcname;
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];
86c020af 119
04236e67 120 for (Int_t i=0; i<24; i++)
121 {
122 timename ="hRawCFD";
123 ampname = "hRawLED";
124 qtcname = "hRawQTC";
125 timename += i;
126 ampname += i;
127 qtcname += i;
86c020af 128 fhRawCFD[i] = new TH1F(timename.Data(), timename.Data(),500,2100,2800);
129 Add2RawsList( fhRawCFD[i],i+1);
130 fhRawLEDamp[i] = new TH1F(ampname.Data(), ampname.Data(),300,350,650);
131 Add2RawsList( fhRawLEDamp[i],i+24+1);
132 fhRawQTC[i] = new TH1F(qtcname.Data(), qtcname.Data(),1500,1000,7000);
133 Add2RawsList( fhRawQTC[i],i+48+1);
04236e67 134 }
135
86c020af 136 TH1F* fhRawMean = new TH1F("hRawMean","online mean signal", 100,2400,2500);
137 Add2RawsList( fhRawMean,73);
138 TH1F* fhRawVertex = new TH1F("hRawVertex","online vertex signal", 100,0,600);
139 Add2RawsList( fhRawVertex,74);
140 TH1F* fhRawORA = new TH1F("hRawORA","online OR A", 100,2500,2800);
141 Add2RawsList( fhRawORA,75);
142 TH1F* fhRawORC = new TH1F("hRawORC","online OR C", 100,2000,2300);
143 Add2RawsList( fhRawORC,76);
04236e67 144
145}
146
147//____________________________________________________________________________
148
149void AliT0QADataMakerRec::InitRecPoints()
150{
151 // create cluster histograms in RecPoint subdir
152 /*
153 TH2F * fhRecCFD = new TH2F("fhRecCFD", " CFD reconstructed",25,-0.5,24.5,100,12,13);
154 Add2DigitsList( fhRecCFD,0);
155 TH2F *fhRecLEDamp = new TH2F("fhRecLEDamp", " amplitude LED reconstructed",25,-0.5,24.5,100,1000,1000);
156 Add2DigitsList( fhRecLEDamp,1);
157 TH2F * fhRecQTC = new TH2F("fhRecQTC", " amplitude QTC reconstructed",25,-0.5,24.5,100,1000,1000);
158 Add2DigitsList( fhRecQTC,2);
159 TH1F * fhRecMean = new TH1F("hRecMean"," reconstructed mean signal",100,500,600);
160 Add2DigitsList( fhRecMean,3);
161 */
162
163 TString timename,ampname, qtcname;
164 TH1F *fhRecCFD[24]; TH1F *fhRecLEDAmp[24]; TH1F * fhRecQTC[24];
165 for (Int_t i=0; i<24; i++)
166 {
167 timename ="hRecCFD";
168 ampname = "hRecLED";
169 qtcname = "hRecQTC";
170 timename += i;
171 ampname += i;
172 qtcname += i;
173 fhRecCFD[i] = new TH1F(timename.Data(), timename.Data(),100,0,1000);
174 Add2RecPointsList ( fhRecCFD[i],i);
175 fhRecLEDAmp[i] = new TH1F(ampname.Data(), ampname.Data(),100,0,200);
176 Add2RecPointsList ( fhRecLEDAmp[i],i+24);
177 fhRecQTC[i] = new TH1F(qtcname.Data(), qtcname.Data(),100,0,200);
178 Add2RecPointsList ( fhRecQTC[i],i+48);
179 }
180
181 TH1F *fhRecEff = new TH1F("hRecEff","Efficiency rec.points",25,-0.5,24.5);
182 Add2RecPointsList ( fhRecEff,72);
183 TH1F * fhRecMean = new TH1F("hRecMean"," reconstructed mean signal",100,500,600);
184 Add2RecPointsList( fhRecMean,73);
185
186}
187
188//____________________________________________________________________________
189void AliT0QADataMakerRec::InitESDs()
190{
191 //create ESDs histograms in ESDs subdir
192 TH1F *fhESDMean = new TH1F("hESDmean"," ESD mean",100,0,100);
193 Add2ESDsList(fhESDMean, 0) ;
194 TH1F * fhESDVertex = new TH1F("hESDvertex","EAD vertex",100,-50,50);
195 Add2ESDsList(fhESDVertex, 1) ;
196
197
198}
199
200//____________________________________________________________________________
201void AliT0QADataMakerRec::MakeRaws( AliRawReader* rawReader)
202{
04236e67 203 //fills QA histos for RAW
86c020af 204 AliT0RawReader *start = new AliT0RawReader(rawReader);
205 // start->Next();
206 if (! start->Next())
207 AliDebug(1,Form(" no raw data found!!"));
208 else
209 {
210 Int_t allData[110][5];
211 for (Int_t i0=0; i0<105; i0++)
212 {
213 for (Int_t j0=0; j0<5; j0++) allData[i0][j0]=0;
04236e67 214 }
86c020af 215 for (Int_t i=0; i<105; i++)
216 for (Int_t iHit=0; iHit<5; iHit++)
217 allData[i][iHit]= start->GetData(i,iHit);
218
219 allData[0][0] = allData[0][0] - 5000;
54a263d5 220
86c020af 221 for (Int_t ik = 0; ik<12; ik++){
222 for (Int_t iHt=0; iHt<5; iHt++){
223 if(allData[ik+1][iHt]>0){
224 GetRawsData(ik+1) -> Fill(allData[ik+1][iHt]-allData[0][0]);
225 if(allData[2*ik+25][iHt] > 0 && allData[2*ik+26][iHt] > 0)
226 GetRawsData(ik+48+1)->Fill(allData[2*ik+25][iHt]-allData[2*ik+26][iHt]);
227 if(allData[ik+13][iHt]!=0 )
228 GetRawsData(ik+24+1)->Fill(allData[ik+13][iHt]-allData[ik+1][iHt]);
229 }
04236e67 230 }
86c020af 231 }
232
233 for (Int_t ik = 12; ik<24; ik++) {
234 for (Int_t iHt=0; iHt<5; iHt++) {
235 if(allData[ik+45][iHt]>0) {
236 GetRawsData(ik+1)->Fill(allData[ik+45][iHt]-allData[0][0]);
237 if(allData[2*ik+57][iHt]!=0 && allData[2*ik+58][iHt]!=0)
238 GetRawsData(ik+48+1)->Fill(allData[2*ik+57][iHt]-allData[2*ik+58][iHt]);
239 if(allData[ik+57][iHt] > 0 )
240 GetRawsData(ik+24+1)->Fill(allData[ik+57][iHt]-allData[ik+45][iHt]);
241 }
242 }
243 }
244
04236e67 245
86c020af 246
247 GetRawsData(72)->Fill(allData[49][0]-allData[0][0]);
248 GetRawsData(73)->Fill(allData[50][0]-allData[0][0]);
249 GetRawsData(74)->Fill(allData[51][0]-allData[0][0]);
250 GetRawsData(75)->Fill(allData[52][0]-allData[0][0]);
251
252 delete start;
253 }
86c020af 254
04236e67 255}
256
257//____________________________________________________________________________
258void AliT0QADataMakerRec::MakeRecPoints(TTree * clustersTree)
259{
260 //fills QA histos for clusters
261
262 AliT0RecPoint* frecpoints= new AliT0RecPoint ();
263 if (!frecpoints) {
264 AliError("Reconstruct Fill ESD >> no recpoints found");
265 return;
266 }
267 TBranch *brRec =clustersTree ->GetBranch("T0");
268 if (brRec) {
269 brRec->SetAddress(&frecpoints);
270 }else{
271 AliError(Form("EXEC Branch T0 rec not found "));
272 return;
273 }
274
275 brRec->GetEntry(0);
276
277 for ( Int_t i=0; i<24; i++) {
278 GetRecPointsData(i) -> Fill(frecpoints -> GetTime(i));
279 GetRecPointsData(i+24) -> Fill(frecpoints -> GetAmp(i));
280 GetRecPointsData(i+48) -> Fill(frecpoints->AmpLED(i));
281 // if(frecpoints -> GetTime(i) > 0) fhRecEff->Fill(i);
282 }
283 GetRecPointsData(72) ->Fill(frecpoints->GetMeanTime());
284
285}
286
287//____________________________________________________________________________
288void AliT0QADataMakerRec::MakeESDs(AliESDEvent * esd)
289{
290 //fills QA histos for ESD
291
292 GetESDsData(0) -> Fill(esd->GetT0());
293 GetESDsData(1)-> Fill(esd->GetT0zVertex());
294
295}
296