|
|
Go to the documentation of this file.
62 static std::string_view closerNominalLabel(
float current);
76 VolumeBasedMagneticFieldESProducerFromDB::VolumeBasedMagneticFieldESProducerFromDB(
const edm::ParameterSet& iConfig)
77 : debug_(iConfig.getUntrackedParameter<
bool>(
"debugBuilder")) {
81 const int current = iConfig.
getParameter<
int>(
"valueOverride");
91 <<
" (from RunInfo DB); using map configuration with label: " <<
label;
92 return iGet(
"",
label);
100 <<
" (from valueOverride card); using map configuration with label: " <<
label;
114 if (iConfig->
version ==
"parametrizedMagneticField") {
115 return iGet.nothing();
128 return std::shared_ptr<MagFieldConfig const>(
config.product(), [](
auto*) {});
136 return std::shared_ptr<MagFieldConfig const>(
config.product(), [](
auto*) {});
144 std::unique_ptr<MagneticField> paramField =
147 edm::LogInfo(
"MagneticField") <<
"Version: " << conf->version <<
" geometryVersion: " << conf->geometryVersion
148 <<
" slaveFieldVersion: " << conf->slaveFieldVersion;
150 if (conf->version ==
"parametrizedMagneticField") {
159 if (!conf->keys.empty()) {
164 if (!conf->gridFiles.empty()) {
175 parser.getDDLSAX2FileHandler()->setUserNS(
true);
177 std::unique_ptr<std::vector<unsigned char> > tb = blob->getUncompressedBlob();
178 parser.parse(*tb, tb->size());
184 return std::make_unique<VolumeBasedMagneticField>(conf->geometryVersion,
191 paramField.release(),
196 constexpr std::array<int, 7>
nominalCurrents = {{-1, 0, 9558, 14416, 16819, 18268, 19262}};
197 constexpr std::array<std::string_view, 7> nominalLabels = {{
"3.8T",
"0T",
"2T",
"3T",
"3.5T",
"3.8T",
"4T"}};
200 for (;
i < (
int)nominalLabels.size() - 1;
i++) {
202 return nominalLabels[
i];
204 return nominalLabels[
i];
210 desc.
add<
int>(
"valueOverride", -1)->setComment(
"Force value of current (in A); take the value from DB if < 0.");
ParameterDescriptionBase * add(U const &iLabel, T const &value)
constexpr std::array< int, 7 > nominalCurrents
static std::unique_ptr< MagneticField > get(std::string version, const edm::ParameterSet ¶meters)
DDName is used to identify DDD entities uniquely.
edm::ESGetToken< MagFieldConfig, MagFieldConfigRcd > mayGetConfigToken_
ESHandle< ProductT > getHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
std::shared_ptr< MagFieldConfig const > chooseConfigAtRuntime(const IdealMagneticFieldRecord &iRecord)
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
std::string version
Version of the data tables to be used.
int geometryVersion
Version of the geometry to be used.
T getUntrackedParameter(std::string const &, T const &) const
std::vector< MagBLayer * > barrelLayers() const
Get barrel layers.
void setScaling(const std::vector< int > &keys, const std::vector< double > &values)
static std::string_view closerNominalLabel(float current)
Compact representation of the geometrical detector hierarchy.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void setGridFiles(const magneticfield::TableFileMap &gridFiles)
ESTransientHandle< ProductT > getTransientHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESGetToken< FileBlob, MFGeometryFileRcd > mayConsumeBlobToken_
virtual void build(const DDCompactView &cpv)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
std::vector< MagESector * > endcapSectors() const
Get endcap layers.
std::shared_ptr< MagFieldConfig const > chooseConfigViaParameter(const IdealMagneticFieldRecord &iRecord)
DDLParser is the main class of Detector Description Language Parser.
std::unique_ptr< MagneticField > produce(const IdealMagneticFieldRecord &iRecord)
std::vector< MagVolume6Faces * > endcapVolumes() const
edm::ESGetToken< MagFieldConfig, IdealMagneticFieldRecord > chosenConfigToken_
T getParameter(std::string const &) const
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
edm::ESGetToken< MagFieldConfig, MagFieldConfigRcd > knownFromParamConfigToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< MagVolume6Faces * > barrelVolumes() const
void addDefault(ParameterSetDescription const &psetDescription)