]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added macros AddTaskCheckV0.C and AddTaskStrange.C temporary in ANALYSIS/macros....
authoragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Apr 2009 09:28:07 +0000 (09:28 +0000)
committeragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Apr 2009 09:28:07 +0000 (09:28 +0000)
ANALYSIS/macros/AddTaskCheckV0.C [new file with mode: 0644]
ANALYSIS/macros/AddTaskStrange.C [new file with mode: 0644]
ANALYSIS/macros/AnalysisTrainNew.C

diff --git a/ANALYSIS/macros/AddTaskCheckV0.C b/ANALYSIS/macros/AddTaskCheckV0.C
new file mode 100644 (file)
index 0000000..e88ef7d
--- /dev/null
@@ -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/ANALYSIS/macros/AddTaskStrange.C b/ANALYSIS/macros/AddTaskStrange.C
new file mode 100644 (file)
index 0000000..c11388a
--- /dev/null
@@ -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;
+}   
index 31692d6bebc13c32275d68f42a88fdc382e53d17..8a5d1c88dd17265310092290404e48fb3d1565a7 100644 (file)
@@ -176,6 +176,12 @@ void AnalysisTrainNew(const char *analysis_mode="grid", const char *plugin_mode=
       // cascades
       gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskCheckCascade.C");
       AliAnalysisTaskCheckCascade *taskcheckcascade = AddTaskCheckCascade();      
+      // v0's
+      gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskCheckV0.C");
+      AliAnalysisTaskCheckV0 *taskcheckV0 = AddTaskCheckV0();
+      // strangeness
+      gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskStrange.C");
+      AliAnalysisTaskStrange *taskstrange = AddTaskStrange();
    }   
    
    // PWG4 hadron correlations