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 **************************************************************************/
15 // last change: 2011-04-04 by M.Knichel
21 #include "AliESDtrack.h"
22 #include "AliExternalTrackParam.h"
23 #include "TParticle.h"
25 #include "AliFilteredTreeAcceptanceCuts.h"
29 ClassImp(AliFilteredTreeAcceptanceCuts)
31 //_____________________________________________________________________________
32 AliFilteredTreeAcceptanceCuts::AliFilteredTreeAcceptanceCuts(const Char_t* name,const Char_t *title) :
33 AliAnalysisCuts(name, title)
52 // default constructor
54 // init data members with defaults
58 //_____________________________________________________________________________
59 AliFilteredTreeAcceptanceCuts::~AliFilteredTreeAcceptanceCuts()
64 //_____________________________________________________________________________
65 void AliFilteredTreeAcceptanceCuts::Init()
75 //_____________________________________________________________________________
76 Bool_t AliFilteredTreeAcceptanceCuts::AcceptTrack(AliESDtrack *track)
78 // check acceptance cuts for AliESDtrack
79 if(!track) return kFALSE;
81 Float_t eta = track->Eta();
82 Float_t phi = track->Phi();
83 Float_t pt = track->Pt();
85 if(eta < fMinEta) return kFALSE;
86 if(eta > fMaxEta) return kFALSE;
87 if(phi < fMinPhi) return kFALSE;
88 if(phi > fMaxPhi) return kFALSE;
89 if(pt < fMinPt) return kFALSE;
90 if(pt > fMaxPt) return kFALSE;
95 Bool_t AliFilteredTreeAcceptanceCuts::AcceptTrackLocalTPC(AliESDtrack *track)
97 // check acceptance cuts for AliESDtrack
98 if(!track) return kFALSE;
99 const AliExternalTrackParam *innerParam = track->GetInnerParam();
100 if(!innerParam) return kFALSE;
102 Float_t eta = track->Eta();
103 Float_t phi = TMath::ATan2(innerParam->Py(),innerParam->Px());
106 if ((eta > fExcludeMinEta) && (eta < fExcludeMaxEta) && (phi > fExcludeMinPhi) && (phi < fExcludeMaxPhi)) { return kFALSE; }
107 if ((eta > fExcludeMinEta2) && (eta < fExcludeMaxEta2) && (phi > fExcludeMinPhi2) && (phi < fExcludeMaxPhi2)) { return kFALSE; }
113 //_____________________________________________________________________________
114 Bool_t AliFilteredTreeAcceptanceCuts::AcceptTrack(AliExternalTrackParam *track)
116 // check acceptance cuts for AliESDtrack
117 if(!track) return kFALSE;
119 Float_t eta = track->Eta();
120 Float_t phi = track->Phi();
121 Float_t pt = track->Pt();
123 if(eta < fMinEta) return kFALSE;
124 if(eta > fMaxEta) return kFALSE;
125 if(phi < fMinPhi) return kFALSE;
126 if(phi > fMaxPhi) return kFALSE;
127 if(pt < fMinPt) return kFALSE;
128 if(pt > fMaxPt) return kFALSE;
133 //_____________________________________________________________________________
134 Bool_t AliFilteredTreeAcceptanceCuts::AcceptTrack(TParticle *particle)
136 // check acceptance cuts for TParticle
137 if(!particle) return kFALSE;
139 Float_t eta = particle->Eta();
140 Float_t phi = particle->Phi();
141 Float_t pt = particle->Pt();
143 if(eta < fMinEta) return kFALSE;
144 if(eta > fMaxEta) return kFALSE;
145 if(phi < fMinPhi) return kFALSE;
146 if(phi > fMaxPhi) return kFALSE;
147 if(pt < fMinPt) return kFALSE;
148 if(pt > fMaxPt) return kFALSE;
153 //_____________________________________________________________________________
154 Long64_t AliFilteredTreeAcceptanceCuts::Merge(TCollection* list)
156 // Merge list of objects (needed by PROOF)
163 TIterator* iter = list->MakeIterator();
167 while((obj = iter->Next()) != 0)
169 AliFilteredTreeAcceptanceCuts* entry = dynamic_cast<AliFilteredTreeAcceptanceCuts*>(obj);