Skip to content

Check if files are open after trying to open them

(CMSSW_12_4_0) lmoureau@lxplus737:~/eos/Patrick/Darwin/ProtoDarwin$ getHighScalePUeventIDs /eos/home-e/euslan/MinBias_TuneCP5_13TeV-pythia8/10259be9c8859_MinBias_pythia8_ak8_RunIISummer20UL18MiniAODv2-NoPU_106X_upgrade2018_realistic_v16_L1v1-v2/231121_110146/0000/output_255.root /afs/cern.ch/work/e/euslan/threshold_20/6.root 20 -k 6 -j 10 -p submit
getHighScalePUeventIDs 6/10 start
Error in <TFile::TFile>: no read permission, could not open file /eos/home-e/euslan/MinBias_TuneCP5_13TeV-pythia8/10259be9c8859_MinBias_pythia8_ak8_RunIISummer20UL18MiniAODv2-NoPU_106X_upgrade2018_realistic_v16_L1v1-v2/231121_110146/0000/output_255.root
Error in <TFile::TFile>: no read permission, could not open file /eos/home-e/euslan/MinBias_TuneCP5_13TeV-pythia8/10259be9c8859_MinBias_pythia8_ak8_RunIISummer20UL18MiniAODv2-NoPU_106X_upgrade2018_realistic_v16_L1v1-v2/231121_110146/0000/output_255.root
/eos/home-l/lmoureau/Patrick/Darwin/CMSSW_12_4_0/../ProtoDarwin/interface/protodarwin.h(126): Throw in function std::unique_ptr<TChain> Darwin::Tools::GetChain(std::vector<std::filesystem::__cxx11::path>, const char*)
Dynamic exception type: boost::wrapexcept<Darwin::Exceptions::BadInput>
std::exception::what: The tree cannot be found in (one of) the input file(s).
TFile**         /eos/home-e/euslan/MinBias_TuneCP5_13TeV-pythia8/10259be9c8859_MinBias_pythia8_ak8_RunIISummer20UL18MiniAODv2-NoPU_106X_upgrade2018_realistic_v16_L1v1-v2/231121_110146/0000/output_255.root
 TFile*         /eos/home-e/euslan/MinBias_TuneCP5_13TeV-pythia8/10259be9c8859_MinBias_pythia8_ak8_RunIISummer20UL18MiniAODv2-NoPU_106X_upgrade2018_realistic_v16_L1v1-v2/231121_110146/0000/output_255.root

To reproduce error, you may run:
submit getHighScalePUeventIDs /eos/home-e/euslan/MinBias_TuneCP5_13TeV-pythia8/10259be9c8859_MinBias_pythia8_ak8_RunIISummer20UL18MiniAODv2-NoPU_106X_upgrade2018_realistic_v16_L1v1-v2/231121_110146/0000/output_255.root /afs/cern.ch/work/e/euslan/threshold_20/ 20 -j 10

TFile::TFile docs

If the constructor fails in any way IsZombie() will return true. Use IsOpen() to check if the file is (still) open.