1 ////////////////////////////////////////////////////////////////////////////////
3 // Author: Artur Szostak
4 // Email: artur@alice.phy.uct.ac.za | artursz@iafrica.com
6 ////////////////////////////////////////////////////////////////////////////////
8 #ifndef dHLT_DECISION_DECISION_MAKER_HPP
9 #define dHLT_DECISION_DECISION_MAKER_HPP
11 #include "BasicTypes.hpp"
13 #include "DecisionRecord.hpp"
26 class DecisionMakerCallback
30 virtual ~DecisionMakerCallback() {};
32 /* Called when the decision maker has finished processing.
33 At this point and tracks passed to the decision maker are no longer is use
34 by the decision maker and the tracks can be released.
35 'decisionsize' indicates the number of bytes required to store the decision.
36 If decisionsize == 0 then no memory is allocated and FillDecisionData should
39 virtual void MadeDecision(DecisionMaker* decisionmaker, const UInt decisionsize) = 0;
53 virtual ~DecisionMaker() {};
55 /* This is the starting point of the decision algorithm. Any initialisation
56 processing should be performed here.
58 virtual void StartDecision() = 0;
60 /* For every track avaiable for a particular event or sub-event this method
61 is called with the relevant track. Most of the actual decision algorithm
62 will go into this method on a per track basis.
64 virtual void AddTrack(const AliHLTMUONCoreTrack& track) = 0;
66 /* When no more tracks are available for the decision then this method is called.
67 Final processing of the decision algorithm should go in to this method.
68 When the decision is made by the algorithm then the MadeDecision should be
71 virtual void EndOfTracks() = 0;
73 /* After a call to MadeDecision this method will be called to retreive the
74 decision. The 'decision' pointer should point to a memory block of at least
75 the number of bytes specified in the call to MadeDecision, with the
76 decisionsize parameter. The decision algorithm should not write more data
79 virtual void FillDecisionData(DecisionRecord* decision) = 0;
81 /* This is called when the decision maker should be reset to an initial state.
82 All extra internal memory allocated during processing should be released.
84 virtual void Reset() = 0;
86 /* Sets the DecisionMakerCallback callback interface.
88 inline void SetCallback(DecisionMakerCallback* callback)
90 this->callback = callback;
95 /* When the decision algorithm is finished processing and a decision is made,
96 then this method should be called. At this point all the track blocks
97 should be considered released and the track memory MUST NOT be accessed.
98 The number of bytes required to store the decision should be indecated by
101 inline void MadeDecision(const UInt decisionsize)
103 Assert( callback != NULL );
104 callback->MadeDecision(this, decisionsize);
109 DecisionMakerCallback* callback;
116 #endif // dHLT_DECISION_DECISION_MAKER_HPP