ParameterSet

ParameterTypeTraits

ParameterTypeTraits

ParameterTypeTraits

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114
#ifndef FWCore_ParameterSet_ParameterSet_h
#define FWCore_ParameterSet_ParameterSet_h

// ----------------------------------------------------------------------
// Declaration for ParameterSet(parameter set) and related types
// ----------------------------------------------------------------------

// ----------------------------------------------------------------------
// prolog

// ----------------------------------------------------------------------
// prerequisite source files and headers

#include "DataFormats/Provenance/interface/ParameterSetID.h"
#include "FWCore/ParameterSet/interface/Entry.h"
#include "FWCore/Utilities/interface/FileInPath.h"
#include "FWCore/ParameterSet/interface/ParameterSetEntry.h"
#include "FWCore/ParameterSet/interface/VParameterSetEntry.h"

#include <iosfwd>
#include <map>
#include <memory>
#include <string>
#include <string_view>
#include <vector>
#include <array>

// ----------------------------------------------------------------------
// contents
namespace cms {
  class Digest;
}

namespace edm {
  class ModuleDescription;
  typedef std::vector<ParameterSet> VParameterSet;

  template <typename T>
  struct ParameterTypeTraits {
    //When specializing the template, include the following in the struct:
    //
    // using GetType = <underlying parameter type to get from the ParameterSet>;
    //
    // //Function to convert the parameter type into the requested type
    // static T convert(GetType, std::string const&);
  };

  class ParameterSet {
  public:
    template <typename T>
    friend class ParameterDescription;

    // default-construct
    ParameterSet();

    // construct from coded string.
    explicit ParameterSet(std::string_view rep);

    ~ParameterSet() = default;
    ParameterSet(ParameterSet const& other) = default;
    ParameterSet(ParameterSet&& other) = default;
    ParameterSet& operator=(ParameterSet const& other) = default;
    ParameterSet& operator=(ParameterSet&& other) = default;

    void swap(ParameterSet& other);

    void copyForModify(ParameterSet const& other);

    // identification
    ParameterSetID id() const;
    void setID(ParameterSetID const& id);
    bool isRegistered() const { return id_.isValid(); }
    ParameterSetID trackedID() const { return id(); }  // to be phased out.

    // Entry-handling
    Entry const& retrieve(char const*) const;
    Entry const& retrieve(std::string const&) const;
    Entry const* retrieveUntracked(char const*) const;
    Entry const* retrieveUntracked(std::string const&) const;
    Entry const* retrieveUnknown(char const*) const;
    Entry const* retrieveUnknown(std::string const&) const;
    ParameterSetEntry const& retrieveParameterSet(std::string const&) const;
    ParameterSetEntry const* retrieveUntrackedParameterSet(std::string const&) const;
    ParameterSetEntry const* retrieveUnknownParameterSet(std::string const&) const;
    VParameterSetEntry const& retrieveVParameterSet(std::string const&) const;
    VParameterSetEntry const* retrieveUntrackedVParameterSet(std::string const&) const;
    VParameterSetEntry const* retrieveUnknownVParameterSet(std::string const&) const;

    void insertParameterSet(bool okay_to_replace, std::string const& name, ParameterSetEntry const& entry);
    void insertVParameterSet(bool okay_to_replace, std::string const& name, VParameterSetEntry const& entry);
    void insert(bool ok_to_replace, char const*, Entry const&);
    void insert(bool ok_to_replace, std::string const&, Entry const&);
    void augment(ParameterSet const& from);
    void copyFrom(ParameterSet const& from, std::string const& name);
    std::string getParameterAsString(std::string const& name) const;

    // encode only tracked parameters
    std::string toString() const;
    void toString(std::string& result) const;
    void toDigest(cms::Digest& digest) const;

    //encode tracked and untracked parameters
    void allToString(std::string& result) const;

    template <typename T>
    T getParameter(std::string const&) const;

    template <typename T>
    T getParameter(char const*) const;

    ParameterSet const& getParameterSet(std::string const&) const;

    ParameterSet const& getParameterSet(char const*) const;

    ParameterSet getUntrackedParameterSet(std::string const& name, ParameterSet const& defaultValue) const;

    ParameterSet getUntrackedParameterSet(char const* name, ParameterSet const& defaultValue) const;

    ParameterSet const& getUntrackedParameterSet(std::string const& name) const;

    ParameterSet const& getUntrackedParameterSet(char const* name) const;

    VParameterSet const& getParameterSetVector(std::string const& name) const;

    VParameterSet const& getParameterSetVector(char const* name) const;

    VParameterSet getUntrackedParameterSetVector(std::string const& name, VParameterSet const& defaultValue) const;

    VParameterSet getUntrackedParameterSetVector(char const* name, VParameterSet const& defaultValue) const;

