Skip to content

Commit 2b885a2

Browse files
committed
Check CTFdict existence before trying to load
1 parent 648018b commit 2b885a2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Detectors/Base/src/CTFCoderBase.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include "DetectorsCommonDataFormats/CTFHeader.h"
1616
#include "DetectorsBase/CTFCoderBase.h"
17+
#include "TSystem.h"
1718

1819
using namespace o2::ctf;
1920

@@ -34,7 +35,7 @@ bool readFromTree(TTree& tree, const std::string brname, T& dest, int ev = 0)
3435
std::unique_ptr<TFile> CTFCoderBase::loadDictionaryTreeFile(const std::string& dictPath, bool mayFail)
3536
{
3637
TDirectory* curd = gDirectory;
37-
std::unique_ptr<TFile> fileDict(TFile::Open(dictPath.c_str()));
38+
std::unique_ptr<TFile> fileDict(gSystem->AccessPathName(dictPath.c_str()) ? nullptr : TFile::Open(dictPath.c_str()));
3839
if (!fileDict || fileDict->IsZombie()) {
3940
if (mayFail) {
4041
LOG(INFO) << "CTF dictionary file " << dictPath << " for detector " << mDet.getName() << " is absent, will use dictionaries stored in CTF";

0 commit comments

Comments
 (0)