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:
25 //_________________________________________________________________________
26 // Class containing methods for the isolation cut.
29 //*-- Author: Gustavo Conesa (LNF-INFN)
30 //////////////////////////////////////////////////////////////////////////////
33 // --- ROOT system ---
34 #include <Riostream.h>
35 #include <TLorentzVector.h>
36 #include <TSeqCollection.h>
38 // --- AliRoot system ---
39 #include "AliIsolationCut.h"
41 #include "AliAODParticleCorrelation.h"
42 #include "AliAODTrack.h"
43 #include "AliAODCaloCluster.h"
45 ClassImp(AliIsolationCut)
47 //____________________________________________________________________________
48 AliIsolationCut::AliIsolationCut() :
50 fConeSize(0.),fPtThreshold(0.), fPtFraction(0.), fICMethod(0)
55 //Initialize parameters
60 //____________________________________________________________________________
61 AliIsolationCut::AliIsolationCut(const AliIsolationCut & g) :
63 fConeSize(g.fConeSize),
64 fPtThreshold(g.fPtThreshold),
65 fPtFraction(g.fPtFraction),
66 fICMethod(g.fICMethod)
72 //_________________________________________________________________________
73 AliIsolationCut & AliIsolationCut::operator = (const AliIsolationCut & source)
75 // assignment operator
77 if(&source == this) return *this;
79 fConeSize = source.fConeSize ;
80 fPtThreshold = source.fPtThreshold ;
81 fICMethod = source.fICMethod ;
82 fPtFraction = source.fPtFraction ;
91 //____________________________________________________________________________
92 void AliIsolationCut::InitParameters()
94 //Initialize the parameters of the analysis.
100 fICMethod = kPtThresIC; // 0 pt threshol method, 1 cone pt sum method
104 //__________________________________________________________________
105 void AliIsolationCut::MakeIsolationCut(TSeqCollection * plCTS, TSeqCollection * plNe, Double_t * vertex,
106 const Bool_t fillAOD, AliAODParticleCorrelation *pCandidate,
107 const Int_t index1, const Int_t index2,
108 Int_t & n, Int_t & nfrac, Float_t &coneptsum, Bool_t &isolated)
110 //Search in cone around a candidate particle if it is isolated
111 Float_t phiC = pCandidate->Phi() ;
112 Float_t etaC = pCandidate->Eta() ;
113 Float_t ptC = pCandidate->Pt() ;
115 Float_t eta = -100. ;
116 Float_t phi = -100. ;
123 //Check charged particles in cone.
126 for(Int_t ipr = 0;ipr < plCTS->GetEntries() ; ipr ++ ){
127 if(ipr == index1 || ipr == index2) continue ;//Do not count the candidate
128 AliAODTrack* track = dynamic_cast<AliAODTrack *>(plCTS->At(ipr)) ;
129 p3.SetXYZ(track->Px(),track->Py(),track->Pz());
133 if(phi<0) phi+=TMath::TwoPi();
135 //Check if there is any particle inside cone with pt larger than fPtThreshold
136 rad = TMath::Sqrt((eta-etaC)*(eta-etaC)+ (phi-phiC)*(phi-phiC));
139 if(fillAOD) pCandidate->AddIsolationConeTrack(track);
140 //printf("charged in isolation cone pt %f, phi %f, eta %f, R %f \n",pt,phi,eta,rad);
142 if(pt > fPtThreshold ) n++;
143 if(pt > fPtFraction*ptC ) nfrac++;
145 }// charged particle loop
148 //Check neutral particles in cone.
151 for(Int_t ipr = 0;ipr < plNe->GetEntries() ; ipr ++ ){
152 if(ipr == index1 || ipr == index2) continue ;//Do not count the candidate
153 AliAODCaloCluster * calo = dynamic_cast< AliAODCaloCluster *>(plNe->At(ipr)) ;
155 //Skip matched clusters with tracks
156 if(calo->GetNTracksMatched() > 0) continue ;
158 calo->GetMomentum(mom,vertex);//Assume that come from vertex in straight line
162 if(phi<0) phi+=TMath::TwoPi();
164 //Check if there is any particle inside cone with pt larger than fPtThreshold
165 rad = TMath::Sqrt((eta-etaC)*(eta-etaC)+ (phi-phiC)*(phi-phiC));
167 if(fillAOD) pCandidate->AddIsolationConeCluster(calo);
168 //printf("neutral in isolation cone pt %f, phi %f, eta %f, R %f \n",pt,phi,eta,rad);
170 if(pt > fPtThreshold ) n++;
171 if(pt > fPtFraction*ptC ) nfrac++;
173 }// neutral particle loop
176 //printf("Isolation Cut: in cone with: pT>pTthres %d, pT > pTfrac*pTcandidate %d \n",n,nfrac);
178 //Check isolation, depending on method.
179 if( fICMethod == kPtThresIC){
180 if(n==0) isolated = kTRUE ;
182 else if( fICMethod == kSumPtIC){
183 if(coneptsum < fPtThreshold)
186 else if( fICMethod == kPtFracIC){
187 if(nfrac==0) isolated = kTRUE ;
189 else if( fICMethod == kSumPtFracIC){
190 if(coneptsum < fPtFraction*ptC)
195 //__________________________________________________________________
196 void AliIsolationCut::Print(const Option_t * opt) const
199 //Print some relevant parameters set for the analysis
203 printf("**** Print %s %s **** \n", GetName(), GetTitle() ) ;
205 printf("IC method = %d\n", fICMethod) ;
206 printf("Cone Size = %1.2f\n", fConeSize) ;
207 printf("pT threshold = %2.1f\n", fPtThreshold) ;
208 printf("pT fraction = %3.1f\n", fPtFraction) ;