including add task macro and link/builder changes for libPWGGAEMCALTask
authormcosenti <mcosenti@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Mar 2012 14:17:38 +0000 (14:17 +0000)
committermcosenti <mcosenti@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Mar 2012 14:17:38 +0000 (14:17 +0000)
PWGGA/CMakelibPWGGAEMCALTasks.pkg
PWGGA/EMCALTasks/macros/AddTaskEMCALPhoton.C [new file with mode: 0644]
PWGGA/PWGGAEMCALTasksLinkDef.h

index 86d10c2..44c517c 100644 (file)
@@ -48,6 +48,7 @@ set ( SRCS
  EMCALTasks/AliStaObjects.cxx
  EMCALTasks/AliFJWrapper.cxx
  EMCALTasks/AliAnalysisTaskTrgContam.cxx
+ EMCALTasks/AliAnalysisTaskEMCALPhoton.cxx
 )
 
 string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
diff --git a/PWGGA/EMCALTasks/macros/AddTaskEMCALPhoton.C b/PWGGA/EMCALTasks/macros/AddTaskEMCALPhoton.C
new file mode 100644 (file)
index 0000000..cf62cce
--- /dev/null
@@ -0,0 +1,66 @@
+AliAnalysisTaskEMCALPhoton *AddTaskEMCALPhoton(Double_t clusTh=2, TString period="LHC11d" )
+{
+  // Get the pointer to the existing analysis manager via the static access method.
+  //==============================================================================
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr) {
+    ::Error("AddTaskEMCALPhoton", "No analysis manager to connect to.");
+    return NULL;
+  }  
+  
+  // Create the task and configure it.
+  //===========================================================================
+  AliAnalysisTaskEMCALPhoton* ana = new  AliAnalysisTaskEMCALPhoton("");
+  
+  ana->SelectCollisionCandidates( AliVEvent::kEMC1 | AliVEvent::kMB | AliVEvent::kEMC7 | AliVEvent::kINT7);
+  
+  Bool_t isMC = (mgr->GetMCtruthEventHandler() != NULL);
+
+
+  ana->SetClusThreshold(clusTh);
+  ana->SetTrainMode(kTRUE);
+  ana->SetGridMode(kTRUE);
+  ana->SetMcMode(isMC);
+  AliESDtrackCuts *cuts = new AliESDtrackCuts;
+  cuts->SetMinNCrossedRowsTPC(50);
+  cuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.7);
+  cuts->SetMaxChi2PerClusterTPC(4);
+  cuts->SetRequireTPCRefit(kTRUE);
+  cuts->SetAcceptKinkDaughters(kTRUE);
+  cuts->SetPtRange(0.2);
+  cuts->SetEtaRange(-1.0,1.0);
+  ana->SetTrackCuts(cuts);
+  
+  AliESDtrackCuts *cutsp = new AliESDtrackCuts;
+  cutsp->SetMinNClustersTPC(70);
+  cutsp->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8);
+  cutsp->SetMaxChi2PerClusterTPC(4);
+  cutsp->SetRequireTPCRefit(kTRUE);
+  cutsp->SetAcceptKinkDaughters(kFALSE);
+  cutsp->SetMaxDCAToVertexZ(3.2);
+  cutsp->SetMaxDCAToVertexXY(2.4);
+  cutsp->SetDCAToVertex2D(kTRUE);
+  cutsp->SetPtRange(0.2);
+  cutsp->SetEtaRange(-1.0,1.0);
+  ana->SetPrimTrackCuts(cutsp);
+  ana->SetPeriod(period.Data());
+  if(period.Contains("11"))
+    ana->SetGeoName("EMCAL_COMPLETEV1");
+  else
+    ana->SetGeoName("EMCAL_FIRSTYEARV1");
+
+  
+  mgr->AddTask(ana);
+  
+  // 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
+  //==============================================================================
+  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("histosEMCALPhoton", 
+                                                           TList::Class(),AliAnalysisManager::kOutputContainer,
+                                                           Form("%s", AliAnalysisManager::GetCommonFileName()));
+  
+  mgr->ConnectInput  (ana, 0, mgr->GetCommonInputContainer());
+  mgr->ConnectOutput (ana, 1, coutput1 );
+   
+  return ana;
+}
index b15703e..0a9834a 100644 (file)
@@ -29,5 +29,6 @@
 #pragma link C++ class AliStaTrigger+;
 #pragma link C++ class AliStaVertex+;
 #pragma link C++ class AliAnalysisTaskTrgContam+;
+#pragma link C++ class AliAnalysisTaskEMCALPhoton+;
 
 #endif