3 #ifndef ALIHLTGLOBALTRIGGERWRAPPER_H
4 #define ALIHLTGLOBALTRIGGERWRAPPER_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 */
9 /// @file AliHLTGlobalTriggerWrapper.h
10 /// @author Artur Szostak <artursz@iafrica.com>
12 /// @brief Declaration of the AliHLTGlobalTriggerWrapper interface class.
14 #include "AliHLTGlobalTrigger.h"
15 #include "AliHLTLogging.h"
16 #include "TMethodCall.h"
21 * \class AliHLTGlobalTriggerWrapper
22 * This class is used to interface with an interpreted class deriving from
23 * AliHLTGlobalTrigger. Technically the interpreted class just need to provide
24 * the same interface, i.e. the same methods set of methods as AliHLTGlobalTrigger.
25 * Direct inheritance from AliHLTGlobalTrigger and AliHLTLogging does not seam to
26 * work so providing the same set of methods is enough.
27 * The underlying class with which the wrapper interfaces is created and deleted
28 * when the wrapper is created and deleted. Thus, the underlying object has the
29 * same lifetime as the wrapper object.
31 class AliHLTGlobalTriggerWrapper : public AliHLTGlobalTrigger, public AliHLTLogging
36 * The default constructor constructs the named underlying class and interfaces with it.
37 * \param classname The name of the underlying class to interface with.
39 AliHLTGlobalTriggerWrapper(const char* classname);
41 /// Default destructor will delete the underlying class.
42 virtual ~AliHLTGlobalTriggerWrapper();
45 * Fill values from a trigger menu. Specifically, the description
46 * strings and domain entry values will be copied over.
47 * \param menu The trigger menu to fill from.
49 virtual void FillFromMenu(const AliHLTTriggerMenu& menu);
52 * Method to indicate that a new event is being processed and the
53 * internal buffers should be reset.
55 virtual void NewEvent();
58 * This method is used to fill in the internal attributes from the given object
59 * which is found in the input data block list.
60 * \param object The object to fill from.
61 * \param type The data block type the object was found in.
62 * \param spec The data block specification the object was found in.
65 const TObject* object,
66 const AliHLTComponentDataType& type,
71 * Calculates the trigger decision and returns the resulting domain and description.
72 * \param domain The resultant trigger domain for the global HLT result.
73 * \param description The resultant description for the global HLT result.
74 * \returns The global HLT trigger decision result.
76 virtual bool CalculateTriggerDecision(AliHLTTriggerDomain& domain, TString& description);
79 * Returns the array of internal trigger counters.
81 virtual const TArrayL64& GetCounters() const;
84 * Sets the internal trigger counter values.
85 * \param counters The array of trigger counters to use.
87 virtual void SetCounters(const TArrayL64& counters);
90 * Indicates if the CINT interpreter had problems with the interpreted class
91 * during a call to one of the interface methods overloaded from AliHLTGlobalTrigger.
92 * \returns true if there was a problem with the method call.
94 virtual bool CallFailed() const { return fCallFailed; }
96 /// Returns true if the wrapper object has setup the underlying object class properly.
101 /// Not implemented. Do not allow copying of this object.
102 AliHLTGlobalTriggerWrapper(const AliHLTGlobalTriggerWrapper& obj);
103 /// Not implemented. Do not allow copying of this object.
104 AliHLTGlobalTriggerWrapper& operator = (const AliHLTGlobalTriggerWrapper& obj);
106 TClass* fClass; /// Pointer to the object class.
107 void* fObject; /// Pointer to the object being interfaced.
108 TMethodCall fFillFromMenuCall; /// Method call object for FillFromMenu method.
109 TMethodCall fNewEventCall; /// Method call object for NewEvent method.
110 TMethodCall fAddCall; /// Method call object for Add method.
111 TMethodCall fCalculateTriggerDecisionCall; /// Method call object for CalculateTriggerDecision method.
112 mutable TMethodCall fGetCountersCall; /// Method call object for GetCounters method.
113 TMethodCall fSetCountersCall; /// Method call object for SetCounters method.
114 mutable bool fCallFailed; /// Indicates if the last method call failed or not.
116 ClassDef(AliHLTGlobalTriggerWrapper, 0) // Wrapper class to interface with an interpreted global trigger class.
119 #endif // ALIHLTGLOBALTRIGGERWRAPPER_H