rivet is hosted by Hepforge, IPPP Durham
RivetPaths.hh
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #ifndef RIVET_RivetPaths_HH
00003 #define RIVET_RivetPaths_HH
00004 
00005 namespace Rivet {
00006 
00007 
00008   /// Convenience function for determining if a filesystem path exists
00009   inline bool fileexists(const std::string& path) {
00010     return (access(path.c_str(), R_OK) == 0);
00011   }
00012 
00013 
00014   /// @name Installation directory paths
00015   //@{
00016 
00017   /// Get library install path
00018   std::string getLibPath();
00019 
00020   /// Get data install path
00021   std::string getDataPath();
00022 
00023   /// Get Rivet data install path
00024   std::string getRivetDataPath();
00025 
00026   //@}
00027 
00028 
00029   /// @name Analysis library search paths
00030   //@{
00031 
00032   /// Get Rivet analysis plugin library search paths
00033   std::vector<std::string> getAnalysisLibPaths();
00034 
00035   /// Set the Rivet analysis plugin library search paths
00036   void setAnalysisLibPaths(const std::vector<std::string>& paths);
00037 
00038   /// Set the Rivet analysis plugin library search paths
00039   void addAnalysisLibPath(const std::string& extrapath);
00040 
00041   /// @brief Find the first file of the given name in the analysis library search dirs
00042   /// @note If none found, returns an empty string
00043   std::string findAnalysisLibFile(const std::string& filename);
00044 
00045   //@}
00046 
00047 
00048   /// @name Analysis data/metadata paths and search functions
00049   //@{
00050 
00051   /// Get Rivet analysis reference data search paths
00052   std::vector<std::string> getAnalysisRefPaths();
00053 
00054   /// @brief Find the first file of the given name in the ref data file search dirs
00055   /// @note If none found, returns an empty string
00056   std::string findAnalysisRefFile(const std::string& filename,
00057                                   const std::vector<std::string>& pathprepend=std::vector<std::string>(),
00058                                   const std::vector<std::string>& pathappend=std::vector<std::string>());
00059 
00060   /// Get Rivet analysis info metadata search paths
00061   std::vector<std::string> getAnalysisInfoPaths();
00062 
00063   /// @brief Find the first file of the given name in the analysis info file search dirs
00064   /// @note If none found, returns an empty string
00065   std::string findAnalysisInfoFile(const std::string& filename,
00066                                    const std::vector<std::string>& pathprepend=std::vector<std::string>(),
00067                                    const std::vector<std::string>& pathappend=std::vector<std::string>());
00068 
00069   /// Get Rivet analysis plot style search paths
00070   std::vector<std::string> getAnalysisPlotPaths();
00071 
00072   /// @brief Find the first file of the given name in the analysis plot file search dirs
00073   /// @note If none found, returns an empty string
00074   std::string findAnalysisPlotFile(const std::string& filename,
00075                                    const std::vector<std::string>& pathprepend=std::vector<std::string>(),
00076                                    const std::vector<std::string>& pathappend=std::vector<std::string>());
00077 
00078   //@}
00079 
00080 
00081 }
00082 
00083 #endif