]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/trigger/AliHLTGlobalTrigger.cxx
Fix for updating CTP counters.
[u/mrichter/AliRoot.git] / HLT / trigger / AliHLTGlobalTrigger.cxx
CommitLineData
68099920 1// $Id$
e2bb8ddd 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 AliHLTGlobalTrigger.cxx
19/// @author Artur Szostak <artursz@iafrica.com>
20/// @date 19 Dec 2008
21/// @brief Implementation of the AliHLTGlobalTrigger base class.
22///
81d62bb4 23/// The AliHLTGlobalTrigger base class is an abstract class from which a
24/// derived class is constructed from AliHLTTriggerMenu on the fly. The derived
e2bb8ddd 25/// class then implements triggering based on the particular trigger menu.
26
27#include "AliHLTGlobalTrigger.h"
81d62bb4 28#include "AliHLTGlobalTriggerWrapper.h"
29#include "TClass.h"
e2bb8ddd 30
31ClassImp(AliHLTGlobalTrigger)
32
e2bb8ddd 33
81d62bb4 34AliHLTGlobalTrigger* AliHLTGlobalTrigger::CreateNew(const char* name)
e2bb8ddd 35{
81d62bb4 36 // Creates a new instance of the named global trigger class.
e2bb8ddd 37
81d62bb4 38 TClass* c = TClass::GetClass(name);
39 if (c == NULL) return NULL;
40 if (c->GetDeclFileLine() == -1 and c->GetImplFileLine() == -1)
e2bb8ddd 41 {
81d62bb4 42 // Could not find the implementation lines which should be there if the code
43 // was compiled. So assuming that this is an interpreted class. In this case
44 // we need to use a interface wrapper class to make things work properly.
45 AliHLTGlobalTriggerWrapper* trigger = new AliHLTGlobalTriggerWrapper(name);
46 if (not trigger->IsValid()) return NULL;
47 return trigger;
e2bb8ddd 48 }
81d62bb4 49 else
52f67e50 50 {
81d62bb4 51 return static_cast<AliHLTGlobalTrigger*>(c->New());
a489a8dd 52 }
68099920 53}
a489a8dd 54