]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/RESONANCES/AliRsnTarget.h
Fix Coverity
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnTarget.h
CommitLineData
a6bda389 1#ifndef ALIRSNTARGET_H
2#define ALIRSNTARGET_H
3
7356f978 4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
61f275d1 6
7356f978 7////////////////////////////////////////////////////////////////////////////////
8//
9// General class for cut/computation target objects (daughter/pair/event).
10//
11////////////////////////////////////////////////////////////////////////////////
12
a6bda389 13#include "TNamed.h"
14
8082e538 15#include "AliRsnDaughter.h"
fec82aba 16#include "AliRsnEvent.h"
17
6aff5015 18class AliRsnMother;
19
2a1c7696 20class AliRsnTarget : public TNamed {
21public:
22
23 enum ETargetType {
a6bda389 24 kDaughter,
25 kMother,
26 kEvent,
27 kTargetTypes
2a1c7696 28 };
29
30 AliRsnTarget() : fTargetType(kTargetTypes), fDaughter(0x0), fMother(0x0), fEvent(0x0) { /*nothing*/ }
c865cb1d 31 AliRsnTarget(const char *name, ETargetType type = kTargetTypes) : TNamed(name, ""), fTargetType(type), fDaughter(0x0), fMother(0x0), fEvent(0x0) { /*nothing*/ }
61f275d1 32 AliRsnTarget(const AliRsnTarget &copy) : TNamed(copy), fTargetType(copy.fTargetType), fDaughter(0x0), fMother(0x0), fEvent(0x0) { /*nothing*/ }
33 AliRsnTarget &operator=(const AliRsnTarget &copy) { TNamed::operator=(copy); if (this==&copy) return *this; fTargetType = copy.fTargetType; return (*this); }
2a1c7696 34 virtual ~AliRsnTarget() { /*nothing*/ }
35
b63357a0 36 Bool_t IsAllNull() const {return (!fDaughter && !fMother && !fEvent);}
37 Bool_t IsTarget(ETargetType targetType) const {return (fTargetType == targetType);}
d7712d44 38 Bool_t TargetOK(TObject *object);
61f275d1 39
b63357a0 40 void SetTargetType(ETargetType type) {fTargetType = type;}
41 ETargetType GetTargetType() const {return fTargetType;}
61f275d1 42 Char_t GetTargetTypeChar() const;
43 const char *GetTargetTypeName() const;
44
45 AliRsnDaughter *GetTargetDaughter() {return fDaughter;}
46 AliRsnMother *GetTargetMother() {return fMother;}
47 AliRsnEvent *GetTargetEvent() {return fEvent;}
2a1c7696 48
49protected:
50
eaa44581 51 ETargetType fTargetType; // target type selected for this object
52 AliRsnDaughter *fDaughter; //! internal pointer to which any checked object is cast if it matches expected type
53 AliRsnMother *fMother; //! internal pointer to which any checked object is cast if it matches expected type
54 AliRsnEvent *fEvent; //! internal pointer to which any checked object is cast if it matches expected type
2a1c7696 55
2a1c7696 56 // ROOT dictionary
d7712d44 57 ClassDef(AliRsnTarget, 2)
a6bda389 58};
59
60typedef AliRsnTarget::ETargetType RSNTARGET;
61
62#endif