13 #include <boost/algorithm/string/split.hpp>
14 #include <boost/algorithm/string/classification.hpp>
15 #include <boost/lexical_cast.hpp>
18 using namespace magneticfield;
24 geometryVersion = pset.
getParameter<
int>(
"geometryVersion");
28 typedef vector<edm::ParameterSet> VPSet;
31 if (fileSpec.size()!=0) {
32 for(VPSet::const_iterator rule = fileSpec.begin(); rule != fileSpec.end(); ++rule){
33 string s_volumes = rule->getParameter<
string>(
"volumes");
34 string s_sectors = rule->getParameter<
string>(
"sectors");
35 int master = rule->getParameter<
int>(
"master");
36 string path = rule->getParameter<
string>(
"path");
38 vector<unsigned>
volumes = expandList(s_volumes);
39 vector<unsigned>
sectors = expandList(s_sectors);
42 cout <<
"Volumes: " << s_volumes <<
" Sectors: " << s_sectors
43 <<
" Master: " << master <<
" Path: " << path << endl;
44 cout <<
" Expanded volumes: ";
45 copy(volumes.begin(), volumes.end(), ostream_iterator<unsigned>(
cout,
" "));
47 cout <<
" Expanded sectors: ";
48 copy(sectors.begin(), sectors.end(), ostream_iterator<unsigned>(
cout,
" "));
52 for (vector<unsigned>::iterator
i = volumes.begin();
i!=volumes.end(); ++
i){
53 for (vector<unsigned>::iterator
j = sectors.begin();
j!=sectors.end(); ++
j){
54 unsigned vpacked = (*i)*100+(*j);
55 if (gridFiles.find(vpacked)==gridFiles.end()) {
56 gridFiles[vpacked] = make_pair(path, master);
58 throw cms::Exception(
"ConfigurationError") <<
"VolumeBasedMagneticFieldESProducer: malformed gridFiles config parameter" << endl;
72 slaveFieldVersion = pset.
getParameter<
string>(
"paramLabel");
74 if (pset.
existsAs<vector<double> >(
"paramData")) {
75 slaveFieldParameters = pset.
getParameter<vector<double> >(
"paramData");
85 for (vstring::const_iterator
i= v1.begin();
i!=v1.end(); ++
i){
88 unsigned start = boost::lexical_cast<
unsigned>(v2.front());
89 unsigned end = boost::lexical_cast<
unsigned>(v2.back());
90 if ((v2.size()>2) || (start>end)) {
91 throw cms::Exception(
"ConfigurationError") <<
"VolumeBasedMagneticFieldESProducerFromDB: malformed configuration" << list << endl;
93 for (
unsigned k = start;
k<=
end; ++
k){
T getParameter(std::string const &) const
tuple start
Check for commandline option errors.
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
std::vector< unsigned > expandList(const std::string &list)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run