    VParameterSet const& getUntrackedParameterSetVector(std::string const& name) const;

    VParameterSet const& getUntrackedParameterSetVector(char const* name) const;

    template <typename T>
    void addParameter(std::string const& name, T const& value) {
      invalidateRegistration(name);
      insert(true, name, Entry(name, value, true));
    }

    template <typename T>
    void addParameter(char const* name, T const& value) {
      invalidateRegistration(name);
      insert(true, name, Entry(name, value, true));
    }

    template <typename T>
    T getUntrackedParameter(std::string const&, T const&) const;

    template <typename T>
    T getUntrackedParameter(char const*, T const&) const;

    template <typename T>
    T getUntrackedParameter(std::string const&) const;

    template <typename T>
    T getUntrackedParameter(char const*) const;

    /// The returned value is the number of new FileInPath objects
    /// pushed into the vector.
    /// N.B.: The vector 'output' is *not* cleared; new entries are
    /// added with push_back.
    std::vector<FileInPath>::size_type getAllFileInPaths(std::vector<FileInPath>& output) const;

    std::vector<std::string> getParameterNames() const;

    /// checks if a parameter exists
    bool exists(std::string const& parameterName) const;

    /// checks if a parameter exists as a given type
    template <typename T>
    bool existsAs(std::string const& parameterName, bool trackiness = true) const {
      std::vector<std::string> names = getParameterNamesForType<T>(trackiness);
      return std::find(names.begin(), names.end(), parameterName) != names.end();
    }

    void deprecatedInputTagWarning(std::string const& name, std::string const& label) const;

    template <typename T>
    std::vector<std::string> getParameterNamesForType(bool trackiness = true) const {
      std::vector<std::string> result;
      // This is icky, but I don't know of another way in the current
      // code to get at the character code that denotes type T.
      T value = T();
      Entry type_translator("", value, trackiness);
      char type_code = type_translator.typeCode();

      (void)getNamesByCode_(type_code, trackiness, result);
      return result;
    }

    template <typename T>
    void addUntrackedParameter(std::string const& name, T const& value) {
      insert(true, name, Entry(name, value, false));
    }

    template <typename T>
    void addUntrackedParameter(char const* name, T const& value) {
      insert(true, name, Entry(name, value, false));
    }

    bool empty() const { return tbl_.empty() && psetTable_.empty() && vpsetTable_.empty(); }

    ParameterSet trackedPart() const;

    // Return the names of all parameters of type ParameterSet,
    // pushing the names into the argument 'output'. Return the number
    // of names pushed into the vector. If 'trackiness' is true, we
    // return tracked parameters; if 'trackiness' is false, w return
    // untracked parameters.
    size_t getParameterSetNames(std::vector<std::string>& output, bool trackiness = true) const;

    // Return the names of all parameters of type
    // vector<ParameterSet>, pushing the names into the argument
    // 'output'. Return the number of names pushed into the vector. If
    // 'trackiness' is true, we return tracked parameters; if
    // 'trackiness' is false, w return untracked parameters.
    size_t getParameterSetVectorNames(std::vector<std::string>& output, bool trackiness = true) const;

    // need a simple interface for python
    std::string dump(unsigned int indent = 0) const;

    friend std::ostream& operator<<(std::ostream& os, ParameterSet const& pset);

    ParameterSet const& registerIt();

    std::unique_ptr<ParameterSet> popParameterSet(std::string const& name);
    void eraseSimpleParameter(std::string const& name);
    void eraseOrSetUntrackedParameterSet(std::string const& name);

    std::vector<ParameterSet> popVParameterSet(std::string const& name);

    typedef std::map<std::string, Entry, std::less<>> table;
    table const& tbl() const { return tbl_; }

    typedef std::map<std::string, ParameterSetEntry, std::less<>> psettable;
    psettable const& psetTable() const { return psetTable_; }

    typedef std::map<std::string, VParameterSetEntry, std::less<>> vpsettable;
    vpsettable const& vpsetTable() const { return vpsetTable_; }

    ParameterSet* getPSetForUpdate(std::string const& name, bool& isTracked);

    ParameterSet* getPSetForUpdate(std::string const& name) {
      bool isTracked = false;
      return getPSetForUpdate(name, isTracked);
    }

    VParameterSetEntry* getPSetVectorForUpdate(std::string const& name);

    // construct from coded string and register it.
    static void registerFromString(std::string const& rep);

    // return ID of empty parameter set without registering it.
    static ParameterSetID emptyParameterSetID();

    // returns empty if cannot find extent
    static std::string_view extent(std::string_view);

  private:
    // construct from coded string and id.
    ParameterSet(std::string_view rep, ParameterSetID const& id);

