ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
RngComps
src
AthRNGSvc.h
Go to the documentation of this file.
1
// -*- c++ -*-
2
/*
3
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
4
*/
5
6
#ifndef RNGCOMPS_ATHRNGSVC_H
7
#define RNGCOMPS_ATHRNGSVC_H
8
9
#include <unordered_map>
10
#include <vector>
11
#include <string>
12
#include <mutex>
13
#include <functional>
14
15
#include "
AthenaKernel/IAthRNGSvc.h
"
16
#include "
AthenaBaseComps/AthService.h
"
17
18
namespace
ATHRNG
{
19
class
RNGWrapper
;
20
}
21
namespace
CLHEP
{
22
class
HepRandomEngine;
23
}
24
33
class
AthRNGSvc
:
public
extends<AthService, IAthRNGSvc>
34
{
35
36
public
:
37
39
AthRNGSvc
(
const
std::string& name, ISvcLocator* svc);
40
virtual
~AthRNGSvc
();
41
43
StatusCode
initialize
()
override
final
;
44
46
virtual
ATHRNG::RNGWrapper
*
getEngine
(
const
INamedInterface* client,
47
const
std::string& streamName=
""
)
override
final
;
48
50
virtual
void
printEngineState
(
const
INamedInterface* client,
51
const
std::string& streamName =
""
)
override
final
;
52
53
private
:
54
56
std::string
m_rngType
;
57
59
std::unordered_map<std::string, ATHRNG::RNGWrapper*>
m_wrappers
;
60
62
typedef
std::function<CLHEP::HepRandomEngine*(void)>
factoryFunc
;
63
factoryFunc
m_fact
;
64
66
std::mutex
m_mutex
;
67
68
};
69
70
#endif
AthService.h
IAthRNGSvc.h
ATHRNG::RNGWrapper
A wrapper class for event-slot-local random engines.
Definition
RNGWrapper.h:56
AthRNGSvc::factoryFunc
std::function< CLHEP::HepRandomEngine *(void)> factoryFunc
Factory function which constructs a HepRandomEngine.
Definition
AthRNGSvc.h:62
AthRNGSvc::printEngineState
virtual void printEngineState(const INamedInterface *client, const std::string &streamName="") override final
Print engine state.
Definition
AthRNGSvc.cxx:75
AthRNGSvc::m_mutex
std::mutex m_mutex
Mutex for protecting access to the wrapper structure.
Definition
AthRNGSvc.h:66
AthRNGSvc::AthRNGSvc
AthRNGSvc(const std::string &name, ISvcLocator *svc)
Standard constructor.
Definition
AthRNGSvc.cxx:15
AthRNGSvc::m_wrappers
std::unordered_map< std::string, ATHRNG::RNGWrapper * > m_wrappers
The structure for storing the RNGWrappers.
Definition
AthRNGSvc.h:59
AthRNGSvc::m_fact
factoryFunc m_fact
Definition
AthRNGSvc.h:63
AthRNGSvc::m_rngType
std::string m_rngType
Random number engine type (e.g. dSFMT, ranecu).
Definition
AthRNGSvc.h:56
AthRNGSvc::~AthRNGSvc
virtual ~AthRNGSvc()
Definition
AthRNGSvc.cxx:97
AthRNGSvc::initialize
StatusCode initialize() override final
Initialize the service.
Definition
AthRNGSvc.cxx:22
AthRNGSvc::getEngine
virtual ATHRNG::RNGWrapper * getEngine(const INamedInterface *client, const std::string &streamName="") override final
IAthRNGSvc method to retrieve the random number wrapper.
Definition
AthRNGSvc.cxx:49
ATHRNG
Definition
IAthRNGSvc.h:23
CLHEP
STD'S.
Definition
CaloNoiseCompCondAlg.h:57
Generated on
for ATLAS Offline Software by
1.17.0