2 /**************************************************************************
3 * This file is property of and copyright by the ALICE HLT Project *
4 * ALICE Experiment at CERN, All rights reserved. *
6 * Primary Authors: Artur Szostak <artursz@iafrica.com> *
7 * for The ALICE HLT Project. *
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 **************************************************************************/
18 /// @file AliHLTGlobalTrigger.cxx
19 /// @author Artur Szostak <artursz@iafrica.com>
21 /// @brief Implementation of the AliHLTGlobalTrigger base class.
23 /// The AliHLTGlobalTriggerComponent class is an abstract class from which a
24 /// derived class is constructed by AliHLTTriggerMenu on the fly. The derived
25 /// class then implements triggering based on the particular trigger menu.
27 #include "AliHLTGlobalTrigger.h"
28 #include "AliHLTGlobalTriggerDecision.h"
31 ClassImp(AliHLTGlobalTrigger)
33 // Static factory array.
34 AliHLTGlobalTrigger::Factory*
35 AliHLTGlobalTrigger::Factory::fFactory[AliHLTGlobalTrigger::Factory::kMaxFactories]
36 = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
39 AliHLTGlobalTrigger::AliHLTGlobalTrigger() :
43 // Default constructor.
47 AliHLTGlobalTrigger::~AliHLTGlobalTrigger()
49 // Default destructor.
53 AliHLTGlobalTrigger* AliHLTGlobalTrigger::Factory::CreateNew(const char* name)
55 // Creates a new instance of the named trigger class.
57 for (int i = 0; i < kMaxFactories; i++)
59 if (fFactory[i] != NULL)
61 if (strcmp(fFactory[i]->ClassName(), name) == 0)
63 return fFactory[i]->New();
71 AliHLTGlobalTrigger::Factory::Factory() : AliHLTLogging()
73 // Default constructor resisters the class factory.
75 for (int i = 0; i < kMaxFactories; i++)
77 if (fFactory[i] == NULL)
84 HLTFatal("Trying to register too many global trigger factories.");
88 AliHLTGlobalTrigger::Factory::~Factory()
90 // The default destructor deregisters the factory.
92 for (int i = 0; i < kMaxFactories; i++)
94 if (fFactory[i] == this)
101 HLTFatal("Could not find factory to deregister.");
105 void AliHLTGlobalTrigger::ResetCounters(UInt_t number)
107 // Resets the trigger counters.
109 fCounters.Set(number);
110 for (UInt_t i = 0; i < number; i++)