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/25 17:24:20 schutz
23 * Revision 1.1 2007/01/23 17:17:29 schutz
29 //_________________________________________________________________________
30 // Class for the analysis of gamma correlations (gamma-jet,
31 // gamma-hadron and isolation cut.
32 // This class makes isolation cut analysis for 2 IC methods
33 //(cone pt sum and particle pt threshold), for different cone sizes
36 // Class created from old AliPHOSGammaJet
37 // (see AliRoot versions previous Release 4-09)
39 //*-- Author: Gustavo Conesa (LNF-INFN)
40 //////////////////////////////////////////////////////////////////////////////
43 // --- ROOT system ---
46 #include <TParticle.h>
49 #include "AliAnaGammaIsolCut.h"
51 #include "AliESDtrack.h"
52 #include "AliESDCaloCluster.h"
53 #include "Riostream.h"
56 ClassImp(AliAnaGammaIsolCut)
58 //____________________________________________________________________________
59 AliAnaGammaIsolCut::AliAnaGammaIsolCut(const char *name) :
60 AliAnaGammaDirect(name),
61 fOutputContainer(new TObjArray(100)),
62 fNCones(0),fNPtThres(0)
65 TList * list = gDirectory->GetListOfKeys() ;
69 for (index = 0 ; index < list->GetSize()-1 ; index++) {
70 //-1 to avoid GammaJet Task
71 h = dynamic_cast<TH2F*>(gDirectory->Get(list->At(index)->GetName())) ;
72 fOutputContainer->Add(h) ;
75 for(Int_t i = 0; i < 10 ; i++){
80 // Input slot #0 works with an Ntuple
81 DefineInput(0, TChain::Class());
82 // Output slot #0 writes into a TH1 container
83 DefineOutput(0, TObjArray::Class()) ;
88 //____________________________________________________________________________
89 AliAnaGammaIsolCut::AliAnaGammaIsolCut(const AliAnaGammaIsolCut & ic) :
90 AliAnaGammaDirect(ic),
91 fOutputContainer(ic. fOutputContainer),
92 fNCones(ic.fNCones),fNPtThres(ic.fNPtThres)
95 SetName (ic.GetName()) ;
96 SetTitle(ic.GetTitle()) ;
98 for(Int_t i = 0; i < 10 ; i++){
99 fConeSizes[i]= ic.fConeSizes[i];
100 fPtThresholds[i]= ic.fPtThresholds[i];
104 //____________________________________________________________________________
105 AliAnaGammaIsolCut::~AliAnaGammaIsolCut()
107 // Remove all pointers
108 fOutputContainer->Clear() ;
109 delete fOutputContainer ;
111 delete fhPtCandidate ;
112 delete [] fhPtThresIsolated ;
113 delete [] fhPtSumIsolated ;
117 //______________________________________________________________________________
118 void AliAnaGammaIsolCut::ConnectInputData(const Option_t*)
120 // Initialisation of branch container and histograms
121 AliAnaGammaDirect::ConnectInputData("");
125 //____________________________________________________
126 void AliAnaGammaIsolCut::CreateOutputObjects()
129 // Init parameteres and create histograms to be saved in output file and
130 // stores them in fOutputContainer
133 fOutputContainer = new TObjArray(100) ;
135 //Isolation cut histograms
136 fhPtCandidate = new TH1F
137 ("PtCandidate","p_{T} of candidate particles for isolation",240,0,120);
138 fhPtCandidate->SetXTitle("p_{T} (GeV/c)");
139 fOutputContainer->Add(fhPtCandidate) ;
143 for(Int_t icone = 0; icone<fNCones; icone++){
144 sprintf(name,"PtSumIsolated_Cone_%d",icone);
145 sprintf(title,"Candidate cone sum p_{T} for cone size %d vs candidate p_{T}",icone);
146 fhPtSumIsolated[icone] = new TH2F(name, title,240,0,120,120,0,10);
147 fhPtSumIsolated[icone]->SetYTitle("#Sigma p_{T} (GeV/c)");
148 fhPtSumIsolated[icone]->SetXTitle("p_{T} (GeV/c)");
149 fOutputContainer->Add(fhPtSumIsolated[icone]) ;
151 for(Int_t ipt = 0; ipt<fNPtThres;ipt++){
152 sprintf(name,"PtThresIsol_Cone_%d_Pt%d",icone,ipt);
153 sprintf(title,"Isolated candidate p_{T} distribution for cone size %d and p_{T}^{th} %d",icone,ipt);
154 fhPtThresIsolated[icone][ipt] = new TH1F(name, title,240,0,120);
155 fhPtThresIsolated[icone][ipt]->SetXTitle("p_{T} (GeV/c)");
156 fOutputContainer->Add(fhPtThresIsolated[icone][ipt]) ;
162 //____________________________________________________________________________
163 void AliAnaGammaIsolCut::Exec(Option_t *)
166 // Processing of one event
169 Long64_t entry = GetChain()->GetReadEntry() ;
171 AliError("fESD is not connected to the input!") ;
175 AliInfo(Form("%s ----> Processing event # %lld", (dynamic_cast<TChain *>(GetChain()))->GetFile()->GetName(), entry)) ;
177 //CreateTLists with arrays of TParticles. Filled with particles only relevant for the analysis.
179 TClonesArray * particleList = new TClonesArray("TParticle",1000); // All particles refitted in CTS and detected in EMCAL (jet)
180 TClonesArray * plCTS = new TClonesArray("TParticle",1000); // All particles refitted in Central Tracking System (ITS+TPC)
181 TClonesArray * plNe = new TClonesArray("TParticle",1000); // All particles measured in Jet Calorimeter (EMCAL)
182 TClonesArray * plPHOS = new TClonesArray("TParticle",1000); // All particles measured in PHOS as Gamma calorimeter
183 TClonesArray * plEMCAL = new TClonesArray("TParticle",1000); // All particles measured in EMCAL as Gamma calorimeter
186 AliDebug(2, "Fill particle lists");
188 //Fill particle lists
189 CreateParticleList(particleList, plCTS,plEMCAL,plPHOS);
191 if(GetCalorimeter() == "PHOS")
193 if(GetCalorimeter() == "EMCAL")
196 //Isolation Cut Analysis for both methods and different pt cuts and cones
198 for(Int_t ipr = 0; ipr < plNe->GetEntries() ; ipr ++ ){
199 TParticle * pCandidate = dynamic_cast<TParticle *>(plNe->At(ipr)) ;
201 if(pCandidate->Pt() > GetMinGammaPt()){
203 Bool_t icPtThres = kFALSE;
204 Bool_t icPtSum = kFALSE;
206 Float_t ptC = pCandidate->Pt() ;
208 fhPtCandidate->Fill(ptC);
210 for(Int_t icone = 0; icone<fNCones; icone++){
211 SetConeSize(fConeSizes[icone]) ;
212 Float_t coneptsum = 0 ;
213 for(Int_t ipt = 0; ipt<fNPtThres;ipt++){
214 SetPtThreshold(fPtThresholds[ipt]) ;
215 MakeIsolationCut(plCTS,plNe, pCandidate, ipr, icPtThres, icPtSum,coneptsum);
216 AliDebug(4,Form("Candidate pt %f, pt in cone %f, Isolated? ICPt %d, ICSum %d",
217 pCandidate->Pt(), coneptsum, icPtThres, icPtSum));
219 fhPtThresIsolated[icone][ipt]->Fill(ptC);
221 fhPtSumIsolated[icone]->Fill(ptC,coneptsum) ;
226 AliDebug(2, "End of analysis, delete pointers");
228 particleList->Delete() ;
238 delete particleList ;
240 PostData(0, fOutputContainer);
243 //____________________________________________________________________________
244 void AliAnaGammaIsolCut::InitParameters()
246 // Initialisation of branch container
247 AliAnaGammaDirect::InitParameters();
251 fConeSizes[0] = 0.1; fConeSizes[0] = 0.2; fConeSizes[2] = 0.3; fConeSizes[3] = 0.4;
252 fPtThresholds[0]=1.; fPtThresholds[0]=2.; fPtThresholds[0]=3.; fPtThresholds[0]=4.;
255 void AliAnaGammaIsolCut::Print(const Option_t * opt) const
258 //Print some relevant parameters set for the analysis
262 Info("Print", "%s %s", GetName(), GetTitle() ) ;
263 printf("N Cone Sizes = %d\n", fNCones) ;
264 printf("N pT thresholds = %d\n", fNPtThres) ;
265 printf("Cone Sizes = \n") ;
266 for(Int_t i = 0; i < fNCones; i++)
267 printf(" %f;", fConeSizes[i]) ;
269 for(Int_t i = 0; i < fNPtThres; i++)
270 printf(" %f;", fPtThresholds[i]) ;
275 void AliAnaGammaIsolCut::Terminate(Option_t *)
277 // The Terminate() function is the last function to be called during
278 // a query. It always runs on the client, it can be used to present
279 // the results graphically or save the results to file.