Project
Loading...
Searching...
No Matches
O2SimDevice.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
13
14
#ifndef ALICEO2_DEVICES_SIMDEVICE_H_
15
#define ALICEO2_DEVICES_SIMDEVICE_H_
16
17
#include <memory>
18
#include <string>
19
#include <fairmq/Device.h>
20
#include <FairRunSim.h>
21
#include <TStopwatch.h>
22
#include "
PrimaryServerState.h
"
23
24
class
TVirtualMC
;
25
26
namespace
o2::steer
27
{
28
class
O2MCApplication;
29
}
30
31
// a helper for logging with worker index prefixed
32
void
doLogInfo
(
int
workerID, std::string
const
&
message
);
33
34
namespace
o2
35
{
36
namespace
devices
37
{
38
39
// device representing a simulation worker
40
class
O2SimDevice
final :
public
fair::mq::Device
41
{
42
public
:
43
O2SimDevice
() =
default
;
44
O2SimDevice
(
o2::steer::O2MCApplication
* vmcapp,
TVirtualMC
* vmc) : mVMCApp{vmcapp}, mVMC{vmc} {}
45
47
~O2SimDevice
() final;
48
49
protected
:
51
void
InitTask
() final;
52
53
public:
54
void
lateInit
();
55
56
// initializes the simulation classes; queries the configuration on a given channel
57
static
bool
initSim
(
fair
::mq::Channel& channel,
std
::unique_ptr<
FairRunSim
>& simptr);
58
59
bool
isWorkAvailable
(
fair
::mq::Channel& statuschannel,
int
workerID = -1);
60
61
bool
Kernel
(
int
workerID,
fair
::mq::Channel& requestchannel,
fair
::mq::Channel& dataoutchannel,
fair
::mq::Channel* statuschannel =
nullptr
);
62
63
protected
:
65
bool
ConditionalRun
() final;
66
67
void
PostRun
() final;
68
69
private:
70
TStopwatch mTimer;
71
o2
::steer::O2MCApplication* mVMCApp =
nullptr
;
72
TVirtualMC
* mVMC =
nullptr
;
73
std
::unique_ptr<
FairRunSim
> mSimRun;
74
};
75
76
}
// namespace devices
77
}
// namespace o2
78
79
#endif
doLogInfo
void doLogInfo(int workerID, std::string const &message)
Definition
O2SimDevice.cxx:27
PrimaryServerState.h
protected
#define protected
Definition
RCombinedDS.cxx:34
FairRunSim
TVirtualMC
fair::mq::Device
o2::devices::O2SimDevice
Definition
O2SimDevice.h:41
o2::devices::O2SimDevice::initSim
static bool initSim(fair::mq::Channel &channel, std::unique_ptr< FairRunSim > &simptr)
Definition
O2SimDevice.cxx:66
o2::devices::O2SimDevice::~O2SimDevice
~O2SimDevice() final
Default destructor.
Definition
O2SimDevice.cxx:37
o2::devices::O2SimDevice::O2SimDevice
O2SimDevice(o2::steer::O2MCApplication *vmcapp, TVirtualMC *vmc)
Definition
O2SimDevice.h:44
o2::devices::O2SimDevice::O2SimDevice
O2SimDevice()=default
o2::devices::O2SimDevice::PostRun
void PostRun() final
Definition
O2SimDevice.cxx:266
o2::devices::O2SimDevice::isWorkAvailable
bool isWorkAvailable(fair::mq::Channel &statuschannel, int workerID=-1)
Definition
O2SimDevice.cxx:87
o2::devices::O2SimDevice::InitTask
void InitTask() final
Overloads the InitTask() method of fair::mq::Device.
Definition
O2SimDevice.cxx:46
o2::devices::O2SimDevice::lateInit
void lateInit()
Definition
O2SimDevice.cxx:60
o2::devices::O2SimDevice::ConditionalRun
bool ConditionalRun() final
Overloads the ConditionalRun() method of fair::mq::Device.
Definition
O2SimDevice.cxx:261
o2::gpu::GPUTPCCFCheckPadBaseline
Definition
GPUTPCCFCheckPadBaseline.h:48
o2::steer::O2MCApplication
Definition
O2MCApplication.h:37
message
GLuint GLsizei const GLchar * message
Definition
glcorearb.h:2517
fair
Definition
ASoA.h:45
o2::steer
Definition
DigitizationContext.h:31
o2
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Definition
FlattenRestore.h:23
std
Definition
CcdbObjectInfo.h:121
run
O2SimDevice.h
Generated on Sat Oct 3 2026 10:55:17 for Project by
1.9.8