Project
Loading...
Searching...
No Matches
VMCSeederService.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef ALICEO2_VMC_SEEDERSERVICE_H
13#define ALICEO2_VMC_SEEDERSERVICE_H
14
15class TVirtualMC;
16
17#include <functional>
18
19namespace o2
20{
21namespace base
22{
23
24// A simple (singleton) service to propagate random number seeding
25// to VMC engines in a loosely-coupled, just-in-time way (without needing to compile against these libraries).
27{
28
29 public:
30 static VMCSeederService const& instance()
31 {
32 static VMCSeederService inst;
33 return inst;
34 }
35
36 void setSeed() const; // will propagate seed to the VMC engines
37
38 typedef std::function<void()> SeederFcn;
39
40 private:
42 void initSeederFunction(TVirtualMC const*);
43
44 SeederFcn mSeederFcn; // the just-in-time compiled function talking to the VMC engines
45};
46
47} // namespace base
48} // namespace o2
49
50#endif
static VMCSeederService const & instance()
std::function< void()> SeederFcn
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...