    // decode
    bool fromString(std::string_view);

    void toStringImp(std::string&, bool useAll) const;

    table tbl_;
    psettable psetTable_;
    vpsettable vpsetTable_;

    // If the id_ is invalid, that means a new value should be
    // calculated before the value is returned. Upon registration, the
    // id_ is made valid. Updating any tracked parameter invalidates the id_.
    ParameterSetID id_;

    void invalidateRegistration(std::string const& nameOfTracked);

    void calculateID();

    // get the untracked Entry object, throwing an exception if it is
    // not found.
    Entry const* getEntryPointerOrThrow_(std::string const& name) const;
    Entry const* getEntryPointerOrThrow_(char const* name) const;

    // Return the names of all the entries with the given typecode and
    // given status (trackiness)
    size_t getNamesByCode_(char code, bool trackiness, std::vector<std::string>& output) const;

  };  // ParameterSet

  inline void swap(ParameterSet& a, ParameterSet& b) { a.swap(b); }

  bool operator==(ParameterSet const& a, ParameterSet const& b);

  bool isTransientEqual(ParameterSet const& a, ParameterSet const& b);

  inline bool operator!=(ParameterSet const& a, ParameterSet const& b) { return !(a == b); }

  // Free function to retrieve a parameter set, given the parameter set ID.
  ParameterSet const& getParameterSet(ParameterSetID const& id);

  ParameterSet const& getProcessParameterSetContainingModule(ModuleDescription const& moduleDescription);

  template <typename T>
  inline T ParameterSet::getParameter(std::string const& name) const {
    using GetType = typename ParameterTypeTraits<T>::GetType;
    return ParameterTypeTraits<T>::convert(getParameter<GetType>(name), name);
  }

  template <typename T>
  inline T ParameterSet::getParameter(const char* name) const {
    using GetType = typename ParameterTypeTraits<T>::GetType;
    return ParameterTypeTraits<T>::convert(getParameter<GetType>(name), name);
  }
  // specializations
  // ----------------------------------------------------------------------
  namespace pset::exceptions {
    void throwWrongNumberOfElements(std::string const& iParameterName, size_t iExpected, size_t iGot);
  }
  //Read an std::array from an std::vector
  template <typename T, std::size_t N>
  struct ParameterTypeTraits<std::array<T, N>> {
    using GetType = std::vector<T>;
    static std::array<T, N> convert(std::vector<T> iVec, std::string const& iName) {
      if (iVec.size() != N) {
        pset::exceptions::throwWrongNumberOfElements(iName, N, iVec.size());
      }
      std::array<T, N> a;
      std::copy_n(std::make_move_iterator(iVec.begin()), N, a.begin());
      return a;
    }
  };
  // read an std::vector<std::pair<std::string, T>> from std::vector<PSet>
  template <typename T>
  struct ParameterTypeTraits<std::vector<std::pair<std::string, T>>> {
    using GetType = std::vector<edm::ParameterSet>;
    static auto convert(std::vector<edm::ParameterSet> vpset, std::string const& iName) {
      std::vector<std::pair<std::string, T>> ret(vpset.size());
      std::transform(vpset.begin(), vpset.end(), ret.begin(), [](edm::ParameterSet const& pset) {
        return std::pair(pset.getParameter<std::string>("key"), pset.getParameter<T>("value"));
      });
      return ret;
    }
  };
  // ----------------------------------------------------------------------

  template <>
  bool ParameterSet::getParameter<bool>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // Int32, vInt32

  template <>
  int ParameterSet::getParameter<int>(std::string const& name) const;

  template <>
  std::vector<int> ParameterSet::getParameter<std::vector<int>>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // Int64, vInt64

  template <>
  long long ParameterSet::getParameter<long long>(std::string const& name) const;

  template <>
  std::vector<long long> ParameterSet::getParameter<std::vector<long long>>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // Uint32, vUint32

  template <>
  unsigned int ParameterSet::getParameter<unsigned int>(std::string const& name) const;

  template <>
  std::vector<unsigned int> ParameterSet::getParameter<std::vector<unsigned int>>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // Uint64, vUint64

  template <>
  unsigned long long ParameterSet::getParameter<unsigned long long>(std::string const& name) const;

  template <>
  std::vector<unsigned long long> ParameterSet::getParameter<std::vector<unsigned long long>>(
      std::string const& name) const;

  // ----------------------------------------------------------------------
  // Double, vDouble

  template <>
  double ParameterSet::getParameter<double>(std::string const& name) const;

  template <>
  std::vector<double> ParameterSet::getParameter<std::vector<double>>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // String, vString

  template <>
  std::string ParameterSet::getParameter<std::string>(std::string const& name) const;

