ROOT logo
#ifndef ALIRSNTARGET_H
#define ALIRSNTARGET_H

/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

////////////////////////////////////////////////////////////////////////////////
//
//  General class for cut/computation target objects (daughter/pair/event).
//
////////////////////////////////////////////////////////////////////////////////

#include "TNamed.h"

#include "AliRsnDaughter.h"
#include "AliRsnEvent.h"

class AliRsnMother;

class AliRsnTarget : public TNamed {
public:

   enum ETargetType {
      kDaughter,
      kMother,
      kEvent,
      kTargetTypes
   };

   AliRsnTarget() : fTargetType(kTargetTypes), fDaughter(0x0), fMother(0x0), fEvent(0x0) { /*nothing*/ }
   AliRsnTarget(const char *name, ETargetType type = kTargetTypes) : TNamed(name, ""), fTargetType(type), fDaughter(0x0), fMother(0x0), fEvent(0x0) { /*nothing*/ }
   AliRsnTarget(const AliRsnTarget &copy) : TNamed(copy), fTargetType(copy.fTargetType), fDaughter(0x0), fMother(0x0), fEvent(0x0) { /*nothing*/ }
   AliRsnTarget &operator=(const AliRsnTarget &copy) { TNamed::operator=(copy); if (this==&copy) return *this; fTargetType = copy.fTargetType; return (*this); }
   virtual ~AliRsnTarget() { /*nothing*/ }

   Bool_t           IsAllNull() const                      {return (!fDaughter && !fMother && !fEvent);}
   Bool_t           IsTarget(ETargetType targetType) const {return (fTargetType == targetType);}
   Bool_t           TargetOK(TObject *object);

   void             SetTargetType(ETargetType type)        {fTargetType = type;}
   ETargetType      GetTargetType() const                  {return fTargetType;}
   Char_t           GetTargetTypeChar() const;
   const char      *GetTargetTypeName() const;

   AliRsnDaughter  *GetTargetDaughter()                    {return fDaughter;}
   AliRsnMother    *GetTargetMother()                      {return fMother;}
   AliRsnEvent     *GetTargetEvent()                       {return fEvent;}

protected:

   ETargetType     fTargetType;  //  target type selected for this object
   AliRsnDaughter *fDaughter;    //! internal pointer to which any checked object is cast if it matches expected type
   AliRsnMother   *fMother;      //! internal pointer to which any checked object is cast if it matches expected type
   AliRsnEvent    *fEvent;       //! internal pointer to which any checked object is cast if it matches expected type

   // ROOT dictionary
   ClassDef(AliRsnTarget, 2)
};

typedef AliRsnTarget::ETargetType RSNTARGET;

#endif
 AliRsnTarget.h:1
 AliRsnTarget.h:2
 AliRsnTarget.h:3
 AliRsnTarget.h:4
 AliRsnTarget.h:5
 AliRsnTarget.h:6
 AliRsnTarget.h:7
 AliRsnTarget.h:8
 AliRsnTarget.h:9
 AliRsnTarget.h:10
 AliRsnTarget.h:11
 AliRsnTarget.h:12
 AliRsnTarget.h:13
 AliRsnTarget.h:14
 AliRsnTarget.h:15
 AliRsnTarget.h:16
 AliRsnTarget.h:17
 AliRsnTarget.h:18
 AliRsnTarget.h:19
 AliRsnTarget.h:20
 AliRsnTarget.h:21
 AliRsnTarget.h:22
 AliRsnTarget.h:23
 AliRsnTarget.h:24
 AliRsnTarget.h:25
 AliRsnTarget.h:26
 AliRsnTarget.h:27
 AliRsnTarget.h:28
 AliRsnTarget.h:29
 AliRsnTarget.h:30
 AliRsnTarget.h:31
 AliRsnTarget.h:32
 AliRsnTarget.h:33
 AliRsnTarget.h:34
 AliRsnTarget.h:35
 AliRsnTarget.h:36
 AliRsnTarget.h:37
 AliRsnTarget.h:38
 AliRsnTarget.h:39
 AliRsnTarget.h:40
 AliRsnTarget.h:41
 AliRsnTarget.h:42
 AliRsnTarget.h:43
 AliRsnTarget.h:44
 AliRsnTarget.h:45
 AliRsnTarget.h:46
 AliRsnTarget.h:47
 AliRsnTarget.h:48
 AliRsnTarget.h:49
 AliRsnTarget.h:50
 AliRsnTarget.h:51
 AliRsnTarget.h:52
 AliRsnTarget.h:53
 AliRsnTarget.h:54
 AliRsnTarget.h:55
 AliRsnTarget.h:56
 AliRsnTarget.h:57
 AliRsnTarget.h:58
 AliRsnTarget.h:59
 AliRsnTarget.h:60
 AliRsnTarget.h:61
 AliRsnTarget.h:62