LDMX Software
TrackersTrackingGeometryProvider.cxx
1
4#include "Framework/Configure/Parameters.h"
5#include "Framework/Process.h"
6#include "Tracking/geo/GeometryContext.h"
7#include "Tracking/geo/TrackersTrackingGeometry.h"
8
9namespace tracking::geo {
10
16 public:
18 const std::string& name, const std::string& tag_name,
19 const framework::config::Parameters& parameters,
29 std::pair<const framework::ConditionsObject*, framework::ConditionsIOV>
30 getCondition(const ldmx::EventHeader& context) final override;
31
32 private:
34 std::string detector_;
36 bool debug_;
37};
38
39TrackersTrackingGeometryProvider::TrackersTrackingGeometryProvider(
40 const std::string& name, const std::string& tag_name,
41 const framework::config::Parameters& parameters,
42 framework::Process& process)
43 : framework::ConditionsObjectProvider(name, tag_name, parameters, process) {
44 detector_ = parameters.getParameter<std::string>("detector");
45 debug_ = parameters.getParameter<bool>("debug");
46}
47
48std::pair<const framework::ConditionsObject*, framework::ConditionsIOV>
50 const ldmx::EventHeader& context) {
59 auto [condition, iov] =
61
62 auto the_context = dynamic_cast<const GeometryContext*>(condition);
63
71 return std::make_pair(
72 new TrackersTrackingGeometry(the_context->get(), detector_, debug_), iov);
73}
74} // namespace tracking::geo
75
76DECLARE_CONDITIONS_PROVIDER_NS(tracking::geo, TrackersTrackingGeometryProvider);
Base class for provider of conditions information like pedestals, gains, electronics maps,...
#define DECLARE_CONDITIONS_PROVIDER_NS(NS, CLASS)
Macro which allows the framework to construct a producer given its name during configuration.
Base class for conditions information like pedestals, gains, electronics maps, etc.
Class which represents the process under execution.
be configured to load conditions objects from CSV files.
Base class for all providers of conditions objects.
std::pair< const ConditionsObject *, ConditionsIOV > requestParentCondition(const std::string &name, const ldmx::EventHeader &context)
Request another condition needed to construct this condition.
const Process & process() const
Get the process handle.
Class which represents the process under execution.
Definition Process.h:36
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
T getParameter(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:89
Provides header information an event such as event number and timestamp.
Definition EventHeader.h:44
The context for a specific geometry.
static const std::string NAME
Conditions object name.
std::string detector_
the path to the detector we will use for tracking
std::pair< const framework::ConditionsObject *, framework::ConditionsIOV > getCondition(const ldmx::EventHeader &context) final override
create the tracking geometry as configured by the input parameters, using the input context to update...
All classes in the ldmx-sw project use this namespace.
Definition PerfDict.cxx:45
Visualization.