adding flag for non-field data
[u/mrichter/AliRoot.git] / PWG0 / CreateStandardCuts.C
CommitLineData
770a1f1d 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
a7f69e56 5AliESDtrackCuts* CreateTrackCuts(AliPWG0Helper::AnalysisMode analysisMode, Bool_t hists = kTRUE)
770a1f1d 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;
1c15d51a 18 Double_t nSigma = 4;
19
20 Bool_t tpcRefit = kTRUE;
65f11d60 21 Bool_t sigmaToVertex = kTRUE;
770a1f1d 22
23 TString tag("Global tracking");
24
25 // TPC-only cuts
a7f69e56 26 if (analysisMode & AliPWG0Helper::kTPC)
770a1f1d 27 {
a7f69e56 28 cov1 = 1e10;
29 cov2 = 1e10;
69b09e3b 30 cov3 = 1e10;
31 cov4 = 1e10;
32 cov5 = 1e10;
33
1c15d51a 34 tpcRefit = kFALSE;
65f11d60 35 sigmaToVertex = kFALSE;
69b09e3b 36
770a1f1d 37 tag = "TPC-only tracking";
38 }
a7f69e56 39
770a1f1d 40 // cuts for data without field
a7f69e56 41 if (!(analysisMode & AliPWG0Helper::kFieldOn))
770a1f1d 42 {
43 cov5 = 1e10;
44 tag += " without field";
45 }
65f11d60 46
770a1f1d 47 esdTrackCuts->SetMaxCovDiagonalElements(cov1, cov2, cov3, cov4, cov5);
48
65f11d60 49 esdTrackCuts->SetRequireSigmaToVertex(sigmaToVertex);
50
51 if (sigmaToVertex) {
69b09e3b 52 esdTrackCuts->SetMaxNsigmaToVertex(nSigma);
65f11d60 53 }
a7f69e56 54 else
55 {
69b09e3b 56 esdTrackCuts->SetMaxDCAToVertexZ(3.2);
57 esdTrackCuts->SetMaxDCAToVertexXY(2.4);
58 esdTrackCuts->SetDCAToVertex2D(kTRUE);
65f11d60 59 }
60
1c15d51a 61 esdTrackCuts->SetRequireTPCRefit(tpcRefit);
58c4f3fb 62 esdTrackCuts->SetAcceptKinkDaughters(kFALSE);
770a1f1d 63
64 esdTrackCuts->SetMinNClustersTPC(50);
a7f69e56 65 esdTrackCuts->SetMaxChi2PerClusterTPC(4);
770a1f1d 66
67 Printf("Created track cuts for: %s", tag.Data());
68
69 return esdTrackCuts;
70}
a7f69e56 71