Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-08-22 04:57:38

0001 #include "FWCore/Utilities/interface/Exception.h"
0002 
0003 #include "BareRootProductGetter.h"
0004 
0005 #include "TROOT.h"
0006 #include "TFile.h"
0007 
0008 TFile* BareRootProductGetter::currentFile() const {
0009   TFile* file = dynamic_cast<TFile*>(gROOT->GetListOfFiles()->Last());
0010   if (nullptr == file) {
0011     throw cms::Exception("FileNotFound") << "unable to find the TFile '" << gROOT->GetListOfFiles()->Last() << "'\n"
0012                                          << "retrieved by calling 'gROOT->GetListOfFiles()->Last()'\n"
0013                                          << "Please check the list of files.";
0014   }
0015   return file;
0016 }