  template <>
  std::vector<std::string> ParameterSet::getParameter<std::vector<std::string>>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // FileInPath

  template <>
  FileInPath ParameterSet::getParameter<FileInPath>(std::string const& name) const;

  // FileInPath can't default-construct something useful, so we specialize
  // this template
  template <>
  std::vector<std::string> ParameterSet::getParameterNamesForType<FileInPath>(bool trackiness) const;

  // ----------------------------------------------------------------------
  // InputTag

  template <>
  InputTag ParameterSet::getParameter<InputTag>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // VInputTag

  template <>
  std::vector<InputTag> ParameterSet::getParameter<std::vector<InputTag>>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // ESInputTag

  template <>
  ESInputTag ParameterSet::getParameter<ESInputTag>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // VESInputTag

  template <>
  std::vector<ESInputTag> ParameterSet::getParameter<std::vector<ESInputTag>>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // EventID

  template <>
  EventID ParameterSet::getParameter<EventID>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // VEventID

  template <>
  std::vector<EventID> ParameterSet::getParameter<std::vector<EventID>>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // LuminosityBlockID

  template <>
  LuminosityBlockID ParameterSet::getParameter<LuminosityBlockID>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // VLuminosityBlockID

  template <>
  std::vector<LuminosityBlockID> ParameterSet::getParameter<std::vector<LuminosityBlockID>>(
      std::string const& name) const;

  // ----------------------------------------------------------------------
  // EventRange

  template <>
  EventRange ParameterSet::getParameter<EventRange>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // VEventRange

  template <>
  std::vector<EventRange> ParameterSet::getParameter<std::vector<EventRange>>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // LuminosityBlockRange

  template <>
  LuminosityBlockRange ParameterSet::getParameter<LuminosityBlockRange>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // VLuminosityBlockRange

  template <>
  std::vector<LuminosityBlockRange> ParameterSet::getParameter<std::vector<LuminosityBlockRange>>(
      std::string const& name) const;

  // ----------------------------------------------------------------------
  // PSet, vPSet

  template <>
  ParameterSet ParameterSet::getParameter<ParameterSet>(std::string const& name) const;

  template <>
  VParameterSet ParameterSet::getParameter<VParameterSet>(std::string const& name) const;

  template <>
  void ParameterSet::addParameter<ParameterSet>(std::string const& name, ParameterSet const& value);

  template <>
  void ParameterSet::addParameter<ParameterSet>(char const* name, ParameterSet const& value);

  template <>
  void ParameterSet::addUntrackedParameter<ParameterSet>(std::string const& name, ParameterSet const& value);

  template <>
  void ParameterSet::addUntrackedParameter<ParameterSet>(char const* name, ParameterSet const& value);

  template <>
  void ParameterSet::addParameter<VParameterSet>(std::string const& name, VParameterSet const& value);

  template <>
  void ParameterSet::addParameter<VParameterSet>(char const* name, VParameterSet const& value);

  template <>
  void ParameterSet::addUntrackedParameter<VParameterSet>(std::string const& name, VParameterSet const& value);

  template <>
  void ParameterSet::addUntrackedParameter<VParameterSet>(char const* name, VParameterSet const& value);

  // untracked parameters

  // ----------------------------------------------------------------------
  // Bool, vBool

  template <>
  bool ParameterSet::getUntrackedParameter<bool>(std::string const& name, bool const& defaultValue) const;

  template <>
  bool ParameterSet::getUntrackedParameter<bool>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // Int32, vInt32

  template <>
  int ParameterSet::getUntrackedParameter<int>(std::string const& name, int const& defaultValue) const;

  template <>
  int ParameterSet::getUntrackedParameter<int>(std::string const& name) const;

  template <>
  std::vector<int> ParameterSet::getUntrackedParameter<std::vector<int>>(std::string const& name,
                                                                         std::vector<int> const& defaultValue) const;

  template <>
  std::vector<int> ParameterSet::getUntrackedParameter<std::vector<int>>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // Uint32, vUint32

  template <>
  unsigned int ParameterSet::getUntrackedParameter<unsigned int>(std::string const& name,
                                                                 unsigned int const& defaultValue) const;

  template <>
  unsigned int ParameterSet::getUntrackedParameter<unsigned int>(std::string const& name) const;

  template <>
  std::vector<unsigned int> ParameterSet::getUntrackedParameter<std::vector<unsigned int>>(
      std::string const& name, std::vector<unsigned int> const& defaultValue) const;

  template <>
  std::vector<unsigned int> ParameterSet::getUntrackedParameter<std::vector<unsigned int>>(
      std::string const& name) const;

  // ----------------------------------------------------------------------
  // Uint64, vUint64

