Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

14x comb2023 #1006

Merged
merged 4 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/CachingNLL.cc
Original file line number Diff line number Diff line change
Expand Up @@ -638,9 +638,13 @@ cacheutils::CachingAddNLL::evaluate() const
}
// get vals
//std::cout<<"Silence is gold!"<<std::endl;
int stdout_fd = dup(STDOUT_FILENO);
freopen("/dev/null", "w", stdout); // (bad) Fix RooFit warnings: [#0] WARNING:Eval -- Evaluating RooAddPdf without a defined normalization set.
const std::vector<Double_t> &pdfvals = itp->eval(*data_);
freopen("/dev/tty", "w", stdout);
//freopen("/dev/tty", "w", stdout);
dup2(stdout_fd, STDOUT_FILENO);
stdout = fdopen(stdout_fd, "w");
close(stdout_fd);
//std::cout<<"I am alive!"<<std::endl;
if (basicIntegrals_) {
double integral = (binWidths_.size() > 1) ?
Expand Down
6 changes: 5 additions & 1 deletion src/ToyMCSamplerOpt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ toymcoptutils::SinglePdfGenInfo::generateWithHisto(RooRealVar *&weightVar, bool
RooCmdArg ay = (y ? RooFit::YVar(*y) : RooCmdArg::none());
RooCmdArg az = (z ? RooFit::ZVar(*z) : RooCmdArg::none());

int stdout_fd = dup(STDOUT_FILENO);
freopen("/dev/null", "w", stdout); // AMARINI
if (histoSpec_ == 0) {
histoSpec_ = pdf_->createHistogram("htemp", *x, ay, az);
Expand Down Expand Up @@ -266,7 +267,10 @@ toymcoptutils::SinglePdfGenInfo::generateWithHisto(RooRealVar *&weightVar, bool
if (!keepHistoSpec_) { delete histoSpec_; histoSpec_ = 0; }
//std::cout << "Asimov dataset generated from " << pdf_->GetName() << " (sumw? " << data->sumEntries() << ", expected events " << expectedEvents << ")" << std::endl;
//utils::printRDH(data);
freopen("/dev/tty", "w", stdout);
//freopen("/dev/tty", "w", stdout);
dup2(stdout_fd, STDOUT_FILENO);
stdout = fdopen(stdout_fd, "w");
close(stdout_fd);
return data;
}

Expand Down
Loading