]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
1. i need to know pointer to parent inputhandler (In case i want to access
authormorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 18 Feb 2011 17:28:57 +0000 (17:28 +0000)
committermorsch <morsch@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 18 Feb 2011 17:28:57 +0000 (17:28 +0000)
right AliMultiInputHandler from child)

2. for physics selection i need that AliMultiInputEventHandler will get
EventSelection from AliESDInputHandler.
M. Vala

ANALYSIS/AliMultiInputEventHandler.cxx
ANALYSIS/AliMultiInputEventHandler.h
STEER/AliInputEventHandler.cxx
STEER/AliInputEventHandler.h

index 5ac395ad3259fb4b4bd01a7f4fa0b6bb44f6907b..fd71ac051205abe03083cc836bd01a7c85165bce 100644 (file)
@@ -104,6 +104,9 @@ Bool_t AliMultiInputEventHandler::Init(TTree *tree, Option_t *opt)
    AliInputEventHandler *eh = 0;
    TObjArrayIter next(&fInputHandlers);
    while ((eh = (AliInputEventHandler *) next())) {
+      // using mixing input hadnler from Base class
+      // for me fParentHandler would be better name
+      eh->SetParentHandler(this);
       eh->Init(tree, fAnalysisType);
    }
    AliDebug(AliLog::kDebug + 5, Form("->"));
@@ -246,3 +249,16 @@ Option_t *AliMultiInputEventHandler::GetDataType() const
    // Returns handled data type.
    return gCurrentMultiDataType;
 }
+
+//______________________________________________________________________________
+UInt_t  AliMultiInputEventHandler::IsEventSelected() 
+{
+  // returns if event is selected
+  
+  AliInputEventHandler *firstIH = dynamic_cast<AliInputEventHandler*> (GetFirstInputEventHandler());
+  if (firstIH) {
+    return firstIH->IsEventSelected();
+  }
+  
+  return fIsSelectedResult;
+}
index 9463569577fa15b731b25c235915cde5ea20d82e..e4e5c9685e9a692a22abfd1a33d5b6a3588f1b70 100644 (file)
@@ -29,7 +29,7 @@ public:
    virtual Bool_t  FinishEvent();
    virtual Bool_t  Notify();
    virtual Bool_t  Notify(const char *path);
-
+   virtual UInt_t  IsEventSelected();
    // add input handler
    virtual void                AddInputEventHandler(AliVEventHandler*inHandler);
    AliVEventHandler           *InputEventHandler(const Int_t index);
index 9a163e8e80f6a90782d8be99f3dd7c3df5c7f7fb..a84cc16f5bbbec92d464435e0336b5d9021383ac 100644 (file)
@@ -38,7 +38,8 @@ AliInputEventHandler::AliInputEventHandler() :
     fNewEvent(kTRUE),
     fEventCuts(0),
     fIsSelectedResult(0),
-    fMixingHandler(0)
+    fMixingHandler(0),
+    fParentHandler(0)
 {
   // default constructor
 }
@@ -58,7 +59,8 @@ AliInputEventHandler::AliInputEventHandler(const char* name, const char* title):
   fNewEvent(kTRUE),
   fEventCuts(0),
   fIsSelectedResult(0),
-  fMixingHandler(0)
+  fMixingHandler(0),
+  fParentHandler(0)
 {
 // Named constructor.
 }
index da2db5884d365447d257480c74f588ec2685eb4b..10c8ae631b7b872c90326996cf67a9c3d2603d13 100644 (file)
@@ -69,6 +69,9 @@ class AliInputEventHandler : public AliVEventHandler {
     {fMixingHandler = mixing;}
     AliInputEventHandler* MixingHandler()
     {return fMixingHandler;}
+    // Parent Handler
+    void SetParentHandler(AliInputEventHandler* parent) {fParentHandler = parent;}
+    AliInputEventHandler* ParentHandler() {return fParentHandler;}
 
  protected:
     void SwitchOffBranches() const;
@@ -83,8 +86,9 @@ class AliInputEventHandler : public AliVEventHandler {
     Bool_t          fNewEvent;     //  New event flag 
     AliVCuts*       fEventCuts;    //  Cuts on the event level
     UInt_t          fIsSelectedResult; //  Selection result
-    AliInputEventHandler* fMixingHandler; // Optionla plugin for mixing 
-    ClassDef(AliInputEventHandler, 5);
+    AliInputEventHandler* fMixingHandler; // Optionla plugin for mixing
+    AliInputEventHandler* fParentHandler; // optional pointer to parent handlers (used in AliMultiInputEventHandler)
+    ClassDef(AliInputEventHandler, 6);
 };
 
 #endif