]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ANALYSIS/macros/AddTaskVZEROEqFactorTask.C
change default acceptance option
[u/mrichter/AliRoot.git] / ANALYSIS / macros / AddTaskVZEROEqFactorTask.C
1 AliAnalysisTaskVZEROEqFactorTask *AddTaskVZEROEqFactorTask( const TString lMasterJobSessionFlag = "")
2 {
3 // Creates, configures and attaches to the train a cascades check task.
4    // Get the pointer to the existing analysis manager via the static access method.
5    //==============================================================================
6    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
7    if (!mgr) {
8       ::Error("AddTaskExtractPerformanceV0", "No analysis manager to connect to.");
9       return NULL;
10    }   
11
12    // Check the analysis type using the event handlers connected to the analysis manager.
13    //==============================================================================
14    if (!mgr->GetInputEventHandler()) {
15       ::Error("AddTaskExtractPerformanceV0", "This task requires an input event handler");
16       return NULL;
17    }   
18    TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
19
20   // Create and configure the task
21   AliAnalysisTaskVZEROEqFactorTask *taskVZEROAuxiliary = new AliAnalysisTaskVZEROEqFactorTask("taskVZEROAuxiliary");
22
23   mgr->AddTask(taskVZEROAuxiliary);
24   TString outputFileName = AliAnalysisManager::GetCommonFileName();
25    
26   outputFileName += ":PWGLF_VZEROEqFactorTask";
27   if (mgr->GetMCtruthEventHandler()) outputFileName += "_MC";
28    
29   Printf("Set OutputFileName : \n %s\n", outputFileName.Data() );
30
31   AliAnalysisDataContainer *coutputList = mgr->CreateContainer("cList_VZERO",
32                                                              TList::Class(),
33                                                              AliAnalysisManager::kOutputContainer,
34                                                              outputFileName );
35
36   //Recommendation: Tree as a single output slot
37   mgr->ConnectInput( taskVZEROAuxiliary, 0, mgr->GetCommonInputContainer());
38   mgr->ConnectOutput(taskVZEROAuxiliary, 1, coutputList);
39   
40   return taskVZEROAuxiliary;
41 }