AliPhysics  59e0e03 (59e0e03)
AliFilteredTreeAcceptanceCuts.cxx
Go to the documentation of this file.
1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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
16 
17 #include <iostream>
18 #include <TList.h>
19 
20 #include "AliLog.h"
21 #include "AliESDtrack.h"
22 #include "AliExternalTrackParam.h"
23 #include "TParticle.h"
24 
26 
27 using namespace std;
28 
30 
31 //_____________________________________________________________________________
33 AliAnalysisCuts(name, title)
34 , fMinEta(0)
35 , fMaxEta(0)
36 , fMinPhi(0)
37 , fMaxPhi(0)
38 , fMinPt(0)
39 , fMaxPt(0)
40 , fExcludeMinEta(0)
41 , fExcludeMaxEta(0)
42 , fExcludeMinPhi(0)
43 , fExcludeMaxPhi(0)
44 , fExcludeMinEta2(0)
45 , fExcludeMaxEta2(0)
46 , fExcludeMinPhi2(0)
47 , fExcludeMaxPhi2(0)
48 , fCheckRange(kFALSE)
49 , fMaxDCAr(0)
50 , fMaxDCAz(0)
51 {
52  // default constructor
53 
54  // init data members with defaults
55  Init();
56 }
57 
58 //_____________________________________________________________________________
60 {
61  // destructor
62 }
63 
64 //_____________________________________________________________________________
66 {
67  // set default values
68  SetEtaRange();
69  SetPhiRange();
70  SetPtRange();
71  SetMaxDCAr();
72  SetMaxDCAz();
73 }
74 
75 //_____________________________________________________________________________
77 {
78  // check acceptance cuts for AliESDtrack
79  if(!track) return kFALSE;
80 
81  Float_t eta = track->Eta();
82  Float_t phi = track->Phi();
83  Float_t pt = track->Pt();
84 
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;
91 
92 return kTRUE;
93 }
94 
96 {
97  // check acceptance cuts for AliESDtrack
98  if(!track) return kFALSE;
99  const AliExternalTrackParam *innerParam = track->GetInnerParam();
100  if(!innerParam) return kFALSE;
101 
102  Float_t eta = track->Eta();
103  Float_t phi = TMath::ATan2(innerParam->Py(),innerParam->Px());
104 
105  if (fCheckRange) {
106  if ((eta > fExcludeMinEta) && (eta < fExcludeMaxEta) && (phi > fExcludeMinPhi) && (phi < fExcludeMaxPhi)) { return kFALSE; }
107  if ((eta > fExcludeMinEta2) && (eta < fExcludeMaxEta2) && (phi > fExcludeMinPhi2) && (phi < fExcludeMaxPhi2)) { return kFALSE; }
108  }
109 
110 return kTRUE;
111 }
112 
113 //_____________________________________________________________________________
115 {
116  // check acceptance cuts for AliESDtrack
117  if(!track) return kFALSE;
118 
119  Float_t eta = track->Eta();
120  Float_t phi = track->Phi();
121  Float_t pt = track->Pt();
122 
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;
129 
130 return kTRUE;
131 }
132 
133 //_____________________________________________________________________________
135 {
136  // check acceptance cuts for TParticle
137  if(!particle) return kFALSE;
138 
139  Float_t eta = particle->Eta();
140  Float_t phi = particle->Phi();
141  Float_t pt = particle->Pt();
142 
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;
149 
150 return kTRUE;
151 }
152 
153 //_____________________________________________________________________________
155 {
156  // Merge list of objects (needed by PROOF)
157  if (!list)
158  return 0;
159 
160  if (list->IsEmpty())
161  return 1;
162 
163  TIterator* iter = list->MakeIterator();
164  TObject* obj = 0;
165 
166  Int_t count=0;
167  while((obj = iter->Next()) != 0)
168  {
170  if (entry == 0)
171  continue;
172 
173  count++;
174  }
175 
176 return count;
177 }
const char * title
Definition: MakeQAPdf.C:27
long long Long64_t
Definition: External.C:43
char Char_t
Definition: External.C:18
int Int_t
Definition: External.C:63
float Float_t
Definition: External.C:68
Bool_t AcceptTrackLocalTPC(AliESDtrack *track)
bool Bool_t
Definition: External.C:53
virtual Long64_t Merge(TCollection *list)