small fix, enhanced comments
[u/mrichter/AliRoot.git] / PWG0 / dNdEta / runMultiplicitySelector.C
CommitLineData
0ab29cfa 1/* $Id$ */
2
3//
4// script to run the AliMultiplicityESDSelector
5//
6
7#include "../CreateESDChain.C"
0bd1f8a0 8#include "../PWG0Helper.C"
0ab29cfa 9
8ca1a6d9 10void runMultiplicitySelector(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aMC = kFALSE, Bool_t aDebug = kFALSE, Bool_t aProof = kFALSE)
0ab29cfa 11{
0bd1f8a0 12 if (aProof)
13 connectProof("proof01@lxb6046");
14
15 TString libraries("libEG;libGeom;libESD;libPWG0base");
16 TString packages("PWG0base");
10ebe68d 17
0ab29cfa 18 if (aMC != kFALSE)
0bd1f8a0 19 {
20 libraries += ";libVMC;libMinuit;libSTEER;libPWG0dep;libEVGEN;libFASTSIM;libmicrocern;libpdf;libpythia6;libEGPythia6;libAliPythia6";
21 packages += ";PWG0dep";
22 }
23
24 if (!prepareQuery(libraries, packages, kTRUE))
25 return;
0ab29cfa 26
0ab29cfa 27 gROOT->ProcessLine(".L CreateCuts.C");
28 gROOT->ProcessLine(".L drawPlots.C");
29
0ab29cfa 30 // selection of esd tracks
31 AliESDtrackCuts* esdTrackCuts = CreateTrackCuts();
32 if (!esdTrackCuts)
33 {
34 printf("ERROR: esdTrackCuts could not be created\n");
35 return;
36 }
37
0bd1f8a0 38 TList inputList;
39 inputList.Add(esdTrackCuts);
40
41 TChain* chain = CreateESDChain(data, nRuns, offset);
0ab29cfa 42
43 TString selectorName = ((aMC == kFALSE) ? "AliMultiplicityESDSelector" : "AliMultiplicityMCSelector");
44 AliLog::SetClassDebugLevel(selectorName, AliLog::kInfo);
45
0bd1f8a0 46 selectorName += ".cxx+";
0ab29cfa 47
48 if (aDebug != kFALSE)
49 selectorName += "g";
50
0bd1f8a0 51 Int_t result = executeQuery(chain, &inputList, selectorName);
0ab29cfa 52
53 if (result != 0)
54 {
55 printf("ERROR: Executing process failed with %d.\n", result);
56 return;
57 }
58
0bd1f8a0 59 // and draw it
60 if (aMC != kFALSE)
61 MultiplicityMC();
62 else
63 MultiplicityESD();
0ab29cfa 64}
65