18 want_d2e_ = parameters.getParameter<
bool>(
"want_d2e");
19 cell_map_ = parameters.getParameter<std::string>(
"cell_map");
20 motherboard_map_ = parameters.getParameter<std::string>(
"motherboard_map");
21 layer_map_ = parameters.getParameter<std::string>(
"layer_map");
32 return std::make_pair(
45 std::string cell_map_;
46 std::string motherboard_map_;
47 std::string layer_map_;
52 const std::string& motherboard_map,
53 const std::string& layer_map,
bool want_d2e)
54 :
framework::ConditionsObject(CONDITIONS_OBJECT_NAME),
55 ldmx::ElectronicsMap<ldmx::EcalElectronicsID, ldmx::EcalID>(want_d2e) {
86 elinks_.push_back(mli);
97 layers_.push_back(mpl);
104 for (
auto olink : layers_) {
105 for (
auto elink : elinks_) {
107 if (elink.motherboard_type != olink.motherboard_type)
continue;
109 for (
auto cell : cells_) {
111 if (elink.rocid != cell.rocid ||
112 elink.roc_elink_number != cell.roc_elink_number)
116 ldmx::EcalID precisionId(olink.layer, elink.module, cell.module_cellid);
118 elink.polarfire_elink,
119 cell.roc_elink_channel);
121 if (this->
exists(elecId)) {
122 std::stringstream ss;
123 ss <<
"Two different mappings for electronics channel " << elecId;
124 EXCEPTION_RAISE(
"DuplicateMapping", ss.str());
126 this->
addEntry(elecId, precisionId);
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 which contains logic for how the detector items connect to and relate with the reconstruction c...
Class which parses a CSV file and provides the rows one at a time to a user The parser ignores any li...
bool nextRow()
Advance to next row if possible.
int getInteger(const std::string &colname, bool ignore_case=true) const
Get the value for the given column in the current row as an integer.
Specialization of the GeneralCSVLoader for loading from a file/stream.
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)
Pure virtual getCondition function.
Class which provides various information about how the parts of the Ecal connect to each other.
void loadCellMap(conditions::GeneralCSVLoader &loader)
import cell map from the provided CSV loader
void loadMotherboardMap(conditions::GeneralCSVLoader &loader)
import motherboard map from the provided CSV loader
static constexpr const char * CONDITIONS_OBJECT_NAME
The name of the EID <-> DetID map for the ECal.
EcalDetectorMap(const std::string &cell_map, const std::string &motherboard_map, const std::string &layer_map, bool want_d2e)
Default constructor which builds the necessary maps.
void buildElectronicsMap()
build the electronics map from loaded maps
void loadLayerMap(conditions::GeneralCSVLoader &loader)
import layer map from the provided CSV loader
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.
ConditionsObjectProvider(const std::string &objname, const std::string &tagname, const framework::config::Parameters ¶meters, Process &process)
Class constructor.
Base class for all conditions objects, very simple.
Class which represents the process under execution.
Class encapsulating parameters for configuring a processor.
Identifies a location in the Ecal readout chain.
Extension of DetectorID providing access to ECal layers and cell numbers in a hex grid.
void addEntry(ldmx::EcalElectronicsID eid, ldmx::EcalID did)
bool exists(ldmx::EcalElectronicsID eid) const
All classes in the ldmx-sw project use this namespace.
Table of per-layer motherboard layouts.
int daq_opticallink
mother global optical link number
int motherboard_type
mother board type