]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ANALYSIS/EventMixing/AliMixInputEventHandler.h
consolidate zero-length arrays (aka struct hack)
[u/mrichter/AliRoot.git] / ANALYSIS / EventMixing / AliMixInputEventHandler.h
index ecdd348db68a4a9b0cc7f82fde71dbe5d5ef62a2..6eabd177ea1fe20aff32cb4a8508e9d6828827db 100644 (file)
@@ -11,6 +11,7 @@
 #define ALIMIXINPUTEVENTHANDLER_H
 
 #include <TObjArray.h>
+#include <TEntryList.h>
 #include <TArrayI.h>
 
 #include <AliVEvent.h>
@@ -18,6 +19,7 @@
 #include "AliMultiInputEventHandler.h"
 
 class TChain;
+class TChainElement;
 class AliMixEventPool;
 class AliMixInputHandlerInfo;
 class AliInputEventHandler;
@@ -25,7 +27,7 @@ class AliMixInputEventHandler : public AliMultiInputEventHandler {
 
 public:
    AliMixInputEventHandler(const Int_t size = 1, const Int_t mixNum = 1);
-
+   virtual ~AliMixInputEventHandler();
    // From the interface
    virtual Bool_t  Init(Option_t *opt) { return AliMultiInputEventHandler::Init(opt); }
    virtual Bool_t  Init(TTree *tree, Option_t *opt);
@@ -41,14 +43,14 @@ public:
    void                    SetInputHandlerForMixing(const AliInputEventHandler *const inHandler);
    void                    SetEventPool(AliMixEventPool *const evPool) { fEventPool = evPool; }
 
-   AliInputEventHandler   *InputEventHandler(const Int_t index);
    AliMixEventPool        *GetEventPool() const { return fEventPool; }
    Int_t                   BufferSize() const { return fBufferSize; }
    Int_t                   NumberMixedTimes() const { return fNumberMixed; }
    Int_t                   MixNumber() const { return fMixNumber; }
    Long64_t                EntryAll() const { return fEntryCounter; }
    void                    UseDefaultProcess(Bool_t b = kTRUE) { fUseDefautProcess = b; }
-   void                    UsePreMixEvents(Bool_t b = kTRUE) { fUsePreMixEvents = b; }
+   void                    DoMixExtra(Bool_t b = kTRUE) { fDoMixExtra = b; }
+   void                    DoMixIfNotEnoughEvents(Bool_t b = kTRUE) { fDoMixIfNotEnoughEvents = b; }
    void                    SetMixNumber(const Int_t mixNum);
 
    void                    SetCurrentBinIndex(Int_t const index) { fCurrentBinIndex = index; }
@@ -65,6 +67,12 @@ public:
 
    void                    SelectCollisionCandidates(UInt_t offlineTriggerMask = AliVEvent::kMB) {fOfflineTriggerMask = offlineTriggerMask;}
    Bool_t                  IsEventCurrentSelected();
+   Bool_t                  IsMixingIfNotEnoughEvents() { return fDoMixIfNotEnoughEvents;}
+
+   void                    DoMixEventGetEntryAuto(Bool_t doAuto=kTRUE) { fDoMixEventGetEntryAuto = doAuto; }
+
+   Bool_t                  GetEntryMainEvent();
+   Bool_t                  GetEntryMixedEvent(Int_t idHandler=0);
 protected:
 
    TObjArray               fMixTrees;              // buffer of input handlers
@@ -78,15 +86,19 @@ protected:
 private:
 
    Bool_t                  fUseDefautProcess;      // use default process
-   Bool_t                  fUsePreMixEvents;       // use pre mixing events
+   Bool_t                  fDoMixExtra;            // mix extra events to get enough combinations
+   Bool_t                  fDoMixIfNotEnoughEvents;// mix events if they don't have enough events to mix
+   Bool_t                  fDoMixEventGetEntryAuto;// flag for preparing mixed events automatically (default on)
 
    // mixing info
    Long64_t fCurrentEntry;       //! current entry number (adds 1 for every event processed on each worker)
    Long64_t fCurrentEntryMain;   //! current entry in chain of processed files
    Long64_t fCurrentEntryMix;    //! current mixed entry in chain of processed files
    Int_t    fCurrentBinIndex;    //! current bin index
+   ULong64_t fOfflineTriggerMask;   //  Task processes collision candidates only
 
-   UInt_t fOfflineTriggerMask;   //  Task processes collision candidates only
+   TEntryList fCurrentMixEntry;    //! array of mix entries currently used (user should touch)
+   Long64_t fCurrentEntryMainTree; //! current entry in current tree (main event)
 
    virtual Bool_t          MixStd();
    virtual Bool_t          MixBuffer();
@@ -95,10 +107,10 @@ private:
 
    void                    UserExecMixAllTasks(Long64_t entryCounter, Int_t idEntryList, Long64_t entryMainReal, Long64_t entryMixReal, Int_t numMixed);
 
-   AliMixInputEventHandler(const AliMixInputEventHandlerhandler);
+   AliMixInputEventHandler(const AliMixInputEventHandler &handler);
    AliMixInputEventHandler &operator=(const AliMixInputEventHandler &handler);
 
-   ClassDef(AliMixInputEventHandler, 2)
+   ClassDef(AliMixInputEventHandler, 5)
 };
 
 #endif