3 AliJetFastSimulation* AddTaskFastSimulation(
4 const char *tracksName1 = "Tracks",
5 const char *tracksName2 = "Tracks2",
6 const char *taskName = "JetFastSimulation"
9 // Get the pointer to the existing analysis manager via the static access method.
10 //==============================================================================
11 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
14 ::Error("AddTaskMergeBranches", "No analysis manager to connect to.");
18 // Check the analysis type using the event handlers connected to the analysis manager.
19 //==============================================================================
20 if (!mgr->GetInputEventHandler())
22 ::Error("AddTaskMergeBranches", "This task requires an input event handler");
26 //-------------------------------------------------------
27 // Init the task and do settings
28 //-------------------------------------------------------
30 AliJetFastSimulation *jetFastSim = new AliJetFastSimulation(taskName);
31 jetFastSim->SetTracksName(tracksName1);
32 jetFastSim->SetTracksOutName(tracksName2);
34 //-------------------------------------------------------
35 // Final settings, pass to manager and set the containers
36 //-------------------------------------------------------
37 mgr->AddTask(jetFastSim);
39 // Create containers for input/output
40 mgr->ConnectInput (jetFastSim, 0, mgr->GetCommonInputContainer() );
42 TString contName = taskName;
43 contName += "_histos";
44 TString outputfile = Form("%s",AliAnalysisManager::GetCommonFileName());
45 AliAnalysisDataContainer *outc = mgr->CreateContainer(contName.Data(),
47 AliAnalysisManager::kOutputContainer,
49 mgr->ConnectOutput(jetFastSim, 1, outc);