]>
Commit | Line | Data |
---|---|---|
c580e182 | 1 | //-*- Mode: C++ -*- |
4a035340 | 2 | // $Id$ |
1b9a175e | 3 | #ifndef ALIHLTTRIGGERDECISION_H |
4 | #define ALIHLTTRIGGERDECISION_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 */ | |
8 | ||
9 | /// @file AliHLTTriggerDecision.h | |
10 | /// @author Artur Szostak <artursz@iafrica.com> | |
11 | /// @date 21 Nov 2008 | |
12 | /// @brief Declaration of the AliHLTTriggerDecision class storing the a AliHLTTrigger component's decision. | |
13 | ||
14 | #include "TString.h" | |
15 | #include "AliHLTReadoutList.h" | |
16 | #include "AliHLTTriggerDomain.h" | |
17 | ||
18 | /** | |
19 | * \class AliHLTTriggerDecision | |
20 | * Stores the information and result of a trigger decision made by a component | |
21 | * deriving from AliHLTTrigger. The information includes the DDL readout list | |
22 | * indicating which DDLs to readout and the trigger domain specifying which HLT | |
23 | * raw data blocks to forward to HLTOUT. | |
24 | */ | |
25 | class AliHLTTriggerDecision : public TObject | |
26 | { | |
27 | public: | |
28 | ||
29 | /** | |
30 | * Default constructor. | |
31 | */ | |
32 | AliHLTTriggerDecision(); | |
33 | ||
c309778e | 34 | /** |
35 | * Copy constructor performs a deep copy. | |
36 | */ | |
37 | AliHLTTriggerDecision(const AliHLTTriggerDecision& obj); | |
38 | ||
1b9a175e | 39 | /** |
40 | * Constructor specifying the result and trigger name. | |
41 | * \param result The result of the trigger decision. | |
42 | * \param name The name of the trigger decision. Should be the name of the | |
43 | * AliHLTTrigger component. | |
44 | */ | |
45 | AliHLTTriggerDecision(bool result, const char* name); | |
46 | ||
47 | /** | |
48 | * Constructor specifying all information fields. | |
49 | * \param result The result of the trigger decision. | |
50 | * \param name The name of the trigger decision. Should be the name of the | |
51 | * AliHLTTrigger component. | |
1b9a175e | 52 | * \param triggerDomain The trigger domain for the trigger decision. |
53 | * \param description The description of (reason for) the trigger decision. | |
54 | */ | |
55 | AliHLTTriggerDecision( | |
52f67e50 | 56 | bool result, const char* name, const AliHLTTriggerDomain& triggerDomain, |
57 | const char* description = "" | |
1b9a175e | 58 | ); |
59 | ||
60 | /** | |
61 | * Default destructor. | |
62 | */ | |
63 | virtual ~AliHLTTriggerDecision(); | |
64 | ||
65 | /** | |
66 | * Inherited from TObject. Returns the name of the trigger decision. | |
67 | */ | |
68 | virtual const char* GetName() const { return fName.Data(); } | |
69 | ||
4a035340 | 70 | /** |
71 | * Inherited from TObject. Returns the description of the trigger decision. | |
72 | */ | |
73 | virtual const char* GetTitle() const { return fDescription.Data(); } | |
74 | ||
1b9a175e | 75 | /** |
76 | * Inherited from TObject. This prints the contents of the trigger decision. | |
77 | * \param option Can be "short" which will print the short format. | |
78 | */ | |
79 | virtual void Print(Option_t* option = "") const; | |
4a035340 | 80 | |
81 | /** | |
82 | * Inherited from TObject. Copy this to the specified object. | |
83 | */ | |
84 | virtual void Copy(TObject &object) const; | |
85 | ||
86 | /** | |
87 | * Inherited from TObject. Create a new clone. | |
88 | */ | |
89 | virtual TObject *Clone(const char *newname="") const; | |
90 | ||
91 | /** | |
92 | * Inherited from TObject. Return the result of the trigger. | |
93 | * @return "0" or "1" (note: its a string) | |
94 | */ | |
95 | virtual Option_t *GetOption() const; | |
96 | ||
1b9a175e | 97 | /** |
98 | * Returns the result of the trigger decision. | |
99 | * \returns true if the event was triggered and should be readout. | |
100 | */ | |
101 | bool EventTriggered() const { return Result(); } | |
102 | ||
103 | /** | |
104 | * Returns the result of the trigger decision. | |
105 | * The decision is stored in bit 15 of the fBits field. | |
106 | * \returns true if the event was triggered and should be readout. | |
107 | */ | |
c309778e | 108 | bool Result() const; |
1b9a175e | 109 | |
110 | /** | |
111 | * Sets the result of the trigger decision. | |
112 | * The decision is stored in bit 15 of the fBits field. | |
113 | * \param value The value to set; true if the event triggered and should be | |
114 | * readout and false otherwise. | |
115 | */ | |
c309778e | 116 | void Result(bool value); |
1b9a175e | 117 | |
118 | /** | |
119 | * Returns the name of the trigger decision. | |
120 | */ | |
121 | const char* Name() const { return fName.Data(); } | |
122 | ||
123 | /** | |
124 | * Sets the name of the trigger decision. | |
125 | */ | |
126 | void Name(const char* name) { fName = name; } | |
127 | ||
128 | /** | |
129 | * Returns the description of (reason for) the trigger decision. | |
130 | */ | |
131 | const char* Description() const { return fDescription.Data(); } | |
132 | ||
133 | /** | |
134 | * Sets the description of the trigger decision. | |
135 | */ | |
136 | void Description(const char* value) { fDescription = value; } | |
137 | ||
138 | /** | |
139 | * Returns the DDL readout list associated with this trigger decision. | |
140 | */ | |
52f67e50 | 141 | AliHLTReadoutList ReadoutList() const { return AliHLTReadoutList(fTriggerDomain); } |
1b9a175e | 142 | |
143 | /** | |
144 | * Sets the DDL readout list associated with this trigger decision. | |
145 | */ | |
81d62bb4 | 146 | void ReadoutList(const AliHLTReadoutList& value); |
1b9a175e | 147 | |
148 | /** | |
149 | * Returns the trigger domain associated with this trigger decision. | |
150 | */ | |
151 | const AliHLTTriggerDomain& TriggerDomain() const { return fTriggerDomain; } | |
152 | ||
52f67e50 | 153 | /** |
154 | * Returns the trigger domain associated with this trigger decision for editing. | |
155 | */ | |
156 | AliHLTTriggerDomain& TriggerDomain() { return fTriggerDomain; } | |
157 | ||
1b9a175e | 158 | /** |
159 | * Sets the trigger domain associated with this trigger decision. | |
160 | */ | |
161 | void TriggerDomain(const AliHLTTriggerDomain& value) { fTriggerDomain = value; } | |
162 | ||
c309778e | 163 | /** |
164 | * Assignment operator performs a deep copy. | |
165 | */ | |
166 | AliHLTTriggerDecision& operator = (const AliHLTTriggerDecision& obj); | |
167 | ||
2f251ae6 | 168 | /** |
169 | * This method clears the trigger domain and sets the decision result to false. | |
170 | * \param option This is passed onto the trigger domain clear method. | |
171 | * The method is inherited from TObject. | |
172 | */ | |
094b7c4a | 173 | virtual void Clear(Option_t* option = "C"); |
2f251ae6 | 174 | |
1b9a175e | 175 | private: |
176 | ||
177 | TString fName; /// The name of the trigger decision. Should be the name of the trigger component that generated it. | |
178 | TString fDescription; /// Optional descriptive text giving the reason for the trigger. | |
1b9a175e | 179 | AliHLTTriggerDomain fTriggerDomain; /// The trigger domain associated with this trigger. i.e. the HLT data blocks to read out. |
180 | ||
c309778e | 181 | ClassDef(AliHLTTriggerDecision, 2) // HLT trigger decision object storing information about the readout list, trigger domain and result. |
1b9a175e | 182 | }; |
183 | ||
184 | #endif // ALIHLTTRIGGERDECISION_H | |
185 |