]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliInputEventHandler.h
New hook needed for fast mixing.
[u/mrichter/AliRoot.git] / STEER / AliInputEventHandler.h
index b7decb68a79b3c6b46121556978818338382d3c6..5b6b7b0cbffe39ce607893ef7d8860c2c9f750d3 100644 (file)
@@ -22,6 +22,9 @@ class AliRunTag;
 class AliInputEventHandler : public AliVEventHandler {
 
  public:
+ enum EInputHandlerFlags {
+    kUserCallSelectionMask = BIT(14) // Watch out for defining base class bits
+ };
     AliInputEventHandler();
     AliInputEventHandler(const char* name, const char* title);
     virtual ~AliInputEventHandler();
@@ -29,6 +32,8 @@ class AliInputEventHandler : public AliVEventHandler {
     virtual const char  *GetOutputFileName()                          {return 0;}
     virtual Bool_t       Init(Option_t* /*opt*/)                      {return kTRUE;}
     virtual Bool_t       Init(TTree* /*tree*/, Option_t* /*opt*/)     {return kTRUE;}
+    virtual Bool_t       GetEntry() {if(fMixingHandler) fMixingHandler->GetEntry(); return kTRUE;}
+    
     virtual Bool_t       BeginEvent(Long64_t /*entry*/)               {return kTRUE;}
     virtual Bool_t       Notify() { return AliVEventHandler::Notify();}
     virtual Bool_t       Notify(const char */*path*/)                 {return kTRUE;}
@@ -38,6 +43,7 @@ class AliInputEventHandler : public AliVEventHandler {
     // Setters
     virtual void         SetInputTree(TTree* tree)                    {fTree = tree;}
     virtual void         SetEventSelection(AliVCuts* cuts)            {fEventCuts = cuts;}
+    virtual void         SetUserCallSelectionMask(Bool_t flag=kTRUE)  {TObject::SetBit(kUserCallSelectionMask,flag);}
     //
     void SetInactiveBranches(const char* branches) {fBranches   = branches;}
     void SetActiveBranches  (const char* branches) {fBranchesOn = branches;}
@@ -46,11 +52,19 @@ class AliInputEventHandler : public AliVEventHandler {
     virtual AliRunTag   *GetRunTag()       const                      {return 0;}
     virtual Option_t    *GetAnalysisType() const                      {return 0;}
     virtual TTree       *GetTree( )        const                      {return fTree;}
+    virtual AliVCuts    *GetEventSelection() const                    {return fEventCuts;}
     virtual Long64_t     GetReadEntry()    const;
+    virtual Bool_t       IsUserCallSelectionMask() const              {return TObject::TestBit(kUserCallSelectionMask);}
     virtual Bool_t       NewEvent()
        {Bool_t ne = fNewEvent; fNewEvent = kFALSE; return ne;}
-    virtual Bool_t       IsEventSelected() 
-        {return fIsSelected;}
+    virtual UInt_t       IsEventSelected() 
+        {return fIsSelectedResult;}
+    // Mixing
+    void SetMixingHandler(AliInputEventHandler* mixing) 
+    {fMixingHandler = mixing;}
+    AliInputEventHandler* MixingHandler()
+    {return fMixingHandler;}
+
  protected:
     void SwitchOffBranches() const;
     void SwitchOnBranches()  const;
@@ -63,8 +77,9 @@ class AliInputEventHandler : public AliVEventHandler {
     TString         fBranchesOn;   //  List of branches to be switched on  (separated by space)
     Bool_t          fNewEvent;     //  New event flag 
     AliVCuts*       fEventCuts;    //  Cuts on the event level
-    Bool_t          fIsSelected;   //  Selection result
-    ClassDef(AliInputEventHandler, 3);
+    UInt_t          fIsSelectedResult; //  Selection result
+    AliInputEventHandler* fMixingHandler; // Optionla plugin for mixing 
+    ClassDef(AliInputEventHandler, 5);
 };
 
 #endif