-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathEventSourceFactory.h
More file actions
53 lines (39 loc) · 1.36 KB
/
EventSourceFactory.h
File metadata and controls
53 lines (39 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once
#include "nuis/eventinput/NormalizedEventSource.h"
#ifdef NUISANCE_USE_BOOSTDLL
#include "boost/function.hpp"
#endif
#include "nuis/log.h"
#include "yaml-cpp/yaml.h"
#include <filesystem>
#include <vector>
namespace HepMC3 {
class GenRunInfo;
}
namespace nuis {
struct PathResolver : public nuis_named_log("EventInput") {
std::vector<std::filesystem::path> nuisance_event_paths;
PathResolver();
std::filesystem::path resolve(std::string const &filepath);
};
class EventSourceFactory : public nuis_named_log("EventInput") {
PathResolver resolv;
#ifdef NUISANCE_USE_BOOSTDLL
using IEventSource_PluginFactory_t = IEventSourcePtr(YAML::Node const &);
std::map<std::filesystem::path, boost::function<IEventSource_PluginFactory_t>>
pluginfactories;
#endif
public:
EventSourceFactory();
// Add a path to the search path list for input files
void add_event_path(std::filesystem::path path);
std::pair<std::shared_ptr<HepMC3::GenRunInfo>, NormalizedEventSourcePtr>
make(YAML::Node const &cfg);
std::pair<std::shared_ptr<HepMC3::GenRunInfo>, NormalizedEventSourcePtr>
make(std::string const &filepath);
std::pair<std::shared_ptr<HepMC3::GenRunInfo>, IEventSourcePtr>
make_unnormalized(YAML::Node cfg);
std::pair<std::shared_ptr<HepMC3::GenRunInfo>, IEventSourcePtr>
make_unnormalized(std::string const &filepath);
};
} // namespace nuis