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 "AliAODParticleCorrelation.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 ;
83 //____________________________________________________________________________
84 void AliIsolationCut::InitParameters()
86 //Initialize the parameters of the analysis.
92 fICMethod = kPtThresIC; // 0 pt threshol method, 1 cone pt sum method
96 //__________________________________________________________________
97 void AliIsolationCut::MakeIsolationCut(TSeqCollection * plCTS, TSeqCollection * plNe, Double_t * vertex,
98 const Bool_t fillAOD, AliAODParticleCorrelation *pCandidate,
99 const Int_t index1, const Int_t index2,
100 Int_t & n, Int_t & nfrac, Float_t &coneptsum, Bool_t &isolated)
102 //Search in cone around a candidate particle if it is isolated
103 Float_t phiC = pCandidate->Phi() ;
104 Float_t etaC = pCandidate->Eta() ;
105 Float_t ptC = pCandidate->Pt() ;
107 Float_t eta = -100. ;
108 Float_t phi = -100. ;
115 //Check charged particles in cone.
118 for(Int_t ipr = 0;ipr < plCTS->GetEntries() ; ipr ++ ){
119 if(ipr == index1 || ipr == index2) continue ;//Do not count the candidate
120 AliAODTrack* track = dynamic_cast<AliAODTrack *>(plCTS->At(ipr)) ;
121 p3.SetXYZ(track->Px(),track->Py(),track->Pz());
125 if(phi<0) phi+=TMath::TwoPi();
127 //Check if there is any particle inside cone with pt larger than fPtThreshold
128 rad = TMath::Sqrt((eta-etaC)*(eta-etaC)+ (phi-phiC)*(phi-phiC));
131 if(fillAOD) pCandidate->AddIsolationConeTrack(track);
132 //printf("charged in isolation cone pt %f, phi %f, eta %f, R %f \n",pt,phi,eta,rad);
134 if(pt > fPtThreshold ) n++;
135 if(pt > fPtFraction*ptC ) nfrac++;
137 }// charged particle loop
140 //Check neutral particles in cone.
143 for(Int_t ipr = 0;ipr < plNe->GetEntries() ; ipr ++ ){
144 if(ipr == index1 || ipr == index2) continue ;//Do not count the candidate
145 AliAODCaloCluster * calo = dynamic_cast< AliAODCaloCluster *>(plNe->At(ipr)) ;
147 //Skip matched clusters with tracks
148 if(calo->GetNTracksMatched() > 0) continue ;
150 calo->GetMomentum(mom,vertex);//Assume that come from vertex in straight line
154 if(phi<0) phi+=TMath::TwoPi();
156 //Check if there is any particle inside cone with pt larger than fPtThreshold
157 rad = TMath::Sqrt((eta-etaC)*(eta-etaC)+ (phi-phiC)*(phi-phiC));
159 if(fillAOD) pCandidate->AddIsolationConeCluster(calo);
160 //printf("neutral in isolation cone pt %f, phi %f, eta %f, R %f \n",pt,phi,eta,rad);
162 if(pt > fPtThreshold ) n++;
163 if(pt > fPtFraction*ptC ) nfrac++;
165 }// neutral particle loop
168 //printf("Isolation Cut: in cone with: pT>pTthres %d, pT > pTfrac*pTcandidate %d \n",n,nfrac);
170 //Check isolation, depending on method.
171 if( fICMethod == kPtThresIC){
172 if(n==0) isolated = kTRUE ;
174 else if( fICMethod == kSumPtIC){
175 if(coneptsum < fPtThreshold)
178 else if( fICMethod == kPtFracIC){
179 if(nfrac==0) isolated = kTRUE ;
181 else if( fICMethod == kSumPtFracIC){
182 if(coneptsum < fPtFraction*ptC)
187 //__________________________________________________________________
188 void AliIsolationCut::Print(const Option_t * opt) const
191 //Print some relevant parameters set for the analysis
195 printf("**** Print %s %s **** \n", GetName(), GetTitle() ) ;
197 printf("IC method = %d\n", fICMethod) ;
198 printf("Cone Size = %1.2f\n", fConeSize) ;
199 printf("pT threshold = %2.1f\n", fPtThreshold) ;
200 printf("pT fraction = %3.1f\n", fPtFraction) ;