From cc1236ede59cc3c0e08b37fd591ab795e6a39b44 Mon Sep 17 00:00:00 2001 From: bhippoly Date: Thu, 30 Apr 2009 17:02:55 +0000 Subject: [PATCH] Validated macros for the global analysis train... --- PWG2/SPECTRA/macros/AddTaskCheckCascade.C | 41 ++++++++++++++++++++++ PWG2/SPECTRA/macros/AddTaskCheckV0.C | 41 ++++++++++++++++++++++ PWG2/SPECTRA/macros/AddTaskStrange.C | 42 +++++++++++++++++++++++ 3 files changed, 124 insertions(+) create mode 100644 PWG2/SPECTRA/macros/AddTaskCheckCascade.C create mode 100644 PWG2/SPECTRA/macros/AddTaskCheckV0.C create mode 100644 PWG2/SPECTRA/macros/AddTaskStrange.C diff --git a/PWG2/SPECTRA/macros/AddTaskCheckCascade.C b/PWG2/SPECTRA/macros/AddTaskCheckCascade.C new file mode 100644 index 00000000000..1d0cb5e1f8d --- /dev/null +++ b/PWG2/SPECTRA/macros/AddTaskCheckCascade.C @@ -0,0 +1,41 @@ +AliAnalysisTaskCheckCascade *AddTaskCheckCascade(Short_t lCollidingSystems=0 /*0 = pp, 1 = AA*/) +{ +// Creates, configures and attaches to the train a cascades check task. + // Get the pointer to the existing analysis manager via the static access method. + //============================================================================== + AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); + if (!mgr) { + ::Error("AddTaskCheckCascade", "No analysis manager to connect to."); + return NULL; + } + + // Check the analysis type using the event handlers connected to the analysis manager. + //============================================================================== + if (!mgr->GetInputEventHandler()) { + ::Error("AddTaskCheckCascade", "This task requires an input event handler"); + return NULL; + } + TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" + + // Create and configure the task + AliAnalysisTaskCheckCascade *taskcheckcascade = new AliAnalysisTaskCheckCascade("TaskCheckCascade"); + taskcheckcascade->SetCollidingSystems(lCollidingSystems); + taskcheckcascade->SetAnalysisType(type); + mgr->AddTask(taskcheckcascade); + + // Create ONLY the output containers for the data produced by the task. + // Get and connect other common input/output containers via the manager as below + //============================================================================== + TString outname = "PP"; + if (lCollidingSystems) outname = "AA"; + if (mgr->GetMCtruthEventHandler()) outname += "-MC-"; + outname += "CascadeList.root"; + AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clistCasc", + TList::Class(), + AliAnalysisManager::kOutputContainer, + outname ); + + mgr->ConnectInput(taskcheckcascade, 0, mgr->GetCommonInputContainer()); + mgr->ConnectOutput(taskcheckcascade, 1, coutput1); + return taskcheckcascade; +} diff --git a/PWG2/SPECTRA/macros/AddTaskCheckV0.C b/PWG2/SPECTRA/macros/AddTaskCheckV0.C new file mode 100644 index 00000000000..1b3ded37e91 --- /dev/null +++ b/PWG2/SPECTRA/macros/AddTaskCheckV0.C @@ -0,0 +1,41 @@ +AliAnalysisTaskCheckV0 *AddTaskCheckV0(Short_t lCollidingSystems=0 /*0 = pp, 1 = AA*/) +{ +// Creates, configures and attaches to the train a V0 check task. + // Get the pointer to the existing analysis manager via the static access method. + //============================================================================== + AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); + if (!mgr) { + ::Error("AddTaskCheckV0", "No analysis manager to connect to."); + return NULL; + } + + // Check the analysis type using the event handlers connected to the analysis manager. + //============================================================================== + if (!mgr->GetInputEventHandler()) { + ::Error("AddTaskCheckV0", "This task requires an input event handler"); + return NULL; + } + TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" + + // Create and configure the task + AliAnalysisTaskCheckV0 *taskcheckv0 = new AliAnalysisTaskCheckV0("TaskCheckV0"); + taskcheckv0->SetCollidingSystems(lCollidingSystems); + taskcheckv0->SetAnalysisType(type); + mgr->AddTask(taskcheckv0); + + // Create ONLY the output containers for the data produced by the task. + // Get and connect other common input/output containers via the manager as below + //============================================================================== + TString outname = "PP"; + if (lCollidingSystems) outname = "AA"; + if (mgr->GetMCtruthEventHandler()) outname += "-MC-"; + outname += "V0List.root"; + AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clistV0", + TList::Class(), + AliAnalysisManager::kOutputContainer, + outname ); + + mgr->ConnectInput(taskcheckv0, 0, mgr->GetCommonInputContainer()); + mgr->ConnectOutput(taskcheckv0, 1, coutput1); + return taskcheckv0; +} diff --git a/PWG2/SPECTRA/macros/AddTaskStrange.C b/PWG2/SPECTRA/macros/AddTaskStrange.C new file mode 100644 index 00000000000..01365d8875c --- /dev/null +++ b/PWG2/SPECTRA/macros/AddTaskStrange.C @@ -0,0 +1,42 @@ +AliAnalysisTaskStrange *AddTaskStrange(Short_t lCollidingSystems=0, /*0 = pp, 1 = AA*/ + const char *optCuts="") +{ +// Creates, configures and attaches to the train a strangeness task. + // Get the pointer to the existing analysis manager via the static access method. + //============================================================================== + AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); + if (!mgr) { + ::Error("AddTaskStrange", "No analysis manager to connect to."); + return NULL; + } + + // Check the analysis type using the event handlers connected to the analysis manager. + //============================================================================== + if (!mgr->GetInputEventHandler()) { + ::Error("AddTaskStrange", "This task requires an input event handler"); + return NULL; + } + TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" + + // Create and configure the task + AliAnalysisTaskStrange *taskstrange = new AliAnalysisTaskStrange("TaskStrange", optCuts); + taskstrange->SetCollidingSystems(lCollidingSystems); + taskstrange->SetAnalysisType(type); + mgr->AddTask(taskstrange); + + // Create ONLY the output containers for the data produced by the task. + // Get and connect other common input/output containers via the manager as below + //============================================================================== + TString outname = "PP"; + if (lCollidingSystems) outname = "AA"; + if (mgr->GetMCtruthEventHandler()) outname += "-MC-"; + outname += "StrangeList.root"; + AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clistStrange", + TList::Class(), + AliAnalysisManager::kOutputContainer, + outname ); + + mgr->ConnectInput(taskstrange, 0, mgr->GetCommonInputContainer()); + mgr->ConnectOutput(taskstrange, 1, coutput1); + return taskstrange; +} -- 2.43.0