  template <>
  unsigned long long ParameterSet::getUntrackedParameter<unsigned long long>(
      std::string const& name, unsigned long long const& defaultValue) const;

  template <>
  unsigned long long ParameterSet::getUntrackedParameter<unsigned long long>(std::string const& name) const;

  template <>
  std::vector<unsigned long long> ParameterSet::getUntrackedParameter<std::vector<unsigned long long>>(
      std::string const& name, std::vector<unsigned long long> const& defaultValue) const;

  template <>
  std::vector<unsigned long long> ParameterSet::getUntrackedParameter<std::vector<unsigned long long>>(
      std::string const& name) const;

  // ----------------------------------------------------------------------
  // Int64, Vint64

  template <>
  long long ParameterSet::getUntrackedParameter<long long>(std::string const& name,
                                                           long long const& defaultValue) const;

  template <>
  long long ParameterSet::getUntrackedParameter<long long>(std::string const& name) const;

  template <>
  std::vector<long long> ParameterSet::getUntrackedParameter<std::vector<long long>>(
      std::string const& name, std::vector<long long> const& defaultValue) const;

  template <>
  std::vector<long long> ParameterSet::getUntrackedParameter<std::vector<long long>>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // Double, vDouble

  template <>
  double ParameterSet::getUntrackedParameter<double>(std::string const& name, double const& defaultValue) const;

  template <>
  double ParameterSet::getUntrackedParameter<double>(std::string const& name) const;

  template <>
  std::vector<double> ParameterSet::getUntrackedParameter<std::vector<double>>(
      std::string const& name, std::vector<double> const& defaultValue) const;

  template <>
  std::vector<double> ParameterSet::getUntrackedParameter<std::vector<double>>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // String, vString

  template <>
  std::string ParameterSet::getUntrackedParameter<std::string>(std::string const& name,
                                                               std::string const& defaultValue) const;

  template <>
  std::string ParameterSet::getUntrackedParameter<std::string>(std::string const& name) const;

  template <>
  std::vector<std::string> ParameterSet::getUntrackedParameter<std::vector<std::string>>(
      std::string const& name, std::vector<std::string> const& defaultValue) const;

  template <>
  std::vector<std::string> ParameterSet::getUntrackedParameter<std::vector<std::string>>(std::string const& name) const;

  // ----------------------------------------------------------------------
  //  FileInPath

  template <>
  FileInPath ParameterSet::getUntrackedParameter<FileInPath>(std::string const& name,
                                                             FileInPath const& defaultValue) const;

  template <>
  FileInPath ParameterSet::getUntrackedParameter<FileInPath>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // InputTag, VInputTag

  template <>
  InputTag ParameterSet::getUntrackedParameter<InputTag>(std::string const& name, InputTag const& defaultValue) const;

  template <>
  InputTag ParameterSet::getUntrackedParameter<InputTag>(std::string const& name) const;

  template <>
  std::vector<InputTag> ParameterSet::getUntrackedParameter<std::vector<InputTag>>(
      std::string const& name, std::vector<InputTag> const& defaultValue) const;

  template <>
  std::vector<InputTag> ParameterSet::getUntrackedParameter<std::vector<InputTag>>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // EventID, VEventID

  template <>
  EventID ParameterSet::getUntrackedParameter<EventID>(std::string const& name, EventID const& defaultValue) const;

  template <>
  EventID ParameterSet::getUntrackedParameter<EventID>(std::string const& name) const;

  template <>
  std::vector<EventID> ParameterSet::getUntrackedParameter<std::vector<EventID>>(
      std::string const& name, std::vector<EventID> const& defaultValue) const;
  template <>
  std::vector<EventID> ParameterSet::getUntrackedParameter<std::vector<EventID>>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // LuminosityBlockID, VLuminosityBlockID

  template <>
  LuminosityBlockID ParameterSet::getUntrackedParameter<LuminosityBlockID>(std::string const& name,
                                                                           LuminosityBlockID const& defaultValue) const;

  template <>
  LuminosityBlockID ParameterSet::getUntrackedParameter<LuminosityBlockID>(std::string const& name) const;

  template <>
  std::vector<LuminosityBlockID> ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockID>>(
      std::string const& name, std::vector<LuminosityBlockID> const& defaultValue) const;
  template <>
  std::vector<LuminosityBlockID> ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockID>>(
      std::string const& name) const;

  // ----------------------------------------------------------------------
  // EventRange, VEventRange

  template <>
  EventRange ParameterSet::getUntrackedParameter<EventRange>(std::string const& name,
                                                             EventRange const& defaultValue) const;

  template <>
  EventRange ParameterSet::getUntrackedParameter<EventRange>(std::string const& name) const;

