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 **************************************************************************/
17 /* History of cvs commits:
20 * Revision 1.1 2007/01/23 17:17:29 schutz
26 //_________________________________________________________________________
27 // Class for the analysis of gamma correlations (gamma-jet,
28 // gamma-hadron and isolation cut.
29 // This class makes isolation cut analysis for 2 IC methods
30 //(cone pt sum and particle pt threshold), for different cone sizes
33 // Class created from old AliPHOSGammaJet
34 // (see AliRoot versions previous Release 4-09)
36 //*-- Author: Gustavo Conesa (LNF-INFN)
37 //////////////////////////////////////////////////////////////////////////////
40 // --- ROOT system ---
43 #include <TParticle.h>
46 #include "AliAnaGammaIsolCut.h"
48 #include "AliESDtrack.h"
49 #include "AliESDCaloCluster.h"
50 #include "Riostream.h"
53 ClassImp(AliAnaGammaIsolCut)
55 //____________________________________________________________________________
56 AliAnaGammaIsolCut::AliAnaGammaIsolCut(const char *name) :
57 AliAnaGammaDirect(name),
58 fOutputContainer(new TObjArray(100)),
59 fNCones(0),fNPtThres(0)
62 TList * list = gDirectory->GetListOfKeys() ;
66 for (index = 0 ; index < list->GetSize()-1 ; index++) {
67 //-1 to avoid GammaJet Task
68 h = dynamic_cast<TH2F*>(gDirectory->Get(list->At(index)->GetName())) ;
69 fOutputContainer->Add(h) ;
72 for(Int_t i = 0; i < 10 ; i++){
77 // Input slot #0 works with an Ntuple
78 DefineInput(0, TChain::Class());
79 // Output slot #0 writes into a TH1 container
80 DefineOutput(0, TObjArray::Class()) ;
85 //____________________________________________________________________________
86 AliAnaGammaIsolCut::AliAnaGammaIsolCut(const AliAnaGammaIsolCut & ic) :
87 AliAnaGammaDirect(ic),
88 fOutputContainer(ic. fOutputContainer),
89 fNCones(ic.fNCones),fNPtThres(ic.fNPtThres)
92 SetName (ic.GetName()) ;
93 SetTitle(ic.GetTitle()) ;
95 for(Int_t i = 0; i < 10 ; i++){
96 fConeSizes[i]= ic.fConeSizes[i];
97 fPtThresholds[i]= ic.fPtThresholds[i];
101 //____________________________________________________________________________
102 AliAnaGammaIsolCut::~AliAnaGammaIsolCut()
104 // Remove all pointers
105 fOutputContainer->Clear() ;
106 delete fOutputContainer ;
108 delete fhPtCandidate ;
109 delete [] fhPtThresIsolated ;
110 delete [] fhPtSumIsolated ;
116 //____________________________________________________________________________
117 void AliAnaGammaIsolCut::Exec(Option_t *)
120 // Processing of one event
123 Long64_t entry = GetChain()->GetReadEntry() ;
126 AliError("fESD is not connected to the input!") ;
131 AliInfo(Form("%s ----> Processing event # %lld", (dynamic_cast<TChain *>(GetChain()))->GetFile()->GetName(), entry)) ;
133 //CreateTLists with arrays of TParticles. Filled with particles only relevant for the analysis.
135 TClonesArray * particleList = new TClonesArray("TParticle",1000); // All particles refitted in CTS and detected in EMCAL (jet)
136 TClonesArray * plCTS = new TClonesArray("TParticle",1000); // All particles refitted in Central Tracking System (ITS+TPC)
137 TClonesArray * plNe = new TClonesArray("TParticle",1000); // All particles measured in Jet Calorimeter (EMCAL)
138 TClonesArray * plPHOS = new TClonesArray("TParticle",1000); // All particles measured in PHOS as Gamma calorimeter
139 TClonesArray * plEMCAL = new TClonesArray("TParticle",1000); // All particles measured in EMCAL as Gamma calorimeter
142 AliDebug(2, "Fill particle lists");
144 //Fill particle lists
145 CreateParticleList(particleList, plCTS,plEMCAL,plPHOS);
147 if(GetCalorimeter() == "PHOS")
149 if(GetCalorimeter() == "EMCAL")
152 //Isolation Cut Analysis for both methods and different pt cuts and cones
154 for(Int_t ipr = 0; ipr < plNe->GetEntries() ; ipr ++ ){
155 TParticle * pCandidate = dynamic_cast<TParticle *>(plNe->At(ipr)) ;
157 if(pCandidate->Pt() > GetMinGammaPt()){
159 Bool_t icPtThres = kFALSE;
160 Bool_t icPtSum = kFALSE;
162 Float_t ptC = pCandidate->Pt() ;
164 fhPtCandidate->Fill(ptC);
166 for(Int_t icone = 0; icone<fNCones; icone++){
167 SetConeSize(fConeSizes[icone]) ;
168 Float_t coneptsum = 0 ;
169 for(Int_t ipt = 0; ipt<fNPtThres;ipt++){
170 SetPtThreshold(fPtThresholds[ipt]) ;
171 MakeIsolationCut(plCTS,plNe, pCandidate, ipr, icPtThres, icPtSum,coneptsum);
172 AliDebug(4,Form("Candidate pt %f, pt in cone %f, Isolated? ICPt %d, ICSum %d",
173 pCandidate->Pt(), coneptsum, icPtThres, icPtSum));
175 fhPtThresIsolated[icone][ipt]->Fill(ptC);
177 fhPtSumIsolated[icone]->Fill(ptC,coneptsum) ;
182 AliDebug(2, "End of analysis, delete pointers");
184 particleList->Delete() ;
194 delete particleList ;
196 PostData(0, fOutputContainer);
199 //____________________________________________________________________________
200 void AliAnaGammaIsolCut::Init(const Option_t * )
202 // Initialisation of branch container
203 AliAnaGammaDirect::Init();
207 fConeSizes[0] = 0.1; fConeSizes[0] = 0.2; fConeSizes[2] = 0.3; fConeSizes[3] = 0.4;
208 fPtThresholds[0]=1.; fPtThresholds[0]=2.; fPtThresholds[0]=3.; fPtThresholds[0]=4.;
210 //Initialization of histograms
214 //___________________________________________________________________
215 void AliAnaGammaIsolCut::MakeHistos()
217 // Create histograms to be saved in output file and
218 // stores them in fOutputContainer
220 fOutputContainer = new TObjArray(10000) ;
222 //Isolation cut histograms
223 fhPtCandidate = new TH1F
224 ("PtCandidate","p_{T} of candidate particles for isolation",240,0,120);
225 fhPtCandidate->SetXTitle("p_{T} (GeV/c)");
226 fOutputContainer->Add(fhPtCandidate) ;
230 for(Int_t icone = 0; icone<fNCones; icone++){
231 sprintf(name,"PtSumIsolated_Cone_%d",icone);
232 sprintf(title,"Candidate cone sum p_{T} for cone size %d vs candidate p_{T}",icone);
233 fhPtSumIsolated[icone] = new TH2F(name, title,240,0,120,120,0,10);
234 fhPtSumIsolated[icone]->SetYTitle("#Sigma p_{T} (GeV/c)");
235 fhPtSumIsolated[icone]->SetXTitle("p_{T} (GeV/c)");
236 fOutputContainer->Add(fhPtSumIsolated[icone]) ;
238 for(Int_t ipt = 0; ipt<fNPtThres;ipt++){
239 sprintf(name,"PtThresIsol_Cone_%d_Pt%d",icone,ipt);
240 sprintf(title,"Isolated candidate p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt);
241 fhPtThresIsolated[icone][ipt] = new TH1F(name, title,240,0,120);
242 fhPtThresIsolated[icone][ipt]->SetXTitle("p_{T} (GeV/c)");
243 fOutputContainer->Add(fhPtThresIsolated[icone][ipt]) ;
250 void AliAnaGammaIsolCut::Print(const Option_t * opt) const
253 //Print some relevant parameters set for the analysis
257 Info("Print", "%s %s", GetName(), GetTitle() ) ;
258 printf("N Cone Sizes = %d\n", fNCones) ;
259 printf("N pT thresholds = %d\n", fNPtThres) ;
260 printf("Cone Sizes = \n") ;
261 for(Int_t i = 0; i < fNCones; i++)
262 printf(" %f;", fConeSizes[i]) ;
264 for(Int_t i = 0; i < fNPtThres; i++)
265 printf(" %f;", fPtThresholds[i]) ;
270 void AliAnaGammaIsolCut::Terminate(Option_t *)
272 // The Terminate() function is the last function to be called during
273 // a query. It always runs on the client, it can be used to present
274 // the results graphically or save the results to file.