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