1 #include "../interface/ProcessNormalization.h"
8 RooAbsReal(name,title),
9 nominalValue_(nominal),
10 thetaList_(
"thetaList",
"List of nuisances for symmetric kappas", this),
11 asymmThetaList_(
"asymmThetaList",
"List of nuisances for asymmetric kappas", this),
12 otherFactorList_(
"otherFactorList",
"Other multiplicative terms", this)
17 RooAbsReal(name,title),
19 thetaList_(
"thetaList",
"List of nuisances for symmetric kappas", this),
20 asymmThetaList_(
"asymmThetaList",
"List of nuisances for asymmetric kappas", this),
21 otherFactorList_(
"otherFactorList",
"Other multiplicative terms", this)
27 RooAbsReal(other, newname ? newname : other.GetName()),
28 nominalValue_(other.nominalValue_),
29 logKappa_(other.logKappa_),
30 thetaList_(
"thetaList", this, other.thetaList_),
31 logAsymmKappa_(other.logAsymmKappa_),
32 asymmThetaList_(
"asymmThetaList", this, other.asymmThetaList_),
33 otherFactorList_(
"otherFactorList", this, other.otherFactorList_)
40 if (kappa != 0.0 && kappa != 1.0) {
47 if (fabs(kappaLo*kappaHi - 1) < 1
e-5) {
62 RooLinkedListIter iterTheta =
thetaList_.iterator();
63 std::vector<double>::const_iterator logKappa =
logKappa_.begin();
64 for (RooAbsReal *
theta = (RooAbsReal*) iterTheta.Next();
theta != 0;
theta = (RooAbsReal*) iterTheta.Next(), ++logKappa) {
65 logVal +=
theta->getVal() * (*logKappa);
70 std::vector<std::pair<double,double> >::const_iterator logKappas =
logAsymmKappa_.begin();
71 for (RooAbsReal *
theta = (RooAbsReal*) iterTheta.Next();
theta != 0;
theta = (RooAbsReal*) iterTheta.Next(), ++logKappas) {
72 double x =
theta->getVal();
77 if (logVal) norm *=
std::exp(logVal);
80 for (RooAbsReal *fact = (RooAbsReal*) iterOther.Next(); fact != 0; fact = (RooAbsReal*) iterOther.Next()) {
81 norm *= fact->getVal();
88 if (fabs(x) >= 0.5)
return (x >= 0 ? logKappas.second : -logKappas.first);
97 double logKhi = logKappas.second;
98 double logKlo = -logKappas.first;
99 double avg = 0.5*(logKhi + logKlo), halfdiff = 0.5*(logKhi - logKlo);
100 double twox = x+
x, twox2 = twox*twox;
101 double alpha = 0.125 * twox * (twox2 * (3*twox2 - 10.) + 15.);
102 double ret = avg + alpha*halfdiff;
107 std::cout <<
"Dumping ProcessNormalization " << GetName() <<
" @ " << (
void*)
this << std::endl;
112 ", theta = " <<
thetaList_.at(i)->GetName() <<
" = " << ((RooAbsReal*)
thetaList_.at(i))->getVal() << std::endl;
118 ", theta = " <<
thetaList_.at(
i)->GetName() <<
" = " << ((RooAbsReal*)
thetaList_.at(
i))->getVal() << std::endl;
RooListProxy asymmThetaList_
void addLogNormal(double kappa, RooAbsReal &theta)
Double_t logKappaForX(double x, const std::pair< double, double > &logKappas) const
Geom::Theta< T > theta() const
U second(std::pair< T, U > const &p)
std::vector< double > logKappa_
Double_t evaluate() const
std::vector< std::pair< double, double > > logAsymmKappa_
void addOtherFactor(RooAbsReal &factor)
void addAsymmLogNormal(double kappaLo, double kappaHi, RooAbsReal &theta)
RooListProxy otherFactorList_