Add PHOSTender for AOD
authorprsnko <prsnko@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Dec 2012 16:34:25 +0000 (16:34 +0000)
committerprsnko <prsnko@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Dec 2012 16:34:25 +0000 (16:34 +0000)
PWGGA/CMakelibPWGGAPHOSTasks.pkg
PWGGA/PHOSTasks/PHOS_PbPb/AliPHOSTenderTask.cxx [new file with mode: 0644]
PWGGA/PHOSTasks/PHOS_PbPb/AliPHOSTenderTask.h [new file with mode: 0644]
PWGGA/PWGGAPHOSTasksLinkDef.h

index 271c24f..e7a7830 100644 (file)
 set ( SRCS 
  PHOSTasks/PHOS_pp_pi0/AliCaloPhoton.cxx
  PHOSTasks/PHOS_pp_pi0/AliAnalysisTaskPi0.cxx
+ PHOSTasks/PHOS_PbPb/AliPHOSEPFlattener.cxx
  PHOSTasks/PHOS_PbPb/AliAnalysisTaskPi0Flow.cxx
  PHOSTasks/PHOS_PbPb/AliPHOSEPFlattener.cxx
+ PHOSTasks/PHOS_PbPb/AliPHOSTenderTask.cxx
  PHOSTasks/PHOS_embedding/AliPHOSEmbedding.cxx
  PHOSTasks/PHOS_embedding/AliAnalysisTaskPi0Efficiency.cxx
  PHOSTasks/PHOS_embedding/AliAnalysisTaskPi0DiffEfficiency.cxx
diff --git a/PWGGA/PHOSTasks/PHOS_PbPb/AliPHOSTenderTask.cxx b/PWGGA/PHOSTasks/PHOS_PbPb/AliPHOSTenderTask.cxx
new file mode 100644 (file)
index 0000000..cc3d514
--- /dev/null
@@ -0,0 +1,78 @@
+// Task to hold TenderSupply in case of running on AOD.
+// 
+// Author: D.Peressounko after EMCAL Tender task
+
+#include <TChain.h>
+#include <TFile.h>
+
+#include "AliAnalysisManager.h"
+#include "TenderSupplies/AliPHOSTenderSupply.h"
+#include "AliAODEvent.h"
+
+#include "AliPHOSTenderTask.h"
+
+ClassImp(AliPHOSTenderTask)
+
+//______________________________________________________________________________
+AliPHOSTenderTask::AliPHOSTenderTask():
+  AliAnalysisTaskSE(),
+  fPHOSTender(NULL)
+{
+  // Default constructor.
+}
+
+//______________________________________________________________________________
+AliPHOSTenderTask::AliPHOSTenderTask(const char* name):
+  AliAnalysisTaskSE(name),
+  fPHOSTender(NULL)
+{
+  // Constructor.
+  DefineOutput(1,  AliAODEvent::Class());
+}
+
+//______________________________________________________________________________
+AliPHOSTenderTask::~AliPHOSTenderTask()
+{
+  // Destructor
+
+  if (fPHOSTender)
+    fPHOSTender->Delete();
+}
+
+//______________________________________________________________________________
+void AliPHOSTenderTask::SetPHOSTenderSupply(AliPHOSTenderSupply *supply)
+{
+  // Set tender supply.
+
+  fPHOSTender = supply;
+  supply->SetTask(this);
+}
+   
+//______________________________________________________________________________
+void AliPHOSTenderTask::ConnectInputData(Option_t *option)
+{
+  // Connect input data.
+
+  AliAnalysisTaskSE::ConnectInputData(option);
+  fPHOSTender->Init();
+}
+
+//______________________________________________________________________________
+void AliPHOSTenderTask::UserCreateOutputObjects()
+{
+  // Nothing to be done.
+}
+
+//______________________________________________________________________________
+void AliPHOSTenderTask::UserExec(Option_t*)
+{
+  // Process the event.
+
+  fPHOSTender->ProcessEvent();
+}
+//______________________________________________________________________________
+void AliPHOSTenderTask::NotifyRun(){
+ //Change of the run number 
+  
+ fPHOSTender->InitTender(); 
+}
diff --git a/PWGGA/PHOSTasks/PHOS_PbPb/AliPHOSTenderTask.h b/PWGGA/PHOSTasks/PHOS_PbPb/AliPHOSTenderTask.h
new file mode 100644 (file)
index 0000000..16ecf30
--- /dev/null
@@ -0,0 +1,34 @@
+#ifndef ALIPHOSTENDERTASK_H
+#define ALIPHOSTENDERTASK_H
+
+
+#ifndef ALIANALYSISTASKSE_H
+#include "AliAnalysisTaskSE.h"
+#endif
+
+class AliPHOSTenderSupply;
+
+class AliPHOSTenderTask : public AliAnalysisTaskSE {
+
+protected:
+  AliPHOSTenderSupply      *fPHOSTender;
+  
+private:
+  AliPHOSTenderTask(const AliPHOSTenderTask &other);
+  AliPHOSTenderTask& operator=(const AliPHOSTenderTask &other);
+
+public:  
+  AliPHOSTenderTask();
+  AliPHOSTenderTask(const char *name);
+  virtual ~AliPHOSTenderTask();
+
+  void                      SetPHOSTenderSupply(AliPHOSTenderSupply *supply);
+
+  virtual void              ConnectInputData(Option_t *option);
+  virtual void              UserCreateOutputObjects();
+  virtual void              UserExec(Option_t*);
+  virtual void              NotifyRun();
+    
+  ClassDef(AliPHOSTenderTask,1) // Wrapper class to hold tender supply for AOD usage
+};
+#endif
index c0cf520..cd61769 100644 (file)
@@ -9,8 +9,10 @@
 #pragma link C++ class AliAnalysisTaskPi0+;
 
 //PHOS_PbPb
+#pragma link C++ class AliPHOSEPFlattener+;
 #pragma link C++ class AliAnalysisTaskPi0Flow+;
 #pragma link C++ class AliPHOSEPFlattener+;
+#pragma link C++ class AliPHOSTenderTask+;
 
 // PHOS_embedding
 #pragma link C++ class AliPHOSEmbedding+;