7#include "Framework/RunHeader.h"
51 else if (hcalGeometry_ !=
nullptr &&
55 "Attempting to run a single job with multiple geometries " +
60 EXCEPTION_RAISE(
"GeometryException",
61 "HcalGeometryProvider unable to get the name of the "
62 "detector from the RunHeader.");
74 const std::string& name,
const std::string& tagname,
79 tagname, parameters, process},
85 if (hcalGeometry_)
delete hcalGeometry_;
89std::pair<const framework::ConditionsObject*, framework::ConditionsIOV>
91 static const std::string KEYNAME(
"detectors_valid");
101 for (
auto key : phex.
keys()) {
105 if (!pver.
exists(KEYNAME)) {
106 ldmx_log(warn) <<
"No parameter " << KEYNAME <<
" found in " << key;
111 std::vector<std::string> dets_valid =
113 for (
auto detregex : dets_valid) {
114 std::string regex(detregex);
115 if (regex.empty())
continue;
116 if (regex[0] !=
'^') regex.insert(0, 1,
'^');
117 if (regex.back() !=
'$') regex +=
'$';
121 regcomp(®, regex.c_str(), REG_EXTENDED | REG_ICASE | REG_NOSUB);
124 regerror(rv, ®, err, 1024);
127 "Invalid detector regular expression : '" + regex +
"' " + err);
136 if (hcalGeometry_)
break;
138 if (!hcalGeometry_) {
139 EXCEPTION_RAISE(
"GeometryException",
"Unable to create HcalGeometry");
143 return std::make_pair(
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.
Class that translates HCal ID into positions of strip hits.
be configured to load conditions objects from CSV files.
Class which defines the run/event/type range for which a given condition is valid,...
Base class for all providers of conditions objects.
const Process & process() const
Get the process handle.
Base class for all conditions objects, very simple.
Class which represents the process under execution.
Class encapsulating parameters for configuring a processor.
std::vector< std::string > keys() const
Get a list of the keys available.
T getParameter(const std::string &name) const
Retrieve the parameter of the given name.
bool exists(const std::string &name) const
Check to see if a parameter exists.
virtual ~HcalGeometryProvider()
Destructor.
virtual void releaseConditionsObject(const framework::ConditionsObject *co)
Take no action on release, as the object is permanently owned by the Provider.
virtual std::pair< const framework::ConditionsObject *, framework::ConditionsIOV > getCondition(const ldmx::EventHeader &context)
Provides access to the HcalGeometry.
virtual void onNewRun(ldmx::RunHeader &rh)
Callback for the ConditionsObjectProvider to take any necessary action when the processing of events ...
framework::config::Parameters params_
Handle to the parameters, needed for future use during get condition.
std::string detectorGeometry_
Geometry as last used.
HcalGeometryProvider(const std::string &name, const std::string &tagname, const framework::config::Parameters ¶meters, framework::Process &process)
Class constructor.
Implementation of HCal strip readout.
All classes in the ldmx-sw project use this namespace.