]>
Commit | Line | Data |
---|---|---|
af0d4791 | 1 | AliAnalysisTaskStrangenessVsMultiplicityMC *AddTaskStrangenessVsMultiplicityMC( Bool_t lSaveV0 = kFALSE, Bool_t lSaveCascade = kTRUE, 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("AddTaskStrangenessVsMultiplicity", "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("AddTaskStrangenessVsMultiplicity", "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 | AliAnalysisTaskStrangenessVsMultiplicityMC *taskAuxiliary = new AliAnalysisTaskStrangenessVsMultiplicityMC("taskAuxiliary"); | |
22 | mgr->AddTask(taskAuxiliary); | |
23 | TString outputFileName = AliAnalysisManager::GetCommonFileName(); | |
24 | ||
25 | outputFileName += ":PWGLF_StrVsMult"; | |
26 | if (mgr->GetMCtruthEventHandler()) outputFileName += "_MC"; | |
27 | ||
28 | Printf("Set OutputFileName : \n %s\n", outputFileName.Data() ); | |
29 | ||
30 | AliAnalysisDataContainer *coutputList = mgr->CreateContainer("cList", | |
31 | TList::Class(), | |
32 | AliAnalysisManager::kOutputContainer, | |
33 | outputFileName ); | |
34 | AliAnalysisDataContainer *coutputTree = mgr->CreateContainer("cTreeEvent", | |
35 | TTree::Class(), | |
36 | AliAnalysisManager::kOutputContainer, | |
37 | outputFileName ); | |
38 | AliAnalysisDataContainer *coutputTreeV0 = mgr->CreateContainer("cTreeV0", | |
39 | TTree::Class(), | |
40 | AliAnalysisManager::kOutputContainer, | |
41 | outputFileName ); | |
42 | AliAnalysisDataContainer *coutputTreeCascade = mgr->CreateContainer("cTreeCascade", | |
43 | TTree::Class(), | |
44 | AliAnalysisManager::kOutputContainer, | |
45 | outputFileName ); | |
46 | ||
47 | //This one you should merge in file-resident ways... | |
48 | coutputTree->SetSpecialOutput(); | |
49 | coutputTreeV0->SetSpecialOutput(); | |
50 | coutputTreeCascade->SetSpecialOutput(); | |
51 | ||
52 | //Recommendation: Tree as a single output slot | |
53 | mgr->ConnectInput (taskAuxiliary, 0, mgr->GetCommonInputContainer()); | |
54 | mgr->ConnectOutput(taskAuxiliary, 1, coutputList); | |
55 | mgr->ConnectOutput(taskAuxiliary, 2, coutputTree); | |
56 | mgr->ConnectOutput(taskAuxiliary, 3, coutputTreeV0); | |
57 | mgr->ConnectOutput(taskAuxiliary, 4, coutputTreeCascade); | |
58 | ||
59 | return taskAuxiliary; | |
60 | } |