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 **************************************************************************/
16 //------------------------------
17 // Analysis task for quality-assurance
20 // 05/12/2009 cvetan.cheshkov@cern.ch
21 //------------------------------
30 #include "AliESDEvent.h"
31 #include "AliESDVZERO.h"
33 #include "AliAnaVZEROQA.h"
35 ClassImp(AliAnaVZEROQA)
37 AliAnaVZEROQA::AliAnaVZEROQA():
38 AliAnalysisTaskSE("AliAnaVZEROQA"),
81 // Default constructor
82 // Define input and output slots here
83 // Input slot #0 works with a TChain
84 DefineInput(0, TChain::Class());
85 // Output slot #1 TList
86 DefineOutput(1, TList::Class());
89 AliAnaVZEROQA::AliAnaVZEROQA(const char* name):
90 AliAnalysisTaskSE(name),
133 AliInfo("Constructor AliAnaVZEROQA");
134 // Define input and output slots here
135 // Input slot #0 works with a TChain
136 DefineInput(0, TChain::Class());
137 // Output slot #1 TList
138 DefineOutput(1, TList::Class());
141 TH1F * AliAnaVZEROQA::CreateHisto1D(const char* name, const char* title,Int_t nBins,
142 Double_t xMin, Double_t xMax,
143 const char* xLabel, const char* yLabel)
145 // create a histogram
146 TH1F* result = new TH1F(name, title, nBins, xMin, xMax);
147 result->SetOption("E");
148 if (xLabel) result->GetXaxis()->SetTitle(xLabel);
149 if (yLabel) result->GetYaxis()->SetTitle(yLabel);
150 result->SetMarkerStyle(kFullCircle);
154 TH2F * AliAnaVZEROQA::CreateHisto2D(const char* name, const char* title,Int_t nBinsX,
155 Double_t xMin, Double_t xMax,
157 Double_t yMin, Double_t yMax,
158 const char* xLabel, const char* yLabel)
160 // create a histogram
161 TH2F* result = new TH2F(name, title, nBinsX, xMin, xMax, nBinsY, yMin, yMax);
162 if (xLabel) result->GetXaxis()->SetTitle(xLabel);
163 if (yLabel) result->GetYaxis()->SetTitle(yLabel);
167 void AliAnaVZEROQA::UserCreateOutputObjects()
170 AliInfo("AliAnaVZEROQA::UserCreateOutputObjects");
171 // Create output container
172 fListOfHistos = new TList();
173 fListOfHistos->SetOwner();
175 fhAdcNoTimeA = CreateHisto1D("hAdcNoTimeA","ADC (no Leading Time) V0A",200,0,200,"ADC charge","Entries");
176 fhAdcWithTimeA = CreateHisto1D("hAdcWithTimeA","ADC ( with Leading Time) V0A",200,0,200,"ADC charge","Entries");
177 fhAdcNoTimeC = CreateHisto1D("hAdcNoTimeC","ADC (no Leading Time) V0C",200,0,200,"ADC charge","Entries");
178 fhAdcWithTimeC = CreateHisto1D("hAdcWithTimeC","ADC ( with Leading Time) V0C",200,0,200,"ADC charge","Entries");
180 fhAdcPMTNoTime = CreateHisto2D("hadcpmtnotime","ADC vs PMT index (no leading time)",64,-0.5,63.5,200,0,200,"PMT index","ADC charge");
181 fhAdcPMTWithTime = CreateHisto2D("hadcpmtwithtime","ADC vs PMT index (with leading time)",64,-0.5,63.5,200,0,200,"PMT index","ADC charge");
183 fhTimeA = CreateHisto1D("htimepmtA","Time measured by TDC V0A",400,-100,100,"Leading time (ns)","Entries");
184 fhTimeC = CreateHisto1D("htimepmtC","Time measured by TDC V0C",400,-100,100,"Leading time (ns)","Entries");
186 fhWidthA = CreateHisto1D("hwidthA","Signal width measured by TDC V0A",200,0,100,"Signal width (ns)","Entries");
187 fhWidthC = CreateHisto1D("hwidthC","Signal width measured by TDC V0C",200,0,100,"Signal width (ns)","Entries");
189 fhTimePMT = CreateHisto2D("htimepmt","Time measured by TDC vs PMT index",64,-0.5,63.5,200,0,100,"PMT Index","Leading time (ns)");
190 fhWidthPMT = CreateHisto2D("hwidthpmt","Time width vs PMT index",64,-0.5,63.5,200,0,100,"PMT Index","Signal width (ns)");
192 fhAdcWidthA = CreateHisto2D("hadcwidthA","Time width vs ADC V0A",200,0,200,200,0,100,"ADC charge","Width (ns)");
193 fhAdcWidthC = CreateHisto2D("hadcwidthC","Time width vs ADC V0C",200,0,200,200,0,100,"ADC charge","Width (ns)");
195 fhTimeCorr = CreateHisto2D("htimecorr","Average time C side vs. A side",200,0,100,200,0,100,"Time V0A (ns)","Time V0C (ns");
197 fhAdcTimeA = CreateHisto2D("hAdcTimeA","ADC vs Time V0A",1000,-100,100,200,0,200,"Time (ns)","ADC charge");
198 fhAdcTimeC = CreateHisto2D("hAdcTimeC","ADC vs Time V0C",1000,-100,100,200,0,200,"Time (ns)","ADC charge");
200 fV0a = CreateHisto1D("hV0a","Number of fired PMTs (V0A)",65,-0.5,64.5);
201 fV0c = CreateHisto1D("hV0c","Number of fired PMTs (V0C)",65,-0.5,64.5);
202 fV0multA = CreateHisto1D("hV0multA","Total reconstructed multiplicity (V0A)",100,0.,1000.);
203 fV0multC = CreateHisto1D("hV0multC","Total reconstructed multiplicity (V0C)",100,0.,1000.);
204 fV0ampl = CreateHisto1D("hV0ampl","V0 multiplicity in single channel (all V0 channels)",400,-0.5,99.5);
206 fhEvents = CreateHisto2D("hEvents","V0C vs V0A (empty,bb,bg)",3,-0.5,2.5,3,-0.5,2.5);
208 fhVtxXYBB = CreateHisto2D("fhVtxXYBB","XY SPD vertex (bb)",200,-2,2,200,-2,2);
209 fhVtxZBB = CreateHisto1D("fhVtxZBB","Z SPD vertex (bb)",400,-50,50);
210 fhVtxXYBGA = CreateHisto2D("fhVtxXYBGA","XY SPD vertex (bga)",200,-2,2,200,-2,2);
211 fhVtxZBGA = CreateHisto1D("fhVtxZBGA","Z SPD vertex (bga)",400,-50,50);
212 fhVtxXYBGC = CreateHisto2D("fhVtxXYBGC","XY SPD vertex (bgc)",200,-2,2,200,-2,2);
213 fhVtxZBGC = CreateHisto1D("fhVtxZBGC","Z SPD vertex (bgc)",400,-50,50);
215 fListOfHistos->Add(fhAdcNoTimeA);
216 fListOfHistos->Add(fhAdcWithTimeA);
217 fListOfHistos->Add(fhAdcNoTimeC);
218 fListOfHistos->Add(fhAdcWithTimeC);
220 fListOfHistos->Add(fhAdcPMTNoTime);
221 fListOfHistos->Add(fhAdcPMTWithTime);
223 fListOfHistos->Add(fhTimeA);
224 fListOfHistos->Add(fhTimeC);
226 fListOfHistos->Add(fhWidthA);
227 fListOfHistos->Add(fhWidthC);
229 fListOfHistos->Add(fhTimePMT);
230 fListOfHistos->Add(fhWidthPMT);
232 fListOfHistos->Add(fhAdcWidthA);
233 fListOfHistos->Add(fhAdcWidthC);
235 fListOfHistos->Add(fhTimeCorr);
237 fListOfHistos->Add(fhAdcTimeA);
238 fListOfHistos->Add(fhAdcTimeC);
240 fListOfHistos->Add(fV0a);
241 fListOfHistos->Add(fV0c);
242 fListOfHistos->Add(fV0multA);
243 fListOfHistos->Add(fV0multC);
244 fListOfHistos->Add(fV0ampl);
246 fListOfHistos->Add(fhEvents);
248 fListOfHistos->Add(fhVtxXYBB);
249 fListOfHistos->Add(fhVtxZBB);
250 fListOfHistos->Add(fhVtxXYBGA);
251 fListOfHistos->Add(fhVtxZBGA);
252 fListOfHistos->Add(fhVtxXYBGC);
253 fListOfHistos->Add(fhVtxZBGC);
255 PostData(1, fListOfHistos);
258 void AliAnaVZEROQA::UserExec(Option_t */*option*/)
260 // Fill the QA histograms
262 AliVEvent* event = InputEvent();
264 Printf("ERROR: Could not retrieve event");
268 AliESDEvent* esd = dynamic_cast<AliESDEvent*>(event);
270 Printf("ERROR: No ESD event");
273 AliESDVZERO* esdV0 = esd->GetVZEROData();
275 Printf("ERROR: No ESD VZERO");
279 for (Int_t i=0; i<64; ++i) {
280 if (esdV0->GetTime(i) < 1e-6) {
282 fhAdcNoTimeA->Fill(esdV0->GetAdc(i));
285 fhAdcNoTimeC->Fill(esdV0->GetAdc(i));
287 fhAdcPMTNoTime->Fill(i,esdV0->GetAdc(i));
291 fhAdcWithTimeA->Fill(esdV0->GetAdc(i));
294 fhAdcWithTimeC->Fill(esdV0->GetAdc(i));
296 fhAdcPMTWithTime->Fill(i,esdV0->GetAdc(i));
300 fhTimeA->Fill(esdV0->GetTime(i));
301 fhWidthA->Fill(esdV0->GetWidth(i));
302 fhAdcWidthA->Fill(esdV0->GetAdc(i),esdV0->GetWidth(i));
303 fhAdcTimeA->Fill(esdV0->GetTime(i),esdV0->GetAdc(i));
306 fhTimeC->Fill(esdV0->GetTime(i));
307 fhWidthC->Fill(esdV0->GetWidth(i));
308 fhAdcWidthC->Fill(esdV0->GetAdc(i),esdV0->GetWidth(i));
309 fhAdcTimeC->Fill(esdV0->GetTime(i),esdV0->GetAdc(i));
311 fhTimePMT->Fill(i,esdV0->GetTime(i));
312 fhWidthPMT->Fill(i,esdV0->GetWidth(i));
316 fhTimeCorr->Fill(esdV0->GetV0ATime(),esdV0->GetV0CTime());
318 AliESDVZERO::Decision flaga = esdV0->GetV0ADecision();
319 AliESDVZERO::Decision flagc = esdV0->GetV0CDecision();
321 fhEvents->Fill(flaga,flagc);
323 const AliESDVertex *vtx = esd->GetPrimaryVertexSPD();
325 if (flaga <= 1 && flagc <=1) {
326 fhVtxXYBB->Fill(vtx->GetXv(),vtx->GetYv());
327 fhVtxZBB->Fill(vtx->GetZv());
331 fhVtxXYBGA->Fill(vtx->GetXv(),vtx->GetYv());
332 fhVtxZBGA->Fill(vtx->GetZv());
335 fhVtxXYBGC->Fill(vtx->GetXv(),vtx->GetYv());
336 fhVtxZBGC->Fill(vtx->GetZv());
340 fV0a->Fill(esdV0->GetNbPMV0A());
341 fV0c->Fill(esdV0->GetNbPMV0C());
342 fV0multA->Fill(esdV0->GetMTotV0A());
343 fV0multC->Fill(esdV0->GetMTotV0C());
344 for(Int_t i = 0; i < 64; i++) {
345 fV0ampl->Fill(esdV0->GetMultiplicity(i));
349 PostData(1, fListOfHistos);
352 void AliAnaVZEROQA::Terminate(Option_t *)
354 // Store the output histograms
356 fListOfHistos = dynamic_cast<TList*>(GetOutputData(1));
357 if (!fListOfHistos) {
358 Printf("ERROR: fListOfHistos not available");
362 Info("AliAnaVZEROQA", "Successfully finished");