3 #ifndef ALIHLTGLOBALTRIGGERDECISION_H
4 #define ALIHLTGLOBALTRIGGERDECISION_H
5 /* This file is property of and copyright by the ALICE HLT Project *
6 * ALICE Experiment at CERN, All rights reserved. *
7 * See cxx source for full Copyright notice */
9 /// @file AliHLTGlobalTriggerDecision.h
10 /// @author Artur Szostak <artursz@iafrica.com>
12 /// @brief Declaration of the AliHLTGlobalTriggerDecision class storing the global HLT decision.
14 #include "AliHLTTriggerDecision.h"
15 #include "TArrayL64.h"
16 #include "TObjArray.h"
19 * \class AliHLTGlobalTriggerDecision
20 * The global trigger decision object is generated by the AliHLTGlobalTriggerComponent
21 * class during processing of input triggers.
23 * Multiple input trigger components deriving from AliHLTTrigger will generate
24 * AliHLTTriggerDecision objects and possibly additional summary objects. All these
25 * objects are input for the global trigger component AliHLTGlobalTriggerComponent.
26 * After processing the input objects based on the trigger menu encoded in AliHLTTriggerMenu,
27 * the global trigger will generate and fill an AliHLTGlobalTriggerDecision object
28 * based on its decision. The new object will contain all the information a normal
29 * AliHLTTriggerDecision object generated by AliHLTTrigger contains. But in addition
30 * all the input objects that contributed to the global decision are also stored
31 * inside AliHLTGlobalTriggerDecision. The contributing trigger decisions are filled
32 * in fContributingTriggers and contributing summary TObjects are filled into fInputObjects.
33 * These can be accessed with the following methods:
34 * <i>NumberOfTriggerInputs</i> <i>TriggerInput</i> <i>TriggerInputs</i> for the
36 * and <i>NumberOfInputObjects</i> <i>InputObject</i> <i>InputObjects</i> for the
37 * input summary objects.
39 * There is also an array of counters stored in the global decision. These are
40 * a copy of the internal counters of the global trigger component. There is one
41 * counter for every item in the trigger menu, plus a possible additional counter
42 * at the end which indicated the total number of events processed by the global
45 * \note The counters do not necessarily correspond to the actual number of triggers
46 * that are recorded in the HLT output data stream. For most simple trigger menu
47 * configurations the counters will indeed correspond the the actual number of triggers
48 * recorded. But for more complex menus that use non zero prescalar values this may not
49 * be the case. The reason is that the counters array returned is the internal counter
50 * values (state) of the global trigger component. The counters are used to make the
51 * prescalars work. Thus, every time a corresponding trigger condition matches
52 * (evaluates to true) the counter is incremented, but the trigger decision might
53 * anyway skip the corresponding trigger in the menu since the prescalar is downscaling
54 * the trigger rate for that particular trigger menu item. This means that the counter
55 * values will be an upper bound.
56 * The real count and rate of particular triggers should always be taken by actually
57 * counting the trigger decision result.
59 class AliHLTGlobalTriggerDecision : public AliHLTTriggerDecision
64 * Default constructor.
66 AliHLTGlobalTriggerDecision();
69 * Constructor specifying multiple information fields.
70 * \param result The result of the global trigger decision.
71 * \param triggerDomain The trigger domain for the global trigger decision.
72 * \param description The description of (reason for) the global trigger decision.
74 AliHLTGlobalTriggerDecision(
75 bool result, const AliHLTTriggerDomain& triggerDomain,
76 const char* description = ""
82 virtual ~AliHLTGlobalTriggerDecision();
87 AliHLTGlobalTriggerDecision(const AliHLTGlobalTriggerDecision& src);
92 AliHLTGlobalTriggerDecision& operator=(const AliHLTGlobalTriggerDecision& src);
95 * Inherited from TObject, this prints the contents of the trigger decision.
96 * \param option Can be "short" which will print the short format or "counters"
97 * which will print only the counters or "compact" which will print only the
98 * global information but not the lists of input objects.
100 virtual void Print(Option_t* option = "") const;
103 * Inherited from TObject. Copy this to the specified object.
105 virtual void Copy(TObject &object) const;
108 * Inherited from TObject. Create a new clone.
110 virtual TObject *Clone(const char *newname="") const;
113 * Returns the number of trigger inputs that contributed to this global trigger decision.
115 Int_t NumberOfTriggerInputs() const { return fContributingTriggers.GetEntriesFast(); }
118 * Returns the i'th trigger input object in fContributingTriggers.
120 const AliHLTTriggerDecision* TriggerInput(Int_t i) const
122 return static_cast<const AliHLTTriggerDecision*>( fContributingTriggers[i] );
126 * Returns the list of trigger inputs used when making the global HLT trigger decision.
128 const TClonesArray& TriggerInputs() const { return fContributingTriggers; }
131 * Adds a trigger input to the list of triggers that were considered when making
132 * this global trigger decision.
133 * \param decision The trigger decision object to add.
135 void AddTriggerInput(const AliHLTTriggerDecision& decision)
137 new (fContributingTriggers[fContributingTriggers.GetEntriesFast()]) AliHLTTriggerDecision(decision);
141 * Returns the number of other input objects that contributed to this global trigger decision.
143 Int_t NumberOfInputObjects() const { return fInputObjects.GetEntriesFast(); }
146 * Returns the i'th input object in fInputObjects.
148 const TObject* InputObject(Int_t i) const { return fInputObjects[i]; }
151 * Returns the list of other input objects used when making the global HLT trigger decision.
153 const TObjArray& InputObjects() const { return fInputObjects; }
156 * Adds a input object to the list of input objects that were considered when
157 * making this global trigger decision.
158 * \param object The input object to add.
159 * \note A copy of the object is made with TObject::Clone() and added.
161 void AddInputObject(const TObject* object)
163 fInputObjects.Add(object->Clone());
167 * Sets the counter array.
168 * If the number of events is specified, an additional counter is added at the end
169 * and filled with <i>eventCount</i> which indicates the number of events that have been counted.
170 * \param counters The array of new counter values that the internal counters should be set to.
171 * \param eventCount This should be the total number of events processed. If it is
172 * a positive number >= 0 then the extra counter is added to the array and filled
173 * with the value of <i>eventCount</i>.
175 void SetCounters(const TArrayL64& counters, Long64_t eventCount = -1);
178 * Returns the event trigger counters associated with the global trigger classes.
179 * There is one counter for every trigger menu item that the global trigger component
180 * was configured with. Thus the first counter will correspond to the first menu item
181 * added to the trigger menu, the second counter for the second item added and so on.
182 * If the total number of events processed counter is pressent it will be at the
183 * end of the array in position N-1 where N is the number of items in the counter
184 * array (also this will correspond to N-1 trigger menu items in the global trigger menu).
186 * \note The counters do not necessarily correspond to the actual number of trigger
187 * that are recorded in the HLT output data stream. For most simple trigger menu
188 * configurations the counters will indeed correspond the the actual number of triggers
189 * recorded. But for more complex menus which use prescalar values this may not be
190 * the case. The reason is that the counters array returned is the internal counter
191 * values (state) of the global trigger component. The counters are used to make the
192 * prescalars work. Thus every time a corresponding trigger condition matches
193 * (evaluates to true) the counter is incremented, but the trigger decision might
194 * anyhow skip the corresponding trigger in the menu since the prescalar is downscaling
195 * the trigger rate for that particular trigger menu item.
197 const TArrayL64& Counters() const { return fCounters; }
201 TClonesArray fContributingTriggers; /// The list of contributing trigger decisions from all AliHLTTrigger components that were considered.
202 TObjArray fInputObjects; /// The list of other input objects.
203 TArrayL64 fCounters; /// Event trigger counters. One counter for each trigger class in the global trigger.
205 ClassDef(AliHLTGlobalTriggerDecision, 1) // Contains the HLT global trigger decision and information contributing to the decision.
208 #endif // ALIHLTGLOBALTRIGGERDECISION_H