adding support for AliESDEvent in AliESDtrackCuts
[u/mrichter/AliRoot.git] / PWG0 / esdTrackCuts / testESDtrackCuts.C
CommitLineData
dc740de4 1/* $Id$ */
2
3633478d 3//
4// script to run the AliMultiplicityESDSelector
5//
6
7#include "../CreateESDChain.C"
8#include "../PWG0Helper.C"
9
70d782ef 10TChain* testESDtrackCuts(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aDebug = kFALSE, Bool_t aProof = kFALSE, Char_t* proofServer = "lxb6046")
3633478d 11{
12 if (aProof)
3c4b53f0 13 connectProof(proofServer);
3633478d 14
3c4b53f0 15 TString libraries("libEG;libGeom;libESD;libPWG0base");
16 TString packages("PWG0base");
3633478d 17
3c4b53f0 18 if (!prepareQuery(libraries, packages, 1))
3633478d 19 return;
20
21 // selection of esd tracks
22 AliESDtrackCuts* esdTrackCutsAll = new AliESDtrackCuts("esdTrackCutsAll");
3633478d 23
24 esdTrackCutsAll->DefineHistograms(1);
25 esdTrackCutsAll->SetMinNClustersTPC(50);
26 esdTrackCutsAll->SetMaxChi2PerClusterTPC(3.5);
27 esdTrackCutsAll->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);
28 esdTrackCutsAll->SetRequireTPCRefit(kTRUE);
29 esdTrackCutsAll->SetMinNsigmaToVertex(3);
30 esdTrackCutsAll->SetRequireSigmaToVertex(kTRUE);
31 esdTrackCutsAll->SetAcceptKingDaughters(kFALSE);
32
3633478d 33 TList inputList;
34 inputList.Add(esdTrackCutsAll);
3633478d 35
36 TChain* chain = CreateESDChain(data, nRuns, offset);
37
38 TString selectorName = "AliTestESDtrackCutsSelector";
39 AliLog::SetClassDebugLevel(selectorName, AliLog::kInfo);
40
70d782ef 41 selectorName += ".cxx++";
3633478d 42
43 if (aDebug != kFALSE)
44 selectorName += "g";
45
46 Int_t result = executeQuery(chain, &inputList, selectorName);
47
48 if (result != 0)
49 {
50 printf("ERROR: Executing process failed with %d.\n", result);
51 return;
52 }
75ec0f41 53}
3633478d 54
3c4b53f0 55void draw(const char* dir, const char* fileName = "trackCuts.root")
56{
57 /*
58 draw("esdTrackCutsAll")
59 draw("fEsdTrackCutsPri")
60 draw("fEsdTrackCutsSec")
61 draw("fEsdTrackCutsPlusZ")
62 draw("fEsdTrackCutsMinusZ")
63 draw("fEsdTrackCutsPos")
64 draw("fEsdTrackCutsNeg")
65 */
66
67 gSystem->Load("libPWG0base");
68
69 TFile::Open(fileName);
70
71 AliESDtrackCuts* cuts = new AliESDtrackCuts(dir, dir);
72 cuts->LoadHistograms();
73
74 cuts->DrawHistograms();
75}