]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTTriggerMenu.cxx
- setting properties for keyword substitution
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTTriggerMenu.cxx
1 // $Id:$
2 /**************************************************************************
3  * This file is property of and copyright by the ALICE HLT Project        *
4  * ALICE Experiment at CERN, All rights reserved.                         *
5  *                                                                        *
6  * Primary Authors: Artur Szostak <artursz@iafrica.com>                   *
7  *                  for The ALICE HLT Project.                            *
8  *                                                                        *
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  **************************************************************************/
17
18 /// @file   AliHLTTriggerMenu.cxx
19 /// @author Artur Szostak <artursz@iafrica.com>
20 /// @date   19 Dec 2008
21 /// @brief  Implementation of the AliHLTTriggerMenu base class.
22 ///
23 /// The AliHLTTriggerMenu class implements the HLT global trigger menu,
24 /// which defines how and on what events the HLT triggers.
25
26 #include "AliHLTTriggerMenu.h"
27 #include "Riostream.h"
28
29 ClassImp(AliHLTTriggerMenu)
30
31
32 AliHLTTriggerMenu::AliHLTTriggerMenu() :
33   TObject(),
34   fName("Unknown"),
35   fSymbols(AliHLTTriggerMenuSymbol::Class(), 100),
36   fItems(AliHLTTriggerMenuItem::Class(), 100),
37   fDefaultDescription(),
38   fDefaultDomain()
39 {
40   // Default constructor.
41 }
42
43
44 AliHLTTriggerMenu::~AliHLTTriggerMenu()
45 {
46   // Default destructor.
47 }
48
49
50 AliHLTTriggerMenu::AliHLTTriggerMenu(const AliHLTTriggerMenu& obj) :
51   TObject(obj),
52   fName(obj.fName),
53   fSymbols(AliHLTTriggerMenuSymbol::Class(), obj.fSymbols.GetEntriesFast()),
54   fItems(AliHLTTriggerMenuItem::Class(), obj.fItems.GetEntriesFast()),
55   fDefaultDescription(obj.fDefaultDescription),
56   fDefaultDomain(obj.fDefaultDomain)
57 {
58   // Copy constructor performs a deep copy.
59   
60   for (UInt_t i = 0; i < obj.NumberOfSymbols(); i++)
61   {
62     AddSymbol(*obj.Symbol(i));
63   }
64   for (UInt_t i = 0; i < obj.NumberOfItems(); i++)
65   {
66     AddItem(*obj.Item(i));
67   }
68 }
69
70
71 AliHLTTriggerMenu& AliHLTTriggerMenu::operator = (const AliHLTTriggerMenu& obj)
72 {
73   // Assignment operator performs a deep copy.
74   
75   if (this != &obj)
76   {
77     TObject::operator = (obj);
78     fName = obj.fName;
79     fSymbols.Clear();
80     for (UInt_t i = 0; i < obj.NumberOfSymbols(); i++)
81     {
82       AddSymbol(*obj.Symbol(i));
83     }
84     fItems.Clear();
85     for (UInt_t i = 0; i < obj.NumberOfItems(); i++)
86     {
87       AddItem(*obj.Item(i));
88     }
89     fDefaultDescription = obj.fDefaultDescription;
90     fDefaultDomain = obj.fDefaultDomain;
91   }
92   return *this;
93 }
94
95
96 void AliHLTTriggerMenu::Print(Option_t* option) const
97 {
98   // Prints the contents of the trigger menu.
99   
100   cout << "HLT Trigger Menu: " << fName.Data();
101   TString opt = option;
102   if (opt.Contains("short"))
103   {
104     cout << ", contains " << NumberOfItems() << " entries." << endl;
105     return;
106   }
107   cout << 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++)
115   {
116     Item(i)->Print("compact");
117   }
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"
126        << setw(0) << endl;
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++)
135   {
136     Symbol(i)->Print("compact");
137   }
138   if (NumberOfSymbols() == 0) cout << "(none)" << endl;
139   cout << "Default trigger description: \"" << fDefaultDescription << "\"" << endl;
140   cout << "Default "; fDefaultDomain.Print();
141 }
142
143
144 void AliHLTTriggerMenu::Clear(Option_t* option)
145 {
146   // Clears the internal symbol and items arrays.
147   
148   fSymbols.Clear(option);
149   fItems.Clear(option);
150 }