  template <>
  std::vector<EventRange> ParameterSet::getUntrackedParameter<std::vector<EventRange>>(
      std::string const& name, std::vector<EventRange> const& defaultValue) const;
  template <>
  std::vector<EventRange> ParameterSet::getUntrackedParameter<std::vector<EventRange>>(std::string const& name) const;

  // ----------------------------------------------------------------------
  // LuminosityBlockRange, VLuminosityBlockRange

  template <>
  LuminosityBlockRange ParameterSet::getUntrackedParameter<LuminosityBlockRange>(
      std::string const& name, LuminosityBlockRange const& defaultValue) const;

  template <>
  LuminosityBlockRange ParameterSet::getUntrackedParameter<LuminosityBlockRange>(std::string const& name) const;

  template <>
  std::vector<LuminosityBlockRange> ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockRange>>(
      std::string const& name, std::vector<LuminosityBlockRange> const& defaultValue) const;
  template <>
  std::vector<LuminosityBlockRange> ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockRange>>(
      std::string const& name) const;

  // specializations
  // ----------------------------------------------------------------------
  // Bool, vBool

  template <>
  bool ParameterSet::getParameter<bool>(char const* name) const;

  // ----------------------------------------------------------------------
  // Int32, vInt32

  template <>
  int ParameterSet::getParameter<int>(char const* name) const;

  template <>
  std::vector<int> ParameterSet::getParameter<std::vector<int>>(char const* name) const;

  // ----------------------------------------------------------------------
  // Int64, vInt64

  template <>
  long long ParameterSet::getParameter<long long>(char const* name) const;

  template <>
  std::vector<long long> ParameterSet::getParameter<std::vector<long long>>(char const* name) const;

  // ----------------------------------------------------------------------
  // Uint32, vUint32

  template <>
  unsigned int ParameterSet::getParameter<unsigned int>(char const* name) const;

  template <>
  std::vector<unsigned int> ParameterSet::getParameter<std::vector<unsigned int>>(char const* name) const;

  // ----------------------------------------------------------------------
  // Uint64, vUint64

  template <>
  unsigned long long ParameterSet::getParameter<unsigned long long>(char const* name) const;

  template <>
  std::vector<unsigned long long> ParameterSet::getParameter<std::vector<unsigned long long>>(char const* name) const;

  // ----------------------------------------------------------------------
  // Double, vDouble

  template <>
  double ParameterSet::getParameter<double>(char const* name) const;

  template <>
  std::vector<double> ParameterSet::getParameter<std::vector<double>>(char const* name) const;

  // ----------------------------------------------------------------------
  // String, vString

  template <>
  std::string ParameterSet::getParameter<std::string>(char const* name) const;

  template <>
  std::vector<std::string> ParameterSet::getParameter<std::vector<std::string>>(char const* name) const;

  // ----------------------------------------------------------------------
  // FileInPath

  template <>
  FileInPath ParameterSet::getParameter<FileInPath>(char const* name) const;

  // ----------------------------------------------------------------------
  // InputTag

  template <>
  InputTag ParameterSet::getParameter<InputTag>(char const* name) const;

  // ----------------------------------------------------------------------
  // VInputTag

  template <>
  std::vector<InputTag> ParameterSet::getParameter<std::vector<InputTag>>(char const* name) const;

  // ----------------------------------------------------------------------
  // ESInputTag

  template <>
  ESInputTag ParameterSet::getParameter<ESInputTag>(char const* name) const;

  // ----------------------------------------------------------------------
  // VESInputTag

  template <>
  std::vector<ESInputTag> ParameterSet::getParameter<std::vector<ESInputTag>>(char const* name) const;

  // ----------------------------------------------------------------------
  // EventID

  template <>
  EventID ParameterSet::getParameter<EventID>(char const* name) const;

  // ----------------------------------------------------------------------
  // VEventID

  template <>
  std::vector<EventID> ParameterSet::getParameter<std::vector<EventID>>(char const* name) const;

  // ----------------------------------------------------------------------
  // LuminosityBlockID

  template <>
  LuminosityBlockID ParameterSet::getParameter<LuminosityBlockID>(char const* name) const;

  // ----------------------------------------------------------------------
  // VLuminosityBlockID

  template <>
  std::vector<LuminosityBlockID> ParameterSet::getParameter<std::vector<LuminosityBlockID>>(char const* name) const;

  // ----------------------------------------------------------------------
  // EventRange

  template <>
  EventRange ParameterSet::getParameter<EventRange>(char const* name) const;

  // ----------------------------------------------------------------------
  // VEventRange

  template <>
  std::vector<EventRange> ParameterSet::getParameter<std::vector<EventRange>>(char const* name) const;

  // ----------------------------------------------------------------------
  // LuminosityBlockRange

  template <>
  LuminosityBlockRange ParameterSet::getParameter<LuminosityBlockRange>(char const* name) const;

