00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00011
00012 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00013 #include "FWCore/ParameterSet/interface/Registry.h"
00014 #include "FWCore/ParameterSet/interface/split.h"
00015 #include "FWCore/Utilities/interface/Algorithms.h"
00016 #include "FWCore/Utilities/interface/Digest.h"
00017 #include "FWCore/Utilities/interface/EDMException.h"
00018
00019 #include "boost/bind.hpp"
00020
00021 #include <algorithm>
00022 #include <iostream>
00023 #include <sstream>
00024 #include <cassert>
00025
00026
00027
00028
00029
00030 namespace edm {
00031
00032 void
00033 ParameterSet::invalidateRegistration(std::string const& nameOfTracked) const {
00034
00035 if(isRegistered()) {
00036 id_ = ParameterSetID();
00037 if(!nameOfTracked.empty()) {
00038
00039 LogInfo("ParameterSet") << "Warning: You have added a new tracked parameter\n"
00040 << "'" << nameOfTracked << "' to a previously registered parameter set.\n"
00041 << "This is a bad idea because the new parameter(s) will not be recorded.\n"
00042 << "Use the forthcoming ParameterSetDescription facility instead.\n"
00043 << "A warning is given only for the first such parameter in a pset.\n";
00044 }
00045 }
00046 assert(!isRegistered());
00047 }
00048
00049
00050
00051
00052
00053 ParameterSet::ParameterSet() :
00054 tbl_(),
00055 psetTable_(),
00056 vpsetTable_(),
00057 id_() {
00058 }
00059
00060
00061
00062
00063 ParameterSet::ParameterSet(std::string const& code) :
00064 tbl_(),
00065 psetTable_(),
00066 vpsetTable_(),
00067 id_() {
00068 if(!fromString(code)) {
00069 throw Exception(errors::Configuration, "InvalidInput")
00070 << "The encoded configuration string "
00071 << "passed to a ParameterSet during construction is invalid:\n"
00072 << code;
00073 }
00074 }
00075
00076
00077
00078
00079 ParameterSet::ParameterSet(std::string const& code, ParameterSetID const& id) :
00080 tbl_(),
00081 psetTable_(),
00082 vpsetTable_(),
00083 id_(id) {
00084 if(!fromString(code)) {
00085 throw Exception(errors::Configuration, "InvalidInput")
00086 << "The encoded configuration string "
00087 << "passed to a ParameterSet during construction is invalid:\n"
00088 << code;
00089 }
00090 pset::Registry::instance()->insertMapped(*this);
00091 }
00092
00093 ParameterSet::~ParameterSet() {}
00094
00095 ParameterSet::ParameterSet(ParameterSet const& other)
00096 : tbl_(other.tbl_),
00097 psetTable_(other.psetTable_),
00098 vpsetTable_(other.vpsetTable_),
00099 id_(other.id_) {
00100 }
00101
00102 ParameterSet& ParameterSet::operator=(ParameterSet const& other) {
00103 ParameterSet temp(other);
00104 swap(temp);
00105 return *this;
00106 }
00107
00108 void ParameterSet::copyForModify(ParameterSet const& other) {
00109 ParameterSet temp(other);
00110 swap(temp);
00111 id_ = ParameterSetID();
00112 }
00113
00114 void ParameterSet::swap(ParameterSet& other) {
00115 tbl_.swap(other.tbl_);
00116 psetTable_.swap(other.psetTable_);
00117 vpsetTable_.swap(other.vpsetTable_);
00118 id_.swap(other.id_);
00119 }
00120
00121 ParameterSet const& ParameterSet::registerIt() {
00122 if(!isRegistered()) {
00123 calculateID();
00124 pset::Registry::instance()->insertMapped(*this);
00125 }
00126 return *this;
00127 }
00128
00129 std::auto_ptr<ParameterSet> ParameterSet::popParameterSet(std::string const& name) {
00130 assert(!isRegistered());
00131 psettable::iterator it = psetTable_.find(name);
00132 assert(it != psetTable_.end());
00133 std::auto_ptr<ParameterSet> pset(new ParameterSet);
00134 std::swap(*pset, it->second.pset());
00135 psetTable_.erase(it);
00136 return pset;
00137 }
00138
00139 void ParameterSet::eraseSimpleParameter(std::string const& name) {
00140 assert(!isRegistered());
00141 table::iterator it = tbl_.find(name);
00142 assert(it != tbl_.end());
00143 tbl_.erase(it);
00144 }
00145
00146 void ParameterSet::eraseOrSetUntrackedParameterSet(std::string const& name) {
00147 assert(!isRegistered());
00148 psettable::iterator it = psetTable_.find(name);
00149 assert(it != psetTable_.end());
00150 ParameterSet& pset = it->second.pset();
00151 if (pset.isRegistered()) {
00152 it->second.setIsTracked(false);
00153 } else {
00154 psetTable_.erase(it);
00155 }
00156 }
00157
00158 std::auto_ptr<std::vector<ParameterSet> > ParameterSet::popVParameterSet(std::string const& name) {
00159 assert(!isRegistered());
00160 vpsettable::iterator it = vpsetTable_.find(name);
00161 assert(it != vpsetTable_.end());
00162 std::auto_ptr<std::vector<ParameterSet> > vpset(new std::vector<ParameterSet>);
00163 std::swap(*vpset, it->second.vpset());
00164 vpsetTable_.erase(it);
00165 return vpset;
00166 }
00167
00168 void ParameterSet::calculateID() {
00169
00170 for(psettable::iterator i = psetTable_.begin(), e = psetTable_.end(); i != e; ++i) {
00171 if(!i->second.pset().isRegistered()) {
00172 i->second.pset().registerIt();
00173 }
00174 i->second.updateID();
00175 }
00176
00177
00178 for(vpsettable::iterator i = vpsetTable_.begin(), e = vpsetTable_.end(); i != e; ++i) {
00179 i->second.registerPsetsAndUpdateIDs();
00180 }
00181
00182
00183
00184
00185
00186
00187 cms::Digest newDigest;
00188 toDigest(newDigest);
00189 id_ = ParameterSetID(newDigest.digest().toString());
00190
00191 assert(isRegistered());
00192 }
00193
00194
00195
00196 ParameterSetID
00197 ParameterSet::id() const {
00198
00199 if(!isRegistered()) {
00200 throw Exception(errors::LogicError)
00201 << "ParameterSet::id() called prematurely\n"
00202 << "before ParameterSet::registerIt() has been called.\n";
00203 }
00204 return id_;
00205 }
00206
00207 void ParameterSet::setID(ParameterSetID const& id) const {
00208 id_ = id;
00209 }
00210
00211
00212
00213
00214
00215 Entry const*
00216 ParameterSet::getEntryPointerOrThrow_(char const* name) const {
00217 return getEntryPointerOrThrow_(std::string(name));
00218 }
00219
00220 Entry const*
00221 ParameterSet::getEntryPointerOrThrow_(std::string const& name) const {
00222 Entry const* result = retrieveUntracked(name);
00223 if(result == 0)
00224 throw Exception(errors::Configuration, "MissingParameter:")
00225 << "The required parameter '" << name
00226 << "' was not specified.\n";
00227 return result;
00228 }
00229
00230 template<typename T, typename U> T first(std::pair<T, U> const& p) {
00231 return p.first;
00232 }
00233
00234 template<typename T, typename U> U second(std::pair<T, U> const& p) {
00235 return p.second;
00236 }
00237
00238 Entry const&
00239 ParameterSet::retrieve(char const* name) const {
00240 return retrieve(std::string(name));
00241 }
00242
00243 Entry const&
00244 ParameterSet::retrieve(std::string const& name) const {
00245 table::const_iterator it = tbl_.find(name);
00246 if(it == tbl_.end()) {
00247 throw Exception(errors::Configuration, "MissingParameter:")
00248 << "Parameter '" << name
00249 << "' not found.";
00250 }
00251 if(it->second.isTracked() == false) {
00252 if(name[0] == '@') {
00253 throw Exception(errors::Configuration, "StatusMismatch:")
00254 << "Framework Error: Parameter '" << name
00255 << "' is incorrectly designated as tracked in the framework.";
00256 } else {
00257 throw Exception(errors::Configuration, "StatusMismatch:")
00258 << "Parameter '" << name
00259 << "' is designated as tracked in the code,\n"
00260 << "but is designated as untracked in the configuration file.\n"
00261 << "Please remove 'untracked' from the configuration file for parameter '"<< name << "'.";
00262 }
00263 }
00264 return it->second;
00265 }
00266
00267 Entry const*
00268 ParameterSet::retrieveUntracked(char const* name) const {
00269 return retrieveUntracked(std::string(name));
00270 }
00271
00272 Entry const*
00273 ParameterSet::retrieveUntracked(std::string const& name) const {
00274 table::const_iterator it = tbl_.find(name);
00275
00276 if(it == tbl_.end()) return 0;
00277 if(it->second.isTracked()) {
00278 if(name[0] == '@') {
00279 throw Exception(errors::Configuration, "StatusMismatch:")
00280 << "Framework Error: Parameter '" << name
00281 << "' is incorrectly designated as untracked in the framework.";
00282 } else {
00283 throw Exception(errors::Configuration, "StatusMismatch:")
00284 << "Parameter '" << name
00285 << "' is designated as untracked in the code,\n"
00286 << "but is not designated as untracked in the configuration file.\n"
00287 << "Please change the configuration file to 'untracked <type> " << name << "'.";
00288 }
00289 }
00290 return &it->second;
00291 }
00292
00293 ParameterSetEntry const&
00294 ParameterSet::retrieveParameterSet(std::string const& name) const {
00295 psettable::const_iterator it = psetTable_.find(name);
00296 if(it == psetTable_.end()) {
00297 throw Exception(errors::Configuration, "MissingParameter:")
00298 << "ParameterSet '" << name
00299 << "' not found.";
00300 }
00301 if(it->second.isTracked() == false) {
00302 if(name[0] == '@') {
00303 throw Exception(errors::Configuration, "StatusMismatch:")
00304 << "Framework Error: ParameterSet '" << name
00305 << "' is incorrectly designated as tracked in the framework.";
00306 } else {
00307 throw Exception(errors::Configuration, "StatusMismatch:")
00308 << "ParameterSet '" << name
00309 << "' is designated as tracked in the code,\n"
00310 << "but is designated as untracked in the configuration file.\n"
00311 << "Please remove 'untracked' from the configuration file for parameter '"<< name << "'.";
00312 }
00313 }
00314 return it->second;
00315 }
00316
00317 ParameterSetEntry const*
00318 ParameterSet::retrieveUntrackedParameterSet(std::string const& name) const {
00319 psettable::const_iterator it = psetTable_.find(name);
00320
00321 if(it == psetTable_.end()) return 0;
00322 if(it->second.isTracked()) {
00323 if(name[0] == '@') {
00324 throw Exception(errors::Configuration, "StatusMismatch:")
00325 << "Framework Error: ParameterSet '" << name
00326 << "' is incorrectly designated as untracked in the framework.";
00327 } else {
00328 throw Exception(errors::Configuration, "StatusMismatch:")
00329 << "ParameterSet '" << name
00330 << "' is designated as untracked in the code,\n"
00331 << "but is not designated as untracked in the configuration file.\n"
00332 << "Please change the configuration file to 'untracked <type> " << name << "'.";
00333 }
00334 }
00335 return &it->second;
00336 }
00337
00338 VParameterSetEntry const&
00339 ParameterSet::retrieveVParameterSet(std::string const& name) const {
00340 vpsettable::const_iterator it = vpsetTable_.find(name);
00341 if(it == vpsetTable_.end()) {
00342 throw Exception(errors::Configuration, "MissingParameter:")
00343 << "VParameterSet '" << name
00344 << "' not found.";
00345 }
00346 if(it->second.isTracked() == false) {
00347 throw Exception(errors::Configuration, "StatusMismatch:")
00348 << "VParameterSet '" << name
00349 << "' is designated as tracked in the code,\n"
00350 << "but is designated as untracked in the configuration file.\n"
00351 << "Please remove 'untracked' from the configuration file for parameter '"<< name << "'.";
00352 }
00353 return it->second;
00354 }
00355
00356 VParameterSetEntry const*
00357 ParameterSet::retrieveUntrackedVParameterSet(std::string const& name) const {
00358 vpsettable::const_iterator it = vpsetTable_.find(name);
00359
00360 if(it == vpsetTable_.end()) return 0;
00361 if(it->second.isTracked()) {
00362 throw Exception(errors::Configuration, "StatusMismatch:")
00363 << "VParameterSet '" << name
00364 << "' is designated as untracked in the code,\n"
00365 << "but is not designated as untracked in the configuration file.\n"
00366 << "Please change the configuration file to 'untracked <type> " << name << "'.";
00367 }
00368 return &it->second;
00369 }
00370
00371 Entry const*
00372 ParameterSet::retrieveUnknown(char const* name) const {
00373 return retrieveUnknown(std::string(name));
00374 }
00375
00376 Entry const*
00377 ParameterSet::retrieveUnknown(std::string const& name) const {
00378 table::const_iterator it = tbl_.find(name);
00379 if(it == tbl_.end()) {
00380 return 0;
00381 }
00382 return &it->second;
00383 }
00384
00385 ParameterSetEntry const*
00386 ParameterSet::retrieveUnknownParameterSet(std::string const& name) const {
00387 psettable::const_iterator it = psetTable_.find(name);
00388 if(it == psetTable_.end()) {
00389 return 0;
00390 }
00391 return &it->second;
00392 }
00393
00394 VParameterSetEntry const*
00395 ParameterSet::retrieveUnknownVParameterSet(std::string const& name) const {
00396 vpsettable::const_iterator it = vpsetTable_.find(name);
00397 if(it == vpsetTable_.end()) {
00398 return 0;
00399 }
00400 return &it->second;
00401 }
00402
00403
00404
00405
00406 std::string
00407 ParameterSet::getParameterAsString(std::string const& name) const {
00408 if(existsAs<ParameterSet>(name)) {
00409 return retrieveUnknownParameterSet(name)->toString();
00410 }
00411 else if(existsAs<std::vector<ParameterSet> >(name)) {
00412 return retrieveUnknownVParameterSet(name)->toString();
00413 }
00414 else if(exists(name)) {
00415 return retrieveUnknown(name)->toString();
00416 }
00417 else {
00418 throw Exception(errors::Configuration, "getParameterAsString")
00419 << "Cannot find parameter " << name << " in " << *this;
00420 }
00421 }
00422
00423
00424
00425
00426 void
00427 ParameterSet::insert(bool okay_to_replace, char const* name, Entry const& value) {
00428 insert(okay_to_replace, std::string(name), value);
00429 }
00430
00431 void
00432 ParameterSet::insert(bool okay_to_replace, std::string const& name, Entry const& value) {
00433
00434
00435 table::iterator it = tbl_.find(name);
00436
00437 if(it == tbl_.end()) {
00438 if(!tbl_.insert(std::make_pair(name, value)).second)
00439 throw Exception(errors::Configuration, "InsertFailure")
00440 << "cannot insert " << name
00441 << " into a ParameterSet\n";
00442 }
00443 else if(okay_to_replace) {
00444 it->second = value;
00445 }
00446 }
00447
00448 void ParameterSet::insertParameterSet(bool okay_to_replace, std::string const& name, ParameterSetEntry const& entry) {
00449
00450
00451 psettable::iterator it = psetTable_.find(name);
00452
00453 if(it == psetTable_.end()) {
00454 if(!psetTable_.insert(std::make_pair(name, entry)).second)
00455 throw Exception(errors::Configuration, "InsertFailure")
00456 << "cannot insert " << name
00457 << " into a ParameterSet\n";
00458 } else if(okay_to_replace) {
00459 it->second = entry;
00460 }
00461 }
00462
00463 void ParameterSet::insertVParameterSet(bool okay_to_replace, std::string const& name, VParameterSetEntry const& entry) {
00464
00465
00466 vpsettable::iterator it = vpsetTable_.find(name);
00467
00468 if(it == vpsetTable_.end()) {
00469 if(!vpsetTable_.insert(std::make_pair(name, entry)).second)
00470 throw Exception(errors::Configuration, "InsertFailure")
00471 << "cannot insert " << name
00472 << " into a VParameterSet\n";
00473 } else if(okay_to_replace) {
00474 it->second = entry;
00475 }
00476 }
00477
00478 void
00479 ParameterSet::augment(ParameterSet const& from) {
00480
00481 invalidateRegistration(std::string());
00482 if(&from == this) {
00483 return;
00484 }
00485
00486 for(table::const_iterator b = from.tbl_.begin(), e = from.tbl_.end(); b != e; ++b) {
00487 this->insert(false, b->first, b->second);
00488 }
00489 for(psettable::const_iterator b = from.psetTable_.begin(), e = from.psetTable_.end(); b != e; ++b) {
00490 this->insertParameterSet(false, b->first, b->second);
00491 }
00492 for(vpsettable::const_iterator b = from.vpsetTable_.begin(), e = from.vpsetTable_.end(); b != e; ++b) {
00493 this->insertVParameterSet(false, b->first, b->second);
00494 }
00495 }
00496
00497 void ParameterSet::copyFrom(ParameterSet const& from, std::string const& name) {
00498 invalidateRegistration(std::string());
00499 if(from.existsAs<ParameterSet>(name)) {
00500 this->insertParameterSet(false, name, *(from.retrieveUnknownParameterSet(name)));
00501 }
00502 else if(from.existsAs<std::vector<ParameterSet> >(name)) {
00503 this->insertVParameterSet(false, name, *(from.retrieveUnknownVParameterSet(name)));
00504 }
00505 else if(from.exists(name)) {
00506 this->insert(false, name, *(from.retrieveUnknown(name)));
00507 }
00508 else {
00509 throw Exception(errors::Configuration, "copyFrom")
00510 << "Cannot find parameter " << name << " in " << from;
00511 }
00512 }
00513
00514 ParameterSet*
00515 ParameterSet::getPSetForUpdate(std::string const& name, bool& isTracked) {
00516 assert(!isRegistered());
00517 isTracked = false;
00518 psettable::iterator it = psetTable_.find(name);
00519 if(it == psetTable_.end()) return 0;
00520 isTracked = it->second.isTracked();
00521 return &it->second.pset();
00522 }
00523
00524 VParameterSetEntry*
00525 ParameterSet::getPSetVectorForUpdate(std::string const& name) {
00526 assert(!isRegistered());
00527 vpsettable::iterator it = vpsetTable_.find(name);
00528 if(it == vpsetTable_.end()) return 0;
00529 return &it->second;
00530 }
00531
00532
00533
00534
00535
00536 void
00537 ParameterSet::toString(std::string& rep) const {
00538 toStringImp(rep, false);
00539 }
00540
00541 void
00542 ParameterSet::allToString(std::string& rep) const {
00543 toStringImp(rep, true);
00544 }
00545
00546 void
00547 ParameterSet::toStringImp(std::string& rep, bool useAll) const {
00548
00549 if(empty()) {
00550 rep += "<>";
00551 return;
00552 }
00553 size_t size = 1;
00554 for(table::const_iterator b = tbl_.begin(), e = tbl_.end(); b != e; ++b) {
00555 if(useAll || b->second.isTracked()) {
00556 size += 2;
00557 size += b->first.size();
00558 size += b->second.sizeOfString();
00559 }
00560 }
00561 for(psettable::const_iterator b = psetTable_.begin(), e = psetTable_.end(); b != e; ++b) {
00562 if(useAll || b->second.isTracked()) {
00563 size += 2;
00564 size += b->first.size();
00565 size += b->first.size();
00566 size += b->first.size();
00567 size += sizeof(ParameterSetID);
00568 }
00569 }
00570 for(vpsettable::const_iterator b = vpsetTable_.begin(), e = vpsetTable_.end(); b != e; ++b) {
00571 if(useAll || b->second.isTracked()) {
00572 size += 2;
00573 size += b->first.size();
00574 size += sizeof(ParameterSetID) * b->second.vpset().size();
00575 }
00576 }
00577
00578 rep.reserve(rep.size()+size);
00579 rep += '<';
00580 std::string start;
00581 std::string const between(";");
00582 for(table::const_iterator b = tbl_.begin(), e = tbl_.end(); b != e; ++b) {
00583 if(useAll || b->second.isTracked()) {
00584 rep += start;
00585 rep += b->first;
00586 rep += '=';
00587 b->second.toString(rep);
00588 start = between;
00589 }
00590 }
00591 for(psettable::const_iterator b = psetTable_.begin(), e = psetTable_.end(); b != e; ++b) {
00592 if(useAll || b->second.isTracked()) {
00593 rep += start;
00594 rep += b->first;
00595 rep += '=';
00596 b->second.toString(rep);
00597 start = between;
00598 }
00599 }
00600 for(vpsettable::const_iterator b = vpsetTable_.begin(), e = vpsetTable_.end(); b != e; ++b) {
00601 if(useAll || b->second.isTracked()) {
00602 rep += start;
00603 rep += b->first;
00604 rep += '=';
00605 b->second.toString(rep);
00606 start = between;
00607 }
00608 }
00609
00610 rep += '>';
00611 }
00612
00613 void
00614 ParameterSet::toDigest(cms::Digest &digest) const {
00615 digest.append("<", 1);
00616 bool started = false;
00617 for(table::const_iterator b = tbl_.begin(), e = tbl_.end(); b != e; ++b) {
00618 if(b->second.isTracked()) {
00619 if (started)
00620 digest.append(";", 1);
00621 digest.append(b->first);
00622 digest.append("=", 1);
00623 b->second.toDigest(digest);
00624 started = true;
00625 }
00626 }
00627 for(psettable::const_iterator b = psetTable_.begin(), e = psetTable_.end(); b != e; ++b) {
00628 if(b->second.isTracked()) {
00629 if (started)
00630 digest.append(";", 1);
00631 digest.append(b->first);
00632 digest.append("=", 1);
00633 b->second.toDigest(digest);
00634 started = true;
00635 }
00636 }
00637 for(vpsettable::const_iterator b = vpsetTable_.begin(), e = vpsetTable_.end(); b != e; ++b) {
00638 if(b->second.isTracked()) {
00639 if (started)
00640 digest.append(";", 1);
00641 digest.append(b->first);
00642 digest.append("=", 1);
00643 b->second.toDigest(digest);
00644 }
00645 }
00646
00647 digest.append(">",1);
00648 }
00649
00650 std::string
00651 ParameterSet::toString() const {
00652 std::string result;
00653 toString(result);
00654 return result;
00655 }
00656
00657
00658
00659 bool
00660 ParameterSet::fromString(std::string const& from) {
00661 std::vector<std::string> temp;
00662 if(!split(std::back_inserter(temp), from, '<', ';', '>'))
00663 return false;
00664
00665 tbl_.clear();
00666 for(std::vector<std::string>::const_iterator b = temp.begin(), e = temp.end(); b != e; ++b) {
00667
00668 std::string::const_iterator q = find_in_all(*b, '=');
00669 if(q == b->end())
00670 return false;
00671
00672
00673 std::string name = std::string(b->begin(), q);
00674 if(tbl_.find(name) != tbl_.end())
00675 return false;
00676
00677 std::string rep(q+1, b->end());
00678
00679 if(rep[0] == '-') {
00680 }
00681 if(rep[1] == 'Q') {
00682 ParameterSetEntry psetEntry(rep);
00683 if(!psetTable_.insert(std::make_pair(name, psetEntry)).second) {
00684 return false;
00685 }
00686 } else if(rep[1] == 'q') {
00687 VParameterSetEntry vpsetEntry(rep);
00688 if(!vpsetTable_.insert(std::make_pair(name, vpsetEntry)).second) {
00689 return false;
00690 }
00691 } else if(rep[1] == 'P') {
00692 Entry value(name, rep);
00693 ParameterSetEntry psetEntry(value.getPSet(), value.isTracked());
00694 if(!psetTable_.insert(std::make_pair(name, psetEntry)).second) {
00695 return false;
00696 }
00697 } else if(rep[1] == 'p') {
00698 Entry value(name, rep);
00699 VParameterSetEntry vpsetEntry(value.getVPSet(), value.isTracked());
00700 if(!vpsetTable_.insert(std::make_pair(name, vpsetEntry)).second) {
00701 return false;
00702 }
00703 } else {
00704
00705 Entry value(name, rep);
00706 if(!tbl_.insert(std::make_pair(name, value)).second) {
00707 return false;
00708 }
00709 }
00710 }
00711
00712 return true;
00713 }
00714
00715 std::vector<FileInPath>::size_type
00716 ParameterSet::getAllFileInPaths(std::vector<FileInPath>& output) const {
00717 std::vector<FileInPath>::size_type count = 0;
00718 table::const_iterator it = tbl_.begin();
00719 table::const_iterator end = tbl_.end();
00720 while (it != end) {
00721 Entry const& e = it->second;
00722 if(e.typeCode() == 'F') {
00723 ++count;
00724 output.push_back(e.getFileInPath());
00725 }
00726 ++it;
00727 }
00728 return count;
00729 }
00730
00731 std::vector<std::string>
00732 ParameterSet::getParameterNames() const {
00733 std::vector<std::string> returnValue;
00734 std::transform(tbl_.begin(), tbl_.end(), back_inserter(returnValue),
00735 boost::bind(&std::pair<std::string const, Entry>::first, _1));
00736 std::transform(psetTable_.begin(), psetTable_.end(), back_inserter(returnValue),
00737 boost::bind(&std::pair<std::string const, ParameterSetEntry>::first, _1));
00738 std::transform(vpsetTable_.begin(), vpsetTable_.end(), back_inserter(returnValue),
00739 boost::bind(&std::pair<std::string const, VParameterSetEntry>::first, _1));
00740 return returnValue;
00741 }
00742
00743 bool ParameterSet::exists(std::string const& parameterName) const {
00744 return(tbl_.find(parameterName) != tbl_.end() ||
00745 psetTable_.find(parameterName) != psetTable_.end() ||
00746 vpsetTable_.find(parameterName) != vpsetTable_.end());
00747 }
00748
00749 ParameterSet
00750 ParameterSet::trackedPart() const {
00751 ParameterSet result;
00752 for(table::const_iterator tblItr = tbl_.begin(); tblItr != tbl_.end(); ++tblItr) {
00753 if(tblItr->second.isTracked()) {
00754 result.tbl_.insert(*tblItr);
00755 }
00756 }
00757 for(psettable::const_iterator psetItr = psetTable_.begin(); psetItr != psetTable_.end(); ++psetItr) {
00758 if(psetItr->second.isTracked()) {
00759 result.addParameter<ParameterSet>(psetItr->first, psetItr->second.pset().trackedPart());
00760 }
00761 }
00762 for(vpsettable::const_iterator vpsetItr = vpsetTable_.begin(); vpsetItr != vpsetTable_.end(); ++vpsetItr) {
00763 if(vpsetItr->second.isTracked()) {
00764 VParameterSet vresult;
00765 std::vector<ParameterSet> const& this_vpset = vpsetItr->second.vpset();
00766
00767 typedef std::vector<ParameterSet>::const_iterator Iter;
00768 for (Iter i = this_vpset.begin(), e = this_vpset.end(); i != e; ++i) {
00769 vresult.push_back(i->trackedPart());
00770 }
00771 result.addParameter<VParameterSet>(vpsetItr->first, vresult);
00772 }
00773 }
00774 return result;
00775 }
00776
00777 size_t
00778 ParameterSet::getParameterSetNames(std::vector<std::string>& output) {
00779 std::transform(psetTable_.begin(), psetTable_.end(), back_inserter(output),
00780 boost::bind(&std::pair<std::string const, ParameterSetEntry>::first, _1));
00781 return output.size();
00782 }
00783
00784 size_t
00785 ParameterSet::getParameterSetNames(std::vector<std::string>& output,
00786 bool trackiness) const {
00787 for(psettable::const_iterator psetItr = psetTable_.begin();
00788 psetItr != psetTable_.end(); ++psetItr) {
00789 if(psetItr->second.isTracked() == trackiness) {
00790 output.push_back(psetItr->first);
00791 }
00792 }
00793 return output.size();
00794 }
00795
00796 size_t
00797 ParameterSet::getParameterSetVectorNames(std::vector<std::string>& output,
00798 bool trackiness) const {
00799 for(vpsettable::const_iterator vpsetItr = vpsetTable_.begin();
00800 vpsetItr != vpsetTable_.end(); ++vpsetItr) {
00801 if(vpsetItr->second.isTracked() == trackiness) {
00802 output.push_back(vpsetItr->first);
00803 }
00804 }
00805 return output.size();
00806 }
00807
00808 size_t
00809 ParameterSet::getNamesByCode_(char code,
00810 bool trackiness,
00811 std::vector<std::string>& output) const {
00812 size_t count = 0;
00813 if(code == 'Q') {
00814 return getParameterSetNames(output, trackiness);
00815 }
00816 if(code == 'q') {
00817 return getParameterSetVectorNames(output, trackiness);
00818 }
00819 table::const_iterator it = tbl_.begin();
00820 table::const_iterator end = tbl_.end();
00821 while (it != end) {
00822 Entry const& e = it->second;
00823 if(e.typeCode() == code &&
00824 e.isTracked() == trackiness) {
00825 ++count;
00826 output.push_back(it->first);
00827 }
00828 ++it;
00829 }
00830 return count;
00831 }
00832
00833 template<>
00834 std::vector<std::string> ParameterSet::getParameterNamesForType<FileInPath>(bool trackiness) const {
00835 std::vector<std::string> result;
00836 getNamesByCode_('F', trackiness, result);
00837 return result;
00838 }
00839
00840 bool operator==(ParameterSet const& a, ParameterSet const& b) {
00841 if(a.isRegistered() && b.isRegistered()) {
00842 return (a.id() == b.id());
00843 }
00844 return isTransientEqual(a.trackedPart(), b.trackedPart());
00845 }
00846
00847 bool isTransientEqual(ParameterSet const& a, ParameterSet const& b) {
00848 if(a.tbl().size() != b.tbl().size()) {
00849 return false;
00850 }
00851 if(a.psetTable().size() != b.psetTable().size()) {
00852 return false;
00853 }
00854 if(a.vpsetTable().size() != b.vpsetTable().size()) {
00855 return false;
00856 }
00857 typedef ParameterSet::table::const_iterator Ti;
00858 for (Ti i = a.tbl().begin(), e = a.tbl().end(),
00859 j = b.tbl().begin(), f = b.tbl().end();
00860 i != e && j != f; ++i, ++j) {
00861 if(*i != *j) {
00862 return false;
00863 }
00864 }
00865 typedef ParameterSet::psettable::const_iterator Pi;
00866 for (Pi i = a.psetTable().begin(), e = a.psetTable().end(),
00867 j = b.psetTable().begin(), f = b.psetTable().end();
00868 i != e && j != f; ++i, ++j) {
00869 if(i->first != j->first) {
00870 return false;
00871 }
00872 if(i->second.isTracked() != j->second.isTracked()) {
00873 return false;
00874 }
00875 if(!isTransientEqual(i->second.pset(), j->second.pset())) {
00876 return false;
00877 }
00878 }
00879 typedef ParameterSet::vpsettable::const_iterator PVi;
00880 for (PVi i = a.vpsetTable().begin(), e = a.vpsetTable().end(),
00881 j = b.vpsetTable().begin(), f = b.vpsetTable().end();
00882 i != e && j != f; ++i, ++j) {
00883 if(i->first != j->first) {
00884 return false;
00885 }
00886 if(i->second.isTracked() != j->second.isTracked()) {
00887 return false;
00888 }
00889 std::vector<ParameterSet> const& iv = i->second.vpset();
00890 std::vector<ParameterSet> const& jv = j->second.vpset();
00891 if(iv.size() != jv.size()) {
00892 return false;
00893 }
00894 for (size_t k = 0; k < iv.size(); ++k) {
00895 if(!isTransientEqual(iv[k], jv[k])) {
00896 return false;
00897 }
00898 }
00899 }
00900 return true;
00901 }
00902
00903 std::string ParameterSet::dump(unsigned int indent) const {
00904 std::ostringstream os;
00905
00906 std::string indentation(indent, ' ');
00907 os << "{" << std::endl;
00908 for(table::const_iterator i = tbl_.begin(), e = tbl_.end(); i != e; ++i) {
00909 os << indentation << " " << i->first << ": " << i->second << std::endl;
00910 }
00911 for(psettable::const_iterator i = psetTable_.begin(), e = psetTable_.end(); i != e; ++i) {
00912
00913 std::string n = i->first;
00914 ParameterSetEntry const& pe = i->second;
00915 os << indentation << " " << n << ": " << pe.dump(indent + 2) << std::endl;
00916 }
00917 for(vpsettable::const_iterator i = vpsetTable_.begin(), e = vpsetTable_.end(); i != e; ++i) {
00918
00919 std::string n = i->first;
00920 VParameterSetEntry const& pe = i->second;
00921 os << indentation << " " << n << ": " << pe.dump(indent + 2) << std::endl;
00922 }
00923 os << indentation << "}";
00924 return os.str();
00925 }
00926
00927 std::ostream& operator<<(std::ostream& os, ParameterSet const& pset) {
00928 os << pset.dump();
00929 return os;
00930 }
00931
00932
00933 ParameterSet const&
00934 getParameterSet(ParameterSetID const& id) {
00935 ParameterSet const* result = 0;
00936 if(0 == (result = pset::Registry::instance()->getMapped(id))) {
00937 throw Exception(errors::Configuration, "MissingParameterSet:")
00938 << "Parameter Set ID '" << id << "' not found.";
00939 }
00940 return *result;
00941 }
00942
00943 void ParameterSet::deprecatedInputTagWarning(std::string const& name,
00944 std::string const& label) const {
00945 LogWarning("Configuration") << "Warning:\n\tstring " << name
00946 << " = \"" << label
00947 << "\"\nis deprecated, "
00948 << "please update your config file to use\n\tInputTag "
00949 << name << " = " << label;
00950 }
00951
00952
00953
00954
00955
00956 template<>
00957 bool
00958 ParameterSet::getParameter<bool>(std::string const& name) const {
00959 return retrieve(name).getBool();
00960 }
00961
00962
00963
00964
00965 template<>
00966 int
00967 ParameterSet::getParameter<int>(std::string const& name) const {
00968 return retrieve(name).getInt32();
00969 }
00970
00971 template<>
00972 std::vector<int>
00973 ParameterSet::getParameter<std::vector<int> >(std::string const& name) const {
00974 return retrieve(name).getVInt32();
00975 }
00976
00977
00978
00979
00980 template<>
00981 long long
00982 ParameterSet::getParameter<long long>(std::string const& name) const {
00983 return retrieve(name).getInt64();
00984 }
00985
00986 template<>
00987 std::vector<long long>
00988 ParameterSet::getParameter<std::vector<long long> >(std::string const& name) const {
00989 return retrieve(name).getVInt64();
00990 }
00991
00992
00993
00994
00995 template<>
00996 unsigned int
00997 ParameterSet::getParameter<unsigned int>(std::string const& name) const {
00998 return retrieve(name).getUInt32();
00999 }
01000
01001 template<>
01002 std::vector<unsigned int>
01003 ParameterSet::getParameter<std::vector<unsigned int> >(std::string const& name) const {
01004 return retrieve(name).getVUInt32();
01005 }
01006
01007
01008
01009
01010 template<>
01011 unsigned long long
01012 ParameterSet::getParameter<unsigned long long>(std::string const& name) const {
01013 return retrieve(name).getUInt64();
01014 }
01015
01016 template<>
01017 std::vector<unsigned long long>
01018 ParameterSet::getParameter<std::vector<unsigned long long> >(std::string const& name) const {
01019 return retrieve(name).getVUInt64();
01020 }
01021
01022
01023
01024
01025 template<>
01026 double
01027 ParameterSet::getParameter<double>(std::string const& name) const {
01028 return retrieve(name).getDouble();
01029 }
01030
01031 template<>
01032 std::vector<double>
01033 ParameterSet::getParameter<std::vector<double> >(std::string const& name) const {
01034 return retrieve(name).getVDouble();
01035 }
01036
01037
01038
01039
01040 template<>
01041 std::string
01042 ParameterSet::getParameter<std::string>(std::string const& name) const {
01043 return retrieve(name).getString();
01044 }
01045
01046 template<>
01047 std::vector<std::string>
01048 ParameterSet::getParameter<std::vector<std::string> >(std::string const& name) const {
01049 return retrieve(name).getVString();
01050 }
01051
01052
01053
01054
01055 template<>
01056 FileInPath
01057 ParameterSet::getParameter<FileInPath>(std::string const& name) const {
01058 return retrieve(name).getFileInPath();
01059 }
01060
01061
01062
01063
01064 template<>
01065 InputTag
01066 ParameterSet::getParameter<InputTag>(std::string const& name) const {
01067 Entry const& e_input = retrieve(name);
01068 switch (e_input.typeCode()) {
01069 case 't':
01070 return e_input.getInputTag();
01071 case 'S':
01072 std::string const& label = e_input.getString();
01073 deprecatedInputTagWarning(name, label);
01074 return InputTag(label);
01075 }
01076 throw Exception(errors::Configuration, "ValueError") << "type of "
01077 << name << " is expected to be InputTag or string (deprecated)";
01078
01079 }
01080
01081
01082
01083
01084 template<>
01085 std::vector<InputTag>
01086 ParameterSet::getParameter<std::vector<InputTag> >(std::string const& name) const {
01087 return retrieve(name).getVInputTag();
01088 }
01089
01090
01091
01092
01093 template<>
01094 ESInputTag
01095 ParameterSet::getParameter<ESInputTag>(std::string const& name) const {
01096 return retrieve(name).getESInputTag();
01097 }
01098
01099
01100
01101
01102 template<>
01103 std::vector<ESInputTag>
01104 ParameterSet::getParameter<std::vector<ESInputTag> >(std::string const& name) const {
01105 return retrieve(name).getVESInputTag();
01106 }
01107
01108
01109
01110
01111 template<>
01112 EventID
01113 ParameterSet::getParameter<EventID>(std::string const& name) const {
01114 return retrieve(name).getEventID();
01115 }
01116
01117
01118
01119
01120 template<>
01121 std::vector<EventID>
01122 ParameterSet::getParameter<std::vector<EventID> >(std::string const& name) const {
01123 return retrieve(name).getVEventID();
01124 }
01125
01126
01127
01128
01129 template<>
01130 LuminosityBlockID
01131 ParameterSet::getParameter<LuminosityBlockID>(std::string const& name) const {
01132 return retrieve(name).getLuminosityBlockID();
01133 }
01134
01135
01136
01137
01138 template<>
01139 std::vector<LuminosityBlockID>
01140 ParameterSet::getParameter<std::vector<LuminosityBlockID> >(std::string const& name) const {
01141 return retrieve(name).getVLuminosityBlockID();
01142 }
01143
01144
01145
01146
01147 template<>
01148 EventRange
01149 ParameterSet::getParameter<EventRange>(std::string const& name) const {
01150 return retrieve(name).getEventRange();
01151 }
01152
01153
01154
01155
01156 template<>
01157 std::vector<EventRange>
01158 ParameterSet::getParameter<std::vector<EventRange> >(std::string const& name) const {
01159 return retrieve(name).getVEventRange();
01160 }
01161
01162
01163
01164
01165 template<>
01166 LuminosityBlockRange
01167 ParameterSet::getParameter<LuminosityBlockRange>(std::string const& name) const {
01168 return retrieve(name).getLuminosityBlockRange();
01169 }
01170
01171
01172
01173
01174 template<>
01175 std::vector<LuminosityBlockRange>
01176 ParameterSet::getParameter<std::vector<LuminosityBlockRange> >(std::string const& name) const {
01177 return retrieve(name).getVLuminosityBlockRange();
01178 }
01179
01180
01181
01182
01183 template<>
01184 ParameterSet
01185 ParameterSet::getParameter<ParameterSet>(std::string const& name) const {
01186 return getParameterSet(name);
01187 }
01188
01189 template<>
01190 VParameterSet
01191 ParameterSet::getParameter<VParameterSet>(std::string const& name) const {
01192 return getParameterSetVector(name);
01193 }
01194
01195
01196
01197
01198
01199
01200 template<>
01201 bool
01202 ParameterSet::getUntrackedParameter<bool>(std::string const& name, bool const& defaultValue) const {
01203 Entry const* entryPtr = retrieveUntracked(name);
01204 return entryPtr == 0 ? defaultValue : entryPtr->getBool();
01205 }
01206
01207 template<>
01208 bool
01209 ParameterSet::getUntrackedParameter<bool>(std::string const& name) const {
01210 return getEntryPointerOrThrow_(name)->getBool();
01211 }
01212
01213
01214
01215
01216 template<>
01217 int
01218 ParameterSet::getUntrackedParameter<int>(std::string const& name, int const& defaultValue) const {
01219 Entry const* entryPtr = retrieveUntracked(name);
01220 return entryPtr == 0 ? defaultValue : entryPtr->getInt32();
01221 }
01222
01223 template<>
01224 int
01225 ParameterSet::getUntrackedParameter<int>(std::string const& name) const {
01226 return getEntryPointerOrThrow_(name)->getInt32();
01227 }
01228
01229 template<>
01230 std::vector<int>
01231 ParameterSet::getUntrackedParameter<std::vector<int> >(std::string const& name, std::vector<int> const& defaultValue) const {
01232 Entry const* entryPtr = retrieveUntracked(name);
01233 return entryPtr == 0 ? defaultValue : entryPtr->getVInt32();
01234 }
01235
01236 template<>
01237 std::vector<int>
01238 ParameterSet::getUntrackedParameter<std::vector<int> >(std::string const& name) const {
01239 return getEntryPointerOrThrow_(name)->getVInt32();
01240 }
01241
01242
01243
01244
01245 template<>
01246 unsigned int
01247 ParameterSet::getUntrackedParameter<unsigned int>(std::string const& name, unsigned int const& defaultValue) const {
01248 Entry const* entryPtr = retrieveUntracked(name);
01249 return entryPtr == 0 ? defaultValue : entryPtr->getUInt32();
01250 }
01251
01252 template<>
01253 unsigned int
01254 ParameterSet::getUntrackedParameter<unsigned int>(std::string const& name) const {
01255 return getEntryPointerOrThrow_(name)->getUInt32();
01256 }
01257
01258 template<>
01259 std::vector<unsigned int>
01260 ParameterSet::getUntrackedParameter<std::vector<unsigned int> >(std::string const& name, std::vector<unsigned int> const& defaultValue) const {
01261 Entry const* entryPtr = retrieveUntracked(name);
01262 return entryPtr == 0 ? defaultValue : entryPtr->getVUInt32();
01263 }
01264
01265 template<>
01266 std::vector<unsigned int>
01267 ParameterSet::getUntrackedParameter<std::vector<unsigned int> >(std::string const& name) const {
01268 return getEntryPointerOrThrow_(name)->getVUInt32();
01269 }
01270
01271
01272
01273
01274 template<>
01275 unsigned long long
01276 ParameterSet::getUntrackedParameter<unsigned long long>(std::string const& name, unsigned long long const& defaultValue) const {
01277 Entry const* entryPtr = retrieveUntracked(name);
01278 return entryPtr == 0 ? defaultValue : entryPtr->getUInt64();
01279 }
01280
01281 template<>
01282 unsigned long long
01283 ParameterSet::getUntrackedParameter<unsigned long long>(std::string const& name) const {
01284 return getEntryPointerOrThrow_(name)->getUInt64();
01285 }
01286
01287 template<>
01288 std::vector<unsigned long long>
01289 ParameterSet::getUntrackedParameter<std::vector<unsigned long long> >(std::string const& name, std::vector<unsigned long long> const& defaultValue) const {
01290 Entry const* entryPtr = retrieveUntracked(name);
01291 return entryPtr == 0 ? defaultValue : entryPtr->getVUInt64();
01292 }
01293
01294 template<>
01295 std::vector<unsigned long long>
01296 ParameterSet::getUntrackedParameter<std::vector<unsigned long long> >(std::string const& name) const {
01297 return getEntryPointerOrThrow_(name)->getVUInt64();
01298 }
01299
01300
01301
01302
01303 template<>
01304 long long
01305 ParameterSet::getUntrackedParameter<long long>(std::string const& name, long long const& defaultValue) const {
01306 Entry const* entryPtr = retrieveUntracked(name);
01307 return entryPtr == 0 ? defaultValue : entryPtr->getInt64();
01308 }
01309
01310 template<>
01311 long long
01312 ParameterSet::getUntrackedParameter<long long>(std::string const& name) const {
01313 return getEntryPointerOrThrow_(name)->getInt64();
01314 }
01315
01316 template<>
01317 std::vector<long long>
01318 ParameterSet::getUntrackedParameter<std::vector<long long> >(std::string const& name, std::vector<long long> const& defaultValue) const {
01319 Entry const* entryPtr = retrieveUntracked(name);
01320 return entryPtr == 0 ? defaultValue : entryPtr->getVInt64();
01321 }
01322
01323 template<>
01324 std::vector<long long>
01325 ParameterSet::getUntrackedParameter<std::vector<long long> >(std::string const& name) const {
01326 return getEntryPointerOrThrow_(name)->getVInt64();
01327 }
01328
01329
01330
01331
01332 template<>
01333 double
01334 ParameterSet::getUntrackedParameter<double>(std::string const& name, double const& defaultValue) const {
01335 Entry const* entryPtr = retrieveUntracked(name);
01336 return entryPtr == 0 ? defaultValue : entryPtr->getDouble();
01337 }
01338
01339 template<>
01340 double
01341 ParameterSet::getUntrackedParameter<double>(std::string const& name) const {
01342 return getEntryPointerOrThrow_(name)->getDouble();
01343 }
01344
01345 template<>
01346 std::vector<double>
01347 ParameterSet::getUntrackedParameter<std::vector<double> >(std::string const& name, std::vector<double> const& defaultValue) const {
01348 Entry const* entryPtr = retrieveUntracked(name); return entryPtr == 0 ? defaultValue : entryPtr->getVDouble();
01349 }
01350
01351 template<>
01352 std::vector<double>
01353 ParameterSet::getUntrackedParameter<std::vector<double> >(std::string const& name) const {
01354 return getEntryPointerOrThrow_(name)->getVDouble();
01355 }
01356
01357
01358
01359
01360 template<>
01361 std::string
01362 ParameterSet::getUntrackedParameter<std::string>(std::string const& name, std::string const& defaultValue) const {
01363 Entry const* entryPtr = retrieveUntracked(name);
01364 return entryPtr == 0 ? defaultValue : entryPtr->getString();
01365 }
01366
01367 template<>
01368 std::string
01369 ParameterSet::getUntrackedParameter<std::string>(std::string const& name) const {
01370 return getEntryPointerOrThrow_(name)->getString();
01371 }
01372
01373 template<>
01374 std::vector<std::string>
01375 ParameterSet::getUntrackedParameter<std::vector<std::string> >(std::string const& name, std::vector<std::string> const& defaultValue) const {
01376 Entry const* entryPtr = retrieveUntracked(name);
01377 return entryPtr == 0 ? defaultValue : entryPtr->getVString();
01378 }
01379
01380 template<>
01381 std::vector<std::string>
01382 ParameterSet::getUntrackedParameter<std::vector<std::string> >(std::string const& name) const {
01383 return getEntryPointerOrThrow_(name)->getVString();
01384 }
01385
01386
01387
01388
01389 template<>
01390 FileInPath
01391 ParameterSet::getUntrackedParameter<FileInPath>(std::string const& name, FileInPath const& defaultValue) const {
01392 Entry const* entryPtr = retrieveUntracked(name);
01393 return entryPtr == 0 ? defaultValue : entryPtr->getFileInPath();
01394 }
01395
01396 template<>
01397 FileInPath
01398 ParameterSet::getUntrackedParameter<FileInPath>(std::string const& name) const {
01399 return getEntryPointerOrThrow_(name)->getFileInPath();
01400 }
01401
01402
01403
01404
01405 template<>
01406 InputTag
01407 ParameterSet::getUntrackedParameter<InputTag>(std::string const& name, InputTag const& defaultValue) const {
01408 Entry const* entryPtr = retrieveUntracked(name);
01409 return entryPtr == 0 ? defaultValue : entryPtr->getInputTag();
01410 }
01411
01412 template<>
01413 InputTag
01414 ParameterSet::getUntrackedParameter<InputTag>(std::string const& name) const {
01415 return getEntryPointerOrThrow_(name)->getInputTag();
01416 }
01417
01418 template<>
01419 std::vector<InputTag>
01420 ParameterSet::getUntrackedParameter<std::vector<InputTag> >(std::string const& name,
01421 std::vector<InputTag> const& defaultValue) const {
01422 Entry const* entryPtr = retrieveUntracked(name);
01423 return entryPtr == 0 ? defaultValue : entryPtr->getVInputTag();
01424 }
01425
01426 template<>
01427 std::vector<InputTag>
01428 ParameterSet::getUntrackedParameter<std::vector<InputTag> >(std::string const& name) const {
01429 return getEntryPointerOrThrow_(name)->getVInputTag();
01430 }
01431
01432
01433
01434
01435 template<>
01436 ESInputTag
01437 ParameterSet::getUntrackedParameter<ESInputTag>(std::string const& name, ESInputTag const& defaultValue) const {
01438 Entry const* entryPtr = retrieveUntracked(name);
01439 return entryPtr == 0 ? defaultValue : entryPtr->getESInputTag();
01440 }
01441
01442 template<>
01443 ESInputTag
01444 ParameterSet::getUntrackedParameter<ESInputTag>(std::string const& name) const {
01445 return getEntryPointerOrThrow_(name)->getESInputTag();
01446 }
01447
01448 template<>
01449 std::vector<ESInputTag>
01450 ParameterSet::getUntrackedParameter<std::vector<ESInputTag> >(std::string const& name,
01451 std::vector<ESInputTag> const& defaultValue) const {
01452 Entry const* entryPtr = retrieveUntracked(name);
01453 return entryPtr == 0 ? defaultValue : entryPtr->getVESInputTag();
01454 }
01455
01456 template<>
01457 std::vector<ESInputTag>
01458 ParameterSet::getUntrackedParameter<std::vector<ESInputTag> >(std::string const& name) const {
01459 return getEntryPointerOrThrow_(name)->getVESInputTag();
01460 }
01461
01462
01463
01464
01465 template<>
01466 EventID
01467 ParameterSet::getUntrackedParameter<EventID>(std::string const& name, EventID const& defaultValue) const {
01468 Entry const* entryPtr = retrieveUntracked(name);
01469 return entryPtr == 0 ? defaultValue : entryPtr->getEventID();
01470 }
01471
01472 template<>
01473 EventID
01474 ParameterSet::getUntrackedParameter<EventID>(std::string const& name) const {
01475 return getEntryPointerOrThrow_(name)->getEventID();
01476 }
01477
01478 template<>
01479 std::vector<EventID>
01480 ParameterSet::getUntrackedParameter<std::vector<EventID> >(std::string const& name,
01481 std::vector<EventID> const& defaultValue) const {
01482 Entry const* entryPtr = retrieveUntracked(name);
01483 return entryPtr == 0 ? defaultValue : entryPtr->getVEventID();
01484 }
01485
01486 template<>
01487 std::vector<EventID>
01488 ParameterSet::getUntrackedParameter<std::vector<EventID> >(std::string const& name) const {
01489 return getEntryPointerOrThrow_(name)->getVEventID();
01490 }
01491
01492
01493
01494
01495 template<>
01496 LuminosityBlockID
01497 ParameterSet::getUntrackedParameter<LuminosityBlockID>(std::string const& name, LuminosityBlockID const& defaultValue) const {
01498 Entry const* entryPtr = retrieveUntracked(name);
01499 return entryPtr == 0 ? defaultValue : entryPtr->getLuminosityBlockID();
01500 }
01501
01502 template<>
01503 LuminosityBlockID
01504 ParameterSet::getUntrackedParameter<LuminosityBlockID>(std::string const& name) const {
01505 return getEntryPointerOrThrow_(name)->getLuminosityBlockID();
01506 }
01507
01508 template<>
01509 std::vector<LuminosityBlockID>
01510 ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockID> >(std::string const& name,
01511 std::vector<LuminosityBlockID> const& defaultValue) const {
01512 Entry const* entryPtr = retrieveUntracked(name);
01513 return entryPtr == 0 ? defaultValue : entryPtr->getVLuminosityBlockID();
01514 }
01515
01516 template<>
01517 std::vector<LuminosityBlockID>
01518 ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockID> >(std::string const& name) const {
01519 return getEntryPointerOrThrow_(name)->getVLuminosityBlockID();
01520 }
01521
01522
01523
01524
01525 template<>
01526 EventRange
01527 ParameterSet::getUntrackedParameter<EventRange>(std::string const& name, EventRange const& defaultValue) const {
01528 Entry const* entryPtr = retrieveUntracked(name);
01529 return entryPtr == 0 ? defaultValue : entryPtr->getEventRange();
01530 }
01531
01532 template<>
01533 EventRange
01534 ParameterSet::getUntrackedParameter<EventRange>(std::string const& name) const {
01535 return getEntryPointerOrThrow_(name)->getEventRange();
01536 }
01537
01538 template<>
01539 std::vector<EventRange>
01540 ParameterSet::getUntrackedParameter<std::vector<EventRange> >(std::string const& name,
01541 std::vector<EventRange> const& defaultValue) const {
01542 Entry const* entryPtr = retrieveUntracked(name);
01543 return entryPtr == 0 ? defaultValue : entryPtr->getVEventRange();
01544 }
01545
01546 template<>
01547 std::vector<EventRange>
01548 ParameterSet::getUntrackedParameter<std::vector<EventRange> >(std::string const& name) const {
01549 return getEntryPointerOrThrow_(name)->getVEventRange();
01550 }
01551
01552
01553
01554
01555 template<>
01556 LuminosityBlockRange
01557 ParameterSet::getUntrackedParameter<LuminosityBlockRange>(std::string const& name, LuminosityBlockRange const& defaultValue) const {
01558 Entry const* entryPtr = retrieveUntracked(name);
01559 return entryPtr == 0 ? defaultValue : entryPtr->getLuminosityBlockRange();
01560 }
01561
01562 template<>
01563 LuminosityBlockRange
01564 ParameterSet::getUntrackedParameter<LuminosityBlockRange>(std::string const& name) const {
01565 return getEntryPointerOrThrow_(name)->getLuminosityBlockRange();
01566 }
01567
01568 template<>
01569 std::vector<LuminosityBlockRange>
01570 ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockRange> >(std::string const& name,
01571 std::vector<LuminosityBlockRange> const& defaultValue) const {
01572 Entry const* entryPtr = retrieveUntracked(name);
01573 return entryPtr == 0 ? defaultValue : entryPtr->getVLuminosityBlockRange();
01574 }
01575
01576 template<>
01577 std::vector<LuminosityBlockRange>
01578 ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockRange> >(std::string const& name) const {
01579 return getEntryPointerOrThrow_(name)->getVLuminosityBlockRange();
01580 }
01581
01582
01583
01584
01585
01586 template<>
01587 bool
01588 ParameterSet::getParameter<bool>(char const* name) const {
01589 return retrieve(name).getBool();
01590 }
01591
01592
01593
01594
01595 template<>
01596 int
01597 ParameterSet::getParameter<int>(char const* name) const {
01598 return retrieve(name).getInt32();
01599 }
01600
01601 template<>
01602 std::vector<int>
01603 ParameterSet::getParameter<std::vector<int> >(char const* name) const {
01604 return retrieve(name).getVInt32();
01605 }
01606
01607
01608
01609
01610 template<>
01611 long long
01612 ParameterSet::getParameter<long long>(char const* name) const {
01613 return retrieve(name).getInt64();
01614 }
01615
01616 template<>
01617 std::vector<long long>
01618 ParameterSet::getParameter<std::vector<long long> >(char const* name) const {
01619 return retrieve(name).getVInt64();
01620 }
01621
01622
01623
01624
01625 template<>
01626 unsigned int
01627 ParameterSet::getParameter<unsigned int>(char const* name) const {
01628 return retrieve(name).getUInt32();
01629 }
01630
01631 template<>
01632 std::vector<unsigned int>
01633 ParameterSet::getParameter<std::vector<unsigned int> >(char const* name) const {
01634 return retrieve(name).getVUInt32();
01635 }
01636
01637
01638
01639
01640 template<>
01641 unsigned long long
01642 ParameterSet::getParameter<unsigned long long>(char const* name) const {
01643 return retrieve(name).getUInt64();
01644 }
01645
01646 template<>
01647 std::vector<unsigned long long>
01648 ParameterSet::getParameter<std::vector<unsigned long long> >(char const* name) const {
01649 return retrieve(name).getVUInt64();
01650 }
01651
01652
01653
01654
01655 template<>
01656 double
01657 ParameterSet::getParameter<double>(char const* name) const {
01658 return retrieve(name).getDouble();
01659 }
01660
01661 template<>
01662 std::vector<double>
01663 ParameterSet::getParameter<std::vector<double> >(char const* name) const {
01664 return retrieve(name).getVDouble();
01665 }
01666
01667
01668
01669
01670 template<>
01671 std::string
01672 ParameterSet::getParameter<std::string>(char const* name) const {
01673 return retrieve(name).getString();
01674 }
01675
01676 template<>
01677 std::vector<std::string>
01678 ParameterSet::getParameter<std::vector<std::string> >(char const* name) const {
01679 return retrieve(name).getVString();
01680 }
01681
01682
01683
01684
01685 template<>
01686 FileInPath
01687 ParameterSet::getParameter<FileInPath>(char const* name) const {
01688 return retrieve(name).getFileInPath();
01689 }
01690
01691
01692
01693
01694 template<>
01695 InputTag
01696 ParameterSet::getParameter<InputTag>(char const* name) const {
01697 Entry const& e_input = retrieve(name);
01698 switch (e_input.typeCode()) {
01699 case 't':
01700 return e_input.getInputTag();
01701 case 'S':
01702 std::string const& label = e_input.getString();
01703 deprecatedInputTagWarning(name, label);
01704 return InputTag(label);
01705 }
01706 throw Exception(errors::Configuration, "ValueError") << "type of "
01707 << name << " is expected to be InputTag or string (deprecated)";
01708 }
01709
01710
01711
01712
01713 template<>
01714 std::vector<InputTag>
01715 ParameterSet::getParameter<std::vector<InputTag> >(char const* name) const {
01716 return retrieve(name).getVInputTag();
01717 }
01718
01719
01720
01721
01722 template<>
01723 ESInputTag
01724 ParameterSet::getParameter<ESInputTag>(char const* name) const {
01725 return retrieve(name).getESInputTag();
01726 }
01727
01728
01729
01730
01731 template<>
01732 std::vector<ESInputTag>
01733 ParameterSet::getParameter<std::vector<ESInputTag> >(char const* name) const {
01734 return retrieve(name).getVESInputTag();
01735 }
01736
01737
01738
01739
01740
01741 template<>
01742 EventID
01743 ParameterSet::getParameter<EventID>(char const* name) const {
01744 return retrieve(name).getEventID();
01745 }
01746
01747
01748
01749
01750 template<>
01751 std::vector<EventID>
01752 ParameterSet::getParameter<std::vector<EventID> >(char const* name) const {
01753 return retrieve(name).getVEventID();
01754 }
01755
01756
01757
01758
01759 template<>
01760 LuminosityBlockID
01761 ParameterSet::getParameter<LuminosityBlockID>(char const* name) const {
01762 return retrieve(name).getLuminosityBlockID();
01763 }
01764
01765
01766
01767
01768 template<>
01769 std::vector<LuminosityBlockID>
01770 ParameterSet::getParameter<std::vector<LuminosityBlockID> >(char const* name) const {
01771 return retrieve(name).getVLuminosityBlockID();
01772 }
01773
01774
01775
01776
01777 template<>
01778 EventRange
01779 ParameterSet::getParameter<EventRange>(char const* name) const {
01780 return retrieve(name).getEventRange();
01781 }
01782
01783
01784
01785
01786 template<>
01787 std::vector<EventRange>
01788 ParameterSet::getParameter<std::vector<EventRange> >(char const* name) const {
01789 return retrieve(name).getVEventRange();
01790 }
01791
01792
01793
01794
01795 template<>
01796 LuminosityBlockRange
01797 ParameterSet::getParameter<LuminosityBlockRange>(char const* name) const {
01798 return retrieve(name).getLuminosityBlockRange();
01799 }
01800
01801
01802
01803
01804 template<>
01805 std::vector<LuminosityBlockRange>
01806 ParameterSet::getParameter<std::vector<LuminosityBlockRange> >(char const* name) const {
01807 return retrieve(name).getVLuminosityBlockRange();
01808 }
01809
01810
01811
01812
01813 template<>
01814 ParameterSet
01815 ParameterSet::getParameter<ParameterSet>(char const* name) const {
01816 return getParameterSet(name);
01817 }
01818
01819 template<>
01820 VParameterSet
01821 ParameterSet::getParameter<VParameterSet>(char const* name) const {
01822 return getParameterSetVector(name);
01823 }
01824
01825
01826
01827
01828
01829
01830 template<>
01831 bool
01832 ParameterSet::getUntrackedParameter<bool>(char const* name, bool const& defaultValue) const {
01833 Entry const* entryPtr = retrieveUntracked(name);
01834 return entryPtr == 0 ? defaultValue : entryPtr->getBool();
01835 }
01836
01837 template<>
01838 bool
01839 ParameterSet::getUntrackedParameter<bool>(char const* name) const {
01840 return getEntryPointerOrThrow_(name)->getBool();
01841 }
01842
01843
01844
01845
01846 template<>
01847 int
01848 ParameterSet::getUntrackedParameter<int>(char const* name, int const& defaultValue) const {
01849 Entry const* entryPtr = retrieveUntracked(name);
01850 return entryPtr == 0 ? defaultValue : entryPtr->getInt32();
01851 }
01852
01853 template<>
01854 int
01855 ParameterSet::getUntrackedParameter<int>(char const* name) const {
01856 return getEntryPointerOrThrow_(name)->getInt32();
01857 }
01858
01859 template<>
01860 std::vector<int>
01861 ParameterSet::getUntrackedParameter<std::vector<int> >(char const* name, std::vector<int> const& defaultValue) const {
01862 Entry const* entryPtr = retrieveUntracked(name);
01863 return entryPtr == 0 ? defaultValue : entryPtr->getVInt32();
01864 }
01865
01866 template<>
01867 std::vector<int>
01868 ParameterSet::getUntrackedParameter<std::vector<int> >(char const* name) const {
01869 return getEntryPointerOrThrow_(name)->getVInt32();
01870 }
01871
01872
01873
01874
01875 template<>
01876 unsigned int
01877 ParameterSet::getUntrackedParameter<unsigned int>(char const* name, unsigned int const& defaultValue) const {
01878 Entry const* entryPtr = retrieveUntracked(name);
01879 return entryPtr == 0 ? defaultValue : entryPtr->getUInt32();
01880 }
01881
01882 template<>
01883 unsigned int
01884 ParameterSet::getUntrackedParameter<unsigned int>(char const* name) const {
01885 return getEntryPointerOrThrow_(name)->getUInt32();
01886 }
01887
01888 template<>
01889 std::vector<unsigned int>
01890 ParameterSet::getUntrackedParameter<std::vector<unsigned int> >(char const* name, std::vector<unsigned int> const& defaultValue) const {
01891 Entry const* entryPtr = retrieveUntracked(name);
01892 return entryPtr == 0 ? defaultValue : entryPtr->getVUInt32();
01893 }
01894
01895 template<>
01896 std::vector<unsigned int>
01897 ParameterSet::getUntrackedParameter<std::vector<unsigned int> >(char const* name) const {
01898 return getEntryPointerOrThrow_(name)->getVUInt32();
01899 }
01900
01901
01902
01903
01904 template<>
01905 unsigned long long
01906 ParameterSet::getUntrackedParameter<unsigned long long>(char const* name, unsigned long long const& defaultValue) const {
01907 Entry const* entryPtr = retrieveUntracked(name);
01908 return entryPtr == 0 ? defaultValue : entryPtr->getUInt64();
01909 }
01910
01911 template<>
01912 unsigned long long
01913 ParameterSet::getUntrackedParameter<unsigned long long>(char const* name) const {
01914 return getEntryPointerOrThrow_(name)->getUInt64();
01915 }
01916
01917 template<>
01918 std::vector<unsigned long long>
01919 ParameterSet::getUntrackedParameter<std::vector<unsigned long long> >(char const* name, std::vector<unsigned long long> const& defaultValue) const {
01920 Entry const* entryPtr = retrieveUntracked(name);
01921 return entryPtr == 0 ? defaultValue : entryPtr->getVUInt64();
01922 }
01923
01924 template<>
01925 std::vector<unsigned long long>
01926 ParameterSet::getUntrackedParameter<std::vector<unsigned long long> >(char const* name) const {
01927 return getEntryPointerOrThrow_(name)->getVUInt64();
01928 }
01929
01930
01931
01932
01933 template<>
01934 long long
01935 ParameterSet::getUntrackedParameter<long long>(char const* name, long long const& defaultValue) const {
01936 Entry const* entryPtr = retrieveUntracked(name);
01937 return entryPtr == 0 ? defaultValue : entryPtr->getInt64();
01938 }
01939
01940 template<>
01941 long long
01942 ParameterSet::getUntrackedParameter<long long>(char const* name) const {
01943 return getEntryPointerOrThrow_(name)->getInt64();
01944 }
01945
01946 template<>
01947 std::vector<long long>
01948 ParameterSet::getUntrackedParameter<std::vector<long long> >(char const* name, std::vector<long long> const& defaultValue) const {
01949 Entry const* entryPtr = retrieveUntracked(name);
01950 return entryPtr == 0 ? defaultValue : entryPtr->getVInt64();
01951 }
01952
01953 template<>
01954 std::vector<long long>
01955 ParameterSet::getUntrackedParameter<std::vector<long long> >(char const* name) const {
01956 return getEntryPointerOrThrow_(name)->getVInt64();
01957 }
01958
01959
01960
01961
01962 template<>
01963 double
01964 ParameterSet::getUntrackedParameter<double>(char const* name, double const& defaultValue) const {
01965 Entry const* entryPtr = retrieveUntracked(name);
01966 return entryPtr == 0 ? defaultValue : entryPtr->getDouble();
01967 }
01968
01969 template<>
01970 double
01971 ParameterSet::getUntrackedParameter<double>(char const* name) const {
01972 return getEntryPointerOrThrow_(name)->getDouble();
01973 }
01974
01975 template<>
01976 std::vector<double>
01977 ParameterSet::getUntrackedParameter<std::vector<double> >(char const* name, std::vector<double> const& defaultValue) const {
01978 Entry const* entryPtr = retrieveUntracked(name); return entryPtr == 0 ? defaultValue : entryPtr->getVDouble();
01979 }
01980
01981 template<>
01982 std::vector<double>
01983 ParameterSet::getUntrackedParameter<std::vector<double> >(char const* name) const {
01984 return getEntryPointerOrThrow_(name)->getVDouble();
01985 }
01986
01987
01988
01989
01990 template<>
01991 std::string
01992 ParameterSet::getUntrackedParameter<std::string>(char const* name, std::string const& defaultValue) const {
01993 Entry const* entryPtr = retrieveUntracked(name);
01994 return entryPtr == 0 ? defaultValue : entryPtr->getString();
01995 }
01996
01997 template<>
01998 std::string
01999 ParameterSet::getUntrackedParameter<std::string>(char const* name) const {
02000 return getEntryPointerOrThrow_(name)->getString();
02001 }
02002
02003 template<>
02004 std::vector<std::string>
02005 ParameterSet::getUntrackedParameter<std::vector<std::string> >(char const* name, std::vector<std::string> const& defaultValue) const {
02006 Entry const* entryPtr = retrieveUntracked(name);
02007 return entryPtr == 0 ? defaultValue : entryPtr->getVString();
02008 }
02009
02010 template<>
02011 std::vector<std::string>
02012 ParameterSet::getUntrackedParameter<std::vector<std::string> >(char const* name) const {
02013 return getEntryPointerOrThrow_(name)->getVString();
02014 }
02015
02016
02017
02018
02019 template<>
02020 FileInPath
02021 ParameterSet::getUntrackedParameter<FileInPath>(char const* name, FileInPath const& defaultValue) const {
02022 Entry const* entryPtr = retrieveUntracked(name);
02023 return entryPtr == 0 ? defaultValue : entryPtr->getFileInPath();
02024 }
02025
02026 template<>
02027 FileInPath
02028 ParameterSet::getUntrackedParameter<FileInPath>(char const* name) const {
02029 return getEntryPointerOrThrow_(name)->getFileInPath();
02030 }
02031
02032
02033
02034
02035 template<>
02036 InputTag
02037 ParameterSet::getUntrackedParameter<InputTag>(char const* name, InputTag const& defaultValue) const {
02038 Entry const* entryPtr = retrieveUntracked(name);
02039 return entryPtr == 0 ? defaultValue : entryPtr->getInputTag();
02040 }
02041
02042 template<>
02043 InputTag
02044 ParameterSet::getUntrackedParameter<InputTag>(char const* name) const {
02045 return getEntryPointerOrThrow_(name)->getInputTag();
02046 }
02047
02048 template<>
02049 std::vector<InputTag>
02050 ParameterSet::getUntrackedParameter<std::vector<InputTag> >(char const* name,
02051 std::vector<InputTag> const& defaultValue) const {
02052 Entry const* entryPtr = retrieveUntracked(name);
02053 return entryPtr == 0 ? defaultValue : entryPtr->getVInputTag();
02054 }
02055
02056 template<>
02057 std::vector<InputTag>
02058 ParameterSet::getUntrackedParameter<std::vector<InputTag> >(char const* name) const {
02059 return getEntryPointerOrThrow_(name)->getVInputTag();
02060 }
02061
02062
02063
02064
02065 template<>
02066 ESInputTag
02067 ParameterSet::getUntrackedParameter<ESInputTag>(char const* name, ESInputTag const& defaultValue) const {
02068 Entry const* entryPtr = retrieveUntracked(name);
02069 return entryPtr == 0 ? defaultValue : entryPtr->getESInputTag();
02070 }
02071
02072 template<>
02073 ESInputTag
02074 ParameterSet::getUntrackedParameter<ESInputTag>(char const* name) const {
02075 return getEntryPointerOrThrow_(name)->getESInputTag();
02076 }
02077
02078 template<>
02079 std::vector<ESInputTag>
02080 ParameterSet::getUntrackedParameter<std::vector<ESInputTag> >(char const* name,
02081 std::vector<ESInputTag> const& defaultValue) const {
02082 Entry const* entryPtr = retrieveUntracked(name);
02083 return entryPtr == 0 ? defaultValue : entryPtr->getVESInputTag();
02084 }
02085
02086 template<>
02087 std::vector<ESInputTag>
02088 ParameterSet::getUntrackedParameter<std::vector<ESInputTag> >(char const* name) const {
02089 return getEntryPointerOrThrow_(name)->getVESInputTag();
02090 }
02091
02092
02093
02094
02095 template<>
02096 EventID
02097 ParameterSet::getUntrackedParameter<EventID>(char const* name, EventID const& defaultValue) const {
02098 Entry const* entryPtr = retrieveUntracked(name);
02099 return entryPtr == 0 ? defaultValue : entryPtr->getEventID();
02100 }
02101
02102 template<>
02103 EventID
02104 ParameterSet::getUntrackedParameter<EventID>(char const* name) const {
02105 return getEntryPointerOrThrow_(name)->getEventID();
02106 }
02107
02108 template<>
02109 std::vector<EventID>
02110 ParameterSet::getUntrackedParameter<std::vector<EventID> >(char const* name,
02111 std::vector<EventID> const& defaultValue) const {
02112 Entry const* entryPtr = retrieveUntracked(name);
02113 return entryPtr == 0 ? defaultValue : entryPtr->getVEventID();
02114 }
02115
02116 template<>
02117 std::vector<EventID>
02118 ParameterSet::getUntrackedParameter<std::vector<EventID> >(char const* name) const {
02119 return getEntryPointerOrThrow_(name)->getVEventID();
02120 }
02121
02122
02123
02124
02125 template<>
02126 LuminosityBlockID
02127 ParameterSet::getUntrackedParameter<LuminosityBlockID>(char const* name, LuminosityBlockID const& defaultValue) const {
02128 Entry const* entryPtr = retrieveUntracked(name);
02129 return entryPtr == 0 ? defaultValue : entryPtr->getLuminosityBlockID();
02130 }
02131
02132 template<>
02133 LuminosityBlockID
02134 ParameterSet::getUntrackedParameter<LuminosityBlockID>(char const* name) const {
02135 return getEntryPointerOrThrow_(name)->getLuminosityBlockID();
02136 }
02137
02138 template<>
02139 std::vector<LuminosityBlockID>
02140 ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockID> >(char const* name,
02141 std::vector<LuminosityBlockID> const& defaultValue) const {
02142 Entry const* entryPtr = retrieveUntracked(name);
02143 return entryPtr == 0 ? defaultValue : entryPtr->getVLuminosityBlockID();
02144 }
02145
02146 template<>
02147 std::vector<LuminosityBlockID>
02148 ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockID> >(char const* name) const {
02149 return getEntryPointerOrThrow_(name)->getVLuminosityBlockID();
02150 }
02151
02152
02153
02154
02155 template<>
02156 EventRange
02157 ParameterSet::getUntrackedParameter<EventRange>(char const* name, EventRange const& defaultValue) const {
02158 Entry const* entryPtr = retrieveUntracked(name);
02159 return entryPtr == 0 ? defaultValue : entryPtr->getEventRange();
02160 }
02161
02162 template<>
02163 EventRange
02164 ParameterSet::getUntrackedParameter<EventRange>(char const* name) const {
02165 return getEntryPointerOrThrow_(name)->getEventRange();
02166 }
02167
02168 template<>
02169 std::vector<EventRange>
02170 ParameterSet::getUntrackedParameter<std::vector<EventRange> >(char const* name,
02171 std::vector<EventRange> const& defaultValue) const {
02172 Entry const* entryPtr = retrieveUntracked(name);
02173 return entryPtr == 0 ? defaultValue : entryPtr->getVEventRange();
02174 }
02175
02176 template<>
02177 std::vector<EventRange>
02178 ParameterSet::getUntrackedParameter<std::vector<EventRange> >(char const* name) const {
02179 return getEntryPointerOrThrow_(name)->getVEventRange();
02180 }
02181
02182
02183
02184
02185 template<>
02186 LuminosityBlockRange
02187 ParameterSet::getUntrackedParameter<LuminosityBlockRange>(char const* name, LuminosityBlockRange const& defaultValue) const {
02188 Entry const* entryPtr = retrieveUntracked(name);
02189 return entryPtr == 0 ? defaultValue : entryPtr->getLuminosityBlockRange();
02190 }
02191
02192 template<>
02193 LuminosityBlockRange
02194 ParameterSet::getUntrackedParameter<LuminosityBlockRange>(char const* name) const {
02195 return getEntryPointerOrThrow_(name)->getLuminosityBlockRange();
02196 }
02197
02198 template<>
02199 std::vector<LuminosityBlockRange>
02200 ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockRange> >(char const* name,
02201 std::vector<LuminosityBlockRange> const& defaultValue) const {
02202 Entry const* entryPtr = retrieveUntracked(name);
02203 return entryPtr == 0 ? defaultValue : entryPtr->getVLuminosityBlockRange();
02204 }
02205
02206 template<>
02207 std::vector<LuminosityBlockRange>
02208 ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockRange> >(char const* name) const {
02209 return getEntryPointerOrThrow_(name)->getVLuminosityBlockRange();
02210 }
02211
02212
02213
02214
02215 template<>
02216 ParameterSet
02217 ParameterSet::getUntrackedParameter<ParameterSet>(char const* name, ParameterSet const& defaultValue) const {
02218 return getUntrackedParameterSet(name, defaultValue);
02219 }
02220
02221 template<>
02222 VParameterSet
02223 ParameterSet::getUntrackedParameter<VParameterSet>(char const* name, VParameterSet const& defaultValue) const {
02224 return getUntrackedParameterSetVector(name, defaultValue);
02225 }
02226
02227 template<>
02228 ParameterSet
02229 ParameterSet::getUntrackedParameter<ParameterSet>(std::string const& name, ParameterSet const& defaultValue) const {
02230 return getUntrackedParameterSet(name, defaultValue);
02231 }
02232
02233 template<>
02234 VParameterSet
02235 ParameterSet::getUntrackedParameter<VParameterSet>(std::string const& name, VParameterSet const& defaultValue) const {
02236 return getUntrackedParameterSetVector(name, defaultValue);
02237 }
02238
02239 template<>
02240 ParameterSet
02241 ParameterSet::getUntrackedParameter<ParameterSet>(char const* name) const {
02242 return getUntrackedParameterSet(name);
02243 }
02244
02245 template<>
02246 VParameterSet
02247 ParameterSet::getUntrackedParameter<VParameterSet>(char const* name) const {
02248 return getUntrackedParameterSetVector(name);
02249 }
02250
02251 template<>
02252 ParameterSet
02253 ParameterSet::getUntrackedParameter<ParameterSet>(std::string const& name) const {
02254 return getUntrackedParameterSet(name);
02255 }
02256
02257 template<>
02258 VParameterSet
02259 ParameterSet::getUntrackedParameter<VParameterSet>(std::string const& name) const {
02260 return getUntrackedParameterSetVector(name);
02261 }
02262
02263
02264
02265
02266 template<>
02267 void
02268 ParameterSet::addParameter<ParameterSet>(std::string const& name, ParameterSet const& value) {
02269 invalidateRegistration(name);
02270 insertParameterSet(true, name, ParameterSetEntry(value, true));
02271 }
02272
02273 template<>
02274 void
02275 ParameterSet::addParameter<VParameterSet>(std::string const& name, VParameterSet const& value) {
02276 invalidateRegistration(name);
02277 insertVParameterSet(true, name, VParameterSetEntry(value, true));
02278 }
02279
02280 template<>
02281 void
02282 ParameterSet::addParameter<ParameterSet>(char const* name, ParameterSet const& value) {
02283 invalidateRegistration(name);
02284 insertParameterSet(true, name, ParameterSetEntry(value, true));
02285 }
02286
02287 template<>
02288 void
02289 ParameterSet::addParameter<VParameterSet>(char const* name, VParameterSet const& value) {
02290 invalidateRegistration(name);
02291 insertVParameterSet(true, name, VParameterSetEntry(value, true));
02292 }
02293
02294 template<>
02295 void
02296 ParameterSet::addUntrackedParameter<ParameterSet>(std::string const& name, ParameterSet const& value) {
02297 insertParameterSet(true, name, ParameterSetEntry(value, false));
02298 }
02299
02300 template<>
02301 void
02302 ParameterSet::addUntrackedParameter<VParameterSet>(std::string const& name, VParameterSet const& value) {
02303 insertVParameterSet(true, name, VParameterSetEntry(value, false));
02304 }
02305
02306 template<>
02307 void
02308 ParameterSet::addUntrackedParameter<ParameterSet>(char const* name, ParameterSet const& value) {
02309 insertParameterSet(true, name, ParameterSetEntry(value, false));
02310 }
02311
02312 template<>
02313 void
02314 ParameterSet::addUntrackedParameter<VParameterSet>(char const* name, VParameterSet const& value) {
02315 insertVParameterSet(true, name, VParameterSetEntry(value, false));
02316 }
02317
02318
02319
02320
02321 template<>
02322 std::vector<std::string>
02323 ParameterSet::getParameterNamesForType<ParameterSet>(bool trackiness) const {
02324 std::vector<std::string> output;
02325 getParameterSetNames(output, trackiness);
02326 return output;
02327 }
02328
02329 template<>
02330 std::vector<std::string>
02331 ParameterSet::getParameterNamesForType<VParameterSet>(bool trackiness) const {
02332 std::vector<std::string> output;
02333 getParameterSetVectorNames(output, trackiness);
02334 return output;
02335 }
02336
02337 ParameterSet const&
02338 ParameterSet::getParameterSet(std::string const& name) const {
02339 return retrieveParameterSet(name).pset();
02340 }
02341
02342 ParameterSet const&
02343 ParameterSet::getParameterSet(char const* name) const {
02344 return retrieveParameterSet(name).pset();
02345 }
02346
02347 ParameterSet const&
02348 ParameterSet::getUntrackedParameterSet(std::string const& name, ParameterSet const& defaultValue) const {
02349 return getUntrackedParameterSet(name.c_str(), defaultValue);
02350 }
02351
02352 ParameterSet const&
02353 ParameterSet::getUntrackedParameterSet(char const* name, ParameterSet const& defaultValue) const {
02354 ParameterSetEntry const* entryPtr = retrieveUntrackedParameterSet(name);
02355 if(entryPtr == 0) {
02356 if(!defaultValue.isRegistered()) {
02357 const_cast<ParameterSet&>(defaultValue).registerIt();
02358 }
02359 return defaultValue;
02360 }
02361 return entryPtr->pset();
02362 }
02363
02364 ParameterSet const&
02365 ParameterSet::getUntrackedParameterSet(std::string const& name) const {
02366 return getUntrackedParameterSet(name.c_str());
02367 }
02368
02369 ParameterSet const&
02370 ParameterSet::getUntrackedParameterSet(char const* name) const {
02371 ParameterSetEntry const* result = retrieveUntrackedParameterSet(name);
02372 if(result == 0)
02373 throw Exception(errors::Configuration, "MissingParameter:")
02374 << "The required ParameterSet '" << name << "' was not specified.\n";
02375 return result->pset();
02376 }
02377
02378 VParameterSet const&
02379 ParameterSet::getParameterSetVector(std::string const& name) const {
02380 return retrieveVParameterSet(name).vpset();
02381 }
02382
02383 VParameterSet const&
02384 ParameterSet::getParameterSetVector(char const* name) const {
02385 return retrieveVParameterSet(name).vpset();
02386 }
02387
02388 VParameterSet const&
02389 ParameterSet::getUntrackedParameterSetVector(std::string const& name, VParameterSet const& defaultValue) const {
02390 return getUntrackedParameterSetVector(name.c_str(), defaultValue);
02391 }
02392
02393 VParameterSet const&
02394 ParameterSet::getUntrackedParameterSetVector(char const* name, VParameterSet const& defaultValue) const {
02395 VParameterSetEntry const* entryPtr = retrieveUntrackedVParameterSet(name);
02396 return entryPtr == 0 ? defaultValue : entryPtr->vpset();
02397 }
02398
02399 VParameterSet const&
02400 ParameterSet::getUntrackedParameterSetVector(std::string const& name) const {
02401 return getUntrackedParameterSetVector(name.c_str());
02402 }
02403
02404 VParameterSet const&
02405 ParameterSet::getUntrackedParameterSetVector(char const* name) const {
02406 VParameterSetEntry const* result = retrieveUntrackedVParameterSet(name);
02407 if(result == 0)
02408 throw Exception(errors::Configuration, "MissingParameter:")
02409 << "The required ParameterSetVector '" << name << "' was not specified.\n";
02410 return result->vpset();
02411 }
02412
02413
02414 ParameterSet::Bool
02415 operator&&(ParameterSet::Bool a, ParameterSet::Bool b) {
02416 if(a == ParameterSet::False || b == ParameterSet::False) {
02417 return ParameterSet::False;
02418 } else if(a == ParameterSet::Unknown || b == ParameterSet::Unknown) {
02419 return ParameterSet::Unknown;
02420 }
02421 return ParameterSet::True;
02422 }
02423
02424
02425 }