ATLAS Offline Software
TestFactory.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //
6 // Simple factory that will generate the test
7 // object given a name.
8 //
9 
13 
14 #include <stdexcept>
15 #include <sstream>
16 
17 using namespace std;
18 
19 namespace TrigAnalysisTest {
20 
21  // Fetch a test. If name is not known then throw an exception.
22  ITest *GetTrigAnalysisTest (const string &name) {
23  if (name == "BasicTriggerFired") {
24  return new BasicTriggerFired();
25  } else if (name == "Run1BStoxAODTrigger") {
26  return new Run1BStoxAODTrigger();
27  } else {
28  // If we are here, then we don't know what kind of test the framework
29  // is asking for. So bomb.
30  ostringstream errtxt;
31  errtxt << "Trigger Analysis Test " << name << " is not known";
32  throw runtime_error (errtxt.str().c_str());
33  }
34  }
35 }
Run1BStoxAODTrigger.h
TrigAnalysisTest::Run1BStoxAODTrigger
Definition: Run1BStoxAODTrigger.h:20
TestFactory.h
TrigAnalysisTest::ITest
Definition: ITest.h:18
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TrigAnalysisTest::BasicTriggerFired
Definition: BasicTriggerFired.h:16
TrigAnalysisTest
Definition: BasicTriggerFired.cxx:30
BasicTriggerFired.h
TrigAnalysisTest::GetTrigAnalysisTest
ITest * GetTrigAnalysisTest(const string &name)
Definition: TestFactory.cxx:22