adding Copy and Clone methods inherited from TObject for abstract access and
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTGlobalTriggerDecision.h
CommitLineData
c580e182 1//-*- Mode: C++ -*-
4a035340 2// $Id$
1b9a175e 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 */
8
9/// @file AliHLTGlobalTriggerDecision.h
10/// @author Artur Szostak <artursz@iafrica.com>
11/// @date 26 Nov 2008
12/// @brief Declaration of the AliHLTGlobalTriggerDecision class storing the global HLT decision.
13
14#include "AliHLTTriggerDecision.h"
e2bb8ddd 15#include "TArrayL64.h"
52f67e50 16#include "TObjArray.h"
1b9a175e 17
18class AliHLTGlobalTriggerDecision : public AliHLTTriggerDecision
19{
20 public:
21
22 /**
23 * Default constructor.
24 */
25 AliHLTGlobalTriggerDecision();
26
27 /**
28 * Constructor specifying multiple information fields.
29 * \param result The result of the global trigger decision.
1b9a175e 30 * \param triggerDomain The trigger domain for the global trigger decision.
31 * \param description The description of (reason for) the global trigger decision.
32 */
33 AliHLTGlobalTriggerDecision(
52f67e50 34 bool result, const AliHLTTriggerDomain& triggerDomain,
35 const char* description = ""
1b9a175e 36 );
37
38 /**
39 * Default destructor.
40 */
41 virtual ~AliHLTGlobalTriggerDecision();
42
43 /**
44 * Inherited from TObject, this prints the contents of the trigger decision.
52f67e50 45 * \param option Can be "short" which will print the short format or "counters"
46 * which will print only the counters or "compact" which will print only the
47 * global information but not the lists of input objects.
1b9a175e 48 */
49 virtual void Print(Option_t* option = "") const;
4a035340 50
51 /**
52 * Inherited from TObject. Copy this to the specified object.
53 */
54 virtual void Copy(TObject &object) const;
1b9a175e 55
4a035340 56 /**
57 * Inherited from TObject. Create a new clone.
58 */
59 virtual TObject *Clone(const char *newname="") const;
60
1b9a175e 61 /**
62 * Returns the number of trigger inputs that contributed to this global trigger decision.
63 */
64 Int_t NumberOfTriggerInputs() const { return fContributingTriggers.GetEntriesFast(); }
65
66 /**
67 * Returns the i'th trigger input object in fContributingTriggers.
68 */
69 const AliHLTTriggerDecision* TriggerInput(Int_t i) const
70 {
71 return static_cast<const AliHLTTriggerDecision*>( fContributingTriggers[i] );
72 }
73
74 /**
75 * Returns the list of trigger inputs used when making the global HLT trigger decision.
76 */
77 const TClonesArray& TriggerInputs() const { return fContributingTriggers; }
78
79 /**
80 * Adds a trigger input to the list of triggers that were considered when making
81 * this global trigger decision.
82 * \param decision The trigger decision object to add.
83 */
84 void AddTriggerInput(const AliHLTTriggerDecision& decision)
85 {
86 new (fContributingTriggers[fContributingTriggers.GetEntriesFast()]) AliHLTTriggerDecision(decision);
87 }
88
52f67e50 89 /**
90 * Returns the number of other input objects that contributed to this global trigger decision.
91 */
92 Int_t NumberOfInputObjects() const { return fInputObjects.GetEntriesFast(); }
93
94 /**
95 * Returns the i'th input object in fInputObjects.
96 */
97 const TObject* InputObject(Int_t i) const { return fInputObjects[i]; }
98
99 /**
100 * Returns the list of other input objects used when making the global HLT trigger decision.
101 */
102 const TObjArray& InputObjects() const { return fInputObjects; }
103
104 /**
105 * Adds a input object to the list of input objects that were considered when
106 * making this global trigger decision.
107 * \param object The input object to add.
108 * \note A copy of the object is made with TObject::Clone() and added.
109 */
110 void AddInputObject(const TObject* object)
111 {
112 fInputObjects.Add(object->Clone());
113 }
114
115 /**
116 * Sets the counter array.
117 */
118 void SetCounters(const TArrayL64& counters) { fCounters = counters; }
119
1b9a175e 120 /**
121 * Returns the event trigger counters associated with the global trigger classes.
122 */
e2bb8ddd 123 const TArrayL64& Counters() const { return fCounters; }
1b9a175e 124
125 private:
126
127 TClonesArray fContributingTriggers; /// The list of contributing trigger decisions from all AliHLTTrigger components that were considered.
52f67e50 128 TObjArray fInputObjects; /// The list of other input objects.
e2bb8ddd 129 TArrayL64 fCounters; /// Event trigger counters. One counter for each trigger class in the global trigger.
1b9a175e 130
131 ClassDef(AliHLTGlobalTriggerDecision, 1) // Contains the HLT global trigger decision and information contributing to the decision.
132};
133
134#endif // ALIHLTGLOBALTRIGGERDECISION_H
135