fixing compilation warnings
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTTriggerDecision.h
CommitLineData
c580e182 1//-*- Mode: C++ -*-
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 */
25class AliHLTTriggerDecision : public TObject
26{
27 public:
28
29 /**
30 * Default constructor.
31 */
32 AliHLTTriggerDecision();
33
34 /**
35 * Constructor specifying the result and trigger name.
36 * \param result The result of the trigger decision.
37 * \param name The name of the trigger decision. Should be the name of the
38 * AliHLTTrigger component.
39 */
40 AliHLTTriggerDecision(bool result, const char* name);
41
42 /**
43 * Constructor specifying all information fields.
44 * \param result The result of the trigger decision.
45 * \param name The name of the trigger decision. Should be the name of the
46 * AliHLTTrigger component.
1b9a175e 47 * \param triggerDomain The trigger domain for the trigger decision.
48 * \param description The description of (reason for) the trigger decision.
49 */
50 AliHLTTriggerDecision(
52f67e50 51 bool result, const char* name, const AliHLTTriggerDomain& triggerDomain,
52 const char* description = ""
1b9a175e 53 );
54
55 /**
56 * Default destructor.
57 */
58 virtual ~AliHLTTriggerDecision();
59
60 /**
61 * Inherited from TObject. Returns the name of the trigger decision.
62 */
63 virtual const char* GetName() const { return fName.Data(); }
64
65 /**
66 * Inherited from TObject. This prints the contents of the trigger decision.
67 * \param option Can be "short" which will print the short format.
68 */
69 virtual void Print(Option_t* option = "") const;
70
71 /**
72 * Returns the result of the trigger decision.
73 * \returns true if the event was triggered and should be readout.
74 */
75 bool EventTriggered() const { return Result(); }
76
77 /**
78 * Returns the result of the trigger decision.
79 * The decision is stored in bit 15 of the fBits field.
80 * \returns true if the event was triggered and should be readout.
81 */
82 bool Result() const { return TestBit(15) == 1; }
83
84 /**
85 * Sets the result of the trigger decision.
86 * The decision is stored in bit 15 of the fBits field.
87 * \param value The value to set; true if the event triggered and should be
88 * readout and false otherwise.
89 */
90 void Result(bool value) { SetBit(15, value); }
91
92 /**
93 * Returns the name of the trigger decision.
94 */
95 const char* Name() const { return fName.Data(); }
96
97 /**
98 * Sets the name of the trigger decision.
99 */
100 void Name(const char* name) { fName = name; }
101
102 /**
103 * Returns the description of (reason for) the trigger decision.
104 */
105 const char* Description() const { return fDescription.Data(); }
106
107 /**
108 * Sets the description of the trigger decision.
109 */
110 void Description(const char* value) { fDescription = value; }
111
112 /**
113 * Returns the DDL readout list associated with this trigger decision.
114 */
52f67e50 115 AliHLTReadoutList ReadoutList() const { return AliHLTReadoutList(fTriggerDomain); }
1b9a175e 116
117 /**
118 * Sets the DDL readout list associated with this trigger decision.
119 */
52f67e50 120 void ReadoutList(const AliHLTReadoutList& value)
121 {
8b745301 122 fTriggerDomain.Remove("DAQRDOUT", kAliHLTDataOriginAny);
123 fTriggerDomain.Add(value);
52f67e50 124 }
1b9a175e 125
126 /**
127 * Returns the trigger domain associated with this trigger decision.
128 */
129 const AliHLTTriggerDomain& TriggerDomain() const { return fTriggerDomain; }
130
52f67e50 131 /**
132 * Returns the trigger domain associated with this trigger decision for editing.
133 */
134 AliHLTTriggerDomain& TriggerDomain() { return fTriggerDomain; }
135
1b9a175e 136 /**
137 * Sets the trigger domain associated with this trigger decision.
138 */
139 void TriggerDomain(const AliHLTTriggerDomain& value) { fTriggerDomain = value; }
140
141 private:
142
143 TString fName; /// The name of the trigger decision. Should be the name of the trigger component that generated it.
144 TString fDescription; /// Optional descriptive text giving the reason for the trigger.
1b9a175e 145 AliHLTTriggerDomain fTriggerDomain; /// The trigger domain associated with this trigger. i.e. the HLT data blocks to read out.
146
147 ClassDef(AliHLTTriggerDecision, 1) // HLT trigger decision object storing information about the readout list, trigger domain and result.
148};
149
150#endif // ALIHLTTRIGGERDECISION_H
151