Simple implementation of the VEventPool which allows to loop several times over the...
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 27 Jun 2008 19:39:28 +0000 (19:39 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 27 Jun 2008 19:39:28 +0000 (19:39 +0000)
event chain.

ANALYSIS/ANALYSISaliceLinkDef.h
ANALYSIS/AliEventPoolLoop.cxx [new file with mode: 0644]
ANALYSIS/AliEventPoolLoop.h [new file with mode: 0644]
ANALYSIS/libANALYSISalice.pkg

index e8f0af6..dae7bde 100644 (file)
@@ -13,6 +13,7 @@
 #pragma link C++ class  AliESDv0Cuts+;
 
 #pragma link C++ class  AliEventPoolOTF+;
+#pragma link C++ class  AliEventPoolLoop+;
 
 #ifdef WITHXML
 #pragma link C++ class AliTagAnalysis+;
diff --git a/ANALYSIS/AliEventPoolLoop.cxx b/ANALYSIS/AliEventPoolLoop.cxx
new file mode 100644 (file)
index 0000000..f16128b
--- /dev/null
@@ -0,0 +1,105 @@
+/**************************************************************************
+ * 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$ */
+
+// Realisation of an AliVEventPool which allows the user to
+// run the analysis in a loop, i.e. passing several times over 
+// the same event chain.
+// Author Andreas Morsch
+// andreas.morsch@cern.ch
+
+
+#include "AliEventPoolLoop.h"
+
+ClassImp(AliEventPoolLoop)
+
+
+////////////////////////////////////////////////////////////////////////
+
+AliEventPoolLoop::AliEventPoolLoop():
+    AliVEventPool(),
+    fMaxIterations(0),
+    fNIteration(0)
+{
+  // Default constructor
+}
+
+AliEventPoolLoop::AliEventPoolLoop(Int_t nit):
+    AliVEventPool(),
+    fMaxIterations(nit),
+    fNIteration(0)
+{
+  // Default constructor
+}
+
+AliEventPoolLoop::AliEventPoolLoop(const char* name, const char* title):
+    AliVEventPool(name, title),
+    fMaxIterations(0),
+    fNIteration(0)
+{
+  // Constructor
+}
+
+
+AliEventPoolLoop::AliEventPoolLoop(const AliEventPoolLoop& obj):
+    AliVEventPool(obj),
+    fMaxIterations(obj.fMaxIterations),
+    fNIteration(obj.fNIteration)
+{
+    // Copy constructor
+}
+
+AliEventPoolLoop& AliEventPoolLoop::operator=(const AliEventPoolLoop& other)
+{
+// Assignment operator
+    AliVEventPool::operator=(other);
+    fMaxIterations = other.fMaxIterations;
+    fNIteration    = other.fNIteration;
+    return *this;
+}
+
+
+void AliEventPoolLoop::Init()
+{
+// Initialisation
+
+    fMaxIterations = 0;
+    fNIteration    = 0;
+}
+
+TChain* AliEventPoolLoop::GetNextChain()
+{
+    //
+    if (fNIteration >= fMaxIterations) {
+       return (0);
+    } else {
+       fNIteration++;
+       return fChain;
+    }
+}
+
+void  AliEventPoolLoop::GetCurrentBin(Float_t* /*bin*/)
+{
+    //
+}
+
+Int_t AliEventPoolLoop::GetDimension()
+{
+    //
+    return (0);
+}
+
diff --git a/ANALYSIS/AliEventPoolLoop.h b/ANALYSIS/AliEventPoolLoop.h
new file mode 100644 (file)
index 0000000..6d21d4d
--- /dev/null
@@ -0,0 +1,44 @@
+#ifndef ALIEVENTPOOLLOOP_H
+#define ALIEVENTPOOLLOOP_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+// Realisation of an AliVEventPool which allows the user to
+// run the analysis in a loop, i.e. passing several times over 
+// the same event chain.
+// Author Andreas Morsch
+// andreas.morsch@cern.ch
+
+#include <AliVEventPool.h>
+class AliRunTagCuts;
+class AliLHCTagCuts;
+class AliDetectorTagCuts;
+class AliEventTagCuts;
+class AliTagAnalysis;
+
+class AliEventPoolLoop : public AliVEventPool
+{
+ public:
+    AliEventPoolLoop();
+    AliEventPoolLoop(Int_t nit);
+    AliEventPoolLoop(const char* name, const char* title);
+
+    virtual ~AliEventPoolLoop() {;}
+    // Interface
+    virtual TChain* GetNextChain();
+    virtual void  GetCurrentBin(Float_t* /*bin*/);
+    virtual Int_t GetDimension();
+    virtual void  Init();
+ private:
+    AliEventPoolLoop(const AliEventPoolLoop& obj);
+    AliEventPoolLoop& operator=(const AliEventPoolLoop& other);
+ protected:
+    Int_t fMaxIterations;
+    Int_t fNIteration;
+    ClassDef(AliEventPoolLoop, 0); 
+};
+#endif
index 7fd974d..72c374b 100644 (file)
@@ -3,7 +3,7 @@
 SRCS =         AliAnalysisTaskSE.cxx AliAnalysisTaskME.cxx \
        AliAnalysisTaskESDfilter.cxx AliAnalysisTaskKineFilter.cxx \
        AliKineTrackCuts.cxx AliESDtrackCuts.cxx AliESDv0Cuts.cxx \
-       AliEventPoolOTF.cxx
+       AliEventPoolOTF.cxx AliEventPoolLoop.cxx
 
 CHECKALIEN = $(shell root-config --has-alien)
 ifeq (yes,$(CHECKALIEN))