]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG0/CreateStandardCuts.C
fix
[u/mrichter/AliRoot.git] / PWG0 / CreateStandardCuts.C
1 /* $Id: CreateCuts.C,v 1.5 2008/01/11 08:28:52 jgrosseo Exp $ */
2
3 // this macro creates the track and event cuts used in this analysis
4
5 AliESDtrackCuts* CreateTrackCuts(AliPWG0Helper::AnalysisMode analysisMode, Bool_t fieldOn = kTRUE, Bool_t hists = kTRUE)
6 {
7   AliESDtrackCuts* esdTrackCuts = new AliESDtrackCuts("AliESDtrackCuts");
8
9   if (hists)
10     esdTrackCuts->DefineHistograms(1);
11
12   // default cuts for ITS+TPC
13   Double_t cov1 = 2;
14   Double_t cov2 = 2;
15   Double_t cov3 = 0.5;
16   Double_t cov4 = 0.5;
17   Double_t cov5 = 2;
18   Double_t nSigma = 4;
19
20   Bool_t tpcRefit = kTRUE;
21   Bool_t sigmaToVertex = kTRUE;
22
23   TString tag("Global tracking");
24
25   // TPC-only cuts
26   if (analysisMode == AliPWG0Helper::kTPC)
27   {
28     cov1 = 9;
29     cov2 = 9;
30     cov3 = 1e10;
31     cov4 = 1e10;
32     cov5 = 1e10;
33     
34     tpcRefit = kFALSE;
35     sigmaToVertex = kFALSE;
36     
37     tag = "TPC-only tracking";
38   }
39
40   // cuts for data without field
41   if (!fieldOn)
42   {
43     cov5 = 1e10;
44     tag += " without field";
45   }
46
47   esdTrackCuts->SetMaxCovDiagonalElements(cov1, cov2, cov3, cov4, cov5);
48
49   esdTrackCuts->SetRequireSigmaToVertex(sigmaToVertex);
50
51   if (sigmaToVertex) {
52     esdTrackCuts->SetMaxNsigmaToVertex(nSigma);
53   }
54   else{
55     
56     esdTrackCuts->SetMaxDCAToVertexZ(3.2);
57     esdTrackCuts->SetMaxDCAToVertexXY(2.4);
58     esdTrackCuts->SetDCAToVertex2D(kTRUE);
59   }
60
61   esdTrackCuts->SetRequireTPCRefit(tpcRefit);
62   esdTrackCuts->SetAcceptKinkDaughters(kFALSE);
63
64   esdTrackCuts->SetMinNClustersTPC(50);
65   esdTrackCuts->SetMaxChi2PerClusterTPC(3.5);
66
67   Printf("Created track cuts for: %s", tag.Data());
68
69   return esdTrackCuts;
70 }