AliPhysics  5dd2c10 (5dd2c10)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliFiducialCut.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 
16 // --- ROOT system ---
17 #include <TMath.h>
18 //#include <TLorentzVector.h>
19 #include <TString.h>
20 
21 //---- ANALYSIS system ----
22 #include "AliFiducialCut.h"
23 #include <AliLog.h>
24 
28 
29 //________________________________
32 //________________________________
34 TObject(),
35 fEMCALFiducialCut(0), fDCALFiducialCut(0), fPHOSFiducialCut(0), fCTSFiducialCut(0),
36 fCTSFidCutMinEta(0x0), fCTSFidCutMinPhi(0x0), fCTSFidCutMaxEta(0x0), fCTSFidCutMaxPhi(0x0),
37 fEMCALFidCutMinEta(0x0),fEMCALFidCutMinPhi(0x0),fEMCALFidCutMaxEta(0x0), fEMCALFidCutMaxPhi(0x0),
38 fPHOSFidCutMinEta(0x0), fPHOSFidCutMinPhi(0x0), fPHOSFidCutMaxEta(0x0), fPHOSFidCutMaxPhi(0x0),
39 fDCALFidCutMinEta(0x0), fDCALFidCutMinPhi(0x0), fDCALFidCutMaxEta(0x0), fDCALFidCutMaxPhi(0x0)
40 {
42 }
43 
44 //_______________________________
46 //_______________________________
48 {
53 
58 
63 
68 }
69 
70 //________________________________________________________________________________
77 //________________________________________________________________________________
78 Bool_t AliFiducialCut::IsInFiducialCut(Float_t eta, Float_t phi, Int_t det) const
79 {
80  if(det == kCTS)
81  {
82  if(!fCTSFiducialCut)
83  return kTRUE; //Fiducial cut not requested, accept all tracks
84  else
86  }
87  else if(det == kEMCAL)
88  {
89  if(!fEMCALFiducialCut)
90  return kTRUE; //Fiducial cut not requested, accept all clusters
91  else
93  }
94  else if(det == kPHOS)
95  {
96  if(!fPHOSFiducialCut)
97  return kTRUE; //Fiducial cut not requested, accept all clusters
98  else
100  }
101  else if(det == kDCAL || det == kDCALPHOS)
102  {
103  if(!fDCALFiducialCut)
104  return kTRUE; //Fiducial cut not requested, accept all clusters
105  else
107  }
108  else
109  {
110  return kFALSE;
111  AliFatal(Form("Detector < %d > not known!", det));
112  }
113 }
114 
115 //___________________________________________________________________________________________
125 //___________________________________________________________________________________________
126 Bool_t AliFiducialCut::CheckFiducialRegion(Float_t eta, Float_t phiOrg,
127  const TArrayF* minphi, const TArrayF* maxphi,
128  const TArrayF* mineta, const TArrayF* maxeta) const
129 {
130  Float_t phi = phiOrg;
131  if(phi < 0) phi+=TMath::TwoPi() ;
132 
133  //printf("IsInFiducialCut::Det: %s, phi = %f, eta = %f\n", det.Data(),phi*TMath::RadToDeg(), eta);
134 
135  Int_t netaregions = maxeta->GetSize();
136  Int_t nphiregions = maxphi->GetSize();
137  if(netaregions != mineta->GetSize() || nphiregions != minphi->GetSize())
138  printf("AliFiducialCut::IsInFiducialCut() - Wrong number of fiducial cut regions: nmaxeta %d != nmineta %d; nmaxphi %d != nminphi %d\n",
139  netaregions, mineta->GetSize(), nphiregions, minphi->GetSize());
140 
141  // Eta fiducial cut
142  Bool_t bInEtaFidCut = kFALSE;
143  for(Int_t ieta = 0; ieta < netaregions; ieta++)
144  {
145  if(eta > mineta->GetAt(ieta) && eta < maxeta->GetAt(ieta)) bInEtaFidCut = kTRUE;
146  }
147 
148  if(bInEtaFidCut)
149  {
150  //printf("Eta cut passed\n");
151  //Phi fiducial cut
152  Bool_t bInPhiFidCut = kFALSE;
153  for(Int_t iphi = 0; iphi < nphiregions; iphi++)
154  if(phi > minphi->GetAt(iphi) *TMath::DegToRad()&& phi < maxphi->GetAt(iphi)*TMath::DegToRad()) bInPhiFidCut = kTRUE ;
155 
156  if(bInPhiFidCut)
157  {
158  //printf("IsInFiducialCut:: %s cluster/track accepted\n",det.Data());
159  return kTRUE;
160  }
161  else return kFALSE;
162 
163  } // In eta fid cut
164  else
165  {
166  return kFALSE;
167  }
168 }
169 
170 
171 //____________________________________________
173 //____________________________________________
175 {
176  fEMCALFiducialCut = kTRUE ;
177  fPHOSFiducialCut = kTRUE ;
178  fCTSFiducialCut = kTRUE ;
179  fDCALFiducialCut = kTRUE ;
180 
181  fCTSFidCutMinEta = new TArrayF(1);
182  fCTSFidCutMinEta->SetAt(-0.9,0);
183  fCTSFidCutMaxEta = new TArrayF(1);
184  fCTSFidCutMaxEta->SetAt( 0.9,0);
185 
186  fCTSFidCutMinPhi = new TArrayF(1);
187  fCTSFidCutMinPhi->SetAt(0. ,0);
188  fCTSFidCutMaxPhi = new TArrayF(1);
189  fCTSFidCutMaxPhi->SetAt(360.,0);
190 
191  fEMCALFidCutMinEta = new TArrayF(1);
192  fEMCALFidCutMinEta->SetAt(-0.7,0);
193  fEMCALFidCutMaxEta = new TArrayF(1);
194  fEMCALFidCutMaxEta->SetAt( 0.7,0);
195 
196  fEMCALFidCutMinPhi = new TArrayF(1);
197  fEMCALFidCutMinPhi->SetAt(80.,0);
198  fEMCALFidCutMaxPhi = new TArrayF(1);
199  fEMCALFidCutMaxPhi->SetAt(187.,0);
200 
201  fPHOSFidCutMinEta = new TArrayF(1);
202  fPHOSFidCutMinEta->SetAt(-0.13,0);
203  fPHOSFidCutMaxEta = new TArrayF(1);
204  fPHOSFidCutMaxEta->SetAt( 0.13,0);
205 
206  fPHOSFidCutMinPhi = new TArrayF(1);
207  fPHOSFidCutMinPhi->SetAt(260.,0);
208  fPHOSFidCutMaxPhi = new TArrayF(1);
209  fPHOSFidCutMaxPhi->SetAt(320.,0);
210 
211 // fDCALFidCutMinEta = new TArrayF(1);
212 // fDCALFidCutMinEta->SetAt(-0.7,0);
213 // fDCALFidCutMaxEta = new TArrayF(1);
214 // fDCALFidCutMaxEta->SetAt( 0.7,0);
215 //
216 // fDCALFidCutMinPhi = new TArrayF(1);
217 // fDCALFidCutMinPhi->SetAt(260.,0);
218 // fDCALFidCutMaxPhi = new TArrayF(1);
219 // fDCALFidCutMaxPhi->SetAt(327.,0);
220 
221  // Divide DCal in 3 regions:
222  // A (C?) side : -0.70<eta<-0.15, 260<phi<320
223  // C (A?) side : 0.15<eta< 0.70, 260<phi<320
224  // 1/3 SM : -0.70<eta< 0.70, 320<phi<327
225 
226  fDCALFidCutMinEta = new TArrayF(3);
227  fDCALFidCutMinEta->SetAt(-0.7 ,0);
228  fDCALFidCutMinEta->SetAt( 0.20,1);
229  fDCALFidCutMinEta->SetAt(-0.7 ,2);
230  fDCALFidCutMaxEta = new TArrayF(3);
231  fDCALFidCutMaxEta->SetAt(-0.20,0);
232  fDCALFidCutMaxEta->SetAt( 0.7 ,1);
233  fDCALFidCutMaxEta->SetAt( 0.7 ,2);
234 
235  fDCALFidCutMinPhi = new TArrayF(3);
236  fDCALFidCutMinPhi->SetAt(260.,0);
237  fDCALFidCutMinPhi->SetAt(260.,1);
238  fDCALFidCutMinPhi->SetAt(320.,2);
239  fDCALFidCutMaxPhi = new TArrayF(3);
240  fDCALFidCutMaxPhi->SetAt(320.,0);
241  fDCALFidCutMaxPhi->SetAt(320.,0);
242  fDCALFidCutMaxPhi->SetAt(327.,0);
243 }
244 
245 
246 //________________________________________________________________
248 //________________________________________________________________
249 void AliFiducialCut::Print(const Option_t * opt) const
250 {
251  if(! opt)
252  return;
253 
254  printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ;
255 
256  if(fCTSFiducialCut)
257  {
258  Int_t netaregions = fCTSFidCutMaxEta->GetSize();
259  Int_t nphiregions = fCTSFidCutMaxPhi->GetSize();
260  printf(">> CTS Fiducial regions : phi %d eta %d\n", netaregions, nphiregions) ;
261  for(Int_t ieta = 0; ieta < netaregions; ieta++)
262  printf(" region %d : %3.2f < eta < %3.2f\n", ieta, fCTSFidCutMinEta->GetAt(ieta), fCTSFidCutMaxEta->GetAt(ieta)) ;
263  for(Int_t iphi = 0; iphi < nphiregions; iphi++)
264  printf(" region %d : %3.1f < phi < %3.1f\n", iphi, fCTSFidCutMinPhi->GetAt(iphi), fCTSFidCutMaxPhi->GetAt(iphi)) ;
265  }
266  else printf(">>No fiducial cuts in CTS\n");
267 
269  {
270  Int_t netaregions = fEMCALFidCutMaxEta->GetSize();
271  Int_t nphiregions = fEMCALFidCutMaxPhi->GetSize();
272  printf(">>EMCAL Fiducial regions : phi %d eta %d\n", netaregions, nphiregions) ;
273  for(Int_t ieta = 0; ieta < netaregions; ieta++)
274  printf(" region %d : %3.2f < eta < %3.2f\n", ieta, fEMCALFidCutMinEta->GetAt(ieta), fEMCALFidCutMaxEta->GetAt(ieta)) ;
275  for(Int_t iphi = 0; iphi < nphiregions; iphi++)
276  printf(" region %d : %3.1f < phi < %3.1f\n", iphi, fEMCALFidCutMinPhi->GetAt(iphi), fEMCALFidCutMaxPhi->GetAt(iphi)) ;
277  }
278  else printf(">>No fiducial cuts in EMCAL\n");
279 
280  if(fPHOSFiducialCut)
281  {
282  Int_t netaregions = fPHOSFidCutMaxEta->GetSize();
283  Int_t nphiregions = fPHOSFidCutMaxPhi->GetSize();
284  printf(">>PHOS Fiducial regions : phi %d eta %d\n", netaregions, nphiregions) ;
285  for(Int_t ieta = 0; ieta < netaregions; ieta++)
286  printf(" region %d : %3.2f < eta < %3.2f\n", ieta, fPHOSFidCutMinEta->GetAt(ieta), fPHOSFidCutMaxEta->GetAt(ieta)) ;
287  for(Int_t iphi = 0; iphi < nphiregions; iphi++)
288  printf(" region %d : %3.1f < phi < %3.1f\n", iphi, fPHOSFidCutMinPhi->GetAt(iphi), fPHOSFidCutMaxPhi->GetAt(iphi)) ;
289  }
290  else printf(">>No fiducial cuts in PHOS\n");
291 
292  if(fDCALFiducialCut)
293  {
294  Int_t netaregions = fDCALFidCutMaxEta->GetSize();
295  Int_t nphiregions = fDCALFidCutMaxPhi->GetSize();
296  printf(">>DCAL Fiducial regions : phi %d eta %d\n", netaregions, nphiregions) ;
297  for(Int_t ieta = 0; ieta < netaregions; ieta++)
298  printf(" region %d : %3.2f < eta < %3.2f\n", ieta, fDCALFidCutMinEta->GetAt(ieta), fDCALFidCutMaxEta->GetAt(ieta)) ;
299  for(Int_t iphi = 0; iphi < nphiregions; iphi++)
300  printf(" region %d : %3.1f < phi < %3.1f\n", iphi, fDCALFidCutMinPhi->GetAt(iphi), fDCALFidCutMaxPhi->GetAt(iphi)) ;
301  }
302  else printf(">>No fiducial cuts in DCAL\n");
303 
304  printf(" \n") ;
305 }
306 
307 //_______________________________________________________________________________________
312 //_______________________________________________________________________________________
313 void AliFiducialCut::SetSimpleCTSFiducialCut(Float_t eta, Float_t minphi, Float_t maxphi)
314 {
315  fCTSFidCutMinEta->Set(1);
316  fCTSFidCutMaxEta->Set(1);
317  fCTSFidCutMinPhi->Set(1);
318  fCTSFidCutMaxPhi->Set(1);
319 
320  fCTSFidCutMinEta->SetAt(-eta,0);
321  fCTSFidCutMaxEta->SetAt( eta,0);
322  fCTSFidCutMinPhi->SetAt(minphi,0);
323  fCTSFidCutMaxPhi->SetAt(maxphi,0);
324 }
325 
326 //_________________________________________________________________________________________
331 //_________________________________________________________________________________________
332 void AliFiducialCut::SetSimpleEMCALFiducialCut(Float_t eta, Float_t minphi, Float_t maxphi)
333 {
334  fEMCALFidCutMinEta->Set(1);
335  fEMCALFidCutMaxEta->Set(1);
336  fEMCALFidCutMinPhi->Set(1);
337  fEMCALFidCutMaxPhi->Set(1);
338 
339  fEMCALFidCutMinEta->SetAt(-eta,0);
340  fEMCALFidCutMaxEta->SetAt( eta,0);
341  fEMCALFidCutMinPhi->SetAt(minphi,0);
342  fEMCALFidCutMaxPhi->SetAt(maxphi,0);
343 }
344 
345 //_______________________________________________________________________________________
350 //_______________________________________________________________________________________
351 void AliFiducialCut::SetSimplePHOSFiducialCut(Float_t eta, Float_t minphi, Float_t maxphi)
352 {
353  fPHOSFidCutMinEta->Set(1);
354  fPHOSFidCutMaxEta->Set(1);
355  fPHOSFidCutMinPhi->Set(1);
356  fPHOSFidCutMaxPhi->Set(1);
357 
358  fPHOSFidCutMinEta->SetAt(-eta,0);
359  fPHOSFidCutMaxEta->SetAt(eta,0);
360  fPHOSFidCutMinPhi->SetAt(minphi,0);
361  fPHOSFidCutMaxPhi->SetAt(maxphi,0);
362 }
363 
364 //_________________________________________________________________________________________
369 //_________________________________________________________________________________________
370 void AliFiducialCut::SetSimpleDCALFiducialCut(Float_t eta, Float_t minphi, Float_t maxphi)
371 {
372  fDCALFidCutMinEta->Set(1);
373  fDCALFidCutMaxEta->Set(1);
374  fDCALFidCutMinPhi->Set(1);
375  fDCALFidCutMaxPhi->Set(1);
376 
377  fDCALFidCutMinEta->SetAt(-eta,0);
378  fDCALFidCutMaxEta->SetAt( eta,0);
379  fDCALFidCutMinPhi->SetAt(minphi,0);
380  fDCALFidCutMaxPhi->SetAt(maxphi,0);
381 }
382 
383 
TArrayF * fEMCALFidCutMinPhi
Take particles in EMCAL with phi > fEMCALFidCutMinPhi.
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
void SetSimpleCTSFiducialCut(Float_t abseta, Float_t phimin, Float_t phimax)
TArrayF * fEMCALFidCutMaxPhi
Take particles in EMCAL with phi > fEMCALFidCutMaxPhi.
void InitParameters()
Initialize the parameters.
void SetSimpleEMCALFiducialCut(Float_t abseta, Float_t phimin, Float_t phimax)
Bool_t fCTSFiducialCut
Apply fiducial cuts to CTS tracks.
Bool_t fEMCALFiducialCut
Apply fiducial cuts to EMCAL clusters.
TArrayF * fPHOSFidCutMaxEta
Take particles in PHOS with eta < fPHOSFidCutMaxEta.
void SetSimplePHOSFiducialCut(Float_t abseta, Float_t phimin, Float_t phimax)
Bool_t fPHOSFiducialCut
Apply fiducial cuts to PHOS clusters.
TArrayF * fDCALFidCutMinEta
Take particles in DCAL with eta > fDCALFidCutMinEta.
TArrayF * fDCALFidCutMaxPhi
Take particles in DCAL with phi > fDCALFidCutMaxPhi.
TArrayF * fCTSFidCutMinPhi
Take particles in CTS with phi > fCTSFidCutMinPhi.
virtual ~AliFiducialCut()
Destructor.
TArrayF * fPHOSFidCutMinPhi
Take particles in PHOS with phi > fPHOSFidCutMinPhi.
void Print(const Option_t *opt) const
Print some relevant parameters set.
Bool_t IsInFiducialCut(Float_t eta, Float_t phi, Int_t det) const
Bool_t CheckFiducialRegion(Float_t eta, Float_t phi, const TArrayF *minphi, const TArrayF *maxphi, const TArrayF *mineta, const TArrayF *maxeta) const
TArrayF * fCTSFidCutMaxPhi
Take particles in CTS with phi > fCTSFidCutMaxPhi.
TArrayF * fCTSFidCutMaxEta
Take particles in CTS with eta < fCTSFidCutMaxEta.
TArrayF * fPHOSFidCutMinEta
Take particles in PHOS with eta > fPHOSFidCutMinEta.
TArrayF * fPHOSFidCutMaxPhi
Take particles in PHOS with phi > fPHOSFidCutMaxPhi.
TArrayF * fEMCALFidCutMinEta
Take particles in EMCAL with eta > fEMCALFidCutMinEta.
TArrayF * fCTSFidCutMinEta
Take particles in CTS with eta > fCTSFidCutMinEta.
void SetSimpleDCALFiducialCut(Float_t abseta, Float_t phimin, Float_t phimax)
TArrayF * fDCALFidCutMaxEta
Take particles in DCAL with eta < fDCALFidCutMaxEta.
Bool_t fDCALFiducialCut
Apply fiducial cuts to DCAL clusters.
TArrayF * fDCALFidCutMinPhi
Take particles in DCAL with phi > fDCALFidCutMinPhi.
Store the acceptance cuts for clusters and tracks or particle objects.
TArrayF * fEMCALFidCutMaxEta
Take particles in EMCAL with eta < fEMCALFidCutMaxEta.