CMS 3D CMS Logo

ParameterSet.h
Go to the documentation of this file.
1 #ifndef FWCore_ParameterSet_ParameterSet_h
2 #define FWCore_ParameterSet_ParameterSet_h
3 
4 // ----------------------------------------------------------------------
5 // Declaration for ParameterSet(parameter set) and related types
6 // ----------------------------------------------------------------------
7 
8 // ----------------------------------------------------------------------
9 // prolog
10 
11 // ----------------------------------------------------------------------
12 // prerequisite source files and headers
13 
19 
20 #include <iosfwd>
21 #include <map>
22 #include <memory>
23 #include <string>
24 #include <vector>
25 
26 // ----------------------------------------------------------------------
27 // contents
28 namespace cms {
29  class Digest;
30 }
31 
32 namespace edm {
34  typedef std::vector<ParameterSet> VParameterSet;
35 
36  class ParameterSet {
37  public:
38  template <typename T>
39  friend class ParameterDescription;
40  enum Bool { False = 0, True = 1, Unknown = 2 };
41 
42  // default-construct
43  ParameterSet();
44 
45  // construct from coded string.
46  explicit ParameterSet(std::string const& rep);
47 
48  ~ParameterSet() = default;
49  ParameterSet(ParameterSet const& other) = default;
50  ParameterSet(ParameterSet&& other) = default;
51  ParameterSet& operator=(ParameterSet const& other) = default;
52  ParameterSet& operator=(ParameterSet&& other) = default;
53 
54  void swap(ParameterSet& other);
55 
56  void copyForModify(ParameterSet const& other);
57 
58  // identification
59  ParameterSetID id() const;
60  void setID(ParameterSetID const& id);
61  bool isRegistered() const { return id_.isValid(); }
62  ParameterSetID trackedID() const { return id(); } // to be phased out.
63 
64  // Entry-handling
65  Entry const& retrieve(char const*) const;
66  Entry const& retrieve(std::string const&) const;
67  Entry const* retrieveUntracked(char const*) const;
68  Entry const* retrieveUntracked(std::string const&) const;
69  Entry const* retrieveUnknown(char const*) const;
70  Entry const* retrieveUnknown(std::string const&) const;
71  ParameterSetEntry const& retrieveParameterSet(std::string const&) const;
72  ParameterSetEntry const* retrieveUntrackedParameterSet(std::string const&) const;
73  ParameterSetEntry const* retrieveUnknownParameterSet(std::string const&) const;
74  VParameterSetEntry const& retrieveVParameterSet(std::string const&) const;
75  VParameterSetEntry const* retrieveUntrackedVParameterSet(std::string const&) const;
76  VParameterSetEntry const* retrieveUnknownVParameterSet(std::string const&) const;
77 
78  void insertParameterSet(bool okay_to_replace, std::string const& name, ParameterSetEntry const& entry);
79  void insertVParameterSet(bool okay_to_replace, std::string const& name, VParameterSetEntry const& entry);
80  void insert(bool ok_to_replace, char const*, Entry const&);
81  void insert(bool ok_to_replace, std::string const&, Entry const&);
82  void augment(ParameterSet const& from);
83  void copyFrom(ParameterSet const& from, std::string const& name);
84  std::string getParameterAsString(std::string const& name) const;
85 
86  // encode only tracked parameters
87  std::string toString() const;
88  void toString(std::string& result) const;
89  void toDigest(cms::Digest& digest) const;
90 
91  //encode tracked and untracked parameters
92  void allToString(std::string& result) const;
93 
94  template <typename T>
95  T getParameter(std::string const&) const;
96 
97  template <typename T>
98  T getParameter(char const*) const;
99 
100  ParameterSet const& getParameterSet(std::string const&) const;
101 
102  ParameterSet const& getParameterSet(char const*) const;
103 
104  ParameterSet getUntrackedParameterSet(std::string const& name, ParameterSet const& defaultValue) const;
105 
106  ParameterSet getUntrackedParameterSet(char const* name, ParameterSet const& defaultValue) const;
107 
108  ParameterSet const& getUntrackedParameterSet(std::string const& name) const;
109 
110  ParameterSet const& getUntrackedParameterSet(char const* name) const;
111 
112  VParameterSet const& getParameterSetVector(std::string const& name) const;
113 
114  VParameterSet const& getParameterSetVector(char const* name) const;
115 
116  VParameterSet getUntrackedParameterSetVector(std::string const& name, VParameterSet const& defaultValue) const;
117 
118  VParameterSet getUntrackedParameterSetVector(char const* name, VParameterSet const& defaultValue) const;
119 
120  VParameterSet const& getUntrackedParameterSetVector(std::string const& name) const;
121 
122  VParameterSet const& getUntrackedParameterSetVector(char const* name) const;
123 
124  template <typename T>
125  void addParameter(std::string const& name, T const& value) {
126  invalidateRegistration(name);
127  insert(true, name, Entry(name, value, true));
128  }
129 
130  template <typename T>
131  void addParameter(char const* name, T const& value) {
132  invalidateRegistration(name);
133  insert(true, name, Entry(name, value, true));
134  }
135 
136  template <typename T>
137  T getUntrackedParameter(std::string const&, T const&) const;
138 
139  template <typename T>
140  T getUntrackedParameter(char const*, T const&) const;
141 
142  template <typename T>
143  T getUntrackedParameter(std::string const&) const;
144 
145  template <typename T>
146  T getUntrackedParameter(char const*) const;
147 
152  std::vector<FileInPath>::size_type getAllFileInPaths(std::vector<FileInPath>& output) const;
153 
154  std::vector<std::string> getParameterNames() const;
155 
157  bool exists(std::string const& parameterName) const;
158 
160  template <typename T>
161  bool existsAs(std::string const& parameterName, bool trackiness = true) const {
162  std::vector<std::string> names = getParameterNamesForType<T>(trackiness);
163  return std::find(names.begin(), names.end(), parameterName) != names.end();
164  }
165 
166  void deprecatedInputTagWarning(std::string const& name, std::string const& label) const;
167 
168  template <typename T>
169  std::vector<std::string> getParameterNamesForType(bool trackiness = true) const {
170  std::vector<std::string> result;
171  // This is icky, but I don't know of another way in the current
172  // code to get at the character code that denotes type T.
173  T value = T();
174  Entry type_translator("", value, trackiness);
175  char type_code = type_translator.typeCode();
176 
177  (void)getNamesByCode_(type_code, trackiness, result);
178  return result;
179  }
180 
181  template <typename T>
182  void addUntrackedParameter(std::string const& name, T const& value) {
183  insert(true, name, Entry(name, value, false));
184  }
185 
186  template <typename T>
187  void addUntrackedParameter(char const* name, T const& value) {
188  insert(true, name, Entry(name, value, false));
189  }
190 
191  bool empty() const { return tbl_.empty() && psetTable_.empty() && vpsetTable_.empty(); }
192 
193  ParameterSet trackedPart() const;
194 
195  // Return the names of all parameters of type ParameterSet,
196  // pushing the names into the argument 'output'. Return the number
197  // of names pushed into the vector. If 'trackiness' is true, we
198  // return tracked parameters; if 'trackiness' is false, w return
199  // untracked parameters.
200  size_t getParameterSetNames(std::vector<std::string>& output, bool trackiness = true) const;
201 
202  // Return the names of all parameters of type
203  // vector<ParameterSet>, pushing the names into the argument
204  // 'output'. Return the number of names pushed into the vector. If
205  // 'trackiness' is true, we return tracked parameters; if
206  // 'trackiness' is false, w return untracked parameters.
207  size_t getParameterSetVectorNames(std::vector<std::string>& output, bool trackiness = true) const;
208 
209  // need a simple interface for python
210  std::string dump(unsigned int indent = 0) const;
211 
212  friend std::ostream& operator<<(std::ostream& os, ParameterSet const& pset);
213 
214  ParameterSet const& registerIt();
215 
216  std::unique_ptr<ParameterSet> popParameterSet(std::string const& name);
217  void eraseSimpleParameter(std::string const& name);
218  void eraseOrSetUntrackedParameterSet(std::string const& name);
219 
220  std::vector<ParameterSet> popVParameterSet(std::string const& name);
221 
222  typedef std::map<std::string, Entry> table;
223  table const& tbl() const { return tbl_; }
224 
225  typedef std::map<std::string, ParameterSetEntry> psettable;
226  psettable const& psetTable() const { return psetTable_; }
227 
228  typedef std::map<std::string, VParameterSetEntry> vpsettable;
229  vpsettable const& vpsetTable() const { return vpsetTable_; }
230 
231  ParameterSet* getPSetForUpdate(std::string const& name, bool& isTracked);
232 
234  bool isTracked = false;
235  return getPSetForUpdate(name, isTracked);
236  }
237 
238  VParameterSetEntry* getPSetVectorForUpdate(std::string const& name);
239 
240  // construct from coded string and register it.
241  static void registerFromString(std::string const& rep);
242 
243  // return ID of empty parameter set without registering it.
244  static ParameterSetID emptyParameterSetID();
245 
246  private:
247  // construct from coded string and id.
248  ParameterSet(std::string const& rep, ParameterSetID const& id);
249 
250  // decode
251  bool fromString(std::string const&);
252 
253  void toStringImp(std::string&, bool useAll) const;
254 
255  table tbl_;
256  psettable psetTable_;
257  vpsettable vpsetTable_;
258 
259  // If the id_ is invalid, that means a new value should be
260  // calculated before the value is returned. Upon registration, the
261  // id_ is made valid. Updating any tracked parameter invalidates the id_.
263 
264  void invalidateRegistration(std::string const& nameOfTracked);
265 
266  void calculateID();
267 
268  // get the untracked Entry object, throwing an exception if it is
269  // not found.
270  Entry const* getEntryPointerOrThrow_(std::string const& name) const;
271  Entry const* getEntryPointerOrThrow_(char const* name) const;
272 
273  // Return the names of all the entries with the given typecode and
274  // given status (trackiness)
275  size_t getNamesByCode_(char code, bool trackiness, std::vector<std::string>& output) const;
276 
277  }; // ParameterSet
278 
279  inline void swap(ParameterSet& a, ParameterSet& b) { a.swap(b); }
280 
281  bool operator==(ParameterSet const& a, ParameterSet const& b);
282 
283  bool isTransientEqual(ParameterSet const& a, ParameterSet const& b);
284 
285  inline bool operator!=(ParameterSet const& a, ParameterSet const& b) { return !(a == b); }
286 
287  // Free function to retrieve a parameter set, given the parameter set ID.
288  ParameterSet const& getParameterSet(ParameterSetID const& id);
289 
291 
292  // specializations
293  // ----------------------------------------------------------------------
294 
295  template <>
296  bool ParameterSet::getParameter<bool>(std::string const& name) const;
297 
298  // ----------------------------------------------------------------------
299  // Int32, vInt32
300 
301  template <>
302  int ParameterSet::getParameter<int>(std::string const& name) const;
303 
304  template <>
305  std::vector<int> ParameterSet::getParameter<std::vector<int> >(std::string const& name) const;
306 
307  // ----------------------------------------------------------------------
308  // Int64, vInt64
309 
310  template <>
311  long long ParameterSet::getParameter<long long>(std::string const& name) const;
312 
313  template <>
314  std::vector<long long> ParameterSet::getParameter<std::vector<long long> >(std::string const& name) const;
315 
316  // ----------------------------------------------------------------------
317  // Uint32, vUint32
318 
319  template <>
320  unsigned int ParameterSet::getParameter<unsigned int>(std::string const& name) const;
321 
322  template <>
323  std::vector<unsigned int> ParameterSet::getParameter<std::vector<unsigned int> >(std::string const& name) const;
324 
325  // ----------------------------------------------------------------------
326  // Uint64, vUint64
327 
328  template <>
329  unsigned long long ParameterSet::getParameter<unsigned long long>(std::string const& name) const;
330 
331  template <>
332  std::vector<unsigned long long> ParameterSet::getParameter<std::vector<unsigned long long> >(
333  std::string const& name) const;
334 
335  // ----------------------------------------------------------------------
336  // Double, vDouble
337 
338  template <>
339  double ParameterSet::getParameter<double>(std::string const& name) const;
340 
341  template <>
342  std::vector<double> ParameterSet::getParameter<std::vector<double> >(std::string const& name) const;
343 
344  // ----------------------------------------------------------------------
345  // String, vString
346 
347  template <>
348  std::string ParameterSet::getParameter<std::string>(std::string const& name) const;
349 
350  template <>
351  std::vector<std::string> ParameterSet::getParameter<std::vector<std::string> >(std::string const& name) const;
352 
353  // ----------------------------------------------------------------------
354  // FileInPath
355 
356  template <>
357  FileInPath ParameterSet::getParameter<FileInPath>(std::string const& name) const;
358 
359  // FileInPath can't default-construct something useful, so we specialize
360  // this template
361  template <>
362  std::vector<std::string> ParameterSet::getParameterNamesForType<FileInPath>(bool trackiness) const;
363 
364  // ----------------------------------------------------------------------
365  // InputTag
366 
367  template <>
368  InputTag ParameterSet::getParameter<InputTag>(std::string const& name) const;
369 
370  // ----------------------------------------------------------------------
371  // VInputTag
372 
373  template <>
374  std::vector<InputTag> ParameterSet::getParameter<std::vector<InputTag> >(std::string const& name) const;
375 
376  // ----------------------------------------------------------------------
377  // ESInputTag
378 
379  template <>
380  ESInputTag ParameterSet::getParameter<ESInputTag>(std::string const& name) const;
381 
382  // ----------------------------------------------------------------------
383  // VESInputTag
384 
385  template <>
386  std::vector<ESInputTag> ParameterSet::getParameter<std::vector<ESInputTag> >(std::string const& name) const;
387 
388  // ----------------------------------------------------------------------
389  // EventID
390 
391  template <>
392  EventID ParameterSet::getParameter<EventID>(std::string const& name) const;
393 
394  // ----------------------------------------------------------------------
395  // VEventID
396 
397  template <>
398  std::vector<EventID> ParameterSet::getParameter<std::vector<EventID> >(std::string const& name) const;
399 
400  // ----------------------------------------------------------------------
401  // LuminosityBlockID
402 
403  template <>
404  LuminosityBlockID ParameterSet::getParameter<LuminosityBlockID>(std::string const& name) const;
405 
406  // ----------------------------------------------------------------------
407  // VLuminosityBlockID
408 
409  template <>
410  std::vector<LuminosityBlockID> ParameterSet::getParameter<std::vector<LuminosityBlockID> >(
411  std::string const& name) const;
412 
413  // ----------------------------------------------------------------------
414  // EventRange
415 
416  template <>
417  EventRange ParameterSet::getParameter<EventRange>(std::string const& name) const;
418 
419  // ----------------------------------------------------------------------
420  // VEventRange
421 
422  template <>
423  std::vector<EventRange> ParameterSet::getParameter<std::vector<EventRange> >(std::string const& name) const;
424 
425  // ----------------------------------------------------------------------
426  // LuminosityBlockRange
427 
428  template <>
429  LuminosityBlockRange ParameterSet::getParameter<LuminosityBlockRange>(std::string const& name) const;
430 
431  // ----------------------------------------------------------------------
432  // VLuminosityBlockRange
433 
434  template <>
435  std::vector<LuminosityBlockRange> ParameterSet::getParameter<std::vector<LuminosityBlockRange> >(
436  std::string const& name) const;
437 
438  // ----------------------------------------------------------------------
439  // PSet, vPSet
440 
441  template <>
442  ParameterSet ParameterSet::getParameter<ParameterSet>(std::string const& name) const;
443 
444  template <>
445  VParameterSet ParameterSet::getParameter<VParameterSet>(std::string const& name) const;
446 
447  template <>
448  void ParameterSet::addParameter<ParameterSet>(std::string const& name, ParameterSet const& value);
449 
450  template <>
451  void ParameterSet::addParameter<ParameterSet>(char const* name, ParameterSet const& value);
452 
453  template <>
454  void ParameterSet::addUntrackedParameter<ParameterSet>(std::string const& name, ParameterSet const& value);
455 
456  template <>
457  void ParameterSet::addUntrackedParameter<ParameterSet>(char const* name, ParameterSet const& value);
458 
459  template <>
460  void ParameterSet::addParameter<VParameterSet>(std::string const& name, VParameterSet const& value);
461 
462  template <>
463  void ParameterSet::addParameter<VParameterSet>(char const* name, VParameterSet const& value);
464 
465  template <>
466  void ParameterSet::addUntrackedParameter<VParameterSet>(std::string const& name, VParameterSet const& value);
467 
468  template <>
469  void ParameterSet::addUntrackedParameter<VParameterSet>(char const* name, VParameterSet const& value);
470 
471  // untracked parameters
472 
473  // ----------------------------------------------------------------------
474  // Bool, vBool
475 
476  template <>
477  bool ParameterSet::getUntrackedParameter<bool>(std::string const& name, bool const& defaultValue) const;
478 
479  template <>
480  bool ParameterSet::getUntrackedParameter<bool>(std::string const& name) const;
481 
482  // ----------------------------------------------------------------------
483  // Int32, vInt32
484 
485  template <>
486  int ParameterSet::getUntrackedParameter<int>(std::string const& name, int const& defaultValue) const;
487 
488  template <>
489  int ParameterSet::getUntrackedParameter<int>(std::string const& name) const;
490 
491  template <>
492  std::vector<int> ParameterSet::getUntrackedParameter<std::vector<int> >(std::string const& name,
493  std::vector<int> const& defaultValue) const;
494 
495  template <>
496  std::vector<int> ParameterSet::getUntrackedParameter<std::vector<int> >(std::string const& name) const;
497 
498  // ----------------------------------------------------------------------
499  // Uint32, vUint32
500 
501  template <>
502  unsigned int ParameterSet::getUntrackedParameter<unsigned int>(std::string const& name,
503  unsigned int const& defaultValue) const;
504 
505  template <>
506  unsigned int ParameterSet::getUntrackedParameter<unsigned int>(std::string const& name) const;
507 
508  template <>
509  std::vector<unsigned int> ParameterSet::getUntrackedParameter<std::vector<unsigned int> >(
510  std::string const& name, std::vector<unsigned int> const& defaultValue) const;
511 
512  template <>
513  std::vector<unsigned int> ParameterSet::getUntrackedParameter<std::vector<unsigned int> >(
514  std::string const& name) const;
515 
516  // ----------------------------------------------------------------------
517  // Uint64, vUint64
518 
519  template <>
520  unsigned long long ParameterSet::getUntrackedParameter<unsigned long long>(
521  std::string const& name, unsigned long long const& defaultValue) const;
522 
523  template <>
524  unsigned long long ParameterSet::getUntrackedParameter<unsigned long long>(std::string const& name) const;
525 
526  template <>
527  std::vector<unsigned long long> ParameterSet::getUntrackedParameter<std::vector<unsigned long long> >(
528  std::string const& name, std::vector<unsigned long long> const& defaultValue) const;
529 
530  template <>
531  std::vector<unsigned long long> ParameterSet::getUntrackedParameter<std::vector<unsigned long long> >(
532  std::string const& name) const;
533 
534  // ----------------------------------------------------------------------
535  // Int64, Vint64
536 
537  template <>
538  long long ParameterSet::getUntrackedParameter<long long>(std::string const& name,
539  long long const& defaultValue) const;
540 
541  template <>
542  long long ParameterSet::getUntrackedParameter<long long>(std::string const& name) const;
543 
544  template <>
545  std::vector<long long> ParameterSet::getUntrackedParameter<std::vector<long long> >(
546  std::string const& name, std::vector<long long> const& defaultValue) const;
547 
548  template <>
549  std::vector<long long> ParameterSet::getUntrackedParameter<std::vector<long long> >(std::string const& name) const;
550 
551  // ----------------------------------------------------------------------
552  // Double, vDouble
553 
554  template <>
555  double ParameterSet::getUntrackedParameter<double>(std::string const& name, double const& defaultValue) const;
556 
557  template <>
558  double ParameterSet::getUntrackedParameter<double>(std::string const& name) const;
559 
560  template <>
561  std::vector<double> ParameterSet::getUntrackedParameter<std::vector<double> >(
562  std::string const& name, std::vector<double> const& defaultValue) const;
563 
564  template <>
565  std::vector<double> ParameterSet::getUntrackedParameter<std::vector<double> >(std::string const& name) const;
566 
567  // ----------------------------------------------------------------------
568  // String, vString
569 
570  template <>
571  std::string ParameterSet::getUntrackedParameter<std::string>(std::string const& name,
572  std::string const& defaultValue) const;
573 
574  template <>
575  std::string ParameterSet::getUntrackedParameter<std::string>(std::string const& name) const;
576 
577  template <>
578  std::vector<std::string> ParameterSet::getUntrackedParameter<std::vector<std::string> >(
579  std::string const& name, std::vector<std::string> const& defaultValue) const;
580 
581  template <>
582  std::vector<std::string> ParameterSet::getUntrackedParameter<std::vector<std::string> >(std::string const& name) const;
583 
584  // ----------------------------------------------------------------------
585  // FileInPath
586 
587  template <>
588  FileInPath ParameterSet::getUntrackedParameter<FileInPath>(std::string const& name,
589  FileInPath const& defaultValue) const;
590 
591  template <>
592  FileInPath ParameterSet::getUntrackedParameter<FileInPath>(std::string const& name) const;
593 
594  // ----------------------------------------------------------------------
595  // InputTag, VInputTag
596 
597  template <>
598  InputTag ParameterSet::getUntrackedParameter<InputTag>(std::string const& name, InputTag const& defaultValue) const;
599 
600  template <>
601  InputTag ParameterSet::getUntrackedParameter<InputTag>(std::string const& name) const;
602 
603  template <>
604  std::vector<InputTag> ParameterSet::getUntrackedParameter<std::vector<InputTag> >(
605  std::string const& name, std::vector<InputTag> const& defaultValue) const;
606 
607  template <>
608  std::vector<InputTag> ParameterSet::getUntrackedParameter<std::vector<InputTag> >(std::string const& name) const;
609 
610  // ----------------------------------------------------------------------
611  // EventID, VEventID
612 
613  template <>
614  EventID ParameterSet::getUntrackedParameter<EventID>(std::string const& name, EventID const& defaultValue) const;
615 
616  template <>
617  EventID ParameterSet::getUntrackedParameter<EventID>(std::string const& name) const;
618 
619  template <>
620  std::vector<EventID> ParameterSet::getUntrackedParameter<std::vector<EventID> >(
621  std::string const& name, std::vector<EventID> const& defaultValue) const;
622  template <>
623  std::vector<EventID> ParameterSet::getUntrackedParameter<std::vector<EventID> >(std::string const& name) const;
624 
625  // ----------------------------------------------------------------------
626  // LuminosityBlockID, VLuminosityBlockID
627 
628  template <>
629  LuminosityBlockID ParameterSet::getUntrackedParameter<LuminosityBlockID>(std::string const& name,
630  LuminosityBlockID const& defaultValue) const;
631 
632  template <>
633  LuminosityBlockID ParameterSet::getUntrackedParameter<LuminosityBlockID>(std::string const& name) const;
634 
635  template <>
636  std::vector<LuminosityBlockID> ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockID> >(
637  std::string const& name, std::vector<LuminosityBlockID> const& defaultValue) const;
638  template <>
639  std::vector<LuminosityBlockID> ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockID> >(
640  std::string const& name) const;
641 
642  // ----------------------------------------------------------------------
643  // EventRange, VEventRange
644 
645  template <>
646  EventRange ParameterSet::getUntrackedParameter<EventRange>(std::string const& name,
647  EventRange const& defaultValue) const;
648 
649  template <>
650  EventRange ParameterSet::getUntrackedParameter<EventRange>(std::string const& name) const;
651 
652  template <>
653  std::vector<EventRange> ParameterSet::getUntrackedParameter<std::vector<EventRange> >(
654  std::string const& name, std::vector<EventRange> const& defaultValue) const;
655  template <>
656  std::vector<EventRange> ParameterSet::getUntrackedParameter<std::vector<EventRange> >(std::string const& name) const;
657 
658  // ----------------------------------------------------------------------
659  // LuminosityBlockRange, VLuminosityBlockRange
660 
661  template <>
662  LuminosityBlockRange ParameterSet::getUntrackedParameter<LuminosityBlockRange>(
663  std::string const& name, LuminosityBlockRange const& defaultValue) const;
664 
665  template <>
666  LuminosityBlockRange ParameterSet::getUntrackedParameter<LuminosityBlockRange>(std::string const& name) const;
667 
668  template <>
669  std::vector<LuminosityBlockRange> ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockRange> >(
670  std::string const& name, std::vector<LuminosityBlockRange> const& defaultValue) const;
671  template <>
672  std::vector<LuminosityBlockRange> ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockRange> >(
673  std::string const& name) const;
674 
675  // specializations
676  // ----------------------------------------------------------------------
677  // Bool, vBool
678 
679  template <>
680  bool ParameterSet::getParameter<bool>(char const* name) const;
681 
682  // ----------------------------------------------------------------------
683  // Int32, vInt32
684 
685  template <>
686  int ParameterSet::getParameter<int>(char const* name) const;
687 
688  template <>
689  std::vector<int> ParameterSet::getParameter<std::vector<int> >(char const* name) const;
690 
691  // ----------------------------------------------------------------------
692  // Int64, vInt64
693 
694  template <>
695  long long ParameterSet::getParameter<long long>(char const* name) const;
696 
697  template <>
698  std::vector<long long> ParameterSet::getParameter<std::vector<long long> >(char const* name) const;
699 
700  // ----------------------------------------------------------------------
701  // Uint32, vUint32
702 
703  template <>
704  unsigned int ParameterSet::getParameter<unsigned int>(char const* name) const;
705 
706  template <>
707  std::vector<unsigned int> ParameterSet::getParameter<std::vector<unsigned int> >(char const* name) const;
708 
709  // ----------------------------------------------------------------------
710  // Uint64, vUint64
711 
712  template <>
713  unsigned long long ParameterSet::getParameter<unsigned long long>(char const* name) const;
714 
715  template <>
716  std::vector<unsigned long long> ParameterSet::getParameter<std::vector<unsigned long long> >(char const* name) const;
717 
718  // ----------------------------------------------------------------------
719  // Double, vDouble
720 
721  template <>
722  double ParameterSet::getParameter<double>(char const* name) const;
723 
724  template <>
725  std::vector<double> ParameterSet::getParameter<std::vector<double> >(char const* name) const;
726 
727  // ----------------------------------------------------------------------
728  // String, vString
729 
730  template <>
731  std::string ParameterSet::getParameter<std::string>(char const* name) const;
732 
733  template <>
734  std::vector<std::string> ParameterSet::getParameter<std::vector<std::string> >(char const* name) const;
735 
736  // ----------------------------------------------------------------------
737  // FileInPath
738 
739  template <>
740  FileInPath ParameterSet::getParameter<FileInPath>(char const* name) const;
741 
742  // ----------------------------------------------------------------------
743  // InputTag
744 
745  template <>
746  InputTag ParameterSet::getParameter<InputTag>(char const* name) const;
747 
748  // ----------------------------------------------------------------------
749  // VInputTag
750 
751  template <>
752  std::vector<InputTag> ParameterSet::getParameter<std::vector<InputTag> >(char const* name) const;
753 
754  // ----------------------------------------------------------------------
755  // EventID
756 
757  template <>
758  EventID ParameterSet::getParameter<EventID>(char const* name) const;
759 
760  // ----------------------------------------------------------------------
761  // VEventID
762 
763  template <>
764  std::vector<EventID> ParameterSet::getParameter<std::vector<EventID> >(char const* name) const;
765 
766  // ----------------------------------------------------------------------
767  // LuminosityBlockID
768 
769  template <>
770  LuminosityBlockID ParameterSet::getParameter<LuminosityBlockID>(char const* name) const;
771 
772  // ----------------------------------------------------------------------
773  // VLuminosityBlockID
774 
775  template <>
776  std::vector<LuminosityBlockID> ParameterSet::getParameter<std::vector<LuminosityBlockID> >(char const* name) const;
777 
778  // ----------------------------------------------------------------------
779  // EventRange
780 
781  template <>
782  EventRange ParameterSet::getParameter<EventRange>(char const* name) const;
783 
784  // ----------------------------------------------------------------------
785  // VEventRange
786 
787  template <>
788  std::vector<EventRange> ParameterSet::getParameter<std::vector<EventRange> >(char const* name) const;
789 
790  // ----------------------------------------------------------------------
791  // LuminosityBlockRange
792 
793  template <>
794  LuminosityBlockRange ParameterSet::getParameter<LuminosityBlockRange>(char const* name) const;
795 
796  // ----------------------------------------------------------------------
797  // VLuminosityBlockRange
798 
799  template <>
800  std::vector<LuminosityBlockRange> ParameterSet::getParameter<std::vector<LuminosityBlockRange> >(
801  char const* name) const;
802 
803  // ----------------------------------------------------------------------
804  // PSet, vPSet
805 
806  template <>
807  ParameterSet ParameterSet::getParameter<ParameterSet>(char const* name) const;
808 
809  template <>
810  VParameterSet ParameterSet::getParameter<VParameterSet>(char const* name) const;
811 
812  // untracked parameters
813 
814  // ----------------------------------------------------------------------
815  // Bool, vBool
816 
817  template <>
818  bool ParameterSet::getUntrackedParameter<bool>(char const* name, bool const& defaultValue) const;
819 
820  template <>
821  bool ParameterSet::getUntrackedParameter<bool>(char const* name) const;
822 
823  // ----------------------------------------------------------------------
824  // Int32, vInt32
825 
826  template <>
827  int ParameterSet::getUntrackedParameter<int>(char const* name, int const& defaultValue) const;
828 
829  template <>
830  int ParameterSet::getUntrackedParameter<int>(char const* name) const;
831 
832  template <>
833  std::vector<int> ParameterSet::getUntrackedParameter<std::vector<int> >(char const* name,
834  std::vector<int> const& defaultValue) const;
835 
836  template <>
837  std::vector<int> ParameterSet::getUntrackedParameter<std::vector<int> >(char const* name) const;
838 
839  // ----------------------------------------------------------------------
840  // Uint32, vUint32
841 
842  template <>
843  unsigned int ParameterSet::getUntrackedParameter<unsigned int>(char const* name,
844  unsigned int const& defaultValue) const;
845 
846  template <>
847  unsigned int ParameterSet::getUntrackedParameter<unsigned int>(char const* name) const;
848 
849  template <>
850  std::vector<unsigned int> ParameterSet::getUntrackedParameter<std::vector<unsigned int> >(
851  char const* name, std::vector<unsigned int> const& defaultValue) const;
852 
853  template <>
854  std::vector<unsigned int> ParameterSet::getUntrackedParameter<std::vector<unsigned int> >(char const* name) const;
855 
856  // ----------------------------------------------------------------------
857  // Uint64, vUint64
858 
859  template <>
860  unsigned long long ParameterSet::getUntrackedParameter<unsigned long long>(
861  char const* name, unsigned long long const& defaultValue) const;
862 
863  template <>
864  unsigned long long ParameterSet::getUntrackedParameter<unsigned long long>(char const* name) const;
865 
866  template <>
867  std::vector<unsigned long long> ParameterSet::getUntrackedParameter<std::vector<unsigned long long> >(
868  char const* name, std::vector<unsigned long long> const& defaultValue) const;
869 
870  template <>
871  std::vector<unsigned long long> ParameterSet::getUntrackedParameter<std::vector<unsigned long long> >(
872  char const* name) const;
873 
874  // ----------------------------------------------------------------------
875  // Int64, Vint64
876 
877  template <>
878  long long ParameterSet::getUntrackedParameter<long long>(char const* name, long long const& defaultValue) const;
879 
880  template <>
881  long long ParameterSet::getUntrackedParameter<long long>(char const* name) const;
882 
883  template <>
884  std::vector<long long> ParameterSet::getUntrackedParameter<std::vector<long long> >(
885  char const* name, std::vector<long long> const& defaultValue) const;
886 
887  template <>
888  std::vector<long long> ParameterSet::getUntrackedParameter<std::vector<long long> >(char const* name) const;
889 
890  // ----------------------------------------------------------------------
891  // Double, vDouble
892 
893  template <>
894  double ParameterSet::getUntrackedParameter<double>(char const* name, double const& defaultValue) const;
895 
896  template <>
897  double ParameterSet::getUntrackedParameter<double>(char const* name) const;
898 
899  template <>
900  std::vector<double> ParameterSet::getUntrackedParameter<std::vector<double> >(
901  char const* name, std::vector<double> const& defaultValue) const;
902 
903  template <>
904  std::vector<double> ParameterSet::getUntrackedParameter<std::vector<double> >(char const* name) const;
905 
906  // ----------------------------------------------------------------------
907  // String, vString
908 
909  template <>
910  std::string ParameterSet::getUntrackedParameter<std::string>(char const* name, std::string const& defaultValue) const;
911 
912  template <>
913  std::string ParameterSet::getUntrackedParameter<std::string>(char const* name) const;
914 
915  template <>
916  std::vector<std::string> ParameterSet::getUntrackedParameter<std::vector<std::string> >(
917  char const* name, std::vector<std::string> const& defaultValue) const;
918 
919  template <>
920  std::vector<std::string> ParameterSet::getUntrackedParameter<std::vector<std::string> >(char const* name) const;
921 
922  // ----------------------------------------------------------------------
923  // FileInPath
924 
925  template <>
926  FileInPath ParameterSet::getUntrackedParameter<FileInPath>(char const* name, FileInPath const& defaultValue) const;
927 
928  template <>
929  FileInPath ParameterSet::getUntrackedParameter<FileInPath>(char const* name) const;
930 
931  // ----------------------------------------------------------------------
932  // InputTag, VInputTag
933 
934  template <>
935  InputTag ParameterSet::getUntrackedParameter<InputTag>(char const* name, InputTag const& defaultValue) const;
936 
937  template <>
938  InputTag ParameterSet::getUntrackedParameter<InputTag>(char const* name) const;
939 
940  template <>
941  std::vector<InputTag> ParameterSet::getUntrackedParameter<std::vector<InputTag> >(
942  char const* name, std::vector<InputTag> const& defaultValue) const;
943 
944  template <>
945  std::vector<InputTag> ParameterSet::getUntrackedParameter<std::vector<InputTag> >(char const* name) const;
946 
947  // ----------------------------------------------------------------------
948  // EventID, VEventID
949 
950  template <>
951  EventID ParameterSet::getUntrackedParameter<EventID>(char const* name, EventID const& defaultValue) const;
952 
953  template <>
954  EventID ParameterSet::getUntrackedParameter<EventID>(char const* name) const;
955 
956  template <>
957  std::vector<EventID> ParameterSet::getUntrackedParameter<std::vector<EventID> >(
958  char const* name, std::vector<EventID> const& defaultValue) const;
959  template <>
960  std::vector<EventID> ParameterSet::getUntrackedParameter<std::vector<EventID> >(char const* name) const;
961 
962  // ----------------------------------------------------------------------
963  // LuminosityBlockID, VLuminosityBlockID
964 
965  template <>
966  LuminosityBlockID ParameterSet::getUntrackedParameter<LuminosityBlockID>(char const* name,
967  LuminosityBlockID const& defaultValue) const;
968 
969  template <>
970  LuminosityBlockID ParameterSet::getUntrackedParameter<LuminosityBlockID>(char const* name) const;
971 
972  template <>
973  std::vector<LuminosityBlockID> ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockID> >(
974  char const* name, std::vector<LuminosityBlockID> const& defaultValue) const;
975  template <>
976  std::vector<LuminosityBlockID> ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockID> >(
977  char const* name) const;
978 
979  // ----------------------------------------------------------------------
980  // EventRange, VEventRange
981 
982  template <>
983  EventRange ParameterSet::getUntrackedParameter<EventRange>(char const* name, EventRange const& defaultValue) const;
984 
985  template <>
986  EventRange ParameterSet::getUntrackedParameter<EventRange>(char const* name) const;
987 
988  template <>
989  std::vector<EventRange> ParameterSet::getUntrackedParameter<std::vector<EventRange> >(
990  char const* name, std::vector<EventRange> const& defaultValue) const;
991  template <>
992  std::vector<EventRange> ParameterSet::getUntrackedParameter<std::vector<EventRange> >(char const* name) const;
993 
994  // ----------------------------------------------------------------------
995  // LuminosityBlockRange, VLuminosityBlockRange
996 
997  template <>
998  LuminosityBlockRange ParameterSet::getUntrackedParameter<LuminosityBlockRange>(
999  char const* name, LuminosityBlockRange const& defaultValue) const;
1000 
1001  template <>
1002  LuminosityBlockRange ParameterSet::getUntrackedParameter<LuminosityBlockRange>(char const* name) const;
1003 
1004  template <>
1005  std::vector<LuminosityBlockRange> ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockRange> >(
1006  char const* name, std::vector<LuminosityBlockRange> const& defaultValue) const;
1007  template <>
1008  std::vector<LuminosityBlockRange> ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockRange> >(
1009  char const* name) const;
1010 
1011  // ----------------------------------------------------------------------
1012  // PSet, vPSet
1013 
1014  template <>
1015  ParameterSet ParameterSet::getUntrackedParameter<ParameterSet>(char const* name,
1016  ParameterSet const& defaultValue) const;
1017 
1018  template <>
1019  ParameterSet ParameterSet::getUntrackedParameter<ParameterSet>(std::string const& name,
1020  ParameterSet const& defaultValue) const;
1021 
1022  template <>
1023  ParameterSet ParameterSet::getUntrackedParameter<ParameterSet>(char const* name) const;
1024 
1025  template <>
1026  ParameterSet ParameterSet::getUntrackedParameter<ParameterSet>(std::string const& name) const;
1027 
1028  template <>
1029  VParameterSet ParameterSet::getUntrackedParameter<VParameterSet>(char const* name,
1030  VParameterSet const& defaultValue) const;
1031 
1032  template <>
1033  VParameterSet ParameterSet::getUntrackedParameter<VParameterSet>(char const* name) const;
1034 
1035  template <>
1036  VParameterSet ParameterSet::getUntrackedParameter<VParameterSet>(std::string const& name,
1037  VParameterSet const& defaultValue) const;
1038 
1039  template <>
1040  VParameterSet ParameterSet::getUntrackedParameter<VParameterSet>(std::string const& name) const;
1041 
1042  template <>
1043  std::vector<std::string> ParameterSet::getParameterNamesForType<ParameterSet>(bool trackiness) const;
1044 
1045  template <>
1046  std::vector<std::string> ParameterSet::getParameterNamesForType<VParameterSet>(bool trackiness) const;
1047 
1049 
1050 } // namespace edm
1051 #endif
bool empty() const
Definition: ParameterSet.h:191
void swap(ParameterSet &a, ParameterSet &b)
Definition: ParameterSet.h:279
ParameterSet::Bool operator&&(ParameterSet::Bool a, ParameterSet::Bool b)
ParameterSetID id_
Definition: ParameterSet.h:262
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:161
std::map< std::string, ParameterSetEntry > psettable
Definition: ParameterSet.h:225
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:33
ParameterSet const & getParameterSet(ParameterSetID const &id)
void addUntrackedParameter(char const *name, T const &value)
Definition: ParameterSet.h:187
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
uint16_t size_type
const std::string names[nVars_]
ParameterSet const & getProcessParameterSetContainingModule(ModuleDescription const &moduleDescription)
void swap(ParameterSet &other)
Definition: ParameterSet.cc:99
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:169
char const * label
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:125
bool operator==(MD5Result const &a, MD5Result const &b)
Definition: Digest.cc:141
Definition: value.py:1
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:50
rep
Definition: cuy.py:1190
bool isRegistered() const
Definition: ParameterSet.h:61
std::string toString(const std::pair< T, T > &aT)
Definition: CaloEllipse.h:72
#define True
Definition: Types.h:96
Namespace of DDCMS conversion namespace.
psettable const & psetTable() const
Definition: ParameterSet.h:226
void addParameter(char const *name, T const &value)
Definition: ParameterSet.h:131
void addUntrackedParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:182
double b
Definition: hdecay.h:120
ParameterSetID trackedID() const
Definition: ParameterSet.h:62
bool operator!=(MD5Result const &a, MD5Result const &b)
Definition: Digest.h:37
std::map< std::string, Entry > table
Definition: ParameterSet.h:222
std::map< std::string, VParameterSetEntry > vpsettable
Definition: ParameterSet.h:228
HLT enums.
vpsettable const & vpsetTable() const
Definition: ParameterSet.h:229
double a
Definition: hdecay.h:121
psettable psetTable_
Definition: ParameterSet.h:256
std::ostream & operator<<(std::ostream &os, MD5Result const &r)
Definition: Digest.h:39
char typeCode() const
Definition: Entry.h:176
pat::CandKinResolution::Parametrization fromString(const std::string &name)
Convert a name into a parametrization code.
table const & tbl() const
Definition: ParameterSet.h:223
long double T
bool isTransientEqual(ParameterSet const &a, ParameterSet const &b)
vpsettable vpsetTable_
Definition: ParameterSet.h:257
ParameterSet * getPSetForUpdate(std::string const &name)
Definition: ParameterSet.h:233
#define False
Definition: Types.h:97