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