Skip to content
Snippets Groups Projects
Commit ac10f874 authored by Nicolas Köhler's avatar Nicolas Köhler
Browse files

synchronized PathResolver with 21.2

Former-commit-id: 7672319212875a0d79511482f09da4e01710e220
parent 3ab8d2c5
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ public:
PR_directory
} PR_file_type;
PathResolver(); //need a constructor to link the dictionary library with the implementation library
/**
......@@ -104,6 +104,9 @@ public:
static void setOutputLevel(MSG::Level level);
inline static std::string FindCalibFile(const std::string& logical_file_name) { return find_calib_file(logical_file_name); }
inline static std::string FindCalibDirectory(const std::string& logical_file_name) { return find_calib_directory(logical_file_name); }
inline static void SetOutputLevel(int lvl) { setOutputLevel(MSG::Level(lvl)); }
private:
static bool PR_find( const std::string& logical_file_name, const std::string& search_list, PR_file_type file_type, SearchType search_type,
......
<lcgdict>
<function name="PathResolverFindCalibFile" />
<function name="PathResolverFindCalibDirectory" />
<function name="PathResolverSetOutputLevel" />
<class name="PathResolver"/>
</lcgdict>
......@@ -33,6 +33,7 @@ using namespace std;
static const char* path_separator = ",:";
bool PathResolver::m_setLevel=false;
PathResolver::PathResolver() { }
asg::AsgMessaging& PathResolver::asgMsg() {
if(!m_setLevel) setOutputLevel(MSG::INFO);
......@@ -309,7 +310,14 @@ std::string PathResolverFindDataFile (const std::string& logical_file_name)
std::string PathResolver::find_calib_file (const std::string& logical_file_name)
{
msg(MSG::DEBUG) << "Trying to locate " << logical_file_name << endmsg;
if(logical_file_name.find("dev/")==0) msg(MSG::ERROR) << "Locating dev file " << logical_file_name << ". Do not let this propagate to a release" << endmsg;
if(logical_file_name.find("dev/")==0) {
#ifdef XAOD_ANALYSIS
msg(MSG::WARNING)
#else
msg(MSG::ERROR)
#endif
<< "Locating dev file " << logical_file_name << ". Do not let this propagate to a release" << endmsg;
}
//expand filename before finding ..
TString tmpString(logical_file_name);
gSystem->ExpandPathName(tmpString);
......@@ -324,7 +332,14 @@ std::string PathResolver::find_calib_file (const std::string& logical_file_name)
std::string PathResolver::find_calib_directory (const std::string& logical_file_name)
{
msg(MSG::DEBUG) <<"Trying to locate " << logical_file_name << endmsg;
if(logical_file_name.find("dev/")==0) msg(MSG::ERROR) << "Locating dev directory " << logical_file_name << ". Do not let this propagate to a release" << endmsg;
if(logical_file_name.find("dev/")==0) {
#ifdef XAOD_ANALYSIS
msg(MSG::WARNING)
#else
msg(MSG::ERROR)
#endif
<< "Locating dev directory " << logical_file_name << ". Do not let this propagate to a release" << endmsg;
}
//expand filename before finding
TString tmpString(logical_file_name);
gSystem->ExpandPathName(tmpString);
......
......@@ -6,21 +6,19 @@
#PathResolver.FindCalibFile("blah")
#if working in athena release, we will need to start the ApplicationMgr so that the appropriate MessageSvc is created
try:
#check if Gaudi already started
from GaudiPython.Bindings import _gaudi as GaudiAppMgr
if GaudiAppMgr==None:
print "PathResolver: Starting Gaudi for access to correct instance of MessageSvc"
from GaudiPython import AppMgr
AppMgr() #note this is not the same thing as 'theApp' in joboptions, but 'theApp' will use this
#the line above starts the application mgr, and _gaudi will become set to that
except ImportError:
pass
#try:
# #check if Gaudi already started
# from GaudiPython.Bindings import _gaudi as GaudiAppMgr
# if GaudiAppMgr==None:
# print "PathResolver: Starting Gaudi for access to correct instance of MessageSvc"
# from GaudiPython import AppMgr
# AppMgr() #note this is not the same thing as 'theApp' in joboptions, but 'theApp' will use this
# #the line above starts the application mgr, and _gaudi will become set to that
#except ImportError:
# pass
import cppyy
cppyy.loadDict('libPathResolver')
cppyy.loadDict('libPathResolverDict') #why do we have to load both the library and the dict :-( To be fixed by ROOT...
FindCalibFile = cppyy.gbl.PathResolverFindCalibFile
FindCalibDirectory = cppyy.gbl.PathResolverFindCalibDirectory
SetOutputLevel = cppyy.gbl.PathResolverSetOutputLevel
import ROOT
FindCalibFile = ROOT.PathResolver.FindCalibFile
FindCalibDirectory = ROOT.PathResolver.FindCalibDirectory
SetOutputLevel = ROOT.PathResolver.SetOutputLevel
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment