3 AliJetEmbeddingTask* AddTaskJetEmbedding(
4 const char *tracksName = "Tracks",
5 const char *clusName = "CaloClustersCorr",
6 const char *taskName = "JetEmbeddingTask",
7 const Double_t minPt = 10,
8 const Double_t maxPt = 10,
9 const Double_t minEta = -0.9,
10 const Double_t maxEta = 0.9,
11 const Double_t minPhi = 0,
12 const Double_t maxPhi = TMath::Pi() * 2,
13 const Int_t nTracks = 1,
14 const Int_t nClus = 0,
15 const Bool_t copyArray = kFALSE
18 // Get the pointer to the existing analysis manager via the static access method.
19 //==============================================================================
20 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
23 ::Error("AddTaskJetEmbedding", "No analysis manager to connect to.");
27 // Check the analysis type using the event handlers connected to the analysis manager.
28 //==============================================================================
29 if (!mgr->GetInputEventHandler())
31 ::Error("AddTaskJetEmbedding", "This task requires an input event handler");
35 //-------------------------------------------------------
36 // Init the task and do settings
37 //-------------------------------------------------------
39 AliJetEmbeddingTask *jetEmb = new AliJetEmbeddingTask(taskName);
40 jetEmb->SetTracksName(tracksName);
41 jetEmb->SetClusName(clusName);
42 jetEmb->SetEtaRange(minEta, maxEta);
43 jetEmb->SetPhiRange(minPhi, maxPhi);
44 jetEmb->SetPtRange(minPt, maxPt);
45 jetEmb->SetCopyArray(copyArray);
46 jetEmb->SetNClusters(nClus);
47 jetEmb->SetNTracks(nTracks);
49 //-------------------------------------------------------
50 // Final settings, pass to manager and set the containers
51 //-------------------------------------------------------
55 // Create containers for input/output
56 mgr->ConnectInput (jetEmb, 0, mgr->GetCommonInputContainer() );