@@ -90,9 +90,9 @@ class HistogramRegistry
9090 HistogramRegistry (char const * const name, std::vector<HistogramSpec> histSpecs = {}, OutputObjHandlingPolicy policy = OutputObjHandlingPolicy::AnalysisObject, bool sortHistos = true , bool createRegistryDir = false );
9191
9292 // functions to add histograms to the registry
93- void add (const HistogramSpec& histSpec);
94- void add (char const * const name, char const * const title, const HistogramConfigSpec& histConfigSpec, bool callSumw2 = false );
95- void add (char const * const name, char const * const title, HistType histType, std::vector<AxisSpec> axes, bool callSumw2 = false );
93+ HistPtr add (const HistogramSpec& histSpec);
94+ HistPtr add (char const * const name, char const * const title, const HistogramConfigSpec& histConfigSpec, bool callSumw2 = false );
95+ HistPtr add (char const * const name, char const * const title, HistType histType, std::vector<AxisSpec> axes, bool callSumw2 = false );
9696 void addClone (const std::string& source, const std::string& target);
9797
9898 // function to query if name is already in use
@@ -137,11 +137,11 @@ class HistogramRegistry
137137
138138 private:
139139 // create histogram from specification and insert it into the registry
140- void insert (const HistogramSpec& histSpec);
140+ HistPtr insert (const HistogramSpec& histSpec);
141141
142142 // clone an existing histogram and insert it into the registry
143143 template <typename T>
144- void insertClone (const HistName& histName, const std::shared_ptr<T>& originalHist);
144+ HistPtr insertClone (const HistName& histName, const std::shared_ptr<T>& originalHist);
145145
146146 // helper function that checks if histogram name can be used in registry
147147 void validateHistName (const char * name, const uint32_t hash);
@@ -345,7 +345,7 @@ auto& HistogramRegistry::operator()(const HistName& histName)
345345}
346346
347347template <typename T>
348- void HistogramRegistry::insertClone (const HistName& histName, const std::shared_ptr<T>& originalHist)
348+ HistPtr HistogramRegistry::insertClone (const HistName& histName, const std::shared_ptr<T>& originalHist)
349349{
350350 validateHistName (histName.str , histName.hash );
351351 for (auto i = 0u ; i < MAX_REGISTRY_SIZE ; ++i) {
@@ -356,10 +356,11 @@ void HistogramRegistry::insertClone(const HistName& histName, const std::shared_
356356 mRegistryKey [imask (histName.idx + i)] = histName.hash ;
357357 mRegistryValue [imask (histName.idx + i)] = std::shared_ptr<T>(static_cast <T*>(originalHist->Clone (histName.str )));
358358 lookup += i;
359- return ;
359+ return mRegistryValue [ imask (histName. idx + i)] ;
360360 }
361361 }
362362 LOGF (FATAL , R"( Internal array of HistogramRegistry "%s" is full.)" , mName );
363+ return HistPtr ();
363364}
364365
365366template <typename T>
0 commit comments