#ifndef STANDALONEGEOMETRY_HPP #define STANDALONEGEOMETRY_HPP // // $Id: StandaloneGeometry.hpp,v 1.2 2001/08/16 21:53:15 hobbs Exp $ // // File: StandaloneGeometry.hpp // Purpose: Parse command line arguments giving instructions to find an // smt-only geometry. The geometry can either be read from a file // or created in memory using RCP. // Created: 1-FEB-2001 John D. Hobbs // // $Revision: 1.2 $ // // // Include files #include #include #include "d0om/d0_Ref.hpp" #include "silicon_geometry/base/SiBaseGeometry.hpp" // Global definitions class StandaloneGeometry { public: /// Initialize given the standard command-line style arguments StandaloneGeometry(const int argc, char **argv); /// Get back the initialization arguments with those used by this class removed void get_modified_args(std::vector &argv) const; /// Fetch the geometry specified in the arguements d0_Ref get_geometry(bool callGeometer=false) const; /// Get the file name used to build the geometry const std::string get_file_name() const { return _fname; } /// See if it was built by reading a file bool is_file() const { return _file; } /// See if it was built from RCP bool is_rcp() const { return !is_file(); } /// Print a list of the known options friend std::ostream& operator <<(std::ostream& os, const StandaloneGeometry& me); /// A generally available function to read silicon geometry from a file... static d0_Ref smt_read_geometry(const std::string fname, const std::string ftype); private: /// Keep around the initializing arguements std::vector _argv; /// Keep around a list of the ones I've actually used std::vector _used_args; /// The geometry I have mutable d0_Ref _smtdet; // Defer creation, so mutable /// The possible geometry sources. Default is Rcp = "SiBaseGeometry" bool _file; // Is it to be read from a file? std::string _ftype; // Is it EVPACK (Default) or DSPACK? std::string _fname; // File or rcp file name? /// Construct a geometry using RCP void smt_build_default() const; /// Read the geometry from a file void smt_read_geometry() const; }; #endif //STANDALONEGEOMETRY_HPP