test
CMS 3D CMS Logo

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