]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
adding Mihaela's macros to be used for the analysis train...
authorbhippoly <bhippoly@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 7 May 2009 10:37:31 +0000 (10:37 +0000)
committerbhippoly <bhippoly@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 7 May 2009 10:37:31 +0000 (10:37 +0000)
PWG2/KINK/macros/AddTaskKink.C [new file with mode: 0644]
PWG2/KINK/macros/AddTaskKinkResonance.C [new file with mode: 0644]
PWG2/KINK/macros/AddTaskKinkResonanceLikeSign.C [new file with mode: 0644]

diff --git a/PWG2/KINK/macros/AddTaskKink.C b/PWG2/KINK/macros/AddTaskKink.C
new file mode 100644 (file)
index 0000000..db66c3f
--- /dev/null
@@ -0,0 +1,46 @@
+AliAnalysisKinkESDMC *AddTaskKink(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("AddTaskKink", "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("AddTaskKink", "This task requires an input event handler");
+      return NULL;
+   }   
+   TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
+   if (type != "ESD") {
+      ::Error("AddTaskKink", "This task needs ESD input handler");
+      return NULL;
+   }   
+   if (!mgr->GetMCtruthEventHandler()) {
+      ::Error("AddTaskKink", "This task needs an MC handler");
+      return NULL;
+   }
+   // Create and configure the task
+       AliAnalysisKinkESDMC *taskkink = new AliAnalysisKinkESDMC("TaskkinkESDMC");
+   mgr->AddTask(taskkink);
+
+   // 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 += "KinkList.root";
+       AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("KinkESDMC",
+                                                                  TList::Class(),
+                                                                  AliAnalysisManager::kOutputContainer,
+                                                                  outname );
+                           
+       mgr->ConnectInput(taskkink, 0, mgr->GetCommonInputContainer());
+   mgr->ConnectOutput(taskkink, 1, coutput1);
+   return taskkink;
+}   
diff --git a/PWG2/KINK/macros/AddTaskKinkResonance.C b/PWG2/KINK/macros/AddTaskKinkResonance.C
new file mode 100644 (file)
index 0000000..e36b7bf
--- /dev/null
@@ -0,0 +1,47 @@
+AliResonanceKinkPID *AddTaskKinkResonance(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("AddTaskKinkResonance", "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("AddTaskKinkResonance", "This task requires an input event handler");
+      return NULL;
+   }   
+   TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
+   if (type != "ESD") {
+      ::Error("AddTaskKinkResonance", "This task needs an ESD input handler");
+      return NULL;
+   }   
+   if (!mgr->GetMCtruthEventHandler()) {
+      ::Error("AddTaskKinkResonance", "This task needs an MC handler");
+      return NULL;
+   }
+
+   // Create and configure the task
+       AliResonanceKinkPID *taskkinkresonance = new AliResonanceKinkPID("TaskResKinkPID");
+   mgr->AddTask(taskkinkresonance);
+
+   // 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 += "KinkResonanceList.root";
+       AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("KinkResPID",
+                                                                  TList::Class(),
+                                                                  AliAnalysisManager::kOutputContainer,
+                                                                  outname );
+                           
+       mgr->ConnectInput(taskkinkresonance, 0, mgr->GetCommonInputContainer());
+   mgr->ConnectOutput(taskkinkresonance, 1, coutput1);
+   return taskkinkresonance;
+}   
diff --git a/PWG2/KINK/macros/AddTaskKinkResonanceLikeSign.C b/PWG2/KINK/macros/AddTaskKinkResonanceLikeSign.C
new file mode 100644 (file)
index 0000000..3ce672c
--- /dev/null
@@ -0,0 +1,43 @@
+AliResonanceKinkLikeSign *AddTaskKinkResonanceLikeSign(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("AddTaskKinkResonanceLikeSign", "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("AddTaskKinkResonanceLikeSign", "This task requires an input event handler");
+      return NULL;
+   }   
+   TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
+   if (type != "ESD") {
+      ::Error("AddTaskKinkResonanceLikeSign", "This task needs ESD input handler");
+      return NULL;
+   }   
+
+   // Create and configure the task
+       AliResonanceKinkLikeSign *taskkinkreslikesign = new AliResonanceKinkLikeSign("TaskResLikeSign");
+   mgr->AddTask(taskkinkreslikesign);
+
+   // 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 += "KinkResLikeSignList.root";
+       AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("KinkResLikeSign",
+                                                                  TList::Class(),
+                                                                  AliAnalysisManager::kOutputContainer,
+                                                                  outname );
+                           
+       mgr->ConnectInput(taskkinkreslikesign, 0, mgr->GetCommonInputContainer());
+   mgr->ConnectOutput(taskkinkreslikesign, 1, coutput1);
+   return taskkinkreslikesign;
+}