Adding pt and eta control plots, increasing ClassDef version
[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, Char_t* proofServer = "lxb6046")
11 {
12   if (aProof)
13     connectProof(proofServer);
14
15   TString libraries("libEG;libGeom;libESD;libPWG0base");
16   TString packages("PWG0base");
17
18   if (!prepareQuery(libraries, packages, 1))
19     return;
20
21   // selection of esd tracks
22   AliESDtrackCuts* esdTrackCutsAll = new AliESDtrackCuts("esdTrackCutsAll");
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
33   TList inputList;
34   inputList.Add(esdTrackCutsAll);
35
36   TChain* chain = CreateESDChain(data, nRuns, offset);
37
38   TString selectorName = "AliTestESDtrackCutsSelector";
39   AliLog::SetClassDebugLevel(selectorName, AliLog::kInfo);
40
41   selectorName += ".cxx++";
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   }
53 }
54
55 void 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 }