Added new classes for the new trigger framework:
[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
18#include "TObject.h"
19#endif
20
79e35bac 21#ifndef ROOT_TString
22#include "TString.h"
23#endif
24
88f843f1 25class TClass;
26class AliTrigEvent : public TObject {
27
28public:
29enum ETrigSignalFlags {
30 kActive = BIT(14)
79e35bac 31};
88f843f1 32
79e35bac 33 AliTrigEvent() : TObject() {}
88f843f1 34 virtual ~AliTrigEvent() {}
35
36 void Activate(Bool_t flag);
37 Bool_t IsActive() const {return TObject::TestBit(kActive);}
38
39 // Import data from a source signal. Has to be implemented by derived signals.
40 virtual Bool_t ImportData(AliTrigEvent *source) = 0;
79e35bac 41 virtual Bool_t SetType(const char */*classname*/) {return kTRUE;}
42 virtual const char *GetType() const {return NULL;}
88f843f1 43
44 ClassDef(AliTrigEvent,1) // Generic event embedding data.
45};
46
47
48//==============================================================================
49// AliTrigEventWithMask - Event embedding a bit mask as TBits
50//
51//==============================================================================
52class TBits;
53class AliTrigEventWithMask : public AliTrigEvent {
54
55public:
56 AliTrigEventWithMask() : AliTrigEvent(), fValue() {}
79e35bac 57 AliTrigEventWithMask(const AliTrigEventWithMask &other);
88f843f1 58 virtual ~AliTrigEventWithMask() {}
59
79e35bac 60 AliTrigEventWithMask &operator=(const AliTrigEventWithMask &other);
88f843f1 61 virtual Bool_t ImportData(AliTrigEvent *source);
62
79e35bac 63 TBits *GetValue() const {return fValue;}
64 void SetValue(TBits *value);
88f843f1 65
66private:
79e35bac 67 TBits *fValue; // Mask value
88f843f1 68
69 ClassDef(AliTrigEventWithMask,1) // Signal embedding a TBits object.
70};
71
72//==============================================================================
73// AliTrigEventWithObject - Event embedding a TObject
74//
75//==============================================================================
76
88f843f1 77class AliTrigEventWithObject : public AliTrigEvent {
78
79public:
80 AliTrigEventWithObject() : AliTrigEvent(), fValue(0) {}
81 AliTrigEventWithObject(const char *classname);
82 AliTrigEventWithObject(const AliTrigEventWithObject &other);
83 virtual ~AliTrigEventWithObject() {}
84
85 AliTrigEventWithObject &operator=(const AliTrigEventWithObject &other);
86 virtual Bool_t ImportData(AliTrigEvent *source);
79e35bac 87 virtual const char *GetType() const {return fType;}
88f843f1 88 virtual Bool_t SetType(const char *classname);
89 TObject *GetValue() const {return fValue;}
90 Bool_t SetValue(TObject *value);
91
92private:
93 TObject *fValue; // Embedded object
79e35bac 94 TString fType; // Object type
88f843f1 95
96 ClassDef(AliTrigEventWithObject,1) // Signal embedding an object.
97};
98
99#endif