42 #include <boost/algorithm/string/split.hpp>
43 #include <boost/algorithm/string/classification.hpp>
44 #include <boost/lexical_cast.hpp>
47 using namespace magneticfield;
50 namespace magneticfield {
71 VolumeBasedMagneticFieldESProducerFromDB::VolumeBasedMagneticFieldESProducerFromDB(
const edm::ParameterSet& iConfig) : pset(iConfig)
75 nominalLabels ={
"3.8T",
"0T",
"2T",
"3T",
"3.5T",
"3.8T",
"4T"};
92 current = rInfo->m_avg_current;
93 message =
" (from RunInfo DB)";
95 message =
" (from valueOverride card)";
98 edm::LogInfo(
"MagneticField|AutoMagneticField") <<
"Current: " << current << message <<
"; using map configuration with label: " << configLabel;
106 cout <<
"VolumeBasedMagneticFieldESProducerFromDB::produce() " << conf->
version << endl;
114 if (conf->
version ==
"parametrizedMagneticField") {
124 if (conf->
keys.size() != 0) {
138 DDName ddName(
"cmsMagneticField:MAGF");
141 std::auto_ptr<DDCompactView> cpv(
new DDCompactView(rootNode));
145 std::unique_ptr<std::vector<unsigned char> > tb = (*gdd).getUncompressedBlob();
146 parser.
parse(*tb, tb->size());
std::string closerNominalLabel(float current)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int parse(const DDLDocumentProvider &dp)
Parse all files. Return is meaningless.
std::vector< MagBLayer * > barrelLayers() const
Get barrel layers.
DDName is used to identify DDD entities uniquely.
std::vector< std::string > nominalLabels
type of data representation of DDCompactView
std::vector< double > values
static std::auto_ptr< MagneticField > get(std::string version, const edm::ParameterSet ¶meters)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
std::vector< int > nominalCurrents
magneticfield::TableFileMap gridFiles
Specification of which data table is to be used for each volume.
std::vector< MagVolume6Faces * > barrelVolumes() const
std::string slaveFieldVersion
Label or type of the tracker parametrization.
const DepRecordT & getRecord() const
static value_type & instance()
virtual void build(const DDCompactView &cpv)
virtual void setUserNS(bool userns)
A DDLogicalPart aggregates information concerning material, solid and sensitveness ...
std::vector< MagESector * > endcapSectors() const
Get endcap layers.
std::vector< int > keys
Scaling factors for the field in specific volumes.
void clearFiles()
Clear the file list - see Warning!
DDLSAX2FileHandler * getDDLSAX2FileHandler()
To get the parent this class allows access to the handler.
DDLParser is the main class of Detector Description Language Parser.
std::string version
Version of the data tables to be used.
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
void setScaling(const std::vector< int > &keys, const std::vector< double > &values)
std::vector< MagVolume6Faces * > endcapVolumes() const
int geometryVersion
Version of the geometry to be used.
std::auto_ptr< MagneticField > produce(const IdealMagneticFieldRecord &iRecord)
void setGridFiles(const magneticfield::TableFileMap &gridFiles)
std::vector< double > slaveFieldParameters