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 #include "AliHLTTrigger.h"
18 #include "TObjString.h"
20 ClassImp(AliHLTTrigger)
23 AliHLTTrigger::AliHLTTrigger() :
28 fTriggerEventResult(0),
31 /// Default constructor sets pointers to NULL.
35 AliHLTTrigger::~AliHLTTrigger()
37 /// Default destructor.
41 void AliHLTTrigger::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
43 /// Returns output data size estimate.
45 constBase = strlen(GetTriggerName()) + sizeof(TObjString) + 1;
50 int AliHLTTrigger::DoEvent(const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData)
52 /// Sets the pointers to the evtData and trigData, then calls the DoTrigger to
53 /// execute the actual trigger algorithm.
55 fEventData = &evtData;
56 fTriggerData = &trigData;
57 fDecisionMade = false;
58 fTriggerEventResult = 0;
60 int result = DoTrigger();
61 if (result != 0) return result;
63 // Fill in a default decision of false if none was made.
64 if (not fDecisionMade)
70 // result = PushBack(&fReadoutList, kAliHLTDataTypeTObject|kAliHLTDataOriginOut);
71 // if (result != 0) return result;
76 return fTriggerEventResult;
80 void AliHLTTrigger::TriggerEvent(bool value)
82 /// Sets the trigger decision for the current event.
84 if (fTriggerEventResult != 0) return; // Do not do anything if a previous call failed.
85 TObjString triggerResult(GetTriggerName());
86 triggerResult.SetBit(BIT(14), value); // Use bit 14 for the boolean decision.
87 fTriggerEventResult = PushBack(&triggerResult, kAliHLTDataTypeTObject|kAliHLTDataOriginOut);