1 /**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * ALICE Experiment at CERN, All rights reserved. *
5 * Primary Authors: Artur Szostak <artursz@iafrica.com> *
6 * for The ALICE HLT Project. *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
17 /// @file AliHLTTriggerMenu.cxx
18 /// @author Artur Szostak <artursz@iafrica.com>
20 /// @brief Implementation of the AliHLTTriggerMenu base class.
22 /// The AliHLTTriggerMenu class implements the HLT global trigger menu,
23 /// which defines how and on what events the HLT triggers.
25 #include "AliHLTTriggerMenu.h"
26 #include "Riostream.h"
28 ClassImp(AliHLTTriggerMenu)
31 AliHLTTriggerMenu::AliHLTTriggerMenu() :
34 fSymbols(AliHLTTriggerMenuSymbol::Class(), 100),
35 fItems(AliHLTTriggerMenuItem::Class(), 100),
36 fDefaultDescription(),
39 // Default constructor.
43 AliHLTTriggerMenu::~AliHLTTriggerMenu()
45 // Default destructor.
49 AliHLTTriggerMenu::AliHLTTriggerMenu(const AliHLTTriggerMenu& obj) :
52 fSymbols(AliHLTTriggerMenuSymbol::Class(), obj.fSymbols.GetEntriesFast()),
53 fItems(AliHLTTriggerMenuItem::Class(), obj.fItems.GetEntriesFast()),
54 fDefaultDescription(obj.fDefaultDescription),
55 fDefaultDomain(obj.fDefaultDomain)
57 // Copy constructor performs a deep copy.
59 for (UInt_t i = 0; i < obj.NumberOfSymbols(); i++)
61 AddSymbol(*obj.Symbol(i));
63 for (UInt_t i = 0; i < obj.NumberOfItems(); i++)
65 AddItem(*obj.Item(i));
70 AliHLTTriggerMenu& AliHLTTriggerMenu::operator = (const AliHLTTriggerMenu& obj)
72 // Assignment operator performs a deep copy.
76 TObject::operator = (obj);
79 for (UInt_t i = 0; i < obj.NumberOfSymbols(); i++)
81 AddSymbol(*obj.Symbol(i));
84 for (UInt_t i = 0; i < obj.NumberOfItems(); i++)
86 AddItem(*obj.Item(i));
88 fDefaultDescription = obj.fDefaultDescription;
89 fDefaultDomain = obj.fDefaultDomain;
95 void AliHLTTriggerMenu::Print(Option_t* option) const
97 // Prints the contents of the trigger menu.
99 cout << "HLT Trigger Menu: " << fName.Data();
100 TString opt = option;
101 if (opt.Contains("short"))
103 cout << ", contains " << NumberOfItems() << " entries." << endl;
107 cout << setw(10) << "Prescalar" << " | "
108 << setw(60) << "Trigger condition" << " | "
109 << setw(60) << "Domain merge expression" << setw(0) << endl;
110 cout << setfill('-') << setw(10) << "-" << "-+-"
111 << setw(60) << "-" << "-+-"
112 << setw(60) << "-" << setw(0) << setfill(' ') << endl;
113 for (UInt_t i = 0; i < NumberOfItems(); i++)
115 Item(i)->Print("compact");
117 if (NumberOfItems() == 0) cout << "(none)" << endl;
118 cout << "Symbol list:" << endl;
119 cout << setw(15) << "Name"
120 << " | " << setw(20) << "Data type"
121 << " | " << setw(24) << "Block type & spec"
122 << " | " << setw(20) << "Class name"
123 << " | " << setw(25) << "Assigned value"
124 << " | " << setw(25) << "Default value"
126 cout << setw(15) << setfill('-') << "-"
127 << "-+-" << setw(20) << "-"
128 << "-+-" << setw(24) << "-"
129 << "-+-" << setw(20) << "-"
130 << "-+-" << setw(25) << "-"
131 << "-+-" << setw(25) << "-"
132 << setw(0) << setfill(' ') << endl;
133 for (UInt_t i = 0; i < NumberOfSymbols(); i++)
135 Symbol(i)->Print("compact");
137 if (NumberOfSymbols() == 0) cout << "(none)" << endl;
138 cout << "Default trigger description: \"" << fDefaultDescription << "\"" << endl;
139 cout << "Default "; fDefaultDomain.Print();
143 void AliHLTTriggerMenu::Clear(Option_t* option)
145 // Clears the internal symbol and items arrays.
147 fSymbols.Clear(option);
148 fItems.Clear(option);