Separation of ALICE independent ANALYSIS code and ALICE specific code.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 28 Feb 2008 14:26:05 +0000 (14:26 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 28 Feb 2008 14:26:05 +0000 (14:26 +0000)
ANALYSIS/ANALYSISLinkDef.h
ANALYSIS/ANALYSISaliceLinkDef.h [new file with mode: 0644]
ANALYSIS/AliAnalysisTaskSE.cxx [new file with mode: 0644]
ANALYSIS/AliAnalysisTaskSE.h [new file with mode: 0644]
ANALYSIS/libANALYSIS.pkg
ANALYSIS/libANALYSISalice.pkg [new file with mode: 0644]

index f57a717..c162c64 100644 (file)
@@ -12,9 +12,5 @@
 #pragma link C++ class  AliAnalysisSelector+;
 #pragma link C++ class  AliAnalysisFilter+;
 #pragma link C++ class  AliAnalysisCuts+;
-#ifdef WITHXML
-#pragma link C++ class AliTagAnalysis+;
-#pragma link C++ class AliXMLCollection+;
-#endif
 
 #endif
diff --git a/ANALYSIS/ANALYSISaliceLinkDef.h b/ANALYSIS/ANALYSISaliceLinkDef.h
new file mode 100644 (file)
index 0000000..6dde4fa
--- /dev/null
@@ -0,0 +1,13 @@
+#ifdef __CINT__
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class  AliAnalysisTaskSE+;
+#ifdef WITHXML
+#pragma link C++ class AliTagAnalysis+;
+#pragma link C++ class AliXMLCollection+;
+#endif
+
+#endif
diff --git a/ANALYSIS/AliAnalysisTaskSE.cxx b/ANALYSIS/AliAnalysisTaskSE.cxx
new file mode 100644 (file)
index 0000000..47ba5fc
--- /dev/null
@@ -0,0 +1,110 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/* $Id$ */
+#include <TROOT.h>
+#include <TSystem.h>
+#include <TInterpreter.h>
+#include <TChain.h>
+#include <TFile.h>
+#include <TList.h>
+
+#include "AliAnalysisTaskSE.h"
+#include "AliAnalysisManager.h"
+#include "AliESDEvent.h"
+#include "AliESD.h"
+#include "AliAODEvent.h"
+#include "AliVEvent.h"
+#include "AliAODHandler.h"
+#include "AliMCEventHandler.h"
+#include "AliInputEventHandler.h"
+#include "AliMCEvent.h"
+#include "AliStack.h"
+
+
+ClassImp(AliAnalysisTaskSE)
+
+////////////////////////////////////////////////////////////////////////
+
+AliAnalysisTaskSE::AliAnalysisTaskSE():
+    AliAnalysisTask(),
+    fDebug(0),
+    fInputEvent(0x0),
+    fOutputAOD(0x0),
+    fMCEvent(0x0),
+    fTreeA(0x0)
+{
+  // Default constructor
+}
+
+AliAnalysisTaskSE::AliAnalysisTaskSE(const char* name):
+    AliAnalysisTask(name, "AnalysisTaskSE"),
+    fDebug(0),
+    fInputEvent(0x0),
+    fOutputAOD(0x0),
+    fMCEvent(0x0),
+    fTreeA(0x0)
+{
+  // Default constructor
+    DefineInput (0, TChain::Class());
+    DefineOutput(0,  TTree::Class());
+}
+
+
+
+void AliAnalysisTaskSE::ConnectInputData(Option_t* /*option*/)
+{
+// Connect the input data
+    if (fDebug > 1) printf("AnalysisTaskSE::ConnectInputData() \n");
+//
+//  ESD
+//
+    AliInputEventHandler* handler = (AliInputEventHandler*) 
+       ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler());
+    if (handler) fInputEvent = handler->GetEvent();
+//
+//  Monte Carlo
+//
+    AliMCEventHandler*    mcH = 0;
+    mcH = (AliMCEventHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetMCtruthEventHandler());
+    if (mcH) fMCEvent = mcH->MCEvent();
+}
+
+void AliAnalysisTaskSE::CreateOutputObjects()
+{
+// Create the output container
+//
+//  Default AOD
+    if (fDebug > 1) printf("AnalysisTaskSE::CreateOutPutData() \n");
+
+    AliAODHandler* handler = (AliAODHandler*) 
+       ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
+    
+    fOutputAOD   = handler->GetAOD();
+    fTreeA = handler->GetTree();
+    UserCreateOutputObjects();
+}
+
+void AliAnalysisTaskSE::Exec(Option_t* option)
+{
+//
+// Exec analysis of one event
+    PostData(0, fTreeA);
+    UserExec(option);
+}
+
+
+
diff --git a/ANALYSIS/AliAnalysisTaskSE.h b/ANALYSIS/AliAnalysisTaskSE.h
new file mode 100644 (file)
index 0000000..a268109
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef ALIANALYSISTASKSE_H
+#define ALIANALYSISTASKSE_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+#include "AliAnalysisTask.h"
+class AliVEvent;
+class AliAODEvent;
+class AliMCEvent;
+class TTree;
+
+
+
+class AliAnalysisTaskSE : public AliAnalysisTask
+{
+ public:
+    AliAnalysisTaskSE();
+    AliAnalysisTaskSE(const char* name);
+    virtual ~AliAnalysisTaskSE() {;}
+    // Implementation of interface methods
+    virtual void ConnectInputData(Option_t *option = "");
+    virtual void CreateOutputObjects();
+    virtual void Exec(Option_t* option);
+    virtual void SetDebugLevel(Int_t level) {fDebug = level;}
+    virtual void Init() {;}
+    // To be implemented by user
+    virtual void UserCreateOutputObjects()  {;}
+    virtual void UserExec(Option_t* option) {;}
+    
+    // Getters
+    virtual AliVEvent*   InputEvent()  {return fInputEvent;}
+    virtual AliAODEvent* AODEvent()    {return fOutputAOD;}
+    virtual TTree*       OutputTree()  {return fTreeA;}
+    virtual AliMCEvent*  MCEvent()     {return fMCEvent;}
+ protected:
+    Int_t         fDebug;        //  Debug flag
+    AliVEvent*    fInputEvent;   //! VEvent Input
+    AliAODEvent*  fOutputAOD;    //! AOD out 
+    AliMCEvent*   fMCEvent;      //! MC
+    TTree*        fTreeA;        //  AOD output Tree
+    ClassDef(AliAnalysisTaskSE, 1); // Analysis task for standard jet analysis
+};
+#endif
index feda9d3..ae15a4c 100644 (file)
@@ -4,17 +4,6 @@ SRCS = AliAnalysisDataContainer.cxx AliAnalysisDataSlot.cxx \
        AliAnalysisFilter.cxx AliAnalysisCuts.cxx       
 
 