  // ----------------------------------------------------------------------
  // VLuminosityBlockRange

  template <>
  std::vector<LuminosityBlockRange> ParameterSet::getParameter<std::vector<LuminosityBlockRange>>(
      char const* name) const;

  // ----------------------------------------------------------------------
  // PSet, vPSet

  template <>
  ParameterSet ParameterSet::getParameter<ParameterSet>(char const* name) const;

  template <>
  VParameterSet ParameterSet::getParameter<VParameterSet>(char const* name) const;

  // untracked parameters

  // ----------------------------------------------------------------------
  // Bool, vBool

  template <>
  bool ParameterSet::getUntrackedParameter<bool>(char const* name, bool const& defaultValue) const;

  template <>
  bool ParameterSet::getUntrackedParameter<bool>(char const* name) const;

  // ----------------------------------------------------------------------
  // Int32, vInt32

  template <>
  int ParameterSet::getUntrackedParameter<int>(char const* name, int const& defaultValue) const;

  template <>
  int ParameterSet::getUntrackedParameter<int>(char const* name) const;

  template <>
  std::vector<int> ParameterSet::getUntrackedParameter<std::vector<int>>(char const* name,
                                                                         std::vector<int> const& defaultValue) const;

  template <>
  std::vector<int> ParameterSet::getUntrackedParameter<std::vector<int>>(char const* name) const;

  // ----------------------------------------------------------------------
  // Uint32, vUint32

  template <>
  unsigned int ParameterSet::getUntrackedParameter<unsigned int>(char const* name,
                                                                 unsigned int const& defaultValue) const;

  template <>
  unsigned int ParameterSet::getUntrackedParameter<unsigned int>(char const* name) const;

  template <>
  std::vector<unsigned int> ParameterSet::getUntrackedParameter<std::vector<unsigned int>>(
      char const* name, std::vector<unsigned int> const& defaultValue) const;

  template <>
  std::vector<unsigned int> ParameterSet::getUntrackedParameter<std::vector<unsigned int>>(char const* name) const;

  // ----------------------------------------------------------------------
  // Uint64, vUint64

  template <>
  unsigned long long ParameterSet::getUntrackedParameter<unsigned long long>(
      char const* name, unsigned long long const& defaultValue) const;

  template <>
  unsigned long long ParameterSet::getUntrackedParameter<unsigned long long>(char const* name) const;

  template <>
  std::vector<unsigned long long> ParameterSet::getUntrackedParameter<std::vector<unsigned long long>>(
      char const* name, std::vector<unsigned long long> const& defaultValue) const;

  template <>
  std::vector<unsigned long long> ParameterSet::getUntrackedParameter<std::vector<unsigned long long>>(
      char const* name) const;

  // ----------------------------------------------------------------------
  // Int64, Vint64

  template <>
  long long ParameterSet::getUntrackedParameter<long long>(char const* name, long long const& defaultValue) const;

  template <>
  long long ParameterSet::getUntrackedParameter<long long>(char const* name) const;

  template <>
  std::vector<long long> ParameterSet::getUntrackedParameter<std::vector<long long>>(
      char const* name, std::vector<long long> const& defaultValue) const;

  template <>
  std::vector<long long> ParameterSet::getUntrackedParameter<std::vector<long long>>(char const* name) const;

  // ----------------------------------------------------------------------
  // Double, vDouble

  template <>
  double ParameterSet::getUntrackedParameter<double>(char const* name, double const& defaultValue) const;

  template <>
  double ParameterSet::getUntrackedParameter<double>(char const* name) const;

  template <>
  std::vector<double> ParameterSet::getUntrackedParameter<std::vector<double>>(
      char const* name, std::vector<double> const& defaultValue) const;

  template <>
  std::vector<double> ParameterSet::getUntrackedParameter<std::vector<double>>(char const* name) const;

  // ----------------------------------------------------------------------
  // String, vString

  template <>
  std::string ParameterSet::getUntrackedParameter<std::string>(char const* name, std::string const& defaultValue) const;

  template <>
  std::string ParameterSet::getUntrackedParameter<std::string>(char const* name) const;

  template <>
  std::vector<std::string> ParameterSet::getUntrackedParameter<std::vector<std::string>>(
      char const* name, std::vector<std::string> const& defaultValue) const;

  template <>
  std::vector<std::string> ParameterSet::getUntrackedParameter<std::vector<std::string>>(char const* name) const;

  // ----------------------------------------------------------------------
  //  FileInPath

  template <>
  FileInPath ParameterSet::getUntrackedParameter<FileInPath>(char const* name, FileInPath const& defaultValue) const;

  template <>
  FileInPath ParameterSet::getUntrackedParameter<FileInPath>(char const* name) const;

