1 //=============================================================================
3 // *** AddTaskTOFCalib.C ***
5 // This macro initialize a complete AnalysisTask object for TOF Calibration.
7 //=============================================================================
9 AliTOFCalibTask *AddTaskTOFCalib()
11 // A. Get the pointer to the existing analysis manager via the static access method.
12 //==============================================================================
14 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
16 Error("AddTaskTOFCalib", "No analysis manager to connect to.");
20 // B. Check the analysis type using the event handlers connected to the analysis
21 // manager. The availability of MC handler cann also be checked here.
22 //==============================================================================
24 if (!mgr->GetInputEventHandler()) {
25 ::Error("AddTask", "This task requires an input event handler");
28 TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
30 // C. Create the task, add it to manager.
31 //===========================================================================
33 AliTOFCalibTask *taskTOF = new AliTOFCalibTask("TOFCalibTask");
34 mgr->AddTask(taskTOF);
36 // D. Configure the analysis task. Extra parameters can be used via optional
37 // arguments of the AddTaskXXX() function.
38 //===========================================================================
40 // E. Create ONLY the output containers for the data produced by the task.
41 // Get and connect other common input/output containers via the manager as below
42 //==============================================================================
43 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("histoList", TList::Class(),
44 AliAnalysisManager::kOutputContainer,"outputHistos.root");
45 AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("tofArray", TList::Class(),
46 AliAnalysisManager::kOutputContainer);
48 mgr->ConnectInput(taskTOF, 0, mgr->GetCommonInputContainer());
49 mgr->ConnectOutput(taskTOF, 1, coutput1);
50 mgr->ConnectOutput(taskTOF, 2, coutput2);
52 // Return task pointer at the end