]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/trigger/AliHLTGlobalTrigger.h
AliTPCcalibCalib.cxx - use also alignmnet - not implemented yet
[u/mrichter/AliRoot.git] / HLT / trigger / AliHLTGlobalTrigger.h
1 //-*- Mode: C++ -*-
2 // $Id$
3 #ifndef ALIHLTGLOBALTRIGGER_H
4 #define ALIHLTGLOBALTRIGGER_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   AliHLTGlobalTrigger.h
10 /// @author Artur Szostak <artursz@iafrica.com>
11 /// @date   19 Dec 2008
12 /// @brief  Declaration of the AliHLTGlobalTrigger base class.
13
14 #include "TObject.h"
15 #include "AliHLTDataTypes.h"
16
17 class AliHLTTriggerDomain;
18 class AliHLTTriggerMenu;
19 class TString;
20 class TArrayL64;
21
22 /**
23  * \class AliHLTGlobalTrigger
24  * This class is an abstract class. Classes which derive from this class should
25  * implement the logic for a particular trigger menu. The AliHLTGlobalTriggerComponent
26  * takes the AliHLTTriggerMenu class and creates a class deriving from AliHLTGlobalTrigger
27  * on the fly to implement the trigger logic for that particular trigger menu.
28  */
29 class AliHLTGlobalTrigger
30 {
31  public:
32   
33   /// Default destructor.
34   virtual ~AliHLTGlobalTrigger() {}
35   
36   /**
37    * Abstract method to fill values from a trigger menu. Specifically, the description
38    * strings and domain entry values will be copied over.
39    * \param  menu  The trigger menu to fill from.
40    */
41   virtual void FillFromMenu(const AliHLTTriggerMenu& menu) = 0;
42   
43   /**
44    * Abstract method to indicate that a new event is being processed and the
45    * internal buffers should be cleared or reset.
46    */
47   virtual void NewEvent() = 0;
48   
49   /**
50    * Abstract method which should fill in the internal attributes from the given
51    * object.
52    * \param  object  The object to fill from.
53    * \param  type  The data block type the object was found in.
54    * \param  spec  The data block specification the object was found in.
55    */
56   virtual void Add(
57       const TObject* object,
58       const AliHLTComponentDataType& type,
59       AliHLTUInt32_t spec
60     ) = 0;
61   
62   /**
63    * Abstract method that calculates the trigger decision
64    * \param  domain  The resultant trigger domain for the global HLT result.
65    * \param  description  The resultant description for the global HLT result.
66    * \returns The global HLT trigger decision result.
67    */
68   virtual bool CalculateTriggerDecision(AliHLTTriggerDomain& domain, TString& description) = 0;
69   
70   /**
71    * Returns the array of internal trigger counters.
72    */
73   virtual const TArrayL64& GetCounters() const = 0;
74   
75   /**
76    * Sets the internal trigger counter values.
77    * \param counters  The array of trigger counters to use.
78    */
79   virtual void SetCounters(const TArrayL64& counters) = 0;
80   
81   /**
82    * Method for checking if the last call to one of the AliHLTGlobalTrigger
83    * methods failed. This is used by the AliHLTGlobalTriggerWrapper to indicate
84    * if the CINT interpreter had problems with the interpreted class.
85    * \returns true if there was a problem with the method call.
86    */
87   virtual bool CallFailed() const { return false; }
88   
89   /**
90    * Creates a new instance of a particular global trigger class.
91    * \param name  The name of the class to create.
92    * \returns the new trigger class instance which needs to be deleted by the
93    *    caller with the delete operator.
94    */
95   static AliHLTGlobalTrigger* CreateNew(const char* name);
96   
97   ClassDef(AliHLTGlobalTrigger, 0) // Global HLT trigger base class which implements logic for a particular trigger menu.
98 };
99
100 #endif // ALIHLTGLOBALTRIGGER_H