making explicit the file format when saving a Canvas
[u/mrichter/AliRoot.git] / PWG2 / KINK / macros / AddTaskKinkResonanceLikeSign.C
CommitLineData
e3475d46 1AliResonanceKinkLikeSign *AddTaskKinkResonanceLikeSign(Short_t lCollidingSystems=0 /*0 = pp, 1 = AA*/)
2{
3// Creates, configures and attaches to the train a V0 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("AddTaskKinkResonanceLikeSign", "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("AddTaskKinkResonanceLikeSign", "This task requires an input event handler");
16 return NULL;
17 }
18 TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
19 if (type != "ESD") {
20 ::Error("AddTaskKinkResonanceLikeSign", "This task needs ESD input handler");
21 return NULL;
22 }
23
24 // Create and configure the task
25 AliResonanceKinkLikeSign *taskkinkreslikesign = new AliResonanceKinkLikeSign("TaskResLikeSign");
26 mgr->AddTask(taskkinkreslikesign);
27
28 // Create ONLY the output containers for the data produced by the task.
29 // Get and connect other common input/output containers via the manager as below
30 //==============================================================================
4cb65f9e 31 TString outputFileName = AliAnalysisManager::GetCommonFileName();
32 outputFileName += ":PWG2KINKResonanceLikeSign";
33 if (lCollidingSystems) outputFileName += "_AA";
34 else outputFileName += "_PP";
35 if (mgr->GetMCtruthEventHandler()) outputFileName += "_MC";
36
37 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("KinkResLikeSign",
38 TList::Class(),
39 AliAnalysisManager::kOutputContainer,
40 outputFileName );
41
42 mgr->ConnectInput(taskkinkreslikesign, 0, mgr->GetCommonInputContainer());
e3475d46 43 mgr->ConnectOutput(taskkinkreslikesign, 1, coutput1);
44 return taskkinkreslikesign;
45}