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 {
33  typedef std::vector<ParameterSet> VParameterSet;
34 
35  class ParameterSet {
36  public:
37  template<typename T> friend class ParameterDescription;
38  enum Bool {
39  False = 0,
40  True = 1,
41  Unknown = 2
42  };
43 
44  // default-construct
45  ParameterSet();
46 
47  // construct from coded string.
48  explicit ParameterSet(std::string const& rep);
49 
50  ~ParameterSet();
51 
52  // instantiate in this library, so these methods don't cause code bloat
53  ParameterSet(ParameterSet const& other);
54 
55  ParameterSet& operator=(ParameterSet const& other);
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;
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);
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&
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 
130  getUntrackedParameterSetVector(std::string const& name, VParameterSet const& defaultValue) const;
131 
133  getUntrackedParameterSetVector(char const* name, VParameterSet const& defaultValue) const;
134 
135  VParameterSet 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) {
145  insert(true, name, Entry(name, value, true));
146  }
147 
148  template<typename T>
149  void
150  addParameter(char const* name, T const& value) {
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
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::auto_ptr<ParameterSet> popParameterSet(std::string const& name);
249 
250  std::auto_ptr<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 
272 
273  // construct from coded string and register it.
274  static
275  void
277 
278  // return ID of empty parameter set without registering it.
279  static
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 
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
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  // specializations
339  // ----------------------------------------------------------------------
340 
341  template<>
342  bool
343  ParameterSet::getParameter<bool>(std::string const& name) const;
344 
345  // ----------------------------------------------------------------------
346  // Int32, vInt32
347 
348  template<>
349  int
350  ParameterSet::getParameter<int>(std::string const& name) const;
351 
352  template<>
353  std::vector<int>
354  ParameterSet::getParameter<std::vector<int> >(std::string const& name) const;
355 
356  // ----------------------------------------------------------------------
357  // Int64, vInt64
358 
359  template<>
360  long long
361  ParameterSet::getParameter<long long>(std::string const& name) const;
362 
363  template<>
364  std::vector<long long>
365  ParameterSet::getParameter<std::vector<long long> >(std::string const& name) const;
366 
367  // ----------------------------------------------------------------------
368  // Uint32, vUint32
369 
370  template<>
371  unsigned int
372  ParameterSet::getParameter<unsigned int>(std::string const& name) const;
373 
374  template<>
375  std::vector<unsigned int>
376  ParameterSet::getParameter<std::vector<unsigned int> >(std::string const& name) const;
377 
378  // ----------------------------------------------------------------------
379  // Uint64, vUint64
380 
381  template<>
382  unsigned long long
383  ParameterSet::getParameter<unsigned long long>(std::string const& name) const;
384 
385  template<>
386  std::vector<unsigned long long>
387  ParameterSet::getParameter<std::vector<unsigned long long> >(std::string const& name) const;
388 
389  // ----------------------------------------------------------------------
390  // Double, vDouble
391 
392  template<>
393  double
394  ParameterSet::getParameter<double>(std::string const& name) const;
395 
396  template<>
397  std::vector<double>
398  ParameterSet::getParameter<std::vector<double> >(std::string const& name) const;
399 
400  // ----------------------------------------------------------------------
401  // String, vString
402 
403  template<>
405  ParameterSet::getParameter<std::string>(std::string const& name) const;
406 
407  template<>
408  std::vector<std::string>
409  ParameterSet::getParameter<std::vector<std::string> >(std::string const& name) const;
410 
411  // ----------------------------------------------------------------------
412  // FileInPath
413 
414  template<>
415  FileInPath
416  ParameterSet::getParameter<FileInPath>(std::string const& name) const;
417 
418  // FileInPath can't default-construct something useful, so we specialize
419  // this template
420  template<>
421  std::vector<std::string>
422  ParameterSet::getParameterNamesForType<FileInPath>(bool trackiness) const;
423 
424  // ----------------------------------------------------------------------
425  // InputTag
426 
427  template<>
428  InputTag
429  ParameterSet::getParameter<InputTag>(std::string const& name) const;
430 
431  // ----------------------------------------------------------------------
432  // VInputTag
433 
434  template<>
435  std::vector<InputTag>
436  ParameterSet::getParameter<std::vector<InputTag> >(std::string const& name) const;
437 
438  // ----------------------------------------------------------------------
439  // ESInputTag
440 
441  template<>
442  ESInputTag
443  ParameterSet::getParameter<ESInputTag>(std::string const& name) const;
444 
445  // ----------------------------------------------------------------------
446  // VESInputTag
447 
448  template<>
449  std::vector<ESInputTag>
450  ParameterSet::getParameter<std::vector<ESInputTag> >(std::string const& name) const;
451 
452  // ----------------------------------------------------------------------
453  // EventID
454 
455  template<>
456  EventID
457  ParameterSet::getParameter<EventID>(std::string const& name) const;
458 
459  // ----------------------------------------------------------------------
460  // VEventID
461 
462  template<>
463  std::vector<EventID>
464  ParameterSet::getParameter<std::vector<EventID> >(std::string const& name) const;
465 
466  // ----------------------------------------------------------------------
467  // LuminosityBlockID
468 
469  template<>
470  LuminosityBlockID
471  ParameterSet::getParameter<LuminosityBlockID>(std::string const& name) const;
472 
473  // ----------------------------------------------------------------------
474  // VLuminosityBlockID
475 
476  template<>
477  std::vector<LuminosityBlockID>
478  ParameterSet::getParameter<std::vector<LuminosityBlockID> >(std::string const& name) const;
479 
480  // ----------------------------------------------------------------------
481  // EventRange
482 
483  template<>
484  EventRange
485  ParameterSet::getParameter<EventRange>(std::string const& name) const;
486 
487  // ----------------------------------------------------------------------
488  // VEventRange
489 
490  template<>
491  std::vector<EventRange>
492  ParameterSet::getParameter<std::vector<EventRange> >(std::string const& name) const;
493 
494  // ----------------------------------------------------------------------
495  // LuminosityBlockRange
496 
497  template<>
499  ParameterSet::getParameter<LuminosityBlockRange>(std::string const& name) const;
500 
501  // ----------------------------------------------------------------------
502  // VLuminosityBlockRange
503 
504  template<>
505  std::vector<LuminosityBlockRange>
506  ParameterSet::getParameter<std::vector<LuminosityBlockRange> >(std::string const& name) const;
507 
508  // ----------------------------------------------------------------------
509  // PSet, vPSet
510 
511  template<>
513  ParameterSet::getParameter<ParameterSet>(std::string const& name) const;
514 
515  template<>
517  ParameterSet::getParameter<VParameterSet>(std::string const& name) const;
518 
519  template<>
520  void
521  ParameterSet::addParameter<ParameterSet>(std::string const& name, ParameterSet const& value);
522 
523  template<>
524  void
525  ParameterSet::addParameter<ParameterSet>(char const* name, ParameterSet const& value);
526 
527  template<>
528  void
529  ParameterSet::addUntrackedParameter<ParameterSet>(std::string const& name, ParameterSet const& value);
530 
531  template<>
532  void
533  ParameterSet::addUntrackedParameter<ParameterSet>(char const* name, ParameterSet const& value);
534 
535  template<>
536  void
537  ParameterSet::addParameter<VParameterSet>(std::string const& name, VParameterSet const& value);
538 
539  template<>
540  void
541  ParameterSet::addParameter<VParameterSet>(char const* name, VParameterSet const& value);
542 
543  template<>
544  void
545  ParameterSet::addUntrackedParameter<VParameterSet>(std::string const& name, VParameterSet const& value);
546 
547  template<>
548  void
549  ParameterSet::addUntrackedParameter<VParameterSet>(char const* name, VParameterSet const& value);
550 
551  // untracked parameters
552 
553  // ----------------------------------------------------------------------
554  // Bool, vBool
555 
556  template<>
557  bool
558  ParameterSet::getUntrackedParameter<bool>(std::string const& name, bool const& defaultValue) const;
559 
560  template<>
561  bool
562  ParameterSet::getUntrackedParameter<bool>(std::string const& name) const;
563 
564  // ----------------------------------------------------------------------
565  // Int32, vInt32
566 
567  template<>
568  int
569  ParameterSet::getUntrackedParameter<int>(std::string const& name, int const& defaultValue) const;
570 
571  template<>
572  int
573  ParameterSet::getUntrackedParameter<int>(std::string const& name) const;
574 
575  template<>
576  std::vector<int>
577  ParameterSet::getUntrackedParameter<std::vector<int> >(std::string const& name, std::vector<int> const& defaultValue) const;
578 
579  template<>
580  std::vector<int>
581  ParameterSet::getUntrackedParameter<std::vector<int> >(std::string const& name) const;
582 
583  // ----------------------------------------------------------------------
584  // Uint32, vUint32
585 
586  template<>
587  unsigned int
588  ParameterSet::getUntrackedParameter<unsigned int>(std::string const& name, unsigned int const& defaultValue) const;
589 
590  template<>
591  unsigned int
592  ParameterSet::getUntrackedParameter<unsigned int>(std::string const& name) const;
593 
594  template<>
595  std::vector<unsigned int>
596  ParameterSet::getUntrackedParameter<std::vector<unsigned int> >(std::string const& name, std::vector<unsigned int> const& defaultValue) const;
597 
598  template<>
599  std::vector<unsigned int>
600  ParameterSet::getUntrackedParameter<std::vector<unsigned int> >(std::string const& name) const;
601 
602  // ----------------------------------------------------------------------
603  // Uint64, vUint64
604 
605  template<>
606  unsigned long long
607  ParameterSet::getUntrackedParameter<unsigned long long>(std::string const& name, unsigned long long const& defaultValue) const;
608 
609  template<>
610  unsigned long long
611  ParameterSet::getUntrackedParameter<unsigned long long>(std::string const& name) const;
612 
613  template<>
614  std::vector<unsigned long long>
615  ParameterSet::getUntrackedParameter<std::vector<unsigned long long> >(std::string const& name, std::vector<unsigned long long> const& defaultValue) const;
616 
617  template<>
618  std::vector<unsigned long long>
619  ParameterSet::getUntrackedParameter<std::vector<unsigned long long> >(std::string const& name) const;
620 
621  // ----------------------------------------------------------------------
622  // Int64, Vint64
623 
624  template<>
625  long long
626  ParameterSet::getUntrackedParameter<long long>(std::string const& name, long long const& defaultValue) const;
627 
628  template<>
629  long long
630  ParameterSet::getUntrackedParameter<long long>(std::string const& name) const;
631 
632  template<>
633  std::vector<long long>
634  ParameterSet::getUntrackedParameter<std::vector<long long> >(std::string const& name, std::vector<long long> const& defaultValue) const;
635 
636  template<>
637  std::vector<long long>
638  ParameterSet::getUntrackedParameter<std::vector<long long> >(std::string const& name) const;
639 
640  // ----------------------------------------------------------------------
641  // Double, vDouble
642 
643  template<>
644  double
645  ParameterSet::getUntrackedParameter<double>(std::string const& name, double const& defaultValue) const;
646 
647  template<>
648  double
649  ParameterSet::getUntrackedParameter<double>(std::string const& name) const;
650 
651  template<>
652  std::vector<double>
653  ParameterSet::getUntrackedParameter<std::vector<double> >(std::string const& name, std::vector<double> const& defaultValue) const;
654 
655  template<>
656  std::vector<double>
657  ParameterSet::getUntrackedParameter<std::vector<double> >(std::string const& name) const;
658 
659  // ----------------------------------------------------------------------
660  // String, vString
661 
662  template<>
664  ParameterSet::getUntrackedParameter<std::string>(std::string const& name, std::string const& defaultValue) const;
665 
666  template<>
668  ParameterSet::getUntrackedParameter<std::string>(std::string const& name) const;
669 
670  template<>
671  std::vector<std::string>
672  ParameterSet::getUntrackedParameter<std::vector<std::string> >(std::string const& name, std::vector<std::string> const& defaultValue) const;
673 
674  template<>
675  std::vector<std::string>
676  ParameterSet::getUntrackedParameter<std::vector<std::string> >(std::string const& name) const;
677 
678  // ----------------------------------------------------------------------
679  // FileInPath
680 
681  template<>
682  FileInPath
683  ParameterSet::getUntrackedParameter<FileInPath>(std::string const& name, FileInPath const& defaultValue) const;
684 
685  template<>
686  FileInPath
687  ParameterSet::getUntrackedParameter<FileInPath>(std::string const& name) const;
688 
689  // ----------------------------------------------------------------------
690  // InputTag, VInputTag
691 
692  template<>
693  InputTag
694  ParameterSet::getUntrackedParameter<InputTag>(std::string const& name, InputTag const& defaultValue) const;
695 
696  template<>
697  InputTag
698  ParameterSet::getUntrackedParameter<InputTag>(std::string const& name) const;
699 
700  template<>
701  std::vector<InputTag>
702  ParameterSet::getUntrackedParameter<std::vector<InputTag> >(std::string const& name,
703  std::vector<InputTag> const& defaultValue) const;
704 
705  template<>
706  std::vector<InputTag>
707  ParameterSet::getUntrackedParameter<std::vector<InputTag> >(std::string const& name) const;
708 
709  // ----------------------------------------------------------------------
710  // EventID, VEventID
711 
712  template<>
713  EventID
714  ParameterSet::getUntrackedParameter<EventID>(std::string const& name, EventID const& defaultValue) const;
715 
716  template<>
717  EventID
718  ParameterSet::getUntrackedParameter<EventID>(std::string const& name) const;
719 
720  template<>
721  std::vector<EventID>
722  ParameterSet::getUntrackedParameter<std::vector<EventID> >(std::string const& name,
723  std::vector<EventID> const& defaultValue) const;
724  template<>
725  std::vector<EventID>
726  ParameterSet::getUntrackedParameter<std::vector<EventID> >(std::string const& name) const;
727 
728  // ----------------------------------------------------------------------
729  // LuminosityBlockID, VLuminosityBlockID
730 
731  template<>
732  LuminosityBlockID
733  ParameterSet::getUntrackedParameter<LuminosityBlockID>(std::string const& name, LuminosityBlockID const& defaultValue) const;
734 
735  template<>
736  LuminosityBlockID
737  ParameterSet::getUntrackedParameter<LuminosityBlockID>(std::string const& name) const;
738 
739  template<>
740  std::vector<LuminosityBlockID>
741  ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockID> >(std::string const& name,
742  std::vector<LuminosityBlockID> const& defaultValue) const;
743  template<>
744  std::vector<LuminosityBlockID>
745  ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockID> >(std::string const& name) const;
746 
747  // ----------------------------------------------------------------------
748  // EventRange, VEventRange
749 
750  template<>
751  EventRange
752  ParameterSet::getUntrackedParameter<EventRange>(std::string const& name, EventRange const& defaultValue) const;
753 
754  template<>
755  EventRange
756  ParameterSet::getUntrackedParameter<EventRange>(std::string const& name) const;
757 
758  template<>
759  std::vector<EventRange>
760  ParameterSet::getUntrackedParameter<std::vector<EventRange> >(std::string const& name,
761  std::vector<EventRange> const& defaultValue) const;
762  template<>
763  std::vector<EventRange>
764  ParameterSet::getUntrackedParameter<std::vector<EventRange> >(std::string const& name) const;
765 
766  // ----------------------------------------------------------------------
767  // LuminosityBlockRange, VLuminosityBlockRange
768 
769  template<>
771  ParameterSet::getUntrackedParameter<LuminosityBlockRange>(std::string const& name, LuminosityBlockRange const& defaultValue) const;
772 
773  template<>
775  ParameterSet::getUntrackedParameter<LuminosityBlockRange>(std::string const& name) const;
776 
777  template<>
778  std::vector<LuminosityBlockRange>
779  ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockRange> >(std::string const& name,
780  std::vector<LuminosityBlockRange> const& defaultValue) const;
781  template<>
782  std::vector<LuminosityBlockRange>
783  ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockRange> >(std::string const& name) const;
784 
785  // specializations
786  // ----------------------------------------------------------------------
787  // Bool, vBool
788 
789  template<>
790  bool
791  ParameterSet::getParameter<bool>(char const* name) const;
792 
793  // ----------------------------------------------------------------------
794  // Int32, vInt32
795 
796  template<>
797  int
798  ParameterSet::getParameter<int>(char const* name) const;
799 
800  template<>
801  std::vector<int>
802  ParameterSet::getParameter<std::vector<int> >(char const* name) const;
803 
804  // ----------------------------------------------------------------------
805  // Int64, vInt64
806 
807  template<>
808  long long
809  ParameterSet::getParameter<long long>(char const* name) const;
810 
811  template<>
812  std::vector<long long>
813  ParameterSet::getParameter<std::vector<long long> >(char const* name) const;
814 
815  // ----------------------------------------------------------------------
816  // Uint32, vUint32
817 
818  template<>
819  unsigned int
820  ParameterSet::getParameter<unsigned int>(char const* name) const;
821 
822  template<>
823  std::vector<unsigned int>
824  ParameterSet::getParameter<std::vector<unsigned int> >(char const* name) const;
825 
826  // ----------------------------------------------------------------------
827  // Uint64, vUint64
828 
829  template<>
830  unsigned long long
831  ParameterSet::getParameter<unsigned long long>(char const* name) const;
832 
833  template<>
834  std::vector<unsigned long long>
835  ParameterSet::getParameter<std::vector<unsigned long long> >(char const* name) const;
836 
837  // ----------------------------------------------------------------------
838  // Double, vDouble
839 
840  template<>
841  double
842  ParameterSet::getParameter<double>(char const* name) const;
843 
844  template<>
845  std::vector<double>
846  ParameterSet::getParameter<std::vector<double> >(char const* name) const;
847 
848  // ----------------------------------------------------------------------
849  // String, vString
850 
851  template<>
853  ParameterSet::getParameter<std::string>(char const* name) const;
854 
855  template<>
856  std::vector<std::string>
857  ParameterSet::getParameter<std::vector<std::string> >(char const* name) const;
858 
859  // ----------------------------------------------------------------------
860  // FileInPath
861 
862  template<>
863  FileInPath
864  ParameterSet::getParameter<FileInPath>(char const* name) const;
865 
866  // ----------------------------------------------------------------------
867  // InputTag
868 
869  template<>
870  InputTag
871  ParameterSet::getParameter<InputTag>(char const* name) const;
872 
873  // ----------------------------------------------------------------------
874  // VInputTag
875 
876  template<>
877  std::vector<InputTag>
878  ParameterSet::getParameter<std::vector<InputTag> >(char const* name) const;
879 
880  // ----------------------------------------------------------------------
881  // EventID
882 
883  template<>
884  EventID
885  ParameterSet::getParameter<EventID>(char const* name) const;
886 
887  // ----------------------------------------------------------------------
888  // VEventID
889 
890  template<>
891  std::vector<EventID>
892  ParameterSet::getParameter<std::vector<EventID> >(char const* name) const;
893 
894  // ----------------------------------------------------------------------
895  // LuminosityBlockID
896 
897  template<>
898  LuminosityBlockID
899  ParameterSet::getParameter<LuminosityBlockID>(char const* name) const;
900 
901  // ----------------------------------------------------------------------
902  // VLuminosityBlockID
903 
904  template<>
905  std::vector<LuminosityBlockID>
906  ParameterSet::getParameter<std::vector<LuminosityBlockID> >(char const* name) const;
907 
908  // ----------------------------------------------------------------------
909  // EventRange
910 
911  template<>
912  EventRange
913  ParameterSet::getParameter<EventRange>(char const* name) const;
914 
915  // ----------------------------------------------------------------------
916  // VEventRange
917 
918  template<>
919  std::vector<EventRange>
920  ParameterSet::getParameter<std::vector<EventRange> >(char const* name) const;
921 
922  // ----------------------------------------------------------------------
923  // LuminosityBlockRange
924 
925  template<>
927  ParameterSet::getParameter<LuminosityBlockRange>(char const* name) const;
928 
929  // ----------------------------------------------------------------------
930  // VLuminosityBlockRange
931 
932  template<>
933  std::vector<LuminosityBlockRange>
934  ParameterSet::getParameter<std::vector<LuminosityBlockRange> >(char const* name) const;
935 
936  // ----------------------------------------------------------------------
937  // PSet, vPSet
938 
939  template<>
941  ParameterSet::getParameter<ParameterSet>(char const* name) const;
942 
943  template<>
945  ParameterSet::getParameter<VParameterSet>(char const* name) const;
946 
947  // untracked parameters
948 
949  // ----------------------------------------------------------------------
950  // Bool, vBool
951 
952  template<>
953  bool
954  ParameterSet::getUntrackedParameter<bool>(char const* name, bool const& defaultValue) const;
955 
956  template<>
957  bool
958  ParameterSet::getUntrackedParameter<bool>(char const* name) const;
959 
960  // ----------------------------------------------------------------------
961  // Int32, vInt32
962 
963  template<>
964  int
965  ParameterSet::getUntrackedParameter<int>(char const* name, int const& defaultValue) const;
966 
967  template<>
968  int
969  ParameterSet::getUntrackedParameter<int>(char const* name) const;
970 
971  template<>
972  std::vector<int>
973  ParameterSet::getUntrackedParameter<std::vector<int> >(char const* name, std::vector<int> const& defaultValue) const;
974 
975  template<>
976  std::vector<int>
977  ParameterSet::getUntrackedParameter<std::vector<int> >(char const* name) const;
978 
979  // ----------------------------------------------------------------------
980  // Uint32, vUint32
981 
982  template<>
983  unsigned int
984  ParameterSet::getUntrackedParameter<unsigned int>(char const* name, unsigned int const& defaultValue) const;
985 
986  template<>
987  unsigned int
988  ParameterSet::getUntrackedParameter<unsigned int>(char const* name) const;
989 
990  template<>
991  std::vector<unsigned int>
992  ParameterSet::getUntrackedParameter<std::vector<unsigned int> >(char const* name, std::vector<unsigned int> const& defaultValue) const;
993 
994  template<>
995  std::vector<unsigned int>
996  ParameterSet::getUntrackedParameter<std::vector<unsigned int> >(char const* name) const;
997 
998  // ----------------------------------------------------------------------
999  // Uint64, vUint64
1000 
1001  template<>
1002  unsigned long long
1003  ParameterSet::getUntrackedParameter<unsigned long long>(char const* name, unsigned long long const& defaultValue) const;
1004 
1005  template<>
1006  unsigned long long
1007  ParameterSet::getUntrackedParameter<unsigned long long>(char const* name) const;
1008 
1009  template<>
1010  std::vector<unsigned long long>
1011  ParameterSet::getUntrackedParameter<std::vector<unsigned long long> >(char const* name, std::vector<unsigned long long> const& defaultValue) const;
1012 
1013  template<>
1014  std::vector<unsigned long long>
1015  ParameterSet::getUntrackedParameter<std::vector<unsigned long long> >(char const* name) const;
1016 
1017  // ----------------------------------------------------------------------
1018  // Int64, Vint64
1019 
1020  template<>
1021  long long
1022  ParameterSet::getUntrackedParameter<long long>(char const* name, long long const& defaultValue) const;
1023 
1024  template<>
1025  long long
1026  ParameterSet::getUntrackedParameter<long long>(char const* name) const;
1027 
1028  template<>
1029  std::vector<long long>
1030  ParameterSet::getUntrackedParameter<std::vector<long long> >(char const* name, std::vector<long long> const& defaultValue) const;
1031 
1032  template<>
1033  std::vector<long long>
1034  ParameterSet::getUntrackedParameter<std::vector<long long> >(char const* name) const;
1035 
1036  // ----------------------------------------------------------------------
1037  // Double, vDouble
1038 
1039  template<>
1040  double
1041  ParameterSet::getUntrackedParameter<double>(char const* name, double const& defaultValue) const;
1042 
1043  template<>
1044  double
1045  ParameterSet::getUntrackedParameter<double>(char const* name) const;
1046 
1047  template<>
1048  std::vector<double>
1049  ParameterSet::getUntrackedParameter<std::vector<double> >(char const* name, std::vector<double> const& defaultValue) const;
1050 
1051  template<>
1052  std::vector<double>
1053  ParameterSet::getUntrackedParameter<std::vector<double> >(char const* name) const;
1054 
1055  // ----------------------------------------------------------------------
1056  // String, vString
1057 
1058  template<>
1059  std::string
1060  ParameterSet::getUntrackedParameter<std::string>(char const* name, std::string const& defaultValue) const;
1061 
1062  template<>
1063  std::string
1064  ParameterSet::getUntrackedParameter<std::string>(char const* name) const;
1065 
1066  template<>
1067  std::vector<std::string>
1068  ParameterSet::getUntrackedParameter<std::vector<std::string> >(char const* name, std::vector<std::string> const& defaultValue) const;
1069 
1070  template<>
1071  std::vector<std::string>
1072  ParameterSet::getUntrackedParameter<std::vector<std::string> >(char const* name) const;
1073 
1074  // ----------------------------------------------------------------------
1075  // FileInPath
1076 
1077  template<>
1078  FileInPath
1079  ParameterSet::getUntrackedParameter<FileInPath>(char const* name, FileInPath const& defaultValue) const;
1080 
1081  template<>
1082  FileInPath
1083  ParameterSet::getUntrackedParameter<FileInPath>(char const* name) const;
1084 
1085  // ----------------------------------------------------------------------
1086  // InputTag, VInputTag
1087 
1088  template<>
1089  InputTag
1090  ParameterSet::getUntrackedParameter<InputTag>(char const* name, InputTag const& defaultValue) const;
1091 
1092  template<>
1093  InputTag
1094  ParameterSet::getUntrackedParameter<InputTag>(char const* name) const;
1095 
1096  template<>
1097  std::vector<InputTag>
1098  ParameterSet::getUntrackedParameter<std::vector<InputTag> >(char const* name,
1099  std::vector<InputTag> const& defaultValue) const;
1100 
1101  template<>
1102  std::vector<InputTag>
1103  ParameterSet::getUntrackedParameter<std::vector<InputTag> >(char const* name) const;
1104 
1105  // ----------------------------------------------------------------------
1106  // EventID, VEventID
1107 
1108  template<>
1109  EventID
1110  ParameterSet::getUntrackedParameter<EventID>(char const* name, EventID const& defaultValue) const;
1111 
1112  template<>
1113  EventID
1114  ParameterSet::getUntrackedParameter<EventID>(char const* name) const;
1115 
1116  template<>
1117  std::vector<EventID>
1118  ParameterSet::getUntrackedParameter<std::vector<EventID> >(char const* name,
1119  std::vector<EventID> const& defaultValue) const;
1120  template<>
1121  std::vector<EventID>
1122  ParameterSet::getUntrackedParameter<std::vector<EventID> >(char const* name) const;
1123 
1124  // ----------------------------------------------------------------------
1125  // LuminosityBlockID, VLuminosityBlockID
1126 
1127  template<>
1128  LuminosityBlockID
1129  ParameterSet::getUntrackedParameter<LuminosityBlockID>(char const* name, LuminosityBlockID const& defaultValue) const;
1130 
1131  template<>
1132  LuminosityBlockID
1133  ParameterSet::getUntrackedParameter<LuminosityBlockID>(char const* name) const;
1134 
1135  template<>
1136  std::vector<LuminosityBlockID>
1137  ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockID> >(char const* name,
1138  std::vector<LuminosityBlockID> const& defaultValue) const;
1139  template<>
1140  std::vector<LuminosityBlockID>
1141  ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockID> >(char const* name) const;
1142 
1143  // ----------------------------------------------------------------------
1144  // EventRange, VEventRange
1145 
1146  template<>
1147  EventRange
1148  ParameterSet::getUntrackedParameter<EventRange>(char const* name, EventRange const& defaultValue) const;
1149 
1150  template<>
1151  EventRange
1152  ParameterSet::getUntrackedParameter<EventRange>(char const* name) const;
1153 
1154  template<>
1155  std::vector<EventRange>
1156  ParameterSet::getUntrackedParameter<std::vector<EventRange> >(char const* name,
1157  std::vector<EventRange> const& defaultValue) const;
1158  template<>
1159  std::vector<EventRange>
1160  ParameterSet::getUntrackedParameter<std::vector<EventRange> >(char const* name) const;
1161 
1162  // ----------------------------------------------------------------------
1163  // LuminosityBlockRange, VLuminosityBlockRange
1164 
1165  template<>
1167  ParameterSet::getUntrackedParameter<LuminosityBlockRange>(char const* name, LuminosityBlockRange const& defaultValue) const;
1168 
1169  template<>
1171  ParameterSet::getUntrackedParameter<LuminosityBlockRange>(char const* name) const;
1172 
1173  template<>
1174  std::vector<LuminosityBlockRange>
1175  ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockRange> >(char const* name,
1176  std::vector<LuminosityBlockRange> const& defaultValue) const;
1177  template<>
1178  std::vector<LuminosityBlockRange>
1179  ParameterSet::getUntrackedParameter<std::vector<LuminosityBlockRange> >(char const* name) const;
1180 
1181  // ----------------------------------------------------------------------
1182  // PSet, vPSet
1183 
1184  template<>
1185  ParameterSet
1186  ParameterSet::getUntrackedParameter<ParameterSet>(char const* name, ParameterSet const& defaultValue) const;
1187 
1188  template<>
1189  ParameterSet
1190  ParameterSet::getUntrackedParameter<ParameterSet>(std::string const& name, ParameterSet const& defaultValue) const;
1191 
1192  template<>
1193  ParameterSet
1194  ParameterSet::getUntrackedParameter<ParameterSet>(char const* name) const;
1195 
1196  template<>
1197  ParameterSet
1198  ParameterSet::getUntrackedParameter<ParameterSet>(std::string const& name) const;
1199 
1200  template<>
1202  ParameterSet::getUntrackedParameter<VParameterSet>(char const* name, VParameterSet const& defaultValue) const;
1203 
1204  template<>
1206  ParameterSet::getUntrackedParameter<VParameterSet>(char const* name) const;
1207 
1208  template<>
1210  ParameterSet::getUntrackedParameter<VParameterSet>(std::string const& name, VParameterSet const& defaultValue) const;
1211 
1212  template<>
1214  ParameterSet::getUntrackedParameter<VParameterSet>(std::string const& name) const;
1215 
1216  template<>
1217  std::vector<std::string>
1218  ParameterSet::getParameterNamesForType<ParameterSet>(bool trackiness) const;
1219 
1220  template<>
1221  std::vector<std::string>
1222  ParameterSet::getParameterNamesForType<VParameterSet>(bool trackiness) const;
1223 
1226 
1227 } // namespace edm
1228 #endif
void setID(ParameterSetID const &id)
T getParameter(std::string const &) const
Entry const & retrieve(char const *) const
bool empty() const
Definition: ParameterSet.h:217
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
ParameterSetID id_
Definition: ParameterSet.h:299
Entry const * getEntryPointerOrThrow_(std::string const &name) const
std::auto_ptr< std::vector< ParameterSet > > popVParameterSet(std::string const &name)
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
static const HistoName names[]
ParameterSetEntry const * retrieveUntrackedParameterSet(std::string const &) const
bool fromString(std::string const &)
std::string dump(unsigned int indent=0) const
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:213
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 trackedPart() const
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:193
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:143
tuple result
Definition: query.py:137
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)
std::auto_ptr< ParameterSet > popParameterSet(std::string const &name)
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:64
Hash< ParameterSetType > ParameterSetID
void invalidateRegistration(std::string const &nameOfTracked)
Definition: ParameterSet.cc:31
friend std::ostream & operator<<(std::ostream &os, ParameterSet const &pset)
static void registerFromString(std::string const &rep)
Definition: ParameterSet.cc:93
std::string getParameterAsString(std::string const &name) const
psettable const & psetTable() const
Definition: ParameterSet.h:256
void deprecatedInputTagWarning(std::string const &name, std::string const &label) const
void addParameter(char const *name, T const &value)
Definition: ParameterSet.h:150
ParameterSet const & getParameterSet(std::string const &) const
void addUntrackedParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:207
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:65
VParameterSetEntry const & retrieveVParameterSet(std::string const &) const
std::map< std::string, Entry > table
Definition: ParameterSet.h:252
void allToString(std::string &result) const
ParameterSet & operator=(ParameterSet const &other)
std::map< std::string, VParameterSetEntry > vpsettable
Definition: ParameterSet.h:258
vpsettable const & vpsetTable() const
Definition: ParameterSet.h:259
bool isValid() const
Definition: Hash.h:150
double a
Definition: hdecay.h:121
psettable psetTable_
Definition: ParameterSet.h:293
VParameterSet getUntrackedParameterSetVector(std::string const &name, VParameterSet const &defaultValue) const
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:253
long double T
static ParameterSetID emptyParameterSetID()
ParameterSet const & registerIt()
bool isTransientEqual(ParameterSet const &a, ParameterSet const &b)
vpsettable vpsetTable_
Definition: ParameterSet.h:294
ParameterSet * getPSetForUpdate(std::string const &name)
Definition: ParameterSet.h:265
ParameterSet * getPSetForUpdate(std::string const &name, bool &isTracked)