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