1ac70343c03b27c9918ace5b4e99811d3c02cb7f
[u/mrichter/AliRoot.git] / PWG0 / esdTrackCuts / testESDtrackCuts.C
1 /* $Id$ */
2
3 //
4 // script to run the AliMultiplicityESDSelector
5 //
6
7 #include "../CreateESDChain.C"
8 #include "../PWG0Helper.C"
9
10 TChain* testESDtrackCuts(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aDebug = kFALSE, Bool_t aProof = kFALSE)
11 {
12   if (aProof)
13     connectProof("proof01@lxb6046");
14
15   TString libraries("libEG;libGeom;libESD;libPWG0base;libVMC;libMinuit;libSTEER;libPWG0dep;libEVGEN;libFASTSIM;libmicrocern;libpdf;libpythia6;lib
16 EGPythia6;libAliPythia6");
17   TString packages("PWG0base;PWG0dep");
18
19   if (!prepareQuery(libraries, packages, kTRUE))
20     return;
21
22   // selection of esd tracks
23   AliESDtrackCuts* esdTrackCutsAll = new AliESDtrackCuts("esdTrackCutsAll");
24   AliESDtrackCuts* esdTrackCutsPri = new AliESDtrackCuts("esdTrackCutsPri");
25   AliESDtrackCuts* esdTrackCutsSec = new AliESDtrackCuts("esdTrackCutsSec");
26
27   esdTrackCutsAll->DefineHistograms(1);
28   esdTrackCutsAll->SetMinNClustersTPC(50);
29   esdTrackCutsAll->SetMaxChi2PerClusterTPC(3.5);
30   esdTrackCutsAll->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);
31   esdTrackCutsAll->SetRequireTPCRefit(kTRUE);
32   esdTrackCutsAll->SetMinNsigmaToVertex(3);
33   esdTrackCutsAll->SetRequireSigmaToVertex(kTRUE);
34   esdTrackCutsAll->SetAcceptKingDaughters(kFALSE);
35
36   esdTrackCutsPri->DefineHistograms(4);
37   esdTrackCutsPri->SetMinNClustersTPC(50);
38   esdTrackCutsPri->SetMaxChi2PerClusterTPC(3.5);
39   esdTrackCutsPri->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);
40   esdTrackCutsPri->SetRequireTPCRefit(kTRUE);
41   esdTrackCutsPri->SetMinNsigmaToVertex(3);
42   esdTrackCutsPri->SetRequireSigmaToVertex(kTRUE);
43   esdTrackCutsPri->SetAcceptKingDaughters(kFALSE);
44
45   esdTrackCutsSec->DefineHistograms(2);
46   esdTrackCutsSec->SetMinNClustersTPC(50);
47   esdTrackCutsSec->SetMaxChi2PerClusterTPC(3.5);
48   esdTrackCutsSec->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);
49   esdTrackCutsSec->SetRequireTPCRefit(kTRUE);
50   esdTrackCutsSec->SetMinNsigmaToVertex(3);
51   esdTrackCutsSec->SetRequireSigmaToVertex(kTRUE);
52   esdTrackCutsSec->SetAcceptKingDaughters(kFALSE);
53
54
55   TList inputList;
56   inputList.Add(esdTrackCutsAll);
57   inputList.Add(esdTrackCutsPri);
58   inputList.Add(esdTrackCutsSec);
59
60   TChain* chain = CreateESDChain(data, nRuns, offset);
61
62   TString selectorName = "AliTestESDtrackCutsSelector";
63   AliLog::SetClassDebugLevel(selectorName, AliLog::kInfo);
64
65   selectorName += ".cxx+";
66
67   if (aDebug != kFALSE)
68     selectorName += "g";
69
70   Int_t result = executeQuery(chain, &inputList, selectorName);
71
72   if (result != 0)
73   {
74     printf("ERROR: Executing process failed with %d.\n", result);
75     return;
76   }
77 }
78