8 using namespace RooFit;
18 useFloor(true), floorEval(0), floorInt(0),
19 rangeXmin(1), rangeXmax(-1),
20 theXVar(
"theXVar",
"theXVar", this),
21 leafDepsList(
"leafDepsList",
"leafDepsList", this)
28 RooAbsReal(name, title),
30 useFloor(true), floorEval(0), floorInt(0),
31 rangeXmin(1), rangeXmax(-1),
32 theXVar(
"theXVar",
"theXVar", this),
33 leafDepsList(
"leafDepsList",
"leafDepsList", this)
40 const std::vector<T>& inXList,
45 RooAbsReal(name, title),
47 useFloor(inUseFloor), floorEval(inFloorEval), floorInt(inFloorInt),
48 rangeXmin(1), rangeXmax(-1),
49 theXVar(
"theXVar",
"theXVar", this, inXVar),
50 leafDepsList(
"leafDepsList",
"leafDepsList", this),
58 RooAbsReal(other, name),
59 verbosity(other.verbosity),
60 useFloor(other.useFloor), floorEval(other.floorEval), floorInt(other.floorInt),
61 rangeXmin(other.rangeXmin), rangeXmax(other.rangeXmax),
62 theXVar(
"theXVar", this, other.theXVar),
63 leafDepsList(
"leafDepsList", this, other.leafDepsList),
74 int npoints=kappas.size();
75 if (npoints!=(
int)fcnList.size()){
76 coutE(InputArguments) <<
"MELANCSplineCore::getBArray: Dim(kappas)=" << npoints <<
" != Dim(fcnList)=" << fcnList.size() << endl;
86 cerr <<
"Npoints " << npoints <<
" <= " << nthr << endl;
95 bcval=(npoints<3 ? 0 : ((fcnList.at(2)-fcnList.at(1))*kappas.at(1)-(fcnList.at(1)-fcnList.at(0))*kappas.at(0))/(0.5/kappas.at(0)+0.5/kappas.at(1)));
97 BArray.push_back(3.*(fcnList.at(1)-fcnList.at(0)) - bcval/2./pow(kappas.at(0), 2));
100 bcval=(fcnList.at(1)-fcnList.at(0))*kappas.at(0);
102 BArray.push_back(bcval/kappas.at(0));
105 bcval=2.*(fcnList.at(1)-fcnList.at(0));
106 BArray.push_back(bcval);
109 bcval=2.*(fcnList.at(1)-fcnList.at(0));
111 BArray.push_back(bcval*kappas.at(0)/kappas.at(1));
114 cerr <<
"MELANCSplineCore::getBArray: bcBegin " << bcBegin <<
" is not implemented!" << endl;
118 for (
int j=1; j<npoints-1; j++){
129 BArray.push_back(Bval);
134 ecval=(npoints<3 ? 0 : ((fcnList.at(npoints-1)-fcnList.at(npoints-2))*kappas.at(npoints-2)-(fcnList.at(npoints-2)-fcnList.at(npoints-3))*kappas.at(npoints-3))/(0.5/kappas.at(npoints-3)+0.5/kappas.at(npoints-2)));
136 BArray.push_back(3.*(fcnList.at(npoints-1)-fcnList.at(npoints-2)) + ecval/2./pow(kappas.at(npoints-1), 2));
139 ecval=(fcnList.at(npoints-1)-fcnList.at(npoints-2))*kappas.at(npoints-2);
141 BArray.push_back(ecval/kappas.at(npoints-1));
144 ecval=2.*(fcnList.at(npoints-1)-fcnList.at(npoints-2));
145 BArray.push_back(ecval);
148 ecval=2.*(fcnList.at(npoints-1)-fcnList.at(npoints-2));
149 BArray.push_back(ecval);
153 cerr <<
"MELANCSplineCore::getAArray: bcEnd " << bcEnd <<
" is not implemented!" << endl;
157 else if (npoints==1) BArray.push_back(0);
161 Int_t npoints = kappas.size();
162 for (
int i=0; i<npoints; i++){
163 vector<MELANCSplineCore::T> Ai(npoints, 0.);
164 if (npoints==1) Ai[0]=1;
169 Ai[0]=2; Ai[1]=kappas.at(1)/kappas.at(0);
177 Ai[0]=1; Ai[1]=kappas.at(1)/kappas.at(0);
180 cerr <<
"MELANCSplineCore::getAArray: bcBegin " << bcBegin <<
" is not implemented!" << endl;
184 else if (i==npoints-1){
188 Ai[npoints-2]=1; Ai[npoints-1]=2.*kappas.at(npoints-1)/kappas.at(npoints-2);
196 Ai[npoints-2]=1; Ai[npoints-1]=kappas.at(npoints-1)/kappas.at(npoints-2);
199 cerr <<
"MELANCSplineCore::getAArray: bcEnd " << bcEnd <<
" is not implemented!" << endl;
211 Ai[i]=2.*kappa_j/kappa_jmo*(1.+kappa_j/kappa_jmo);
212 Ai[i+1]=kappa_j*kappa_jpo/pow(kappa_jmo, 2);
215 AArray.push_back(Ai);
221 vector<MELANCSplineCore::T> res;
223 const int fcnsize = fcnList.size();
227 if (fcnsize>(bin+1)){
233 C -= S[bin+1]*kappas.at(bin+1)/kappas.at(bin);
237 D += S[bin+1]*kappas.at(bin+1)/kappas.at(bin);
248 vector<MELANCSplineCore::T> BArray;
249 getBArray(kappas, fcnList, BArray, bcBegin, bcEnd);
251 Int_t npoints = BArray.size();
253 for (
int i=0; i<npoints; i++) Btrans[i]=BArray.at(i);
256 vector<vector<MELANCSplineCore::T>> coefs;
257 for (Int_t bin=0; bin<(npoints>1 ? npoints-1 : 1); bin++){
258 if (pickBin>=0 && bin!=pickBin)
continue;
259 vector<MELANCSplineCore::T> coef =
getCoefficients(Strans, kappas, fcnList, bin);
260 coefs.push_back(coef);
267 for (
unsigned int ic=0; ic<coefs.size(); ic++){
268 if (doIntegrate) res += coefs.at(ic)*(pow(tup, (
int)(ic+1))-pow(tdn, (
int)(ic+1)))/((
MELANCSplineCore::T)(ic+1));
269 else res += coefs.at(ic)*pow(tup, (
int)ic);
271 if (doIntegrate) res /=
kappa;
277 proxy.absArg()->leafNodeServerList(&deps, 0,
true);
281 TIterator* iter =
set.createIterator();
283 while ((absarg = (RooAbsArg*)iter->Next())){
if (
dynamic_cast<RooRealVar*
>(absarg))
leafDepsList.add(*absarg); }