2 /**************************************************************************
3 * This file is property of and copyright by the ALICE HLT Project *
4 * ALICE Experiment at CERN, All rights reserved. *
6 * Primary Authors: Artur Szostak <artursz@iafrica.com> *
7 * for The ALICE HLT Project. *
9 * Permission to use, copy, modify and distribute this software and its *
10 * documentation strictly for non-commercial purposes is hereby granted *
11 * without fee, provided that the above copyright notice appears in all *
12 * copies and that both the copyright notice and this permission notice *
13 * appear in the supporting documentation. The authors make no claims *
14 * about the suitability of this software for any purpose. It is *
15 * provided "as is" without express or implied warranty. *
16 **************************************************************************/
18 /// @file AliHLTTriggerMenu.cxx
19 /// @author Artur Szostak <artursz@iafrica.com>
21 /// @brief Implementation of the AliHLTTriggerMenu base class.
23 /// The AliHLTTriggerMenu class implements the HLT global trigger menu,
24 /// which defines how and on what events the HLT triggers.
26 #include "AliHLTTriggerMenu.h"
27 #include "Riostream.h"
29 ClassImp(AliHLTTriggerMenu)
32 AliHLTTriggerMenu::AliHLTTriggerMenu() :
35 fSymbols(AliHLTTriggerMenuSymbol::Class(), 100),
36 fItems(AliHLTTriggerMenuItem::Class(), 100),
37 fDefaultDescription(),
40 // Default constructor.
44 AliHLTTriggerMenu::~AliHLTTriggerMenu()
46 // Default destructor.
50 AliHLTTriggerMenu::AliHLTTriggerMenu(const AliHLTTriggerMenu& obj) :
53 fSymbols(AliHLTTriggerMenuSymbol::Class(), obj.fSymbols.GetEntriesFast()),
54 fItems(AliHLTTriggerMenuItem::Class(), obj.fItems.GetEntriesFast()),
55 fDefaultDescription(obj.fDefaultDescription),
56 fDefaultDomain(obj.fDefaultDomain)
58 // Copy constructor performs a deep copy.
60 for (UInt_t i = 0; i < obj.NumberOfSymbols(); i++)
62 AddSymbol(*obj.Symbol(i));
64 for (UInt_t i = 0; i < obj.NumberOfItems(); i++)
66 AddItem(*obj.Item(i));
71 AliHLTTriggerMenu& AliHLTTriggerMenu::operator = (const AliHLTTriggerMenu& obj)
73 // Assignment operator performs a deep copy.
77 TObject::operator = (obj);
80 for (UInt_t i = 0; i < obj.NumberOfSymbols(); i++)
82 AddSymbol(*obj.Symbol(i));
85 for (UInt_t i = 0; i < obj.NumberOfItems(); i++)
87 AddItem(*obj.Item(i));
89 fDefaultDescription = obj.fDefaultDescription;
90 fDefaultDomain = obj.fDefaultDomain;
96 void AliHLTTriggerMenu::Print(Option_t* option) const
98 // Prints the contents of the trigger menu.
100 cout << "HLT Trigger Menu: " << fName.Data();
101 TString opt = option;
102 if (opt.Contains("short"))
104 cout << ", contains " << NumberOfItems() << " entries." << endl;
108 cout << setw(10) << "Prescalar" << " | "
109 << setw(60) << "Trigger condition" << " | "
110 << setw(60) << "Domain merge expression" << setw(0) << endl;
111 cout << setfill('-') << setw(10) << "-" << "-+-"
112 << setw(60) << "-" << "-+-"
113 << setw(60) << "-" << setw(0) << setfill(' ') << endl;
114 for (UInt_t i = 0; i < NumberOfItems(); i++)
116 Item(i)->Print("compact");
118 if (NumberOfItems() == 0) cout << "(none)" << endl;
119 cout << "Symbol list:" << endl;
120 cout << setw(15) << "Name"
121 << " | " << setw(20) << "Data type"
122 << " | " << setw(24) << "Block type & spec"
123 << " | " << setw(20) << "Class name"
124 << " | " << setw(25) << "Assigned value"
125 << " | " << setw(25) << "Default value"
127 cout << setw(15) << setfill('-') << "-"
128 << "-+-" << setw(20) << "-"
129 << "-+-" << setw(24) << "-"
130 << "-+-" << setw(20) << "-"
131 << "-+-" << setw(25) << "-"
132 << "-+-" << setw(25) << "-"
133 << setw(0) << setfill(' ') << endl;
134 for (UInt_t i = 0; i < NumberOfSymbols(); i++)
136 Symbol(i)->Print("compact");
138 if (NumberOfSymbols() == 0) cout << "(none)" << endl;
139 cout << "Default trigger description: \"" << fDefaultDescription << "\"" << endl;
140 cout << "Default "; fDefaultDomain.Print();
144 void AliHLTTriggerMenu::Clear(Option_t* option)
146 // Clears the internal symbol and items arrays.
148 fSymbols.Clear(option);
149 fItems.Clear(option);