]>
Commit | Line | Data |
---|---|---|
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 */ | |
6 | ||
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 | 18 | class AliRsnMother; |
19 | ||
2a1c7696 | 20 | class AliRsnTarget : public TNamed { |
21 | public: | |
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*/ } |
2a1c7696 | 32 | AliRsnTarget(const AliRsnTarget& copy) : TNamed(copy), fTargetType(copy.fTargetType), fDaughter(0x0), fMother(0x0), fEvent(0x0) { /*nothing*/ } |
eaa44581 | 33 | AliRsnTarget& operator=(const AliRsnTarget& copy) { TNamed::operator=(copy); 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); |
39 | ||
b63357a0 | 40 | void SetTargetType(ETargetType type) {fTargetType = type;} |
41 | ETargetType GetTargetType() const {return fTargetType;} | |
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 | |
49 | protected: | |
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 | ||
60 | typedef AliRsnTarget::ETargetType RSNTARGET; | |
61 | ||
62 | #endif |