From 43b8b4f0fd83dbd7feab9e9b0d39e048a9850121 Mon Sep 17 00:00:00 2001 From: michaelmackenzie Date: Mon, 17 Aug 2026 12:44:30 -0500 Subject: [PATCH] Return references to vectors instead of copies --- rooutil/inc/Event.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rooutil/inc/Event.hh b/rooutil/inc/Event.hh index 8ea1f8d..ff96943 100644 --- a/rooutil/inc/Event.hh +++ b/rooutil/inc/Event.hh @@ -259,7 +259,7 @@ namespace rooutil { } - Tracks GetTracks() { return tracks; } + const Tracks& GetTracks() { return tracks; } Tracks GetTracks(TrackCut cut, bool inplace = false) { if (!inplace) { // if we are not changing inplace, then just create a new vector to return Tracks select_tracks; @@ -310,7 +310,7 @@ namespace rooutil { } } - CrvCoincs GetCrvCoincs() { return crv_coincs; } + const CrvCoincs& GetCrvCoincs() { return crv_coincs; } CrvCoincs GetCrvCoincs(CrvCoincCut cut) { CrvCoincs select_crv_coincs; for (auto& crv_coinc : crv_coincs) { @@ -321,7 +321,7 @@ namespace rooutil { return select_crv_coincs; } - TimeClusters GetTimeClusters() { return time_clusters; } + const TimeClusters& GetTimeClusters() { return time_clusters; } TimeClusters GetTimeClusters(TimeClusterCut cut, bool inplace = false) { if (!inplace) { // if we are not changing inplace, then just create a new vector to return TimeClusters select_time_clusters;