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 //_________________________________________________________________________
18 // Class containing methods for the isolation cut.
21 //*-- Author: Gustavo Conesa (LNF-INFN)
22 //////////////////////////////////////////////////////////////////////////////
25 // --- ROOT system ---
26 //#include <Riostream.h>
27 #include <TLorentzVector.h>
28 #include <TSeqCollection.h>
30 // --- AliRoot system ---
31 #include "AliIsolationCut.h"
33 #include "AliAODPWG4ParticleCorrelation.h"
34 #include "AliAODTrack.h"
35 #include "AliAODCaloCluster.h"
37 ClassImp(AliIsolationCut)
39 //____________________________________________________________________________
40 AliIsolationCut::AliIsolationCut() :
42 fConeSize(0.),fPtThreshold(0.), fPtFraction(0.), fICMethod(0)
47 //Initialize parameters
52 //____________________________________________________________________________
53 AliIsolationCut::AliIsolationCut(const AliIsolationCut & g) :
55 fConeSize(g.fConeSize),
56 fPtThreshold(g.fPtThreshold),
57 fPtFraction(g.fPtFraction),
58 fICMethod(g.fICMethod)
64 //_________________________________________________________________________
65 AliIsolationCut & AliIsolationCut::operator = (const AliIsolationCut & source)
67 // assignment operator
69 if(&source == this) return *this;
71 fConeSize = source.fConeSize ;
72 fPtThreshold = source.fPtThreshold ;
73 fICMethod = source.fICMethod ;
74 fPtFraction = source.fPtFraction ;
81 //____________________________________________________________________________
82 TString AliIsolationCut::GetICParametersList()
84 //Put data member values in string to keep in output container
86 TString parList ; //this will be list of parameters used for this analysis.
89 sprintf(onePar,"--- AliIsolationCut ---\n") ;
91 sprintf(onePar,"fConeSize: (isolation cone size) %1.2f\n",fConeSize) ;
93 sprintf(onePar,"fPtThreshold =%1.2f (isolation pt threshold) \n",fPtThreshold) ;
95 sprintf(onePar,"fPtFraction=%1.2f (isolation pt threshold fraction ) \n",fPtFraction) ;
97 sprintf(onePar,"fICMethod=%d (isolation cut case) \n",fICMethod) ;
103 //____________________________________________________________________________
104 void AliIsolationCut::InitParameters()
106 //Initialize the parameters of the analysis.
112 fICMethod = kPtThresIC; // 0 pt threshol method, 1 cone pt sum method
116 //__________________________________________________________________
117 void AliIsolationCut::MakeIsolationCut(TSeqCollection * plCTS, TSeqCollection * plNe, Double_t * vertex,
118 const Bool_t fillAOD, AliAODPWG4ParticleCorrelation *pCandidate,
119 Int_t & n, Int_t & nfrac, Float_t &coneptsum, Bool_t &isolated) const
121 //Search in cone around a candidate particle if it is isolated
122 Float_t phiC = pCandidate->Phi() ;
123 Float_t etaC = pCandidate->Eta() ;
124 Float_t ptC = pCandidate->Pt() ;
126 Float_t eta = -100. ;
127 Float_t phi = -100. ;
134 //Check charged particles in cone.
137 for(Int_t ipr = 0;ipr < plCTS->GetEntries() ; ipr ++ ){
138 AliAODTrack* track = (AliAODTrack *)(plCTS->At(ipr)) ;
139 //Do not count the candidate (pion, conversion photon) or the daughters of the candidate
140 if(track->GetID() == pCandidate->GetTrackLabel(0) || track->GetID() == pCandidate->GetTrackLabel(1)) continue ;
141 p3.SetXYZ(track->Px(),track->Py(),track->Pz());
145 if(phi<0) phi+=TMath::TwoPi();
147 //Check if there is any particle inside cone with pt larger than fPtThreshold
148 rad = TMath::Sqrt((eta-etaC)*(eta-etaC)+ (phi-phiC)*(phi-phiC));
151 if(fillAOD) pCandidate->AddIsolationConeTrack(track);
152 //printf("charged in isolation cone pt %f, phi %f, eta %f, R %f \n",pt,phi,eta,rad);
154 if(pt > fPtThreshold ) n++;
155 if(pt > fPtFraction*ptC ) nfrac++;
157 }// charged particle loop
160 //Check neutral particles in cone.
163 for(Int_t ipr = 0;ipr < plNe->GetEntries() ; ipr ++ ){
164 AliAODCaloCluster * calo = (AliAODCaloCluster *)(plNe->At(ipr)) ;
166 //Do not count the candidate (photon or pi0) or the daughters of the candidate
167 if(calo->GetID() == pCandidate->GetCaloLabel(0) || calo->GetID() == pCandidate->GetCaloLabel(1)) continue ; //Skip matched clusters with tracks
169 if(calo->GetNTracksMatched() > 0) continue ;
171 calo->GetMomentum(mom,vertex);//Assume that come from vertex in straight line
175 if(phi<0) phi+=TMath::TwoPi();
177 //Check if there is any particle inside cone with pt larger than fPtThreshold
178 rad = TMath::Sqrt((eta-etaC)*(eta-etaC)+ (phi-phiC)*(phi-phiC));
180 if(fillAOD) pCandidate->AddIsolationConeCluster(calo);
181 //printf("neutral in isolation cone pt %f, phi %f, eta %f, R %f \n",pt,phi,eta,rad);
183 if(pt > fPtThreshold ) n++;
184 if(pt > fPtFraction*ptC ) nfrac++;
186 }// neutral particle loop
189 //printf("Isolation Cut: in cone with: pT>pTthres %d, pT > pTfrac*pTcandidate %d \n",n,nfrac);
191 //Check isolation, depending on method.
192 if( fICMethod == kPtThresIC){
193 if(n==0) isolated = kTRUE ;
195 else if( fICMethod == kSumPtIC){
196 if(coneptsum < fPtThreshold)
199 else if( fICMethod == kPtFracIC){
200 if(nfrac==0) isolated = kTRUE ;
202 else if( fICMethod == kSumPtFracIC){
203 if(coneptsum < fPtFraction*ptC)
208 //__________________________________________________________________
209 void AliIsolationCut::Print(const Option_t * opt) const
212 //Print some relevant parameters set for the analysis
216 printf("**** Print %s %s **** \n", GetName(), GetTitle() ) ;
218 printf("IC method = %d\n", fICMethod) ;
219 printf("Cone Size = %1.2f\n", fConeSize) ;
220 printf("pT threshold = %2.1f\n", fPtThreshold) ;
221 printf("pT fraction = %3.1f\n", fPtFraction) ;