5 #include "RooAbsReal.h"
8 using namespace RooFit;
32 const std::vector<T>& inXList,
33 const std::vector<T>& inFcnList,
40 MELANCSplineCore(name, title, inXVar, inXList, inUseFloor, inFloorEval, inFloorInt),
41 bcBeginX(bcBeginX_), bcEndX(bcEndX_),
50 for (
int i=0; i<npoints; i++){
for (
int j=0; j<npoints; j++){ xAtrans[i][j]=xA.at(i).at(j); } }
54 coutE(InputArguments) <<
"MELANCSpline_1D::interpolateFcn: Matrix xA could not be inverted. Something is wrong with the x coordinates of points!" << endl;
74 bcBeginX(other.bcBeginX), bcEndX(other.bcEndX),
75 FcnList(other.FcnList),
77 coefficients(other.coefficients)
86 Int_t xbin=-1, xbinmin=-1, xbinmax=-1;
88 if (code==0 || code%2!=0){
103 for (
int ix=0; ix<nxbins; ix++){
105 (xbin>=0 && ix!=xbin)
107 (xbinmin>=0 && xbinmax>=xbinmin && !(xbinmin<=ix && ix<=xbinmax))
111 if (code>0 && code%2==0){
112 if (ix==xbinmin) txlow=txmin;
113 if (ix==xbinmax) txhigh=txmax;
129 vector<MELANCSplineCore::T>
const* coord;
133 for (Int_t j=0; j<npoints-1; j++){
139 kappas.push_back(
kappa);
141 kappas.push_back(
kappa);
147 vector<MELANCSplineCore::T>
const* coord;
151 if (npoints<=1) bin=0;
153 valjpo = coord->at(0);
154 for (Int_t j=0; j<npoints-1; j++){
156 valjpo = coord->at(j+1);
157 if (val<valjpo && val>=valj){ bin=j;
break; }
159 if (bin==-1 && val>=valjpo) bin=npoints-2;
160 else if (bin==-1) bin=0;
167 return (val-
XList.at(bin))*K;
177 cout <<
"MELANCSpline_1D_fast(" << GetName() <<
")::evaluate = " <<
value <<
" at x = " <<
theXVar << endl;
178 RooArgSet Xdeps;
theXVar.absArg()->leafNodeServerList(&Xdeps, 0,
true);
179 TIterator* iter = Xdeps.createIterator();
181 while ((var = (RooAbsArg*)iter->Next())){
182 cout << var->GetName() <<
" value = " <<
dynamic_cast<RooAbsReal*
>(var)->getVal() << endl;
190 if (_forceNumInt)
return 0;
192 if (
dynamic_cast<RooRealVar*
>(
theXVar.absArg())!=0){
193 if (matchArgs(allVars, analVars,
theXVar)) code=2;
200 if (
verbosity>=
MELANCSplineCore::kError) coutE(Integration) <<
"MELANCSpline_1D_fast ERROR::MELANCSpline_1D_fast(" << GetName() <<
") integration returned " <<
value <<
" for code = " << code << endl;
211 return (*(range[0])>*(range[1]) || (val>=*(range[0]) && val<=*(range[1])));
225 if (val<*(range[0])) val = *(range[0]);
226 if (val>*(range[1])) val = *(range[1]);