Revert file committed by mistake.
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTTriggerDecision.cxx
CommitLineData
4a035340 1// $Id$
1b9a175e 2/**************************************************************************
3 * This file is property of and copyright by the ALICE HLT Project *
4 * ALICE Experiment at CERN, All rights reserved. *
5 * *
6 * Primary Authors: Artur Szostak <artursz@iafrica.com> *
7 * for The ALICE HLT Project. *
8 * *
9 * Permission to use, copy, modify and distribute this software and its *
10 * documentation strictly for non-commercial purposes is hereby granted *
11 * without fee, provided that the above copyright notice appears in all *
12 * copies and that both the copyright notice and this permission notice *
13 * appear in the supporting documentation. The authors make no claims *
14 * about the suitability of this software for any purpose. It is *
15 * provided "as is" without express or implied warranty. *
16 **************************************************************************/
17
18/// @file AliHLTTriggerDecision.cxx
19/// @author Artur Szostak <artursz@iafrica.com>
20/// @date 21 Nov 2008
21/// @brief Implementation of the AliHLTTriggerDecision class.
22///
23/// The trigger decision class stores the HLT decision from an AliHLTTrigger component.
24
25#include "AliHLTTriggerDecision.h"
26#include "Riostream.h"
27
28ClassImp(AliHLTTriggerDecision)
29
30
31AliHLTTriggerDecision::AliHLTTriggerDecision() :
32 TObject(),
33 fName(),
34 fDescription(),
1b9a175e 35 fTriggerDomain()
36{
37 // Default constructor.
38}
39
40
41AliHLTTriggerDecision::AliHLTTriggerDecision(bool result, const char* name) :
42 TObject(),
43 fName(name),
44 fDescription(),
1b9a175e 45 fTriggerDomain()
46{
47 // Constructor specifying the name and result of the trigger decision.
48
49 Result(result);
50}
51
52
53AliHLTTriggerDecision::AliHLTTriggerDecision(
52f67e50 54 bool result, const char* name,
55 const AliHLTTriggerDomain& triggerDomain,
56 const char* description
1b9a175e 57 ) :
58 TObject(),
59 fName(name),
60 fDescription(description),
1b9a175e 61 fTriggerDomain(triggerDomain)
62{
63 // Constructor specifying all information fields.
64
65 Result(result);
66}
67
68
69AliHLTTriggerDecision::~AliHLTTriggerDecision()
70{
71 // Default destructor.
72}
73
74
81d62bb4 75void AliHLTTriggerDecision::ReadoutList(const AliHLTReadoutList& value)
76{
77 // Replaces the readout list in the trigger domain with the new value.
78
79 AliHLTReadoutList fullReadout = ~ AliHLTReadoutList(0x0);
80 fTriggerDomain.Remove(fullReadout);
81 fTriggerDomain.Add(value);
82}
83
84
1b9a175e 85void AliHLTTriggerDecision::Print(Option_t* option) const
86{
87 // Prints the contents of the trigger decision.
88
89 cout << "Trigger (" << fName.Data() << ") result = " << Result() << endl;
90 TString opt(option);
91 if (opt.Contains("short")) return;
92 cout << "Description = \"" << fDescription.Data() << "\"" << endl;
1b9a175e 93 fTriggerDomain.Print();
94}
95
4a035340 96void AliHLTTriggerDecision::Copy(TObject &object) const
97{
98 // copy this to the specified object
99
100 AliHLTTriggerDecision* pDecision=dynamic_cast<AliHLTTriggerDecision*>(&object);
101 if (pDecision) {
102 // copy members if target is a AliHLTTriggerDecision
103 *pDecision=*this;
104 }
105
106 // copy the base class
107 TObject::Copy(object);
108}
109
110TObject *AliHLTTriggerDecision::Clone(const char */*newname*/) const
111{
112 // create a new clone, classname is ignored
113
114 return new AliHLTTriggerDecision(*this);
115}
116
117Option_t *AliHLTTriggerDecision::GetOption() const
118{
119 // Return the result of the trigger.
120 // "0" or "1"
121 if (Result()) return "1";
122 return "0";
123}