]>
Commit | Line | Data |
---|---|---|
dc740de4 | 1 | /* $Id$ */ |
2 | ||
75e130df | 3 | // |
4 | // Script to test the dN/dEta analysis using the dNdEtaAnalysis and | |
5 | // dNdEtaCorrection classes. Note that there is a cut on the events, | |
6 | // so the measurement will be biassed. | |
7 | // | |
8 | // implementation with TSelector | |
9 | // | |
10 | ||
11 | #include "../CreateESDChain.C" | |
12 | ||
16e24ca3 | 13 | void testAnalysis2(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aMC = kFALSE, Bool_t aDebug = kFALSE, Bool_t aProof = kFALSE) |
75e130df | 14 | { |
16e24ca3 | 15 | gSystem->Load("libEG"); |
16 | gSystem->Load("libGeom"); | |
17 | gSystem->Load("libESD"); | |
75e130df | 18 | gSystem->Load("libPWG0base"); |
16e24ca3 | 19 | if (aMC != kFALSE) |
20 | gSystem->Load("libPWG0dep"); | |
75e130df | 21 | |
16e24ca3 | 22 | gROOT->ProcessLine(".L CreatedNdEta.C"); |
23 | gROOT->ProcessLine(".L CreateCuts.C"); | |
24 | ||
25 | TChain* chain = 0; | |
26 | TVirtualProof* proof = 0; | |
27 | if (aProof == kFALSE) | |
28 | chain = CreateESDChainFromDir(data, nRuns, offset); | |
29 | else | |
30 | { | |
31 | chain = CreateESDChainFromList(data, nRuns, offset); | |
32 | proof = gROOT->Proof("alicecaf@lxb6041"); | |
33 | ||
34 | if (!proof) | |
35 | { | |
36 | printf("ERROR: PROOF connection not established.\n"); | |
37 | return; | |
38 | } | |
39 | ||
40 | if (proof->EnablePackage("ESD")) | |
41 | { | |
42 | printf("ERROR: ESD package could not be enabled.\n"); | |
43 | return; | |
44 | } | |
45 | ||
46 | if (proof->EnablePackage("PWG0base")) | |
47 | { | |
48 | printf("ERROR: PWG0base package could not be enabled.\n"); | |
49 | return; | |
50 | } | |
51 | ||
52 | if (aMC != kFALSE) | |
53 | { | |
54 | if (proof->EnablePackage("PWG0dep")) | |
55 | { | |
56 | printf("ERROR: PWG0dep package could not be enabled.\n"); | |
57 | return; | |
58 | } | |
59 | } | |
60 | ||
61 | chain->SetProof(proof); | |
62 | } | |
75e130df | 63 | |
64 | // ######################################################## | |
65 | // selection of esd tracks | |
16e24ca3 | 66 | AliESDtrackCuts* esdTrackCuts = CreateTrackCuts(); |
67 | if (!esdTrackCuts) | |
dded7a68 | 68 | { |
16e24ca3 | 69 | printf("ERROR: esdTrackCuts could not be created\n"); |
70 | return; | |
dded7a68 | 71 | } |
37dbb69e | 72 | |
16e24ca3 | 73 | chain->GetUserInfo()->Add(esdTrackCuts); |
74 | if (proof) | |
75 | proof->AddInput(esdTrackCuts); | |
76 | ||
dc740de4 | 77 | TString selectorName = ((aMC == kFALSE) ? "AlidNdEtaAnalysisESDSelector" : "AlidNdEtaAnalysisMCSelector"); |
4dd2ad81 | 78 | AliLog::SetClassDebugLevel(selectorName, AliLog::kInfo); |
79 | ||
16e24ca3 | 80 | // workaround for a bug in PROOF that only allows header files for .C files |
81 | // please create symlink from <selector>.cxx to <selector>.C | |
82 | if (proof != kFALSE) | |
83 | selectorName += ".C+"; | |
84 | else | |
85 | selectorName += ".cxx+"; | |
86 | ||
fcf2fb36 | 87 | if (aDebug != kFALSE) |
88 | selectorName += "g"; | |
89 | ||
dafef3c8 | 90 | TStopwatch timer; |
91 | timer.Start(); | |
92 | ||
16e24ca3 | 93 | Long64_t result = chain->Process(selectorName); |
94 | if (result != 0) | |
95 | { | |
96 | printf("ERROR: Executing process failed with %d.\n", result); | |
97 | return; | |
98 | } | |
dafef3c8 | 99 | |
100 | timer.Stop(); | |
101 | timer.Print(); | |
5fbd0b17 | 102 | |
103 | CreatedNdEta(aMC ? kFALSE : kTRUE); | |
75e130df | 104 | } |
16e24ca3 | 105 |