1 #ifndef ALIHLTTRIGGERMENU_H
2 #define ALIHLTTRIGGERMENU_H
3 /* This file is property of and copyright by the ALICE HLT Project *
4 * ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 /// @file AliHLTTriggerMenu.h
8 /// @author Artur Szostak <artursz@iafrica.com>
10 /// @brief Declaration of the AliHLTTriggerMenu base class.
14 #include "TClonesArray.h"
15 #include "AliHLTTriggerMenuItem.h"
18 * \class AliHLTTriggerMenu
19 * This class is an abstract class. Classes which derive from this class should
20 * implement the logic for a particular trigger menu. The AliHLTTriggerMenu class
21 * creates a class deriving from AliHLTTriggerMenu on the fly to implement the
22 * trigger logic for that particular trigger menu.
24 class AliHLTTriggerMenu : public TObject
29 * Default constructor.
36 virtual ~AliHLTTriggerMenu();
39 * Inherited from TObject, this prints the contents of the trigger menu.
40 * \param option Can be "short" which will print the short format.
42 virtual void Print(Option_t* option = "") const;
45 * Copy constructor performs a deep copy of the object.
46 * \param obj Object to copy from.
48 AliHLTTriggerMenu(const AliHLTTriggerMenu& obj);
51 * Assignment operator performs a deep copy of the object.
52 * \param obj Object to copy from.
53 * \return This object is returned after being replaced by a copy of <i>obj</i>.
55 AliHLTTriggerMenu& operator = (const AliHLTTriggerMenu& obj);
58 * Inherited from TObject. Returns the name of the trigger menu.
60 virtual const char* GetName() const { return fName.Data(); }
63 * Returns the name of the trigger menu.
65 const char* Name() const { return fName.Data(); }
68 * Sets the name of the trigger menu.
70 void Name(const char* name) { fName = name; }
73 * Returns the number of items in the trigger menu.
75 UInt_t NumberOfItems() const { return UInt_t(fItems.GetEntriesFast()); }
78 * Fetches the i'th trigger menu item.
80 const AliHLTTriggerMenuItem* Item(UInt_t i) const
82 if (i >= UInt_t(fItems.GetEntriesFast())) return NULL;
83 return static_cast<const AliHLTTriggerMenuItem*>( fItems.UncheckedAt(Int_t(i)) );
87 * Fetches the i'th trigger menu item for editing.
89 AliHLTTriggerMenuItem* Item(UInt_t i)
91 if (i >= UInt_t(fItems.GetEntriesFast())) return NULL;
92 return static_cast<AliHLTTriggerMenuItem*>( fItems.UncheckedAt(Int_t(i)) );
96 * Adds a new entry to the trigger menu.
98 void AddItem(const AliHLTTriggerMenuItem& entry)
100 new (fItems[fItems.GetEntriesFast()]) AliHLTTriggerMenuItem(entry);
105 TString fName; /// Name of the trigger menu.
106 TClonesArray fItems; /// List of trigger menu items.
108 ClassDef(AliHLTTriggerMenu, 1) // Trigger menu for the global HLT trigger.
111 #endif // ALIHLTTRIGGERMENU_H