Saving histograms into a pdf / png format directly from ROOT

Ah maybe! Yes, the data is /eos/…/spark_tnp/UL_2018.
inFile is already tagged with what is necessary to pull through all of those folders, but if I redefine a pathway to insert, say:
dir = "eos/home/tcarnaha/UL_2018/

And, ROOT.TFile(dir), it complains. Also, what header do you use to have getall be defined?