diff --git a/include/GenericToolbox.Root.h b/include/GenericToolbox.Root.h index 3112536..1d85ea3 100644 --- a/include/GenericToolbox.Root.h +++ b/include/GenericToolbox.Root.h @@ -151,6 +151,7 @@ namespace GenericToolbox{ inline TDirectory* mkdirTFile(TFile* outputFile_, const std::string &dirName_); inline TDirectory* getCurrentTDirectory(); inline void writeInTFileWithObjTypeExt(TDirectory* dir_, const TObject* objToSave_, std::string saveName_ = "", bool forceWriteFile_=false); + inline void writeInTFileWithObjTypeExt(TDirectory* dir_, const TObject& objToSave_, std::string saveName_ = "", bool forceWriteFile_=false); inline void writeInTFile(TDirectory* dir_, const TObject* objToSave_, std::string saveName_ = "", bool forceWriteFile_=false); inline void writeInTFile(TDirectory* dir_, const TObject& objToSave_, std::string saveName_ = "", bool forceWriteFile_=false); inline void writeInTFile(TDirectory* dir_, const std::string& objToSave_, std::string saveName_, bool forceWriteFile_=false); @@ -774,6 +775,9 @@ namespace GenericToolbox { // Force TFile Write? if( forceWriteFile_ ){ triggerTFileWrite(dir_); } } + inline void writeInTFileWithObjTypeExt(TDirectory* dir_, const TObject& objToSave_, std::string saveName_, bool forceWriteFile_){ + writeInTFileWithObjTypeExt(dir_, &objToSave_, std::move(saveName_), forceWriteFile_); + } inline void writeInTFile(TDirectory* dir_, const TObject& objToSave_, std::string saveName_, bool forceWriteFile_){ writeInTFile(dir_, &objToSave_, std::move(saveName_), forceWriteFile_); }