ATLAS Offline Software
Loading...
Searching...
No Matches
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
17using namespace std;
18
19namespace 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}
ITest * GetTrigAnalysisTest(const string &name)
STL namespace.