-CHECKALIEN = $(shell root-config --has-alien)
-ifeq (yes,$(CHECKALIEN))
-PACKCXXFLAGS := $(CXXFLAGS) -DWITHALIEN
-endif
-
-CHECKXML = $(shell root-config --has-xml)
-ifeq (yes,$(CHECKXML))
-PACKCXXFLAGS += $(CXXFLAGS) -DWITHXML
-CINTFLAGS += -DWITHXML
-SRCS += AliTagAnalysis.cxx AliXMLCollection.cxx
-endif
 
 HDRS:= $(SRCS:.cxx=.h) 
 
diff --git a/ANALYSIS/libANALYSISalice.pkg b/ANALYSIS/libANALYSISalice.pkg
new file mode 100644 (file)
index 0000000..bb2db22
--- /dev/null
@@ -0,0 +1,23 @@
+SRCS = AliAnalysisTaskSE.cxx
+
+CHECKALIEN = $(shell root-config --has-alien)
+ifeq (yes,$(CHECKALIEN))
+PACKCXXFLAGS := $(CXXFLAGS) -DWITHALIEN
+endif
+
+CHECKXML = $(shell root-config --has-xml)
+ifeq (yes,$(CHECKXML))
+PACKCXXFLAGS += $(CXXFLAGS) -DWITHXML
+CINTFLAGS += -DWITHXML
+SRCS += AliTagAnalysis.cxx AliXMLCollection.cxx
+endif
+       
+
+HDRS:= $(SRCS:.cxx=.h) 
+
+DHDR= ANALYSISaliceLinkDef.h
+
+EXPORT:=$(SRCS:.cxx=.h)
+
+
+