]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/trigger/AliHLTGlobalTrigger.cxx
AliTPCcalibCalib.cxx - use also alignmnet - not implemented yet
[u/mrichter/AliRoot.git] / HLT / trigger / AliHLTGlobalTrigger.cxx
1 // $Id$
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 ///
23 /// The AliHLTGlobalTrigger base class is an abstract class from which a
24 /// derived class is constructed from AliHLTTriggerMenu on the fly. The derived
25 /// class then implements triggering based on the particular trigger menu.
26
27 #include "AliHLTGlobalTrigger.h"
28 #include "AliHLTGlobalTriggerWrapper.h"
29 #include "TClass.h"
30
31 ClassImp(AliHLTGlobalTrigger)
32
33
34 AliHLTGlobalTrigger* AliHLTGlobalTrigger::CreateNew(const char* name)
35 {
36   // Creates a new instance of the named global trigger class.
37   
38   TClass* c = TClass::GetClass(name);
39   if (c == NULL) return NULL;
40   if (c->GetDeclFileLine() == -1 and c->GetImplFileLine() == -1)
41   {
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;
48   }
49   else
50   {
51     return static_cast<AliHLTGlobalTrigger*>(c->New());
52   }
53 }
54