13 #include <boost/algorithm/string/split.hpp>
14 #include <boost/algorithm/string/classification.hpp>
17 using namespace magneticfield;
21 geometryVersion = pset.
getParameter<
int>(
"geometryVersion");
24 typedef vector<edm::ParameterSet>
VPSet;
27 if (!fileSpec.empty()) {
28 for (VPSet::const_iterator rule = fileSpec.begin(); rule != fileSpec.end(); ++rule) {
29 string s_volumes = rule->getParameter<
string>(
"volumes");
30 string s_sectors = rule->getParameter<
string>(
"sectors");
31 int master = rule->getParameter<
int>(
"master");
32 string path = rule->getParameter<
string>(
"path");
34 vector<unsigned> volumes = expandList(s_volumes);
35 vector<unsigned>
sectors = expandList(s_sectors);
38 cout <<
"Volumes: " << s_volumes <<
" Sectors: " << s_sectors <<
" Master: " << master <<
" Path: " << path
40 cout <<
" Expanded volumes: ";
41 copy(volumes.begin(), volumes.end(), ostream_iterator<unsigned>(
cout,
" "));
43 cout <<
" Expanded sectors: ";
44 copy(sectors.begin(), sectors.end(), ostream_iterator<unsigned>(
cout,
" "));
48 for (vector<unsigned>::iterator
i = volumes.begin();
i != volumes.end(); ++
i) {
49 for (vector<unsigned>::iterator
j = sectors.begin();
j != sectors.end(); ++
j) {
50 unsigned vpacked = (*i) * 100 + (*j);
51 if (gridFiles.find(vpacked) == gridFiles.end()) {
52 gridFiles[vpacked] = make_pair(path, master);
55 <<
"VolumeBasedMagneticFieldESProducer: malformed gridFiles config parameter" << endl;
68 slaveFieldVersion = pset.
getParameter<
string>(
"paramLabel");
70 if (pset.
existsAs<vector<double> >(
"paramData")) {
71 slaveFieldParameters = pset.
getParameter<vector<double> >(
"paramData");
80 for (vstring::const_iterator
i = v1.begin();
i != v1.end(); ++
i) {
83 unsigned start = std::stoul(v2.front());
84 unsigned end = std::stoul(v2.back());
85 if ((v2.size() > 2) || (start > end)) {
87 <<
"VolumeBasedMagneticFieldESProducerFromDB: malformed configuration" << list << endl;
89 for (
unsigned k = start;
k <=
end; ++
k) {
Master< F > master(const F &f)
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
T getParameter(std::string const &) const
std::vector< unsigned > expandList(const std::string &list)