Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 09:06:54

0001 // -*- C++ -*-
0002 #ifndef RIVET_RivetPaths_HH
0003 #define RIVET_RivetPaths_HH
0004 #include <string>
0005 #include <vector>
0006 #include <unistd.h>
0007 
0008 namespace Rivet {
0009 
0010 
0011   /// @defgroup rivetpaths Rivet file-searching utils
0012   ///@{
0013 
0014 
0015   /// Convenience function for determining if a filesystem path exists
0016   inline bool fileexists(const std::string& path) {
0017     return (access(path.c_str(), R_OK) == 0);
0018   }
0019 
0020 
0021   /// @name Installation directory paths
0022   /// @{
0023 
0024   /// Get library install path
0025   std::string getLibPath();
0026 
0027   /// Get data install path
0028   std::string getDataPath();
0029 
0030   /// Get Rivet data install path
0031   std::string getRivetDataPath();
0032 
0033   /// @}
0034 
0035 
0036   /// @name Analysis library search paths
0037   /// @{
0038 
0039   /// Get Rivet analysis plugin library search paths
0040   std::vector<std::string> getAnalysisLibPaths();
0041 
0042   /// Set the Rivet analysis plugin library search paths
0043   void setAnalysisLibPaths(const std::vector<std::string>& paths);
0044 
0045   /// Add a Rivet analysis plugin library search path
0046   void addAnalysisLibPath(const std::string& extrapath);
0047 
0048   /// @brief Find the first file of the given name in the analysis library search dirs
0049   /// @note If none found, returns an empty string
0050   std::string findAnalysisLibFile(const std::string& filename);
0051 
0052   /// @}
0053 
0054 
0055   /// @name Analysis data/metadata paths and search functions
0056   /// @{
0057 
0058   /// Get Rivet analysis reference data search paths
0059   std::vector<std::string> getAnalysisDataPaths();
0060 
0061   /// Set the Rivet data file search paths
0062   void setAnalysisDataPaths(const std::vector<std::string>& paths);
0063 
0064   /// Add a Rivet data file search path
0065   void addAnalysisDataPath(const std::string& extrapath);
0066 
0067   /// @brief Find the first file of the given name in the general data file search dirs
0068   ///
0069   /// @note If none found, returns an empty string
0070   std::string findAnalysisDataFile(const std::string& filename,
0071                                    const std::vector<std::string>& pathprepend=std::vector<std::string>(),
0072                                    const std::vector<std::string>& pathappend=std::vector<std::string>());
0073 
0074 
0075   /// Get Rivet analysis reference data search paths
0076   std::vector<std::string> getAnalysisRefPaths();
0077 
0078   /// @brief Find the first file of the given name in the ref data file search dirs
0079   ///
0080   /// @note If none found, returns an empty string
0081   std::string findAnalysisRefFile(const std::string& filename,
0082                                   const std::vector<std::string>& pathprepend=std::vector<std::string>(),
0083                                   const std::vector<std::string>& pathappend=std::vector<std::string>());
0084 
0085 
0086   /// Get Rivet analysis info metadata search paths
0087   std::vector<std::string> getAnalysisInfoPaths();
0088 
0089   /// @brief Find the first file of the given name in the analysis info file search dirs
0090   ///
0091   /// @note If none found, returns an empty string
0092   std::string findAnalysisInfoFile(const std::string& filename,
0093                                    const std::vector<std::string>& pathprepend=std::vector<std::string>(),
0094                                    const std::vector<std::string>& pathappend=std::vector<std::string>());
0095 
0096 
0097   /// Get Rivet analysis plot style search paths
0098   std::vector<std::string> getAnalysisPlotPaths();
0099 
0100   /// @brief Find the first file of the given name in the analysis plot file search dirs
0101   ///
0102   /// @note If none found, returns an empty string
0103   std::string findAnalysisPlotFile(const std::string& filename,
0104                                    const std::vector<std::string>& pathprepend=std::vector<std::string>(),
0105                                    const std::vector<std::string>& pathappend=std::vector<std::string>());
0106 
0107   /// @}
0108 
0109   /// @}
0110 
0111 
0112 }
0113 
0114 #endif