Removal of no longer maintained neural trackers
[u/mrichter/AliRoot.git] / HLT / trigger / AliHLTTrigger.cxx
CommitLineData
a9670afe 1/**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * ALICE Experiment at CERN, All rights reserved. *
4 * *
5 * Primary Authors: Artur Szostak <artursz@iafrica.com> *
6 * for The ALICE HLT Project. *
7 * *
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 **************************************************************************/
5a806c0e 16
1b9a175e 17/// @file AliHLTTrigger.h
18/// @author Artur Szostak <artursz@iafrica.com>
19/// @date 12 Aug 2008
20/// @brief Implementation of the AliHLTTrigger base component class.
21///
22/// The AliHLTTrigger class is the base class from which all HLT trigger components
23/// should be derived.
24
4aa41877 25#include "AliHLTTrigger.h"
1b9a175e 26#include "AliHLTTriggerDecision.h"
5a806c0e 27
4aa41877 28ClassImp(AliHLTTrigger)
5a806c0e 29
5a806c0e 30
a9670afe 31AliHLTTrigger::AliHLTTrigger() :
32 AliHLTProcessor(),
33 fEventData(NULL),
34 fTriggerData(NULL),
35 fDecisionMade(false),
4adf50d6 36 fTriggerEventResult(0),
1b9a175e 37 fDescription(),
38 fReadoutList(),
39 fTriggerDomain()
5a806c0e 40{
5d79eb88 41 // Default constructor sets pointers to NULL.
5a806c0e 42}
43
5a806c0e 44
a9670afe 45AliHLTTrigger::~AliHLTTrigger()
5a806c0e 46{
5d79eb88 47 // Default destructor.
4adf50d6 48}
49
50
51void AliHLTTrigger::GetOutputDataSize(unsigned long& constBase, double& inputMultiplier)
52{
5d79eb88 53 // Returns output data size estimate.
54 // See header file for more details.
4adf50d6 55
1b9a175e 56 constBase = sizeof(AliHLTTriggerDecision);
4adf50d6 57 inputMultiplier = 1;
5a806c0e 58}
59
5a806c0e 60
a9670afe 61int AliHLTTrigger::DoEvent(const AliHLTComponentEventData& evtData, AliHLTComponentTriggerData& trigData)
5a806c0e 62{
5d79eb88 63 // Sets the pointers to the evtData and trigData, then calls the DoTrigger to
64 // execute the actual trigger algorithm.
5a806c0e 65
a9670afe 66 fEventData = &evtData;
67 fTriggerData = &trigData;
68 fDecisionMade = false;
69 fTriggerEventResult = 0;
70
71 int result = DoTrigger();
72 if (result != 0) return result;
73
74 // Fill in a default decision of false if none was made.
75 if (not fDecisionMade)
76 {
77 TriggerEvent(false);
78 }
4adf50d6 79
a9670afe 80 // Cleanup
81 fEventData = NULL;
82 fTriggerData = NULL;
83 return fTriggerEventResult;
5a806c0e 84}
85
5a806c0e 86
4654280e 87int AliHLTTrigger::TriggerEvent(bool value)
5a806c0e 88{
5d79eb88 89 // Sets the trigger decision for the current event.
90 // See header file for more details.
5a806c0e 91
4654280e 92 if (fTriggerEventResult != 0) return fTriggerEventResult; // Do not do anything if a previous call failed.
52f67e50 93 AliHLTTriggerDecision triggerResult(value, GetTriggerName(), fTriggerDomain, fDescription);
8b745301 94 // Append the readout list if it contains anything.
95 triggerResult.TriggerDomain().Add(fReadoutList);
4adf50d6 96 fTriggerEventResult = PushBack(&triggerResult, kAliHLTDataTypeTObject|kAliHLTDataOriginOut);
5d79eb88 97 if (fTriggerEventResult == 0) fDecisionMade = true;
4654280e 98 return fTriggerEventResult;
5d79eb88 99}
100
101
4654280e 102int AliHLTTrigger::TriggerEvent(
5d79eb88 103 AliHLTTriggerDecision* result, const AliHLTComponentDataType& type,
104 AliHLTUInt32_t spec
105 )
106{
107 // Sets a custom trigger decision for the current event.
108 // See header file for more details.
109
4654280e 110 if (fTriggerEventResult != 0) return fTriggerEventResult; // Do not do anything if a previous call failed.
5d79eb88 111 fTriggerEventResult = PushBack(result, type, spec);
112 if (fTriggerEventResult == 0) fDecisionMade = true;
4654280e 113 return fTriggerEventResult;
5d79eb88 114}
115
116
117void AliHLTTrigger::GetInputDataTypes(AliHLTComponentDataTypeList& list)
118{
119 // Calls the const version of this method.
120
121 // Assign to const temporary variable to make sure we call the constant version
122 // of the GetOutputDataTypes method.
123 const AliHLTTrigger* t = this;
4a0b19b6 124 t->GetInputDataTypes(list);
5d79eb88 125}
126
127
128int AliHLTTrigger::GetOutputDataTypes(AliHLTComponentDataTypeList& list)
129{
130 // Calls the const version of this method.
131
132 // Assign to const temporary variable to make sure we call the constant version
133 // of the GetOutputDataTypes method.
134 const AliHLTTrigger* t = this;
135 t->GetOutputDataTypes(list);
136 list.push_back(kAliHLTDataTypeTObject|kAliHLTDataOriginOut);
137 return list.size();
5a806c0e 138}
139