there is something peculiar with the histogram stored in that file of yours. You should really consult with the person who generated file05.root: ask them how they did it exactly.
@Axel Try (it first generates an error that it does not need a dictionary and then it generates an error that this dictionary does not exist):
[...]$ root -q -e 'gInterpreter->GenerateDictionary("unique_ptr<TH1F>", "TH1.h;memory");' file05.root
Error: It is not necessary to explicitly select class unique_ptr<TH1F,default_delete<TH1F> >. I/O is supported for it transparently.
Error in <ACLiC>: Executing '/.../v6-24-00-patches-cxx17/bin/rootcling -v0 "--lib-list-prefix=/tmp/AutoDict_unique_ptr_TH1F__cxx_ACLiC_map" -f "/tmp/AutoDict_unique_ptr_TH1F__cxx_ACLiC_dict.cxx" -I$ROOTSYS/include -I"/.../v6-24-00-patches-cxx17/etc/" -I"/.../v6-24-00-patches-cxx17/etc//cling" -I"/.../v6-24-00-patches-cxx17/include/" -I"/.../v6-24-00-patches-cxx17/include" -D__ACLIC__ "/tmp/AutoDict_unique_ptr_TH1F_.cxx" "/tmp/AutoDict_unique_ptr_TH1F__cxx_ACLiC_linkdef.h"' failed!
Attaching file file05.root as _file0...
Warning in <TStreamerInfo::Build>: unique_ptr<TH1F,default_delete<TH1F> >: __uniq_ptr_impl<TH1F,default_delete<TH1F> > has no streamer or dictionary, data member "_M_t" will not be saved
Warning in <TClass::Init>: no dictionary for class __compressed_pair<TH1F*,default_delete<TH1F> > is available
Warning in <TClass::Init>: no dictionary for class __compressed_pair_elem<TH1F*,0,false> is available
Warning in <TClass::Init>: no dictionary for class __compressed_pair_elem<default_delete<TH1F>,1,true> is available
(TFile *) 0x55f5d0927720
It worked when I commented out “->Draw” part. How can I draw the histogram? Because it gave this error when I include ht1Ptr->Draw("hist"): error:no member named ‘Draw’ in 'std::__1::unique_ptr<TH1F, std::__1::default_delete >'