Project
Loading...
Searching...
No Matches
Plugin.cxx
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
#include "
Framework/Plugins.h
"
13
#include "
Framework/ServiceHandle.h
"
14
#include "
Framework/ServiceSpec.h
"
15
#include "
Framework/CommonServices.h
"
16
#include "
Framework/O2DatabasePDGPlugin.h
"
17
#include "TDatabasePDG.h"
18
#include "
SimulationDataFormat/O2DatabasePDG.h
"
19
20
using namespace
o2::framework
;
21
22
struct
PDGSupport
:
o2::framework::ServicePlugin
{
23
o2::framework::ServiceSpec
*
create
() final
24
{
25
return
new
ServiceSpec
{
26
.
name
=
"database-pdg"
,
27
.init = [](
ServiceRegistryRef
,
DeviceState
&, fair::mq::ProgOptions&) ->
ServiceHandle
{
28
auto
* wrapper =
new
o2::framework::O2DatabasePDG
();
29
auto
*
ptr
=
new
o2::framework::O2DatabasePDGImpl
();
30
o2::O2DatabasePDG::addALICEParticles
(
ptr
);
31
wrapper->setInstance(
ptr
);
32
return
ServiceHandle
{TypeIdHelpers::uniqueId<O2DatabasePDG>(), wrapper, ServiceKind::Serial,
"database-pdg"
};
33
},
34
.configure =
CommonServices::noConfiguration
(),
35
.exit = [](
ServiceRegistryRef
,
void
* service) { (*
reinterpret_cast<
O2DatabasePDG
*
>
(service))->Delete(); },
36
.
kind
= ServiceKind::Serial};
37
}
38
};
39
40
struct
PDGSupportOld
:
o2::framework::ServicePlugin
{
41
o2::framework::ServiceSpec
*
create
() final
42
{
43
return
new
ServiceSpec
{
44
.
name
=
"database-pdg-old"
,
45
.init = [](
ServiceRegistryRef
ref
,
DeviceState
&, fair::mq::ProgOptions&) ->
ServiceHandle
{
46
return
ServiceHandle
{TypeIdHelpers::uniqueId<TDatabasePDG>(),
ref
.get<
O2DatabasePDG
>().get(), ServiceKind::Serial,
"database-pdg-old"
};
47
},
48
.configure =
CommonServices::noConfiguration
(),
49
.kind = ServiceKind::Serial};
50
}
51
};
52
53
DEFINE_DPL_PLUGINS_BEGIN
54
DEFINE_DPL_PLUGIN_INSTANCE
(
PDGSupportOld
,
CustomService
);
55
DEFINE_DPL_PLUGIN_INSTANCE
(
PDGSupport
,
CustomService
);
56
DEFINE_DPL_PLUGINS_END
CommonServices.h
O2DatabasePDGPlugin.h
O2DatabasePDG.h
Plugins.h
DEFINE_DPL_PLUGIN_INSTANCE
#define DEFINE_DPL_PLUGIN_INSTANCE(NAME, KIND)
Definition
Plugins.h:112
DEFINE_DPL_PLUGINS_END
#define DEFINE_DPL_PLUGINS_END
Definition
Plugins.h:115
DEFINE_DPL_PLUGINS_BEGIN
#define DEFINE_DPL_PLUGINS_BEGIN
Definition
Plugins.h:107
ServiceHandle.h
ServiceSpec.h
ptr
TBranch * ptr
Definition
TTreePlugin.cxx:832
int
o2::O2DatabasePDG::addALICEParticles
static void addALICEParticles(TDatabasePDG *db=TDatabasePDG::Instance())
Definition
O2DatabasePDG.h:87
o2::framework::ServiceRegistryRef
Definition
ServiceRegistryRef.h:21
ref
GLint ref
Definition
glcorearb.h:291
o2::framework
Defining PrimaryVertex explicitly as messageable.
Definition
TFIDInfo.h:20
o2::framework::DplPluginKind::CustomService
@ CustomService
PDGSupportOld
Definition
Plugin.cxx:40
PDGSupportOld::create
o2::framework::ServiceSpec * create() final
Definition
Plugin.cxx:41
PDGSupport
Definition
Plugin.cxx:22
PDGSupport::create
o2::framework::ServiceSpec * create() final
Definition
Plugin.cxx:23
o2::framework::CommonServices::noConfiguration
static ServiceConfigureCallback noConfiguration()
Definition
CommonServices.h:54
o2::framework::DeviceState
Running state information of a given device.
Definition
DeviceState.h:34
o2::framework::O2DatabasePDGImpl
Definition
O2DatabasePDGPlugin.h:21
o2::framework::O2DatabasePDG
Definition
O2DatabasePDGPlugin.h:34
o2::framework::ServiceHandle
Definition
ServiceHandle.h:43
o2::framework::ServiceHandle::kind
ServiceKind kind
Kind of service.
Definition
ServiceHandle.h:49
o2::framework::ServicePlugin
Definition
ServiceSpec.h:321
o2::framework::ServiceSpec
Definition
ServiceSpec.h:138
o2::framework::ServiceSpec::name
std::string name
Name of the service.
Definition
ServiceSpec.h:140
Framework
PhysicsSupport
src
Plugin.cxx
Generated on Tue Feb 25 2025 23:16:41 for Project by
1.9.8