]>
Commit | Line | Data |
---|---|---|
0ab29cfa | 1 | /* $Id$ */ |
2 | ||
3 | // | |
4 | // script to run the AliMultiplicityESDSelector | |
5 | // | |
6 | ||
7 | #include "../CreateESDChain.C" | |
8 | ||
9 | void runMultiplicitySelector(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aMC = kFALSE, Bool_t aDebug = kFALSE, Bool_t aProof = kFALSE) | |
10 | { | |
11 | /*gSystem->Load("libEG"); | |
12 | gSystem->Load("libGeom"); | |
13 | gSystem->Load("libESD");*/ | |
14 | gSystem->cd("ESD"); | |
15 | gROOT->ProcessLine(".x PROOF-INF/SETUP.C"); | |
16 | gSystem->cd(".."); | |
17 | gSystem->cd("PWG0base"); | |
18 | gROOT->ProcessLine(".x PROOF-INF/SETUP.C"); | |
19 | gSystem->cd(".."); | |
20 | //gSystem->Load("libPWG0base"); | |
21 | if (aMC != kFALSE) | |
22 | gSystem->Load("libPWG0dep"); | |
23 | ||
24 | gROOT->ProcessLine(".L CreatedNdEta.C"); | |
25 | gROOT->ProcessLine(".L CreateCuts.C"); | |
26 | gROOT->ProcessLine(".L drawPlots.C"); | |
27 | ||
28 | TChain* chain = CreateESDChain(data, nRuns, offset); | |
29 | TVirtualProof* proof = 0; | |
30 | ||
31 | if (aProof != kFALSE) | |
32 | { | |
33 | proof = TProof::Open("jgrosseo@lxb6043"); | |
34 | ||
35 | if (!proof) | |
36 | { | |
37 | printf("ERROR: PROOF connection not established.\n"); | |
38 | return; | |
39 | } | |
40 | ||
41 | if (proof->EnablePackage("ESD")) | |
42 | { | |
43 | printf("ERROR: ESD package could not be enabled.\n"); | |
44 | return; | |
45 | } | |
46 | ||
47 | if (proof->EnablePackage("PWG0base")) | |
48 | { | |
49 | printf("ERROR: PWG0base package could not be enabled.\n"); | |
50 | return; | |
51 | } | |
52 | ||
53 | if (aMC != kFALSE) | |
54 | { | |
55 | if (proof->EnablePackage("PWG0dep")) | |
56 | { | |
57 | printf("ERROR: PWG0dep package could not be enabled.\n"); | |
58 | return; | |
59 | } | |
60 | } | |
61 | ||
62 | //chain->SetProof(proof); | |
63 | } | |
64 | ||
65 | // ######################################################## | |
66 | // selection of esd tracks | |
67 | AliESDtrackCuts* esdTrackCuts = CreateTrackCuts(); | |
68 | if (!esdTrackCuts) | |
69 | { | |
70 | printf("ERROR: esdTrackCuts could not be created\n"); | |
71 | return; | |
72 | } | |
73 | ||
74 | chain->GetUserInfo()->Add(esdTrackCuts); | |
75 | if (proof) | |
76 | proof->AddInput(esdTrackCuts); | |
77 | ||
78 | TString selectorName = ((aMC == kFALSE) ? "AliMultiplicityESDSelector" : "AliMultiplicityMCSelector"); | |
79 | AliLog::SetClassDebugLevel(selectorName, AliLog::kInfo); | |
80 | ||
81 | selectorName += ".cxx++"; | |
82 | ||
83 | if (aDebug != kFALSE) | |
84 | selectorName += "g"; | |
85 | ||
86 | TStopwatch timer; | |
87 | timer.Start(); | |
88 | ||
89 | Long64_t result = -1; | |
90 | ||
91 | if (proof != kFALSE) | |
92 | result = chain->MakeTDSet()->Process(selectorName); | |
93 | else | |
94 | result = chain->Process(selectorName); | |
95 | ||
96 | if (result != 0) | |
97 | { | |
98 | printf("ERROR: Executing process failed with %d.\n", result); | |
99 | return; | |
100 | } | |
101 | ||
102 | timer.Stop(); | |
103 | timer.Print(); | |
104 | } | |
105 |