Test implementation of event pool based on TagAnalysis.
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 26 May 2008 16:43:35 +0000 (16:43 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 26 May 2008 16:43:35 +0000 (16:43 +0000)
ANALYSIS/ANALYSISaliceLinkDef.h
ANALYSIS/AliEventPoolOTF.cxx [new file with mode: 0644]
ANALYSIS/AliEventPoolOTF.h [new file with mode: 0644]
ANALYSIS/libANALYSISalice.pkg

index 050ac5d..e8f0af6 100644 (file)
@@ -11,6 +11,9 @@
 #pragma link C++ class  AliKineTrackCuts+;
 #pragma link C++ class  AliESDtrackCuts+;
 #pragma link C++ class  AliESDv0Cuts+;
+
+#pragma link C++ class  AliEventPoolOTF+;
+
 #ifdef WITHXML
 #pragma link C++ class AliTagAnalysis+;
 #pragma link C++ class AliXMLCollection+;
diff --git a/ANALYSIS/AliEventPoolOTF.cxx b/ANALYSIS/AliEventPoolOTF.cxx
new file mode 100644 (file)
index 0000000..c8d5e44
--- /dev/null
@@ -0,0 +1,127 @@
+/**************************************************************************
+ * 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 via
+// on the flight (OTF) generation of the bin using AliTagAnalysis.
+// Author Andreas Morsch
+// andreas.morsch@cern.ch
+
+#include "AliEventPoolOTF.h"
+
+#include "AliRunTagCuts.h"
+#include "AliLHCTagCuts.h"
+#include "AliDetectorTagCuts.h"
+#include "AliEventTagCuts.h"
+#include "AliTagAnalysis.h"
+
+ClassImp(AliEventPoolOTF)
+
+
+////////////////////////////////////////////////////////////////////////
+
+AliEventPoolOTF::AliEventPoolOTF():
+    AliVEventPool(),
+    fTagAnalysis(0),
+    fRunCuts(0),
+    fLHCCuts(0),
+    fDetectorCuts(0),
+    fEventCuts(0),
+    fTagDirectory(0),
+    fMultMin(0),
+    fMultMax(0),
+    fMultStep(0),
+    fMultiplicity()
+{
+  // Default constructor
+}
+
+AliEventPoolOTF::AliEventPoolOTF(const char* name, const char* title):
+    AliVEventPool(name, title),
+    fTagAnalysis(new AliTagAnalysis("AOD")),
+    fRunCuts(new AliRunTagCuts()),
+    fLHCCuts(new AliLHCTagCuts()),
+    fDetectorCuts(new AliDetectorTagCuts()),
+    fEventCuts(new AliEventTagCuts()),
+    fTagDirectory("."),
+    fMultMin(0),
+    fMultMax(0),
+    fMultStep(0),
+    fMultiplicity()
+{
+  // Constructor
+}
+
+
+AliEventPoolOTF::AliEventPoolOTF(const AliEventPoolOTF& obj):
+    AliVEventPool(obj),
+    fTagAnalysis(0),
+    fRunCuts(0),
+    fLHCCuts(0),
+    fDetectorCuts(0),
+    fEventCuts(0),
+    fTagDirectory(0),
+    fMultMin(0),
+    fMultMax(0),
+    fMultStep(0),
+    fMultiplicity()
+{
+    // Copy constructor
+}
+
+AliEventPoolOTF& AliEventPoolOTF::operator=(const AliEventPoolOTF& other)
+{
+// Assignment operator
+    AliVEventPool::operator=(other);
+    return *this;
+}
+
+
+void AliEventPoolOTF::Init()
+{
+    //
+    fTagAnalysis->ChainLocalTags(fTagDirectory);
+    fMultiplicity = fMultMin;
+}
+
+TChain* AliEventPoolOTF::GetNextChain()
+{
+    //
+    TChain* chain = 0;
+    
+    Int_t mmax = fMultiplicity + fMultStep;
+    if (mmax > fMultMax) {
+       return 0;
+    } else {
+       fEventCuts->SetMultiplicityRange(fMultiplicity, mmax);
+       chain = fTagAnalysis->QueryTags(fRunCuts, fLHCCuts, fDetectorCuts, fEventCuts);
+       fMultiplicity += fMultStep;
+       return chain;
+    }
+}
+
+void  AliEventPoolOTF::GetCurrentBin(Float_t* /*bin*/)
+{
+    //
+}
+
+Int_t AliEventPoolOTF::GetDimension()
+{
+    //
+    return (1);
+}
+
diff --git a/ANALYSIS/AliEventPoolOTF.h b/ANALYSIS/AliEventPoolOTF.h
new file mode 100644 (file)
index 0000000..420f0cb
--- /dev/null
@@ -0,0 +1,54 @@
+#ifndef ALIEVENTPOOLOTF_H
+#define ALIEVENTPOOLOTF_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/* $Id$ */
+
+// Realisation of an AliVEventPool via
+// on the flight (OTF) generation of the bin using AliTagAnalysis.
+// Author Andreas Morsch
+// andreas.morsch@cern.ch
+
+#include <AliVEventPool.h>
+class AliRunTagCuts;
+class AliLHCTagCuts;
+class AliDetectorTagCuts;
+class AliEventTagCuts;
+class AliTagAnalysis;
+
+class AliEventPoolOTF : public AliVEventPool
+{
+ public:
+    AliEventPoolOTF();
+    AliEventPoolOTF(const char* name, const char* title);
+
+    virtual ~AliEventPoolOTF() {;}
+    // Interface
+    virtual TChain* GetNextChain();
+    virtual void  GetCurrentBin(Float_t* /*bin*/);
+    virtual Int_t GetDimension();
+    virtual void  Init();
+    virtual void  SetMultiplicityBin(Int_t min, Int_t max, Int_t step)
+       {fMultMin = min; fMultMax = max; fMultStep = step;}
+    //
+    void SetTagDirectory(char* dirname) {fTagDirectory = dirname;};
+ private:
+    AliEventPoolOTF(const AliEventPoolOTF& obj);
+    AliEventPoolOTF& operator=(const AliEventPoolOTF& other);
+ protected:
+    AliTagAnalysis*      fTagAnalysis;  // Pointer to tag analysis
+    AliRunTagCuts*       fRunCuts;      // Run      cuts
+    AliLHCTagCuts*       fLHCCuts;      // LHC      cuts
+    AliDetectorTagCuts*  fDetectorCuts; // Detector cuts
+    AliEventTagCuts*     fEventCuts;    // Event    cuts
+    char*                fTagDirectory; // Directory with local tag files
+    Int_t                fMultMin;      // Minimum multiplicity
+    Int_t                fMultMax;      // Maximum multiplicity
+    Int_t                fMultStep;     // Multiplicity step-size 
+    Int_t                fMultiplicity; // Current multiplicity
+    ClassDef(AliEventPoolOTF, 0); 
+};
+#endif
index 40daa28..7fd974d 100644 (file)
@@ -2,7 +2,8 @@
 
 SRCS =         AliAnalysisTaskSE.cxx AliAnalysisTaskME.cxx \
        AliAnalysisTaskESDfilter.cxx AliAnalysisTaskKineFilter.cxx \
-       AliKineTrackCuts.cxx AliESDtrackCuts.cxx AliESDv0Cuts.cxx
+       AliKineTrackCuts.cxx AliESDtrackCuts.cxx AliESDv0Cuts.cxx \
+       AliEventPoolOTF.cxx
 
 CHECKALIEN = $(shell root-config --has-alien)
 ifeq (yes,$(CHECKALIEN))