1 /**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * ALICE Experiment at CERN, All rights reserved. *
5 * Primary Authors: Artur Szostak <artursz@iafrica.com> *
6 * for The ALICE HLT Project. *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
17 /// @file AliHLTTrigger.h
18 /// @author Artur Szostak <artursz@iafrica.com>
20 /// @brief Implementation of the AliHLTTrigger base component class.
22 /// The AliHLTTrigger class is the base class from which all HLT trigger components
23 /// should be derived.
25 #include "AliHLTTrigger.h"
26 #include "AliHLTTriggerDecision.h"
28 ClassImp(AliHLTTrigger)
31 AliHLTTrigger::AliHLTTrigger() :
36 fTriggerEventResult(0),
41 /// Default constructor sets pointers to NULL.
45 AliHLTTrigger::~AliHLTTrigger()
47 /// Default destructor.
51 void AliHLTTrigger::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
53 /// Returns output data size estimate.
55 constBase = sizeof(AliHLTTriggerDecision);
60 int AliHLTTrigger::DoEvent(const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData)
62 /// Sets the pointers to the evtData and trigData, then calls the DoTrigger to
63 /// execute the actual trigger algorithm.
65 fEventData = &evtData;
66 fTriggerData = &trigData;
67 fDecisionMade = false;
68 fTriggerEventResult = 0;
70 int result = DoTrigger();
71 if (result != 0) return result;
73 // Fill in a default decision of false if none was made.
74 if (not fDecisionMade)
82 return fTriggerEventResult;
86 void AliHLTTrigger::TriggerEvent(bool value)
88 /// Sets the trigger decision for the current event.
90 if (fTriggerEventResult != 0) return; // Do not do anything if a previous call failed.
91 AliHLTTriggerDecision triggerResult(value, GetTriggerName(), fReadoutList, fTriggerDomain, fDescription);
92 fTriggerEventResult = PushBack(&triggerResult, kAliHLTDataTypeTObject|kAliHLTDataOriginOut);