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