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 **************************************************************************/
18 // An analysis task to check the ESD VZERO data in simulated data
19 // An analysis task to check the ESD VZERO data in simulated data
20 // An analysis task to check the ESD VZERO data in simulated data
21 // An analysis task to check the ESD VZERO data in simulated data
22 // An analysis task to check the ESD VZERO data in simulated data
24 //////////////////////////////////////////////////////////////////////////////
34 #include "AliVZEROQATask.h"
36 #include "AliESDVZERO.h"
39 //______________________________________________________________________________
40 AliVZEROQATask::AliVZEROQATask(const char *name) :
41 AliAnalysisTask(name,""),
52 // Input slot #0 works with an Ntuple
53 DefineInput(0, TChain::Class());
54 // Output slot #0 writes into a TH1 container
55 DefineOutput(0, TObjArray::Class()) ;
58 AliVZEROQATask::AliVZEROQATask(const AliVZEROQATask& ta) :
59 AliAnalysisTask(ta.GetName(),""),
62 fOutputContainer(ta.fOutputContainer),
63 fhVZERONbPMA(ta.fhVZERONbPMA),
64 fhVZERONbPMC(ta.fhVZERONbPMC),
65 fhVZEROMultA(ta.fhVZEROMultA),
66 fhVZEROMultC(ta.fhVZEROMultC)
72 //_____________________________________________________________________________
73 AliVZEROQATask& AliVZEROQATask::operator = (const AliVZEROQATask& ap)
75 // assignment operator
77 this->~AliVZEROQATask();
78 new(this) AliVZEROQATask(ap);
82 //______________________________________________________________________________
83 AliVZEROQATask::~AliVZEROQATask()
87 fOutputContainer->Clear();
88 delete fOutputContainer;
96 //______________________________________________________________________________
97 void AliVZEROQATask::ConnectInputData(const Option_t*)
99 // Initialises branch container and histograms
101 AliInfo(Form("*** Initialization of %s", GetName())) ;
104 fChain = dynamic_cast<TChain *>(GetInputData(0)) ;
106 AliError(Form("Input 0 for %s not found\n", GetName()));
110 // One should first check if the branch address was taken by some other task
111 char ** address = (char **)GetBranchAddress(0, "ESD");
113 fESD = (AliESD*)(*address);
116 SetBranchAddress(0, "ESD", &fESD);
120 //________________________________________________________________________
121 void AliVZEROQATask::CreateOutputObjects()
123 // Creates histograms
127 fhVZERONbPMA = new TH1I("Nb of fired PMs in V0A", "VZERONbPMA" ,100 ,0 ,99);
128 fhVZERONbPMC = new TH1I("Nb of fired PMs in V0C", "VZERONbPMC" ,100 ,0 ,99);
129 fhVZEROMultA = new TH1I("Multiplicity in V0A", "VZEROMultA" ,50 ,0 ,49);
130 fhVZEROMultC = new TH1I("Multiplicity in V0C", "VZEROMultC" ,50 ,0 ,49);
132 // Creates output container
134 fOutputContainer = new TObjArray(4);
135 fOutputContainer->SetName(GetName()) ;
136 fOutputContainer->AddAt(fhVZERONbPMA, 0);
137 fOutputContainer->AddAt(fhVZERONbPMC, 1);
138 fOutputContainer->AddAt(fhVZEROMultA, 2);
139 fOutputContainer->AddAt(fhVZEROMultC, 3);
143 //______________________________________________________________________________
144 void AliVZEROQATask::Exec(Option_t *)
146 // Processing of one event
147 Long64_t entry = fChain->GetReadEntry() ;
150 AliError("fESD is not connected to the input!") ;
154 if ( !((entry-1)%100) )
155 AliInfo(Form("%s ----> Processing event # %lld", (dynamic_cast<TChain *>(fChain))->GetFile()->GetName(), entry)) ;
157 AliESDVZERO *esdVZERO=fESD->GetVZEROData();
160 fhVZERONbPMA->Fill(esdVZERO->GetNbPMV0A());
161 fhVZERONbPMC->Fill(esdVZERO->GetNbPMV0C());
162 fhVZEROMultA->Fill(esdVZERO->GetMTotV0A());
163 fhVZEROMultC->Fill(esdVZERO->GetMTotV0C());
165 PostData(0, fOutputContainer);
169 //______________________________________________________________________________
170 void AliVZEROQATask::Terminate(Option_t *)
172 // Processed when the event loop is ended
174 fOutputContainer = (TObjArray*)GetOutputData(0);
175 fhVZERONbPMA = (TH1I*)fOutputContainer->At(0);
176 fhVZERONbPMC = (TH1I*)fOutputContainer->At(1);
177 fhVZEROMultA = (TH1I*)fOutputContainer->At(2);
178 fhVZEROMultC = (TH1I*)fOutputContainer->At(3);
180 Bool_t problem = kFALSE ;
181 AliInfo(Form(" *** %s Report:", GetName())) ;
182 printf(" V0A Multiplicity Mean : %5.3f , RMS : %5.3f \n",fhVZEROMultA->GetMean(),fhVZEROMultA->GetRMS());
183 printf(" V0C Multiplicity Mean : %5.3f , RMS : %5.3f \n",fhVZEROMultC->GetMean(),fhVZEROMultC->GetRMS());
185 TCanvas * c1 = new TCanvas("Number of PMs fired in V0A", "Number of PMs fired in V0A", 1);
186 fhVZERONbPMA->SetAxisRange(0, 99);
187 fhVZERONbPMA->SetLineColor(2);
188 fhVZERONbPMA->Draw("SAME");
191 TCanvas * c2 = new TCanvas("Number of PMs fired in V0C", "Number of PMs fired in V0C", 1);
192 fhVZERONbPMC->SetAxisRange(0,99);
193 fhVZERONbPMC->SetLineColor(2);
194 fhVZERONbPMC->Draw("SAME");
197 TCanvas * c3 = new TCanvas("Multiplicity in V0A", "Multiplicity in V0A", 1);
198 fhVZEROMultA->SetAxisRange(0, 49);
199 fhVZEROMultA->SetLineColor(2);
200 fhVZEROMultA->Draw("SAME");
203 TCanvas * c4 = new TCanvas("Multiplicity in V0C", "Multiplicity in V0C", 1);
204 fhVZEROMultC->SetAxisRange(0,49);
205 fhVZEROMultC->SetLineColor(2);
206 fhVZEROMultC->Draw("SAME");
209 c1->Print("V0AMultiplicity.eps");
210 c2->Print("V0CMultiplicity.eps");
211 c3->Print("NumberV0APMs.eps");
212 c4->Print("NumberV0CPMs.eps");
215 sprintf(line, ".!tar -zcf %s.tar.gz *.eps", GetName()) ;
216 gROOT->ProcessLine(line);
217 sprintf(line, ".!rm -fR *.eps");
218 gROOT->ProcessLine(line);
220 AliInfo(Form("!!! All the eps files are in %s.tar.gz !!! ", GetName())) ;
224 report="Problems found, please check!!!";
228 AliInfo(Form("*** %s Summary Report: %s\n",GetName(), report.Data())) ;