]>
Commit | Line | Data |
---|---|---|
804ae415 | 1 | // $Id$ |
b2de6a89 | 2 | |
25283b37 | 3 | AliHadCorrTask* AddTaskHadCorr( |
b2de6a89 | 4 | const char *ntracks = "Tracks", |
5 | const char *nclusters = "CaloClusters", | |
6 | const char *outclusname = "CaloClustersCorr", | |
7 | const Double_t hadcorr = 1, | |
8 | const Double_t minPt = 0.15, | |
9 | const char *outputname = "HadCorrOutput.root" | |
10 | ) | |
25283b37 | 11 | { |
12 | // Get the pointer to the existing analysis manager via the static access method. | |
13 | //============================================================================== | |
14 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
15 | if (!mgr) | |
16 | { | |
17 | ::Error("AddTaskHadCorr", "No analysis manager to connect to."); | |
18 | return NULL; | |
19 | } | |
20 | ||
21 | // Check the analysis type using the event handlers connected to the analysis manager. | |
22 | //============================================================================== | |
23 | if (!mgr->GetInputEventHandler()) | |
24 | { | |
25 | ::Error("AddTaskHadCorr", "This task requires an input event handler"); | |
26 | return NULL; | |
27 | } | |
28 | ||
29 | //------------------------------------------------------- | |
30 | // Init the task and do settings | |
31 | //------------------------------------------------------- | |
32 | ||
b2de6a89 | 33 | TString name(Form("HadronicCorrection_%s", outclusname)); |
34 | AliHadCorrTask *hcor = new AliHadCorrTask(name); | |
25283b37 | 35 | hcor->SetTracksName(ntracks); |
25283b37 | 36 | hcor->SetClusName(nclusters); |
25283b37 | 37 | hcor->SetOutClusName(outclusname); |
b2de6a89 | 38 | hcor->SetHadCorr(hadcorr); |
39 | hcor->SetMinPt(minPt); | |
25283b37 | 40 | |
41 | //------------------------------------------------------- | |
42 | // Final settings, pass to manager and set the containers | |
43 | //------------------------------------------------------- | |
44 | ||
45 | mgr->AddTask(hcor); | |
46 | ||
47 | // Create containers for input/output | |
48 | mgr->ConnectInput (hcor, 0, mgr->GetCommonInputContainer() ); | |
b2de6a89 | 49 | AliAnalysisDataContainer *cohcor = mgr->CreateContainer(name, |
50 | TList::Class(),AliAnalysisManager::kOutputContainer, | |
51 | outputname); | |
25283b37 | 52 | mgr->ConnectOutput(hcor,1,cohcor); |
53 | ||
54 | return hcor; | |
25283b37 | 55 | } |