81 _val(std::numeric_limits<Double_t>::quiet_NaN())
83 RooRealVar& x = parent.convVar();
87 myunique_ptr<const RooArgSet> effInt( eff.getObservables(iset) );
89 if (effInt->getSize()>1) {
90 std::cout <<
" got efficiency iset with more than 1 AbsArg -- not yet supported" << std::endl;
93 assert(effInt->getSize() < 2);
99 if (0 == effInt->getSize()) {
100 _int = parent.
model().createIntegral(iset, RooNameReg::str(rangeName));
104 const char* rn = (rangeName ? RooNameReg::str(rangeName) :
"");
106 const double rxmin = x.getMin(rn);
107 const double rxmax = x.getMax(rn);
109 myunique_ptr<std::list<Double_t> > bounds(
110 eff.binBoundaries(x, x.getMin(), x.getMax()));
111 assert(bounds->size() > 1);
112 _bounds.reserve(bounds->size());
113 for (std::list<Double_t>::const_iterator
114 lo = bounds->begin(), hi = ++(bounds->begin());
115 hi != bounds->end(); ++hi, ++lo) {
116 if (*hi < rxmin)
continue;
117 if (*lo > rxmax)
break;
118 const double xmin = std::max(*lo, rxmin);
119 const double xmax = std::min(*hi, rxmax);
126 _x = dynamic_cast<RooRealVar*>(x.clone((std::string(x.GetName()) +
"_" +
129 RooCustomizer customizer2(
model, (std::string(rn) +
"_customizer2").c_str());
130 customizer2.replaceArg(x, *
_x);
131 RooAbsReal*
m = dynamic_cast<RooAbsReal*>(customizer2.build(
false));
134 RooArgSet custiset(iset);
135 custiset.replace(x, *
_x);
137 _xmin = dynamic_cast<RooRealVar*>(
_x->clone(
138 (std::string(
_x->GetName()) +
"_xmin").c_str()));
141 _xmax = dynamic_cast<RooRealVar*>(
_x->clone(
142 (std::string(
_x->GetName()) +
"_xmax").c_str()));
145 std::string wrn(parent.GetName());
146 wrn +=
"_"; wrn += x.GetName(); wrn +=
"_"; wrn +=
model.GetName();
147 wrn +=
"_"; wrn += eff.GetName(); wrn +=
"_"; wrn += rn;
149 assert(!
_x->hasRange(wrn.c_str()));
152 _int =
m->createIntegral(custiset, wrn.c_str());
154 _int->addOwnedComponents(*
m);
155 _int->addOwnedComponents(*
_x);
159 RooCustomizer customizer(eff, (std::string(rn) +
"_customizer").c_str());
160 customizer.replaceArg(x, *
_x);
161 _eff = static_cast<RooAbsReal*>(customizer.build(
false));
std::vector< double > _bounds
virtual RooResolutionModel & model() const
virtual RooAbsReal * efficiency() const
Return pointer to pdf in product.