corrected TRD/TOF MV position
[u/mrichter/AliRoot.git] / TRIGGER / AliTrigEvent.h
CommitLineData
88f843f1 1#ifndef ALITRIGEVENT_H
2#define ALITRIGEVENT_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7// Author: Andrei Gheata, 28/07/2009
8
9//==============================================================================
10// AliTrigEvent - Base class for generic information exchanged by a trigger
11// device. Trigger inputs and outputs are represented and
12// handled via AliTrigEvent objects. Trigger events are typically
13// wrappers for the information exchanged on a single I/O slot
14// or a group of correlated inputs.
15//==============================================================================
16
17#ifndef ROOT_TObject
90719948 18#include "TNamed.h"
88f843f1 19#endif
20
79e35bac 21#ifndef ROOT_TString
22#include "TString.h"
23#endif
24
88f843f1 25class TClass;
90719948 26class AliTrigEvent : public TNamed {
88f843f1 27
28public:
29enum ETrigSignalFlags {
30 kActive = BIT(14)
79e35bac 31};
88f843f1 32
90719948 33 AliTrigEvent() : TNamed() {}
34 AliTrigEvent(const char *name) : TNamed(name,"") {}
35 AliTrigEvent(const AliTrigEvent &other) : TNamed(other) {}
88f843f1 36 virtual ~AliTrigEvent() {}
37
90719948 38 AliTrigEvent &operator=(const AliTrigEvent &other);
88f843f1 39 void Activate(Bool_t flag);
40 Bool_t IsActive() const {return TObject::TestBit(kActive);}
41
42 // Import data from a source signal. Has to be implemented by derived signals.
43 virtual Bool_t ImportData(AliTrigEvent *source) = 0;
79e35bac 44 virtual Bool_t SetType(const char */*classname*/) {return kTRUE;}
45 virtual const char *GetType() const {return NULL;}
88f843f1 46
47 ClassDef(AliTrigEvent,1) // Generic event embedding data.
48};
49
50
51//==============================================================================
52// AliTrigEventWithMask - Event embedding a bit mask as TBits
53//
54//==============================================================================
55class TBits;
56class AliTrigEventWithMask : public AliTrigEvent {
57
58public:
59 AliTrigEventWithMask() : AliTrigEvent(), fValue() {}
90719948 60 AliTrigEventWithMask(const char *name) : AliTrigEvent(name), fValue() {}
79e35bac 61 AliTrigEventWithMask(const AliTrigEventWithMask &other);
88f843f1 62 virtual ~AliTrigEventWithMask() {}
63
79e35bac 64 AliTrigEventWithMask &operator=(const AliTrigEventWithMask &other);
88f843f1 65 virtual Bool_t ImportData(AliTrigEvent *source);
66
79e35bac 67 TBits *GetValue() const {return fValue;}
68 void SetValue(TBits *value);
88f843f1 69
70private:
79e35bac 71 TBits *fValue; // Mask value
88f843f1 72
73 ClassDef(AliTrigEventWithMask,1) // Signal embedding a TBits object.
74};
75
76//==============================================================================
77// AliTrigEventWithObject - Event embedding a TObject
78//
79//==============================================================================
80
88f843f1 81class AliTrigEventWithObject : public AliTrigEvent {
82
83public:
fcd2bfb7 84 AliTrigEventWithObject() : AliTrigEvent(), fValue(0), fType() {}
90719948 85 AliTrigEventWithObject(const char *name, const char *classname);
88f843f1 86 AliTrigEventWithObject(const AliTrigEventWithObject &other);
87 virtual ~AliTrigEventWithObject() {}
88
89 AliTrigEventWithObject &operator=(const AliTrigEventWithObject &other);
90 virtual Bool_t ImportData(AliTrigEvent *source);
79e35bac 91 virtual const char *GetType() const {return fType;}
88f843f1 92 virtual Bool_t SetType(const char *classname);
93 TObject *GetValue() const {return fValue;}
94 Bool_t SetValue(TObject *value);
95
96private:
97 TObject *fValue; // Embedded object
79e35bac 98 TString fType; // Object type
88f843f1 99
100 ClassDef(AliTrigEventWithObject,1) // Signal embedding an object.
101};
102
103#endif