  // ----------------------------------------------------------------------
  // InputTag, VInputTag

  template <>
  InputTag ParameterSet::getUntrackedParameter<InputTag>(char const* name, InputTag const& defaultValue) const;

  template <>
  InputTag ParameterSet::getUntrackedParameter<InputTag>(char const* name) const;

  template <>
  std::vector<InputTag> ParameterSet::getUntrackedParameter<std::vector<InputTag>>(
      char const* name, std::vector<InputTag> const& defaultValue) const;

  template <>
  std::vector<InputTag> ParameterSet::getUntrackedParameter<std::vector<InputTag>>(char const* name) const;

  // ----------------------------------------------------------------------
  // EventID, VEventID

  template <>
  EventID ParameterSet::getUntrackedParameter<EventID>(char const* name, EventID const& defaultValue) const;

  template <>
  EventID ParameterSet::getUntrackedParameter<EventID>(char const* name) const;

  template <>
  std::vector<EventID> ParameterSet::getUntrackedParameter<std::vector<EventID>>(
      char const* name, std::vector<EventID> const& defaultValue) const;
  template <>
  std::vector<EventID> ParameterSet::getUntrackedParameter<std::vector<EventID>>(char const* name) const;

  // ----------------------------------------------------------------------
  // LuminosityBlockID, VLuminosityBlockID

  template <>
  LuminosityBlockID ParameterSet::getUntrackedParameter<LuminosityBlockID>(char const* name,
                                                                           LuminosityBlockID const& defaultValue) const;

  template <>
  LuminosityBlockID ParameterSet::getUntrackedParameter<LuminosityBlockID>(char const* name) const;

  template <>
  std::vector<LuminosityBlockID> ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockID>>(
      char const* name, std::vector<LuminosityBlockID> const& defaultValue) const;
  template <>
  std::vector<LuminosityBlockID> ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockID>>(
      char const* name) const;

  // ----------------------------------------------------------------------
  // EventRange, VEventRange

  template <>
  EventRange ParameterSet::getUntrackedParameter<EventRange>(char const* name, EventRange const& defaultValue) const;

  template <>
  EventRange ParameterSet::getUntrackedParameter<EventRange>(char const* name) const;

  template <>
  std::vector<EventRange> ParameterSet::getUntrackedParameter<std::vector<EventRange>>(
      char const* name, std::vector<EventRange> const& defaultValue) const;
  template <>
  std::vector<EventRange> ParameterSet::getUntrackedParameter<std::vector<EventRange>>(char const* name) const;

  // ----------------------------------------------------------------------
  // LuminosityBlockRange, VLuminosityBlockRange

  template <>
  LuminosityBlockRange ParameterSet::getUntrackedParameter<LuminosityBlockRange>(
      char const* name, LuminosityBlockRange const& defaultValue) const;

  template <>
  LuminosityBlockRange ParameterSet::getUntrackedParameter<LuminosityBlockRange>(char const* name) const;

  template <>
  std::vector<LuminosityBlockRange> ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockRange>>(
      char const* name, std::vector<LuminosityBlockRange> const& defaultValue) const;
  template <>
  std::vector<LuminosityBlockRange> ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockRange>>(
      char const* name) const;

  // ----------------------------------------------------------------------
  // PSet, vPSet

  template <>
  ParameterSet ParameterSet::getUntrackedParameter<ParameterSet>(char const* name,
                                                                 ParameterSet const& defaultValue) const;

  template <>
  ParameterSet ParameterSet::getUntrackedParameter<ParameterSet>(std::string const& name,
                                                                 ParameterSet const& defaultValue) const;

  template <>
  ParameterSet ParameterSet::getUntrackedParameter<ParameterSet>(char const* name) const;

  template <>
  ParameterSet ParameterSet::getUntrackedParameter<ParameterSet>(std::string const& name) const;

  template <>
  VParameterSet ParameterSet::getUntrackedParameter<VParameterSet>(char const* name,
                                                                   VParameterSet const& defaultValue) const;

  template <>
  VParameterSet ParameterSet::getUntrackedParameter<VParameterSet>(char const* name) const;

  template <>
  VParameterSet ParameterSet::getUntrackedParameter<VParameterSet>(std::string const& name,
                                                                   VParameterSet const& defaultValue) const;

  template <>
  VParameterSet ParameterSet::getUntrackedParameter<VParameterSet>(std::string const& name) const;

  template <>
  std::vector<std::string> ParameterSet::getParameterNamesForType<ParameterSet>(bool trackiness) const;

  template <>
  std::vector<std::string> ParameterSet::getParameterNamesForType<VParameterSet>(bool trackiness) const;
}  // namespace edm
#endif