ATLAS Offline Software
TrkDetDescrUnitTestBase.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // TrkDetDescrUnitTestBase.cxx, (c) ATLAS Detector software
8 
9 //TrkDetDescrUnitTests
11 
12 Trk::TrkDetDescrUnitTestBase::TrkDetDescrUnitTestBase(const std::string& name, ISvcLocator* pSvcLocator):
13  AthAlgorithm(name,pSvcLocator),
14  m_gaussDist(nullptr),
15  m_flatDist(nullptr),
16  m_numTests(100)
17 {
18  declareProperty("NumberOfTestsPerEvent", m_numTests);
19 }
20 
22 {
23  delete m_gaussDist;
24  delete m_flatDist;
25 }
26 
28 {
29  ATH_MSG_INFO( "Creating random number services, call bookTree() and initializeTest()" );
30 
31  // intialize the random number generators
32  m_gaussDist = new Rndm::Numbers(randSvc(), Rndm::Gauss(0.,1.));
33  m_flatDist = new Rndm::Numbers(randSvc(), Rndm::Flat(0.,1.));
34 
35  if (bookTree().isFailure()){
36  ATH_MSG_FATAL( "Could not book the TTree object" );
37  return StatusCode::FAILURE;
38  }
39 
40  if (initializeTest().isFailure()){
41  ATH_MSG_FATAL( "Could not initialize the test" );
42  return StatusCode::FAILURE;
43  }
44 
45  return StatusCode::SUCCESS;
46 }
47 
49 {
50  return runTest();
51 }
52 
54 {
55 
56  ATH_MSG_INFO( "finalize()" );
57  return StatusCode::SUCCESS;
58 }
59 
60 StatusCode Trk::TrkDetDescrUnitTestBase::bookTree() { return StatusCode::SUCCESS; }
61 
63 
Trk::TrkDetDescrUnitTestBase::m_numTests
size_t m_numTests
number of tests
Definition: TrkDetDescrUnitTestBase.h:61
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Trk::TrkDetDescrUnitTestBase::execute
StatusCode execute()
standard Athena-Algorithm method
Definition: TrkDetDescrUnitTestBase.cxx:48
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::TrkDetDescrUnitTestBase::bookTree
virtual StatusCode bookTree()
Definition: TrkDetDescrUnitTestBase.cxx:60
Trk::TrkDetDescrUnitTestBase::~TrkDetDescrUnitTestBase
virtual ~TrkDetDescrUnitTestBase()
Default Destructor.
Definition: TrkDetDescrUnitTestBase.cxx:21
Trk::TrkDetDescrUnitTestBase::finalize
StatusCode finalize()
standard Athena-Algorithm method
Definition: TrkDetDescrUnitTestBase.cxx:53
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgorithm
Definition: AthAlgorithm.h:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
Trk::TrkDetDescrUnitTestBase::initialize
StatusCode initialize()
standard Athena-Algorithm method
Definition: TrkDetDescrUnitTestBase.cxx:27
TrkDetDescrUnitTestBase.h
Trk::TrkDetDescrUnitTestBase::initializeTest
virtual StatusCode initializeTest()
Definition: TrkDetDescrUnitTestBase.cxx:62
Trk::TrkDetDescrUnitTestBase::TrkDetDescrUnitTestBase
TrkDetDescrUnitTestBase(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
Definition: TrkDetDescrUnitTestBase.cxx:12