]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/STRANGENESS/LambdaK0/macros/AddTaskExtractPerformanceV0.C
1) Added "Swapped charge fix" for On-the-fly V0 candidates to the code contained...
[u/mrichter/AliRoot.git] / PWGLF / STRANGENESS / LambdaK0 / macros / AddTaskExtractPerformanceV0.C
1 AliAnalysisTaskExtractPerformanceV0 *AddTaskExtractPerformanceV0( Bool_t lSwitchIsNuclear     = kTRUE, 
2                                                                   Bool_t lSwitchIsLowEnergyPP = kFALSE,
3                                                                   Bool_t lSwitchUseOnTheFly   = kFALSE, 
4                                                                   const TString lMasterJobSessionFlag = "")
5 {
6 // Creates, configures and attaches to the train a cascades check task.
7    // Get the pointer to the existing analysis manager via the static access method.
8    //==============================================================================
9    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
10    if (!mgr) {
11       ::Error("AddTaskExtractPerformanceV0", "No analysis manager to connect to.");
12       return NULL;
13    }   
14
15    // Check the analysis type using the event handlers connected to the analysis manager.
16    //==============================================================================
17    if (!mgr->GetInputEventHandler()) {
18       ::Error("AddTaskExtractPerformanceV0", "This task requires an input event handler");
19       return NULL;
20    }   
21    TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
22
23    // Create and configure the task
24          AliAnalysisTaskExtractPerformanceV0 *taskv0extractperformance = new AliAnalysisTaskExtractPerformanceV0("taskv0extractperformance");
25
26    //Configuration
27    taskv0extractperformance -> SetIsNuclear     ( lSwitchIsNuclear     );
28    taskv0extractperformance -> SetIsLowEnergyPP ( lSwitchIsLowEnergyPP );
29    taskv0extractperformance -> SetUseOnTheFly   ( lSwitchUseOnTheFly   );
30
31    mgr->AddTask(taskv0extractperformance);
32
33    TString outputFileName = AliAnalysisManager::GetCommonFileName();
34    
35    outputFileName += ":PWG2CheckPerformanceLambda";
36    //if (lSwitchIsNuclear) outputFileName += "_AA";
37    outputFileName += "_PP";
38    if (mgr->GetMCtruthEventHandler()) outputFileName += "_MC";
39    //if(lMasterJobSessionFlag.Length()) outputFileName += lMasterJobSessionFlag.Data();
40    
41    Printf("Set OutputFileName : \n %s\n", outputFileName.Data() );
42
43    AliAnalysisDataContainer *coutputList = mgr->CreateContainer("clistV0MC",
44                                                              TList::Class(),
45                                                              AliAnalysisManager::kOutputContainer,
46                                                              outputFileName );
47    AliAnalysisDataContainer *coutputTree = mgr->CreateContainer("cTreeMC",
48                                                              TTree::Class(),
49                                                              AliAnalysisManager::kOutputContainer,
50                                                              outputFileName );
51    
52    //This one you should merge in file-resident ways...
53    coutputTree->SetSpecialOutput();
54
55    mgr->ConnectInput( taskv0extractperformance, 0, mgr->GetCommonInputContainer());
56    mgr->ConnectOutput(taskv0extractperformance, 1, coutputList);
57    mgr->ConnectOutput(taskv0extractperformance, 2, coutputTree);
58    
59    return taskv0extractperformance;
60 }