3 AliHadCorrTask* AddTaskHadCorr(
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 Double_t phiMatch = 0.050,
10 const Double_t etaMatch = 0.025,
11 const char *outputname = "AnalysisResults.root",
12 const Bool_t histo = kFALSE
15 // Get the pointer to the existing analysis manager via the static access method.
16 //==============================================================================
17 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
20 ::Error("AddTaskHadCorr", "No analysis manager to connect to.");
24 // Check the analysis type using the event handlers connected to the analysis manager.
25 //==============================================================================
26 if (!mgr->GetInputEventHandler())
28 ::Error("AddTaskHadCorr", "This task requires an input event handler");
32 //-------------------------------------------------------
33 // Init the task and do settings
34 //-------------------------------------------------------
36 TString name(Form("HadCorr_%s", outClusName));
37 AliHadCorrTask *hcor = new AliHadCorrTask(name, histo);
38 hcor->SetTracksName(nTracks);
39 hcor->SetClusName(nClusters);
40 hcor->SetOutClusName(outClusName);
41 hcor->SetPhiMatch(phiMatch);
42 hcor->SetEtaMatch(etaMatch);
43 hcor->SetHadCorr(hadcorr);
44 hcor->SetMinPt(minPt);
46 //-------------------------------------------------------
47 // Final settings, pass to manager and set the containers
48 //-------------------------------------------------------
52 // Create containers for input/output
53 mgr->ConnectInput (hcor, 0, mgr->GetCommonInputContainer() );
56 AliAnalysisDataContainer *cohcor = mgr->CreateContainer(name,
58 AliAnalysisManager::kOutputContainer,
60 mgr->ConnectOutput(hcor,1,cohcor);