Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F19251728
get_analysis.cc
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
get_analysis.cc
View Options
/**
* \authors The HEJ collaboration (see AUTHORS for details)
* \date 2019
* \copyright GPLv2 or later
*/
#include
"HEJ/get_analysis.hh"
#include
<dlfcn.h>
#include
<string>
#include
"yaml-cpp/yaml.h"
#include
"HEJ/EmptyAnalysis.hh"
#include
"HEJ/RivetAnalysis.hh"
namespace
HEJ
{
std
::
unique_ptr
<
Analysis
>
get_analysis
(
YAML
::
Node
const
&
parameters
){
if
(
!
parameters
[
"plugin"
]){
if
(
parameters
[
"rivet"
])
return
RivetAnalysis
::
create
(
parameters
);
return
EmptyAnalysis
::
create
(
parameters
);
}
using
AnalysisMaker
=
std
::
unique_ptr
<
Analysis
>
(
*
)(
YAML
::
Node
);
const
auto
plugin_name
=
parameters
[
"plugin"
].
as
<
std
::
string
>
();
auto
handle
=
dlopen
(
plugin_name
.
c_str
(),
RTLD_NOW
);
char
*
error
=
dlerror
();
if
(
error
!=
nullptr
)
throw
std
::
runtime_error
(
error
);
void
*
sym
=
dlsym
(
handle
,
"make_analysis"
);
error
=
dlerror
();
if
(
error
!=
nullptr
)
throw
std
::
runtime_error
(
error
);
auto
make_analysis
=
reinterpret_cast
<
AnalysisMaker
>
(
sym
);
return
make_analysis
(
parameters
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Tue, Sep 30, 6:09 AM (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6405135
Default Alt Text
get_analysis.cc (1 KB)
Attached To
Mode
rHEJ HEJ
Attached
Detach File
Event Timeline
Log In to Comment