]>
Commit | Line | Data |
---|---|---|
0f67a57c | 1 | void runCorrection(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aDebug = kFALSE, Bool_t aProof = kFALSE, const char* option = ""){ |
2 | if (aProof) | |
3 | { | |
4 | TProof::Open("lxb6046"); | |
5 | ||
6 | // Enable the needed package | |
7 | gProof->UploadPackage("STEERBase"); | |
8 | gProof->EnablePackage("STEERBase"); | |
9 | gProof->UploadPackage("ESD"); | |
10 | gProof->EnablePackage("ESD"); | |
11 | gProof->UploadPackage("ANALYSIS"); | |
12 | gProof->EnablePackage("ANALYSIS"); | |
13 | gProof->UploadPackage("PWG0base"); | |
14 | gProof->EnablePackage("PWG0base"); | |
15 | } | |
16 | else | |
17 | { | |
18 | gSystem->Load("libVMC"); | |
19 | gSystem->Load("libTree"); | |
20 | gSystem->Load("libSTEERBase"); | |
21 | gSystem->Load("libESD"); | |
22 | gSystem->Load("libANALYSIS"); | |
23 | gSystem->Load("libPWG0base"); | |
24 | } | |
25 | ||
26 | // Create chain of input files | |
27 | gROOT->LoadMacro("../CreateESDChain.C"); | |
28 | chain = CreateESDChain(data, nRuns, offset); | |
29 | ||
30 | // Create the analysis manager | |
31 | mgr = new AliAnalysisManager; | |
32 | ||
33 | // selection of esd tracks | |
34 | gROOT->ProcessLine(".L CreateCuts.C"); | |
35 | AliESDtrackCuts* esdTrackCuts = CreateTrackCuts(); | |
36 | if (!esdTrackCuts) | |
37 | { | |
38 | printf("ERROR: esdTrackCuts could not be created\n"); | |
39 | return; | |
40 | } | |
41 | ||
42 | TString taskName("AlidNdEtaCorrectionTask.cxx+"); | |
43 | if (aDebug) | |
44 | taskName += "+g"; | |
45 | ||
46 | // Create, add task | |
47 | if (aProof) { | |
48 | gProof->Load(taskName); | |
49 | } else | |
50 | gROOT->Macro(taskName); | |
51 | ||
52 | task = new AlidNdEtaCorrectionTask(option); | |
53 | task->SetTrackCuts(esdTrackCuts); | |
54 | task->SetAnalysisMode(AlidNdEtaCorrectionTask::kSPD); | |
55 | ||
56 | mgr->AddTask(task); | |
57 | ||
58 | // Enable MC event handler | |
59 | AliMCEventHandler* handler = new AliMCEventHandler; | |
60 | handler->SetReadTR(kFALSE); | |
61 | mgr->SetMCtruthEventHandler(handler); | |
62 | ||
63 | // Add ESD handler | |
64 | AliESDInputHandler* esdH = new AliESDInputHandler; | |
65 | mgr->SetInputEventHandler(esdH); | |
66 | ||
67 | // Attach input | |
68 | cInput = mgr->CreateContainer("cInput", TChain::Class(), AliAnalysisManager::kInputContainer); | |
69 | mgr->ConnectInput(task, 0, cInput); | |
70 | ||
71 | // Attach output | |
72 | cOutput = mgr->CreateContainer("cOutput", TList::Class(), AliAnalysisManager::kOutputContainer); | |
73 | mgr->ConnectOutput(task, 0, cOutput); | |
74 | ||
75 | // Enable debug printouts | |
76 | if (aDebug) | |
77 | mgr->SetDebugLevel(2); | |
78 | ||
79 | // Run analysis | |
80 | mgr->InitAnalysis(); | |
81 | mgr->PrintStatus(); | |
82 | ||
83 | //aProof = kFALSE; | |
84 | ||
85 | mgr->StartAnalysis((aProof) ? "proof" : "local", chain); | |
86 | } |