Skip to content

Commit

Permalink
14x comb2023 (#1006)
Browse files Browse the repository at this point in the history
* silencing ZZ complains

* silencing ZZ complains on Asimov

* trying to dup the file descriptors. this should work on condor and on local.
  • Loading branch information
amarini authored Sep 25, 2024
1 parent e794a7f commit e62f3ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
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

0 comments on commit e62f3ee

Please sign in to comment.