]>
Commit | Line | Data |
---|---|---|
804ae415 | 1 | // $Id$ |
b2de6a89 | 2 | |
25283b37 | 3 | AliHadCorrTask* AddTaskHadCorr( |
9b9955ea | 4 | const char *nTracks = "EmcalTracks", |
5 | const char *nClusters = "EmcalClusters", | |
e61400a6 | 6 | const char *outClusName = "CaloClustersCorr", |
b2de6a89 | 7 | const Double_t hadcorr = 1, |
8 | const Double_t minPt = 0.15, | |
ab601ed1 | 9 | const Double_t phiMatch = 0.050, |
10 | const Double_t etaMatch = 0.025, | |
b72edd5f | 11 | const Double_t Eexcl = 0, |
12 | const Bool_t trackClus = kTRUE, | |
13 | const Bool_t histo = kFALSE, | |
14 | const char *outputname = "AnalysisResults.root" | |
b2de6a89 | 15 | ) |
25283b37 | 16 | { |
17 | // Get the pointer to the existing analysis manager via the static access method. | |
18 | //============================================================================== | |
19 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
20 | if (!mgr) | |
21 | { | |
22 | ::Error("AddTaskHadCorr", "No analysis manager to connect to."); | |
23 | return NULL; | |
24 | } | |
25 | ||
26 | // Check the analysis type using the event handlers connected to the analysis manager. | |
27 | //============================================================================== | |
28 | if (!mgr->GetInputEventHandler()) | |
29 | { | |
30 | ::Error("AddTaskHadCorr", "This task requires an input event handler"); | |
31 | return NULL; | |
32 | } | |
33 | ||
34 | //------------------------------------------------------- | |
35 | // Init the task and do settings | |
36 | //------------------------------------------------------- | |
37 | ||
e61400a6 | 38 | TString name(Form("HadCorr_%s", outClusName)); |
5d845887 | 39 | AliHadCorrTask *hcor = new AliHadCorrTask(name, histo); |
e61400a6 | 40 | hcor->SetTracksName(nTracks); |
41 | hcor->SetClusName(nClusters); | |
ab601ed1 | 42 | hcor->SetOutClusName(outClusName); |
43 | hcor->SetPhiMatch(phiMatch); | |
44 | hcor->SetEtaMatch(etaMatch); | |
b2de6a89 | 45 | hcor->SetHadCorr(hadcorr); |
b72edd5f | 46 | hcor->SetPtCut(minPt); |
47 | hcor->SetEexcl(Eexcl); | |
48 | hcor->SetTrackClus(trackClus); | |
49 | hcor->SetAnaType(AliAnalysisTaskEmcal::kEMCAL); | |
25283b37 | 50 | |
51 | //------------------------------------------------------- | |
52 | // Final settings, pass to manager and set the containers | |
53 | //------------------------------------------------------- | |
54 | ||
55 | mgr->AddTask(hcor); | |
56 | ||
57 | // Create containers for input/output | |
58 | mgr->ConnectInput (hcor, 0, mgr->GetCommonInputContainer() ); | |
d41a0b1c | 59 | |
60 | if (histo) { | |
61 | AliAnalysisDataContainer *cohcor = mgr->CreateContainer(name, | |
62 | TList::Class(), | |
63 | AliAnalysisManager::kOutputContainer, | |
64 | outputname); | |
65 | mgr->ConnectOutput(hcor,1,cohcor); | |
66 | } | |
25283b37 | 67 | |
68 | return hcor; | |
25283b37 | 69 | } |