Skip to content

Commit eeba948

Browse files
committed
[hf] Try to avoid the list of cleanups in HistFactory.
HistFactory models can suffer from slowdowns of minutes during destruction because the list of cleanups is visited over and over again.
1 parent 33345a7 commit eeba948

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

roofit/histfactory/src/Channel.cxx

+2-1
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,9 @@ TH1* RooStats::HistFactory::Channel::GetHistogram(std::string InputFile, std::st
464464
throw hf_exc();
465465
}
466466

467-
467+
TDirectory::TContext ctx{nullptr}; // Suppress any kind of registration
468468
TH1 * ptr = static_cast<TH1 *>(hist->Clone());
469+
ptr->SetBit(kMustCleanup, false); // Don't try to clean up this histogram
469470

470471
if(!ptr){
471472
std::cerr << "Not all necessary info are set to access the input file. Check your config" << std::endl;

0 commit comments

Comments
 (0)