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