CMSSW/ FWCore/ ParameterSet/ interface/ ParameterSet.h

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

-- DavidCockerill - 24-Aug-2010

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2010-08-24 - DavidCockerill
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback