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)
37 // Default constructor.
41 AliHLTTriggerMenu::~AliHLTTriggerMenu()
43 // Default destructor.
47 AliHLTTriggerMenu::AliHLTTriggerMenu(const AliHLTTriggerMenu& obj) :
50 fSymbols(AliHLTTriggerMenuSymbol::Class(), obj.fSymbols.GetEntriesFast()),
51 fItems(AliHLTTriggerMenuItem::Class(), obj.fItems.GetEntriesFast())
53 // Copy constructor performs a deep copy.
55 for (UInt_t i = 0; i < obj.NumberOfSymbols(); i++)
57 AddSymbol(*obj.Symbol(i));
59 for (UInt_t i = 0; i < obj.NumberOfItems(); i++)
61 AddItem(*obj.Item(i));
66 AliHLTTriggerMenu& AliHLTTriggerMenu::operator = (const AliHLTTriggerMenu& obj)
68 // Assignment operator performs a deep copy.
72 TObject::operator = (obj);
75 for (UInt_t i = 0; i < obj.NumberOfSymbols(); i++)
77 AddSymbol(*obj.Symbol(i));
79 for (UInt_t i = 0; i < obj.NumberOfItems(); i++)
81 AddItem(*obj.Item(i));
88 void AliHLTTriggerMenu::Print(Option_t* option) const
90 // Prints the contents of the trigger menu.
92 cout << "HLT Trigger Menu: " << fName.Data();
94 if (opt.Contains("short"))
96 cout << ", contains " << NumberOfItems() << " entries." << endl;
100 cout << setw(10) << "Prescalar" << " | "
101 << setw(60) << "Trigger condition" << " | "
102 << setw(60) << "Domain merge expression" << setw(0) << endl;
103 cout << setfill('-') << setw(10) << "-" << "-+-"
104 << setw(60) << "-" << "-+-"
105 << setw(60) << "-" << setw(0) << setfill(' ') << endl;
106 for (UInt_t i = 0; i < NumberOfItems(); i++)
108 Item(i)->Print("compact");
110 if (NumberOfItems() == 0) cout << "(none)" << endl;
111 cout << "Symbol list:" << endl;
112 cout << setw(15) << "Name"
113 << " | " << setw(20) << "Data type"
114 << " | " << setw(24) << "Block type & spec"
115 << " | " << setw(20) << "Class name"
116 << " | " << setw(25) << "Assigned value"
117 << " | " << setw(25) << "Default value"
119 cout << setw(15) << setfill('-') << "-"
120 << "-+-" << setw(20) << "-"
121 << "-+-" << setw(24) << "-"
122 << "-+-" << setw(20) << "-"
123 << "-+-" << setw(25) << "-"
124 << "-+-" << setw(25) << "-"
125 << setw(0) << setfill(' ') << endl;
126 for (UInt_t i = 0; i < NumberOfSymbols(); i++)
128 Symbol(i)->Print("compact");
130 if (NumberOfSymbols() == 0) cout << "(none)" << endl;