First version of a jet analysis deriving from AliAnalysisTask.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Jan 2007 14:44:38 +0000 (14:44 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Jan 2007 14:44:38 +0000 (14:44 +0000)
JETAN/AliAnalysisTaskJets.cxx [new file with mode: 0644]
JETAN/AliAnalysisTaskJets.h [new file with mode: 0644]
JETAN/JETANLinkDef.h
JETAN/libJETAN.pkg

diff --git a/JETAN/AliAnalysisTaskJets.cxx b/JETAN/AliAnalysisTaskJets.cxx
new file mode 100644 (file)
index 0000000..9da9152
--- /dev/null
@@ -0,0 +1,74 @@
+/**************************************************************************
+ * 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.                  *
+ **************************************************************************/
+#include <TROOT.h>
+#include <TSystem.h>
+#include <TInterpreter.h>
+#include <TChain.h>
+#include <TH1.h>
+
+#include "AliAnalysisTaskJets.h"
+#include "AliJetFinder.h"
+#include "AliESD.h"
+
+ClassImp(AliAnalysisTaskJets)
+
+////////////////////////////////////////////////////////////////////////
+
+AliAnalysisTaskJets::AliAnalysisTaskJets(const char* name):
+    AliAnalysisTask(name, "AnalysisTaskJets"),
+    fJetFinder(0x0),
+    fChain(0x0),
+    fESD(0x0)
+{
+  // Default constructor
+    DefineInput (0, TChain::Class());
+    DefineOutput(0, TH1::Class());
+}
+
+void AliAnalysisTaskJets::Init(Option_t */*option*/)
+{
+// Initialisation
+//
+    printf("AnalysisJets::Init() \n");
+
+    // Call configuration file
+    gROOT->LoadMacro("ConfigJetAnalysis.C");
+    fJetFinder = (AliJetFinder*) gInterpreter->ProcessLine("ConfigJetAnalysis()");
+    // Initialise Jet Analysis
+    fJetFinder->Init();
+    fChain = (TChain*)GetInputData(0);
+    fJetFinder->ConnectTree(fChain);
+    fJetFinder->WriteHeaders();
+}
+
+void AliAnalysisTaskJets::Exec(Option_t */*option*/)
+{
+// Execute analysis for current event
+//
+    Long64_t ientry = fChain->GetReadEntry();
+    printf("Analysing event # %5d \n", (Int_t) ientry);
+    
+    fJetFinder->ProcessEvent(ientry);
+}
+
+void AliAnalysisTaskJets::Terminate(Option_t */*option*/)
+{
+// Terminate analysis
+//
+    printf("AnalysisJets: Terminate() \n");
+    fJetFinder->FinishRun();
+}
+
diff --git a/JETAN/AliAnalysisTaskJets.h b/JETAN/AliAnalysisTaskJets.h
new file mode 100644 (file)
index 0000000..03d6230
--- /dev/null
@@ -0,0 +1,30 @@
+#ifndef ALIANALYSISTASKJETS_H
+#define ALIANALYSISTASKJETS_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+#include "AliAnalysisTask.h"
+class AliJetFinder;
+class AliESD;
+class TChain;
+
+
+class AliAnalysisTaskJets : public AliAnalysisTask
+{
+ public: 
+  AliAnalysisTaskJets(const char* name);
+  virtual ~AliAnalysisTaskJets() {;}
+  // Implementation of interface methods
+  virtual void Init(Option_t *option);
+  virtual void Exec(Option_t *option);
+  virtual void Terminate(Option_t *option); 
+ private:
+  AliJetFinder* fJetFinder;
+  TChain*       fChain;
+  AliESD*       fESD;
+  
+  ClassDef(AliAnalysisTaskJets, 1); // Analysis task for standard jet analysis
+};
+#endif
index 1d3d97c..7c251f4 100644 (file)
@@ -27,4 +27,5 @@
 #pragma link C++ class AliJetHadronCorrectionv1+; 
 #pragma link C++ class AliJetFillUnitArrayTracks+;
 #pragma link C++ class AliJetDummyGeo+;
+#pragma link C++ class AliAnalysisTaskJets+;
 #endif
index 5d0dde8..a0c77d8 100644 (file)
@@ -11,7 +11,8 @@ SRCS =        AliJet.cxx AliJetHeader.cxx \
        AliJetGrid.cxx AliJetUnitArray.cxx AliJetHadronCorrection.cxx \
        AliJetHadronCorrectionv0.cxx AliJetHadronCorrectionv1.cxx \
        AliJetFillUnitArrayTracks.cxx \
-       AliJetDummyGeo.cxx
+       AliJetDummyGeo.cxx \
+       AliAnalysisTaskJets.cxx
 
 
 HDRS:= $(SRCS:.cxx=.h)