AliPhysics  ff07904 (ff07904)
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 <TString.h>
19 
20 //---- ANALYSIS system ----
21 #include "AliFiducialCut.h"
22 #include <AliLog.h>
23 
25 ClassImp(AliFiducialCut) ;
27 
28 //________________________________
31 //________________________________
33 TObject(),
34 fEMCALFiducialCut(0), fDCALFiducialCut(0), fPHOSFiducialCut(0), fCTSFiducialCut(0),
35 fCTSFidCutMinEta(0x0), fCTSFidCutMinPhi(0x0), fCTSFidCutMaxEta(0x0), fCTSFidCutMaxPhi(0x0),
36 fEMCALFidCutMinEta(0x0),fEMCALFidCutMinPhi(0x0),fEMCALFidCutMaxEta(0x0), fEMCALFidCutMaxPhi(0x0),
37 fPHOSFidCutMinEta(0x0), fPHOSFidCutMinPhi(0x0), fPHOSFidCutMaxEta(0x0), fPHOSFidCutMaxPhi(0x0),
38 fDCALFidCutMinEta(0x0), fDCALFidCutMinPhi(0x0), fDCALFidCutMaxEta(0x0), fDCALFidCutMaxPhi(0x0)
39 {
41 }
42 
43 //_______________________________
45 //_______________________________
47 {
52 
57 
62 
67 }
68 
69 //________________________________________________________________________________
76 //________________________________________________________________________________
78 {
79  if(det == kCTS)
80  {
81  if(!fCTSFiducialCut)
82  return kTRUE; //Fiducial cut not requested, accept all tracks
83  else
85  }
86  else if(det == kEMCAL)
87  {
88  if(!fEMCALFiducialCut)
89  return kTRUE; //Fiducial cut not requested, accept all clusters
90  else
92  }
93  else if(det == kPHOS)
94  {
95  if(!fPHOSFiducialCut)
96  return kTRUE; //Fiducial cut not requested, accept all clusters
97  else
99  }
100  else if(det == kDCAL || det == kDCALPHOS)
101  {
102  if(!fDCALFiducialCut)
103  return kTRUE; //Fiducial cut not requested, accept all clusters
104  else
106  }
107  else
108  {
109  return kFALSE;
110  AliFatal(Form("Detector < %d > not known!", det));
111  }
112 }
113 
114 //___________________________________________________________________________________________
124 //___________________________________________________________________________________________
126  const TArrayF* phimin, const TArrayF* phimax,
127  const TArrayF* etamin, const TArrayF* etamax) const
128 {
129  Float_t phi = phiOrg;
130  if(phi < 0) phi+=TMath::TwoPi() ;
131  phi*=TMath::RadToDeg();
132 
133  //printf("IsInFiducialCut::Det: %s, phi = %f, eta = %f\n", det.Data(),phi*TMath::RadToDeg(), eta);
134 
135  Int_t netaregions = etamax->GetSize();
136  Int_t nphiregions = phimax->GetSize();
137 
138  if ( netaregions != etamin->GetSize() || nphiregions != phimin->GetSize() )
139  AliWarning(Form("Wrong number of fiducial cut regions: netamax %d != netamin %d; nphimax %d != nphimin %d\n",
140  netaregions, etamin->GetSize(), nphiregions, phimin->GetSize()));
141 
142  //printf("n eta %d, nphi %d\n",netaregions,nphiregions);
143  //printf("eta %2.2f, phi %2.2f\n",eta,phi);
144 
145  //
146  // Same number of regions in eta and phi
147  //
148  if(netaregions == nphiregions)
149  {
150  for(Int_t iRegion = 0; iRegion < netaregions; iRegion++)
151  {
152  // printf("region %d, min %2.2f < eta %2.2f < max %2.2f;min %2.2f < phi %2.2f < max %2.2f\n",
153  // iRegion,
154  // etamin->GetAt(iRegion),eta,etamax->GetAt(iRegion),
155  // phimax->GetAt(iRegion),phi,phimax->GetAt(iRegion));
156 
157  if ( eta > etamin->GetAt(iRegion) && eta < etamax->GetAt(iRegion) &&
158  phi > phimin->GetAt(iRegion) && phi < phimax->GetAt(iRegion) )
159  return kTRUE ;
160  }
161 
162  return kFALSE;
163  }
164 
165  //
166  // Different number of regions in eta and phi
167  // Careful, better use same number.
168  //
169 
170  // Eta fiducial cut
171  Bool_t bInEtaFidCut = kFALSE;
172  for(Int_t ieta = 0; ieta < netaregions; ieta++)
173  {
174  if(eta > etamin->GetAt(ieta) && eta < etamax->GetAt(ieta)) bInEtaFidCut = kTRUE;
175  }
176 
177  //printf("Eta ok? %d\n",bInEtaFidCut);
178  if(bInEtaFidCut)
179  {
180  //printf("Eta cut passed\n");
181  //Phi fiducial cut
182  Bool_t bInPhiFidCut = kFALSE;
183  for(Int_t iphi = 0; iphi < nphiregions; iphi++)
184  {
185  if ( phi > phimin->GetAt(iphi) && phi < phimax->GetAt(iphi) ) bInPhiFidCut = kTRUE ;
186  }
187  //printf("Phi ok? %d\n",bInPhiFidCut);
188 
189  if(bInPhiFidCut)
190  {
191  //printf("IsInFiducialCut:: %s cluster/track accepted\n",det.Data());
192  return kTRUE;
193  }
194  else return kFALSE;
195 
196  } // In eta fid cut
197  else
198  {
199  return kFALSE;
200  }
201 }
202 
203 
204 //____________________________________________
206 //____________________________________________
208 {
209  fEMCALFiducialCut = kTRUE ;
210  fPHOSFiducialCut = kTRUE ;
211  fCTSFiducialCut = kTRUE ;
212  fDCALFiducialCut = kTRUE ;
213 
214  fCTSFidCutMinEta = new TArrayF(1);
215  fCTSFidCutMinEta->SetAt(-0.9,0);
216  fCTSFidCutMaxEta = new TArrayF(1);
217  fCTSFidCutMaxEta->SetAt( 0.9,0);
218 
219  fCTSFidCutMinPhi = new TArrayF(1);
220  fCTSFidCutMinPhi->SetAt(0. ,0);
221  fCTSFidCutMaxPhi = new TArrayF(1);
222  fCTSFidCutMaxPhi->SetAt(360.,0);
223 
224  fEMCALFidCutMinEta = new TArrayF(1);
225  fEMCALFidCutMinEta->SetAt(-0.7,0);
226  fEMCALFidCutMaxEta = new TArrayF(1);
227  fEMCALFidCutMaxEta->SetAt( 0.7,0);
228 
229  fEMCALFidCutMinPhi = new TArrayF(1);
230  fEMCALFidCutMinPhi->SetAt(80.,0);
231  fEMCALFidCutMaxPhi = new TArrayF(1);
232  fEMCALFidCutMaxPhi->SetAt(187.,0);
233 
234  fPHOSFidCutMinEta = new TArrayF(1);
235  fPHOSFidCutMinEta->SetAt(-0.13,0);
236  fPHOSFidCutMaxEta = new TArrayF(1);
237  fPHOSFidCutMaxEta->SetAt( 0.13,0);
238 
239  fPHOSFidCutMinPhi = new TArrayF(1);
240  fPHOSFidCutMinPhi->SetAt(260.,0);
241  fPHOSFidCutMaxPhi = new TArrayF(1);
242  fPHOSFidCutMaxPhi->SetAt(320.,0);
243 
244  // Divide DCal in 3 regions:
245  // A (C?) side : -0.70<eta<-0.22, 260<phi<320
246  // C (A?) side : 0.22<eta< 0.70, 260<phi<320
247  // 1/3 SM : -0.70<eta< 0.70, 320<phi<327
248 
249  fDCALFidCutMinEta = new TArrayF(3);
250  fDCALFidCutMinEta->SetAt(-0.7 ,0);
251  fDCALFidCutMinEta->SetAt( 0.22,1);
252  fDCALFidCutMinEta->SetAt(-0.7 ,2);
253 
254  fDCALFidCutMaxEta = new TArrayF(3);
255  fDCALFidCutMaxEta->SetAt(-0.22,0);
256  fDCALFidCutMaxEta->SetAt( 0.7 ,1);
257  fDCALFidCutMaxEta->SetAt( 0.7 ,2);
258 
259  fDCALFidCutMinPhi = new TArrayF(3);
260  fDCALFidCutMinPhi->SetAt(260.,0);
261  fDCALFidCutMinPhi->SetAt(260.,1);
262  fDCALFidCutMinPhi->SetAt(320.,2);
263 
264  fDCALFidCutMaxPhi = new TArrayF(3);
265  fDCALFidCutMaxPhi->SetAt(320.,0);
266  fDCALFidCutMaxPhi->SetAt(320.,1);
267  fDCALFidCutMaxPhi->SetAt(327.,2);
268 }
269 
270 
271 //________________________________________________________________
273 //________________________________________________________________
274 void AliFiducialCut::Print(const Option_t * opt) const
275 {
276  if(! opt)
277  return;
278 
279  printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ;
280 
281  if(fCTSFiducialCut)
282  {
283  Int_t netaregions = fCTSFidCutMaxEta->GetSize();
284  Int_t nphiregions = fCTSFidCutMaxPhi->GetSize();
285  printf(">> CTS Fiducial regions : phi %d eta %d\n", netaregions, nphiregions) ;
286  for(Int_t ieta = 0; ieta < netaregions; ieta++)
287  printf(" region %d : %3.2f < eta < %3.2f\n", ieta, fCTSFidCutMinEta->GetAt(ieta), fCTSFidCutMaxEta->GetAt(ieta)) ;
288  for(Int_t iphi = 0; iphi < nphiregions; iphi++)
289  printf(" region %d : %3.1f < phi < %3.1f\n", iphi, fCTSFidCutMinPhi->GetAt(iphi), fCTSFidCutMaxPhi->GetAt(iphi)) ;
290  }
291  else printf(">>No fiducial cuts in CTS\n");
292 
294  {
295  Int_t netaregions = fEMCALFidCutMaxEta->GetSize();
296  Int_t nphiregions = fEMCALFidCutMaxPhi->GetSize();
297  printf(">>EMCAL Fiducial regions : phi %d eta %d\n", netaregions, nphiregions) ;
298  for(Int_t ieta = 0; ieta < netaregions; ieta++)
299  printf(" region %d : %3.2f < eta < %3.2f\n", ieta, fEMCALFidCutMinEta->GetAt(ieta), fEMCALFidCutMaxEta->GetAt(ieta)) ;
300  for(Int_t iphi = 0; iphi < nphiregions; iphi++)
301  printf(" region %d : %3.1f < phi < %3.1f\n", iphi, fEMCALFidCutMinPhi->GetAt(iphi), fEMCALFidCutMaxPhi->GetAt(iphi)) ;
302  }
303  else printf(">>No fiducial cuts in EMCAL\n");
304 
305  if(fPHOSFiducialCut)
306  {
307  Int_t netaregions = fPHOSFidCutMaxEta->GetSize();
308  Int_t nphiregions = fPHOSFidCutMaxPhi->GetSize();
309  printf(">>PHOS Fiducial regions : phi %d eta %d\n", netaregions, nphiregions) ;
310  for(Int_t ieta = 0; ieta < netaregions; ieta++)
311  printf(" region %d : %3.2f < eta < %3.2f\n", ieta, fPHOSFidCutMinEta->GetAt(ieta), fPHOSFidCutMaxEta->GetAt(ieta)) ;
312  for(Int_t iphi = 0; iphi < nphiregions; iphi++)
313  printf(" region %d : %3.1f < phi < %3.1f\n", iphi, fPHOSFidCutMinPhi->GetAt(iphi), fPHOSFidCutMaxPhi->GetAt(iphi)) ;
314  }
315  else printf(">>No fiducial cuts in PHOS\n");
316 
317  if(fDCALFiducialCut)
318  {
319  Int_t netaregions = fDCALFidCutMaxEta->GetSize();
320  Int_t nphiregions = fDCALFidCutMaxPhi->GetSize();
321  printf(">>DCAL Fiducial regions : phi %d eta %d\n", netaregions, nphiregions) ;
322  for(Int_t ieta = 0; ieta < netaregions; ieta++)
323  printf(" region %d : %3.2f < eta < %3.2f\n", ieta, fDCALFidCutMinEta->GetAt(ieta), fDCALFidCutMaxEta->GetAt(ieta)) ;
324  for(Int_t iphi = 0; iphi < nphiregions; iphi++)
325  printf(" region %d : %3.1f < phi < %3.1f\n", iphi, fDCALFidCutMinPhi->GetAt(iphi), fDCALFidCutMaxPhi->GetAt(iphi)) ;
326  }
327  else printf(">>No fiducial cuts in DCAL\n");
328 
329  printf(" \n") ;
330 }
331 
332 //_______________________________________________________________________________________
337 //_______________________________________________________________________________________
339 {
340  fCTSFidCutMinEta->Set(1);
341  fCTSFidCutMaxEta->Set(1);
342  fCTSFidCutMinPhi->Set(1);
343  fCTSFidCutMaxPhi->Set(1);
344 
345  fCTSFidCutMinEta->SetAt(-eta,0);
346  fCTSFidCutMaxEta->SetAt( eta,0);
347  fCTSFidCutMinPhi->SetAt(phimin,0);
348  fCTSFidCutMaxPhi->SetAt(phimax,0);
349 }
350 
351 //_________________________________________________________________________________________
356 //_________________________________________________________________________________________
358 {
359  fEMCALFidCutMinEta->Set(1);
360  fEMCALFidCutMaxEta->Set(1);
361  fEMCALFidCutMinPhi->Set(1);
362  fEMCALFidCutMaxPhi->Set(1);
363 
364  fEMCALFidCutMinEta->SetAt(-eta,0);
365  fEMCALFidCutMaxEta->SetAt( eta,0);
366  fEMCALFidCutMinPhi->SetAt(phimin,0);
367  fEMCALFidCutMaxPhi->SetAt(phimax,0);
368 }
369 
370 //_______________________________________________________________________________________
375 //_______________________________________________________________________________________
377 {
378  fPHOSFidCutMinEta->Set(1);
379  fPHOSFidCutMaxEta->Set(1);
380  fPHOSFidCutMinPhi->Set(1);
381  fPHOSFidCutMaxPhi->Set(1);
382 
383  fPHOSFidCutMinEta->SetAt(-eta,0);
384  fPHOSFidCutMaxEta->SetAt(eta,0);
385  fPHOSFidCutMinPhi->SetAt(phimin,0);
386  fPHOSFidCutMaxPhi->SetAt(phimax,0);
387 }
388 
389 //_________________________________________________________________________________________
394 //_________________________________________________________________________________________
396 {
397  fDCALFidCutMinEta->Set(1);
398  fDCALFidCutMaxEta->Set(1);
399  fDCALFidCutMinPhi->Set(1);
400  fDCALFidCutMaxPhi->Set(1);
401 
402  fDCALFidCutMinEta->SetAt(-eta,0);
403  fDCALFidCutMaxEta->SetAt( eta,0);
404  fDCALFidCutMinPhi->SetAt(phimin,0);
405  fDCALFidCutMaxPhi->SetAt(phimax,0);
406 }
407 
408 //_________________________________________________________________________________________
419 //_________________________________________________________________________________________
421  Float_t phiminFull , Float_t phimaxFull,
422  Float_t etaminThird, Float_t etamaxThird,
423  Float_t phiminThird, Float_t phimaxThird)
424 {
425  fDCALFidCutMinEta->Set(3);
426  fDCALFidCutMaxEta->Set(3);
427  fDCALFidCutMinPhi->Set(3);
428  fDCALFidCutMaxPhi->Set(3);
429 
430  // 1/3 SM
431  fDCALFidCutMinEta->SetAt(etaminThird,2);
432  fDCALFidCutMaxEta->SetAt(etamaxThird,2);
433  fDCALFidCutMinPhi->SetAt(phiminThird,2);
434  fDCALFidCutMaxPhi->SetAt(phimaxThird,2);
435 
436  // Full SM positive eta
437  fDCALFidCutMinEta->SetAt(etaminFull,1);
438  fDCALFidCutMaxEta->SetAt(etamaxFull,1);
439  fDCALFidCutMinPhi->SetAt(phiminFull,1);
440  fDCALFidCutMaxPhi->SetAt(phimaxFull,1);
441 
442  // Full SM negative eta
443  fDCALFidCutMinEta->SetAt(-etamaxFull,0);
444  fDCALFidCutMaxEta->SetAt(-etaminFull,0);
445  fDCALFidCutMinPhi->SetAt( phiminFull,0);
446  fDCALFidCutMaxPhi->SetAt( phimaxFull,0);
447 }
448 
449 
TArrayF * fEMCALFidCutMinPhi
Take particles in EMCAL with phi > fEMCALFidCutMinPhi.
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.
const Double_t etamin
TArrayF * fDCALFidCutMinEta
Take particles in DCAL with eta > fDCALFidCutMinEta.
TArrayF * fDCALFidCutMaxPhi
Take particles in DCAL with phi > fDCALFidCutMaxPhi.
int Int_t
Definition: External.C:63
TArrayF * fCTSFidCutMinPhi
Take particles in CTS with phi > fCTSFidCutMinPhi.
virtual ~AliFiducialCut()
Destructor.
TArrayF * fPHOSFidCutMinPhi
Take particles in PHOS with phi > fPHOSFidCutMinPhi.
float Float_t
Definition: External.C:68
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.
const Double_t etamax
void SetDCALFiducialCut(Float_t etaminFull, Float_t etamaxFull, Float_t phiminFull, Float_t phimaxFull, Float_t etaminThird, Float_t etamaxThird, Float_t phiminThird, Float_t phimaxThird)
TArrayF * fEMCALFidCutMinEta
Take particles in EMCAL with eta > fEMCALFidCutMinEta.
const char Option_t
Definition: External.C:48
TArrayF * fCTSFidCutMinEta
Take particles in CTS with eta > fCTSFidCutMinEta.
bool Bool_t
Definition: External.C:53
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.
const Double_t phimin