]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG0/testAliSelector.C
added constructors
[u/mrichter/AliRoot.git] / PWG0 / testAliSelector.C
1 /* $Id$ */
2
3 //
4 // This is an example how to run a selector
5 //
6 // This script runs the AliSelector on a chain of ESD files,
7 // some debug information is printed
8 //
9
10 #include "CreateESDChain.C"
11
12 // parameters are
13 //   dataDir: the directory containing subdirectories that contain the ESD files
14 //   nRuns: the number of files that should be processed
15 //   offset: the directory to start with
16 void testAliSelector(const Char_t* dataDir, Int_t nRuns = 5, Int_t offset = 0)
17 {
18   // load needed libraries
19   gSystem->Load("libEG");
20   gSystem->Load("libGeom");
21   gSystem->Load("libESD");
22   gSystem->Load("libPWG0base");
23
24   // create chain, CreateESDChain() is defined in CreateESDChain.C
25   TChain* chain = CreateESDChain(dataDir, nRuns, offset);
26
27   // enable debugging
28   AliLog::SetClassDebugLevel("AliSelector", AliLog::kInfo);
29
30   // run selector on chain
31   Long64_t result = chain->Process("AliSelector.cxx+");
32
33   if (result != 0)
34   {
35     printf("ERROR: Executing process failed with %d.\n", result);
36     return;
37   }
38
39   printf("Execution complete.\n");
40 }