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