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

[RF][HF] Re-use any type of RooAbsArgs in ParamHistFunc::createParamSet #17654

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
22 changes: 9 additions & 13 deletions roofit/histfactory/src/ParamHistFunc.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,8 @@ RooArgList ParamHistFunc::createParamSet(RooWorkspace& w, const std::string& Pre
gamma.setConstant( false );

w.import( gamma, RooFit::RecycleConflictNodes() );
RooRealVar* gamma_wspace = (RooRealVar*) w.var( VarName );

paramSet.add( *gamma_wspace );

paramSet.add(*w.arg(VarName));
}
}

Expand Down Expand Up @@ -351,10 +349,8 @@ RooArgList ParamHistFunc::createParamSet(RooWorkspace& w, const std::string& Pre
gamma.setConstant( false );

w.import( gamma, RooFit::RecycleConflictNodes() );
RooRealVar* gamma_wspace = (RooRealVar*) w.var( VarName );

paramSet.add( *gamma_wspace );

paramSet.add(*w.arg(VarName));
}
}
}
Expand Down Expand Up @@ -388,10 +384,8 @@ RooArgList ParamHistFunc::createParamSet(RooWorkspace& w, const std::string& Pre
gamma.setConstant( false );

w.import( gamma, RooFit::RecycleConflictNodes() );
RooRealVar* gamma_wspace = (RooRealVar*) w.var( VarName );

paramSet.add( *gamma_wspace );

paramSet.add(*w.arg(VarName));
}
}
}
Expand Down Expand Up @@ -431,10 +425,12 @@ RooArgList ParamHistFunc::createParamSet(RooWorkspace& w, const std::string& Pre
RooArgList params = ParamHistFunc::createParamSet( w, Prefix, vars );

for (auto comp : params) {
auto var = static_cast<RooRealVar*>(comp);

var->setMin( gamma_min );
var->setMax( gamma_max );
// If the gamma is subject to a preprocess function, it is a RooAbsReal and
// we don't need to set the range.
if(auto var = dynamic_cast<RooRealVar*>(comp)) {
var->setMin( gamma_min );
var->setMax( gamma_max );
}
}

return params;
Expand Down
Loading