3 #ifndef ALIHLTTRIGGERMENU_H
4 #define ALIHLTTRIGGERMENU_H
5 /* This file is property of and copyright by the ALICE HLT Project *
6 * ALICE Experiment at CERN, All rights reserved. *
7 * See cxx source for full Copyright notice */
9 /// @file AliHLTTriggerMenu.h
10 /// @author Artur Szostak <artursz@iafrica.com>
12 /// @brief Declaration of the AliHLTTriggerMenu base class.
16 #include "TClonesArray.h"
17 #include "AliHLTTriggerMenuSymbol.h"
18 #include "AliHLTTriggerMenuItem.h"
19 #include "AliHLTTriggerDomain.h"
22 * \class AliHLTTriggerMenu
23 * This class is an abstract class. Classes which derive from this class should
24 * implement the logic for a particular trigger menu. The AliHLTTriggerMenu class
25 * creates a class deriving from AliHLTTriggerMenu on the fly to implement the
26 * trigger logic for that particular trigger menu.
28 class AliHLTTriggerMenu : public TObject
33 * Default constructor.
40 virtual ~AliHLTTriggerMenu();
43 * Inherited from TObject, this prints the contents of the trigger menu.
44 * \param option Can be "short" which will print the short format.
46 virtual void Print(Option_t* option = "") const;
49 * This method removes all items and symbols from the trigger menu.
50 * \note The name and default values are not changed. Only the items and symbol
52 * \param option This is passed onto the internal fSymbols and fItems TClonesArrays.
53 * The method is inherited from TObject.
55 virtual void Clear(Option_t* option = "");
58 * Copy constructor performs a deep copy of the object.
59 * \param obj Object to copy from.
61 AliHLTTriggerMenu(const AliHLTTriggerMenu& obj);
64 * Assignment operator performs a deep copy of the object.
65 * \param obj Object to copy from.
66 * \return This object is returned after being replaced by a copy of <i>obj</i>.
68 AliHLTTriggerMenu& operator = (const AliHLTTriggerMenu& obj);
71 * Inherited from TObject. Returns the name of the trigger menu.
73 virtual const char* GetName() const { return fName.Data(); }
76 * Returns the name of the trigger menu.
78 const char* Name() const { return fName.Data(); }
81 * Sets the name of the trigger menu.
83 void Name(const char* name) { fName = name; }
86 * Returns the number of symbols in the trigger menu.
88 UInt_t NumberOfSymbols() const { return UInt_t(fSymbols.GetEntriesFast()); }
91 * Fetches the i'th trigger menu symbol.
93 const AliHLTTriggerMenuSymbol* Symbol(UInt_t i) const
95 if (i >= UInt_t(fSymbols.GetEntriesFast())) return NULL;
96 return static_cast<const AliHLTTriggerMenuSymbol*>( fSymbols.UncheckedAt(Int_t(i)) );
100 * Fetches the i'th trigger menu symbol for editing.
102 AliHLTTriggerMenuSymbol* Symbol(UInt_t i)
104 if (i >= UInt_t(fSymbols.GetEntriesFast())) return NULL;
105 return static_cast<AliHLTTriggerMenuSymbol*>( fSymbols.UncheckedAt(Int_t(i)) );
109 * Adds a new symbol to the trigger menu.
111 void AddSymbol(const AliHLTTriggerMenuSymbol& entry)
113 new (fSymbols[fSymbols.GetEntriesFast()]) AliHLTTriggerMenuSymbol(entry);
117 * Returns the array of symbols.
119 const TClonesArray& SymbolArray() const { return fSymbols; }
122 * Returns the number of items in the trigger menu.
124 UInt_t NumberOfItems() const { return UInt_t(fItems.GetEntriesFast()); }
127 * Fetches the i'th trigger menu item.
129 const AliHLTTriggerMenuItem* Item(UInt_t i) const
131 if (i >= UInt_t(fItems.GetEntriesFast())) return NULL;
132 return static_cast<const AliHLTTriggerMenuItem*>( fItems.UncheckedAt(Int_t(i)) );
136 * Fetches the i'th trigger menu item for editing.
138 AliHLTTriggerMenuItem* Item(UInt_t i)
140 if (i >= UInt_t(fItems.GetEntriesFast())) return NULL;
141 return static_cast<AliHLTTriggerMenuItem*>( fItems.UncheckedAt(Int_t(i)) );
145 * Adds a new entry to the trigger menu.
147 void AddItem(const AliHLTTriggerMenuItem& entry)
149 new (fItems[fItems.GetEntriesFast()]) AliHLTTriggerMenuItem(entry);
153 * Returns the array of menu items.
155 const TClonesArray& ItemsArray() const { return fItems; }
158 * Sets the default trigger description to use if the global trigger does not
159 * fire and returns a negative result.
161 void DefaultDescription(const char* value) { fDefaultDescription = value; }
164 * Returns the default trigger description to use if the global trigger does not
165 * fire and returns a negative result.
167 const char* DefaultDescription() const { return fDefaultDescription.Data(); }
170 * Sets the default trigger domain to use if the global trigger does not
171 * fire and returns a negative result.
173 void DefaultTriggerDomain(const AliHLTTriggerDomain& value) { fDefaultDomain = value; }
176 * Returns the default trigger domain to use if the global trigger does not
177 * fire and returns a negative result.
179 const AliHLTTriggerDomain& DefaultTriggerDomain() const { return fDefaultDomain; }
182 * Returns the default trigger domain for modification.
184 AliHLTTriggerDomain& DefaultTriggerDomain() { return fDefaultDomain; }
188 TString fName; /// Name of the trigger menu.
189 TClonesArray fSymbols; /// List of symbols used in trigger expressions.
190 TClonesArray fItems; /// List of trigger menu items.
191 TString fDefaultDescription; /// The default trigger description to use for negative global triggers.
192 AliHLTTriggerDomain fDefaultDomain; /// The default trigger domain to use for negative global triggers.
194 ClassDef(AliHLTTriggerMenu, 2) // Trigger menu for the global HLT trigger.
197 #endif // ALIHLTTRIGGERMENU_H