]>
Commit | Line | Data |
---|---|---|
b2e7de7f | 1 | AliAnalysisTaskExtractPerformanceV0pPb *AddTaskExtractPerformanceV0pPb( 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 | AliAnalysisTaskExtractPerformanceV0pPb *taskv0extractperformance = new AliAnalysisTaskExtractPerformanceV0pPb("taskv0extractperformance"); | |
22 | ||
23 | mgr->AddTask(taskv0extractperformance); | |
24 | ||
25 | TString outputFileName = AliAnalysisManager::GetCommonFileName(); | |
26 | ||
27 | outputFileName += ":PWGLFExtractPerformanceV0"; | |
28 | //if (lSwitchIsNuclear) outputFileName += "_AA"; | |
29 | outputFileName += "_PP"; | |
30 | if (mgr->GetMCtruthEventHandler()) outputFileName += "_MC"; | |
31 | //if(lMasterJobSessionFlag.Length()) outputFileName += lMasterJobSessionFlag.Data(); | |
32 | ||
33 | Printf("Set OutputFileName : \n %s\n", outputFileName.Data() ); | |
34 | ||
35 | AliAnalysisDataContainer *coutputList = mgr->CreateContainer("clistV0MC", | |
36 | TList::Class(), | |
37 | AliAnalysisManager::kOutputContainer, | |
38 | outputFileName ); | |
39 | AliAnalysisDataContainer *coutputTree = mgr->CreateContainer("cTreeMC", | |
40 | TTree::Class(), | |
41 | AliAnalysisManager::kOutputContainer, | |
42 | outputFileName ); | |
43 | AliAnalysisDataContainer *coutputTreeEvents = mgr->CreateContainer("cTreeEventsMC", | |
44 | TTree::Class(), | |
45 | AliAnalysisManager::kOutputContainer, | |
46 | outputFileName ); | |
47 | ||
48 | //This one you should merge in file-resident ways... | |
49 | coutputTree->SetSpecialOutput(); | |
3214e069 | 50 | coutputTreeEvents->SetSpecialOutput(); |
b2e7de7f | 51 | |
52 | //Recommendation: Tree as a single output slot | |
53 | mgr->ConnectInput( taskv0extractperformance, 0, mgr->GetCommonInputContainer()); | |
54 | mgr->ConnectOutput(taskv0extractperformance, 1, coutputList); | |
55 | mgr->ConnectOutput(taskv0extractperformance, 2, coutputTree); | |
56 | mgr->ConnectOutput(taskv0extractperformance, 3, coutputTreeEvents); | |
57 | ||
58 | return taskv0extractperformance; | |
59 | } |