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
20 //////////////////////////////////////////////////////////////////////////////
33 #include "AliVZEROQATask.h"
35 #include "AliESDVZERO.h"
38 //______________________________________________________________________________
39 AliVZEROQATask::AliVZEROQATask(const char *name) :
40 AliAnalysisTask(name,""),
51 // Input slot #0 works with an Ntuple
52 DefineInput(0, TChain::Class());
53 // Output slot #0 writes into a TH1 container
54 DefineOutput(0, TObjArray::Class()) ;
57 //______________________________________________________________________________
58 AliVZEROQATask::~AliVZEROQATask()
62 fOutputContainer->Clear();
63 delete fOutputContainer;
71 //______________________________________________________________________________
72 void AliVZEROQATask::ConnectInputData(const Option_t*)
74 // Initialises branch container and histograms
76 AliInfo(Form("*** Initialization of %s", GetName())) ;
79 fChain = dynamic_cast<TChain *>(GetInputData(0)) ;
81 AliError(Form("Input 0 for %s not found\n", GetName()));
85 // One should first check if the branch address was taken by some other task
86 char ** address = (char **)GetBranchAddress(0, "ESD");
88 fESD = (AliESD*)(*address);
91 SetBranchAddress(0, "ESD", &fESD);
95 //________________________________________________________________________
96 void AliVZEROQATask::CreateOutputObjects()
100 fhVZERONbPMA = new TH1I("Nb of fired PMs in V0A", "VZERONbPMA" ,100 ,0 ,99);
101 fhVZERONbPMC = new TH1I("Nb of fired PMs in V0C", "VZERONbPMC" ,100 ,0 ,99);
102 fhVZEROMultA = new TH1I("Multiplicity in V0A", "VZEROMultA" ,50 ,0 ,49);
103 fhVZEROMultC = new TH1I("Multiplicity in V0C", "VZEROMultC" ,50 ,0 ,49);
105 // Creates output container
107 fOutputContainer = new TObjArray(4);
108 fOutputContainer->SetName(GetName()) ;
109 fOutputContainer->AddAt(fhVZERONbPMA, 0);
110 fOutputContainer->AddAt(fhVZERONbPMC, 1);
111 fOutputContainer->AddAt(fhVZEROMultA, 2);
112 fOutputContainer->AddAt(fhVZEROMultC, 3);
116 //______________________________________________________________________________
117 void AliVZEROQATask::Exec(Option_t *)
119 // Processing of one event
120 Long64_t entry = fChain->GetReadEntry() ;
123 AliError("fESD is not connected to the input!") ;
127 if ( !((entry-1)%100) )
128 AliInfo(Form("%s ----> Processing event # %lld", (dynamic_cast<TChain *>(fChain))->GetFile()->GetName(), entry)) ;
130 AliESDVZERO *esdVZERO=fESD->GetVZEROData();
133 fhVZERONbPMA->Fill(esdVZERO->GetNbPMV0A());
134 fhVZERONbPMC->Fill(esdVZERO->GetNbPMV0C());
135 fhVZEROMultA->Fill(esdVZERO->GetMTotV0A());
136 fhVZEROMultC->Fill(esdVZERO->GetMTotV0C());
138 PostData(0, fOutputContainer);
142 //______________________________________________________________________________
143 void AliVZEROQATask::Terminate(Option_t *)
145 // Processed when the event loop is ended
147 fOutputContainer = (TObjArray*)GetOutputData(0);
148 fhVZERONbPMA = (TH1I*)fOutputContainer->At(0);
149 fhVZERONbPMC = (TH1I*)fOutputContainer->At(1);
150 fhVZEROMultA = (TH1I*)fOutputContainer->At(2);
151 fhVZEROMultC = (TH1I*)fOutputContainer->At(3);
153 Bool_t problem = kFALSE ;
154 AliInfo(Form(" *** %s Report:", GetName())) ;
155 printf(" V0A Multiplicity Mean : %5.3f , RMS : %5.3f \n",fhVZEROMultA->GetMean(),fhVZEROMultA->GetRMS());
156 printf(" V0C Multiplicity Mean : %5.3f , RMS : %5.3f \n",fhVZEROMultC->GetMean(),fhVZEROMultC->GetRMS());
158 TCanvas * c1 = new TCanvas("Number of PMs fired in V0A", "Number of PMs fired in V0A", 1);
159 fhVZERONbPMA->SetAxisRange(0, 99);
160 fhVZERONbPMA->SetLineColor(2);
161 fhVZERONbPMA->Draw("SAME");
164 TCanvas * c2 = new TCanvas("Number of PMs fired in V0C", "Number of PMs fired in V0C", 1);
165 fhVZERONbPMC->SetAxisRange(0,99);
166 fhVZERONbPMC->SetLineColor(2);
167 fhVZERONbPMC->Draw("SAME");
170 TCanvas * c3 = new TCanvas("Multiplicity in V0A", "Multiplicity in V0A", 1);
171 fhVZEROMultA->SetAxisRange(0, 49);
172 fhVZEROMultA->SetLineColor(2);
173 fhVZEROMultA->Draw("SAME");
176 TCanvas * c4 = new TCanvas("Multiplicity in V0C", "Multiplicity in V0C", 1);
177 fhVZEROMultC->SetAxisRange(0,49);
178 fhVZEROMultC->SetLineColor(2);
179 fhVZEROMultC->Draw("SAME");
182 c1->Print("V0AMultiplicity.eps");
183 c2->Print("V0CMultiplicity.eps");
184 c3->Print("NumberV0APMs.eps");
185 c4->Print("NumberV0CPMs.eps");
188 sprintf(line, ".!tar -zcf %s.tar.gz *.eps", GetName()) ;
189 gROOT->ProcessLine(line);
190 sprintf(line, ".!rm -fR *.eps");
191 gROOT->ProcessLine(line);
193 AliInfo(Form("!!! All the eps files are in %s.tar.gz !!! ", GetName())) ;
197 report="Problems found, please check!!!";
201 AliInfo(Form("*** %s Summary Report: %s\n",GetName(), report)) ;