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