From eff5017a3c9d4a5e2dd02983147a3f319ddaacbe Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Thu, 14 Sep 2023 11:39:44 -0700 Subject: [PATCH 1/2] Fix bugs --- utils/TrkAnaUtils.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/TrkAnaUtils.C b/utils/TrkAnaUtils.C index 1c5dc0c..50f575b 100644 --- a/utils/TrkAnaUtils.C +++ b/utils/TrkAnaUtils.C @@ -31,8 +31,8 @@ class TrkAnaUtils { TFile const& File() const { return *myfile_; } void ListTrees() const; void UseTree(const char* treename="TrkAnaNeg"); - void fileName() { return myfile_->GetName(); } - void treeName() { if(mytree_)return mytree_->GetName(); else std::cout << "No current tree" << std::endl; } + auto fileName() { return myfile_->GetName(); } + auto treeName() { if(mytree_)return mytree_->GetName(); else return "none"; } TFile* file() { return myfile_;} TTree* tree() { return mytree_;} TCanvas* can() const { return mycan_; } From c7a77d36496c1ecfc367b7150fe1366693be3887 Mon Sep 17 00:00:00 2001 From: David Nathan Brown Date: Thu, 14 Sep 2023 11:41:23 -0700 Subject: [PATCH 2/2] remove delete --- utils/TrkAnaUtils.C | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/TrkAnaUtils.C b/utils/TrkAnaUtils.C index 50f575b..d6d58b0 100644 --- a/utils/TrkAnaUtils.C +++ b/utils/TrkAnaUtils.C @@ -27,7 +27,6 @@ class TrkAnaUtils { TrkAnaUtils(TFile* myfile,const char* treename="TrkAnaNeg"); TrkAnaUtils(const char* filename,const char* treename); TrkAnaUtils(const char* treename="TrkAnaNeg"); - ~TrkAnaUtils() { delete myfile_; } TFile const& File() const { return *myfile_; } void ListTrees() const; void UseTree(const char* treename="TrkAnaNeg");