Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:17

0001 //
0002 //
0003 // File: hitfit/Defaults.h
0004 // Purpose: Define an interface for getting parameter settings.
0005 // Created: Nov, 2000, sss.
0006 //
0007 // This defines a very simple abstract interface for retrieving settings
0008 // for named parameters.  Using this ensures that the hitfit code doesn't
0009 // have to depend on something like rcp.  There is a lightweight concrete
0010 // implementation of this interface, Defaults_Text, which can be used
0011 // for standalone applications.  If this code gets used with the D0 framework,
0012 // a Defaults_RCP can be provided too.
0013 //
0014 // CMSSW File      : interface/Defaults.h
0015 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
0016 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
0017 //
0018 
0019 /**
0020     @file Defaults.h
0021     @brief Define an abstract interface for getting parameter settings.
0022 
0023     This defines a very simple abstract interface for retrieving settings
0024     for named parameters.  Using ensures that the hitft code doesn't
0025     have to depend on something like rcp.  There is a lightweight concrete
0026     implementation of this interface, <i>Defaults_Text</i>,
0027     which can be used for standalone applications.  If this code gets used
0028     with the D0 framework, a <i>Defaults_RCP</i> can be provided too.
0029 
0030     @par Creation date:
0031     November 2000.
0032 
0033     @author
0034     Scott Stuart Snyder <snyder@bnl.gov>
0035 
0036     @par Modification History:
0037     Apr 2009: Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>:
0038     Imported to CMSSW.<br>
0039     Oct 2009: Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>:
0040     Added Doxygen tags for automatic generation of documentation.
0041 
0042     @par Terms of Usage:
0043     With consent from the original author (Scott Snyder).
0044  */
0045 
0046 #ifndef HITFIT_DEFAULTS_H
0047 #define HITFIT_DEFAULTS_H
0048 
0049 #include <string>
0050 
0051 namespace hitfit {
0052 
0053   /**
0054     @class Defaults
0055     @brief Define an interface for getting parameter settings.
0056  */
0057   class Defaults
0058   //
0059   // Purpose: Define an interface for getting parameter settings.
0060   //
0061   {
0062   public:
0063     // Constructor, destructor.
0064 
0065     /**
0066      Constructor.
0067    */
0068     Defaults() {}
0069 
0070     /**
0071      Destructor
0072    */
0073     virtual ~Defaults() {}
0074 
0075     // Test to see if parameter NAME exists.
0076     /**
0077      Test to see if parameter <i>name</i> exists.
0078      @param name The parameter name to be checked.
0079      @par Return:
0080      The parameter value.
0081    */
0082     virtual bool exists(std::string name) const = 0;
0083 
0084     // Get the value of NAME as an integer.
0085     /**
0086      Get the value of <i>name</i> as integer.
0087      @param name The parameter name.
0088      @par Return:
0089      The parameter value.
0090    */
0091     virtual int get_int(std::string name) const = 0;
0092 
0093     // Get the value of NAME as a boolean.
0094     /**
0095      Get the value of <i>name</i> as boolean.
0096      @param name The parameter name.
0097      @par Return:
0098      The parameter value.
0099    */
0100     virtual bool get_bool(std::string name) const = 0;
0101 
0102     // Get the value of NAME as a float.
0103     /**
0104      Get the value of <i>name</i> as a floating-point of
0105      type double.
0106      @param name The parameter name.
0107      @par Return:
0108      The parameter value.
0109    */
0110     virtual double get_float(std::string name) const = 0;
0111 
0112     // Get the value of NAME as a string.
0113     /**
0114      Get the value of <i>name</i> as a string.
0115      @param name The parameter name.
0116      @par Return:
0117      The parameter value.
0118    */
0119     virtual std::string get_string(std::string name) const = 0;
0120   };
0121 
0122 }  // namespace hitfit
0123 
0124 #endif  // not HITFIT_DEFAULTS_H