]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTTriggerDecision.h
3b5bd04953b16ed0dfb7aba54f68f86676839930
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTTriggerDecision.h
1 #ifndef ALIHLTTRIGGERDECISION_H
2 #define ALIHLTTRIGGERDECISION_H
3 /* This file is property of and copyright by the ALICE HLT Project        *
4  * ALICE Experiment at CERN, All rights reserved.                         *
5  * See cxx source for full Copyright notice                               */
6
7 /// @file   AliHLTTriggerDecision.h
8 /// @author Artur Szostak <artursz@iafrica.com>
9 /// @date   21 Nov 2008
10 /// @brief  Declaration of the AliHLTTriggerDecision class storing the a AliHLTTrigger component's decision.
11
12 #include "TString.h"
13 #include "AliHLTReadoutList.h"
14 #include "AliHLTTriggerDomain.h"
15
16 /**
17  * \class AliHLTTriggerDecision
18  * Stores the information and result of a trigger decision made by a component
19  * deriving from AliHLTTrigger. The information includes the DDL readout list
20  * indicating which DDLs to readout and the trigger domain specifying which HLT
21  * raw data blocks to forward to HLTOUT.
22  */
23 class AliHLTTriggerDecision : public TObject
24 {
25  public:
26   
27   /**
28    * Default constructor.
29    */
30   AliHLTTriggerDecision();
31   
32   /**
33    * Constructor specifying the result and trigger name.
34    * \param result  The result of the trigger decision.
35    * \param name  The name of the trigger decision. Should be the name of the
36    *     AliHLTTrigger component.
37    */
38   AliHLTTriggerDecision(bool result, const char* name);
39   
40   /**
41    * Constructor specifying all information fields.
42    * \param result  The result of the trigger decision.
43    * \param name  The name of the trigger decision. Should be the name of the
44    *     AliHLTTrigger component.
45    * \param triggerDomain  The trigger domain for the trigger decision.
46    * \param description  The description of (reason for) the trigger decision.
47    */
48   AliHLTTriggerDecision(
49       bool result, const char* name, const AliHLTTriggerDomain& triggerDomain,
50       const char* description = ""
51     );
52   
53   /**
54    * Default destructor.
55    */
56   virtual ~AliHLTTriggerDecision();
57   
58   /**
59    * Inherited from TObject. Returns the name of the trigger decision.
60    */
61   virtual const char* GetName() const { return fName.Data(); }
62   
63   /**
64    * Inherited from TObject. This prints the contents of the trigger decision.
65    * \param option  Can be "short" which will print the short format.
66    */
67   virtual void Print(Option_t* option = "") const;
68   
69   /**
70    * Returns the result of the trigger decision.
71    * \returns true if the event was triggered and should be readout.
72    */
73   bool EventTriggered() const { return Result(); }
74   
75   /**
76    * Returns the result of the trigger decision.
77    * The decision is stored in bit 15 of the fBits field.
78    * \returns true if the event was triggered and should be readout.
79    */
80   bool Result() const { return TestBit(15) == 1; }
81   
82   /**
83    * Sets the result of the trigger decision.
84    * The decision is stored in bit 15 of the fBits field.
85    * \param value  The value to set; true if the event triggered and should be
86    *     readout and false otherwise.
87    */
88   void Result(bool value) { SetBit(15, value); }
89   
90   /**
91    * Returns the name of the trigger decision.
92    */
93   const char* Name() const { return fName.Data(); }
94   
95   /**
96    * Sets the name of the trigger decision.
97    */
98   void Name(const char* name) { fName = name; }
99   
100   /**
101    * Returns the description of (reason for) the trigger decision.
102    */
103   const char* Description() const { return fDescription.Data(); }
104   
105   /**
106    * Sets the description of the trigger decision.
107    */
108   void Description(const char* value) { fDescription = value; }
109   
110   /**
111    * Returns the DDL readout list associated with this trigger decision.
112    */
113   AliHLTReadoutList ReadoutList() const { return AliHLTReadoutList(fTriggerDomain); }
114   
115   /**
116    * Sets the DDL readout list associated with this trigger decision.
117    */
118   void ReadoutList(const AliHLTReadoutList& value)
119   {
120     fTriggerDomain.Remove("DAQRDOUT", kAliHLTDataOriginAny);
121     fTriggerDomain.Add(value);
122   }
123   
124   /**
125    * Returns the trigger domain associated with this trigger decision.
126    */
127   const AliHLTTriggerDomain& TriggerDomain() const { return fTriggerDomain; }
128   
129   /**
130    * Returns the trigger domain associated with this trigger decision for editing.
131    */
132   AliHLTTriggerDomain& TriggerDomain() { return fTriggerDomain; }
133   
134   /**
135    * Sets the trigger domain associated with this trigger decision.
136    */
137   void TriggerDomain(const AliHLTTriggerDomain& value) { fTriggerDomain = value; }
138   
139  private:
140   
141   TString fName; /// The name of the trigger decision. Should be the name of the trigger component that generated it.
142   TString fDescription; /// Optional descriptive text giving the reason for the trigger.
143   AliHLTTriggerDomain fTriggerDomain;  /// The trigger domain associated with this trigger. i.e. the HLT data blocks to read out.
144   
145   ClassDef(AliHLTTriggerDecision, 1) // HLT trigger decision object storing information about the readout list, trigger domain and result.
146 };
147
148 #endif // ALIHLTTRIGGERDECISION_H
149