#include <MELALinearInterpFunc.h>
|
| MELALinearInterpFunc () |
|
| MELALinearInterpFunc (const char *name, const char *title) |
|
| MELALinearInterpFunc (const char *name, const char *title, RooAbsReal &inXVar, const std::vector< T > &inXList, const RooArgList &inFcnList, Bool_t inUseFloor=true, T inFloorEval=1e-15, T inFloorInt=1e-10) |
|
| MELALinearInterpFunc (const MELALinearInterpFunc &other, const char *name=0) |
|
virtual TObject * | clone (const char *newname) const |
|
virtual | ~MELALinearInterpFunc () |
|
void | setVerbosity (VerbosityLevel flag) |
|
void | setEvalFloor (T val) |
|
void | setIntFloor (T val) |
|
void | doFloor (Bool_t flag) |
|
void | setRangeValidity (const T valmin, const T valmax) |
|
Int_t | getAnalyticalIntegral (RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const |
|
Double_t | analyticalIntegral (Int_t code, const char *rangeName=0) const |
|
Definition at line 13 of file MELALinearInterpFunc.h.
◆ VerbosityLevel
◆ MELALinearInterpFunc() [1/4]
MELALinearInterpFunc::MELALinearInterpFunc |
( |
| ) |
|
◆ MELALinearInterpFunc() [2/4]
MELALinearInterpFunc::MELALinearInterpFunc |
( |
const char * |
name, |
|
|
const char * |
title |
|
) |
| |
◆ MELALinearInterpFunc() [3/4]
MELALinearInterpFunc::MELALinearInterpFunc |
( |
const char * |
name, |
|
|
const char * |
title, |
|
|
RooAbsReal & |
inXVar, |
|
|
const std::vector< T > & |
inXList, |
|
|
const RooArgList & |
inFcnList, |
|
|
Bool_t |
inUseFloor = true , |
|
|
T |
inFloorEval = 1e-15 , |
|
|
T |
inFloorInt = 1e-10 |
|
) |
| |
◆ MELALinearInterpFunc() [4/4]
MELALinearInterpFunc::MELALinearInterpFunc |
( |
const MELALinearInterpFunc & |
other, |
|
|
const char * |
name = 0 |
|
) |
| |
◆ ~MELALinearInterpFunc()
virtual MELALinearInterpFunc::~MELALinearInterpFunc |
( |
| ) |
|
|
inlinevirtual |
◆ analyticalIntegral()
Double_t MELALinearInterpFunc::analyticalIntegral |
( |
Int_t |
code, |
|
|
const char * |
rangeName = 0 |
|
) |
| const |
◆ clone()
virtual TObject* MELALinearInterpFunc::clone |
( |
const char * |
newname | ) |
const |
|
inlinevirtual |
◆ cropValueForRange()
void MELALinearInterpFunc::cropValueForRange |
( |
T & |
val | ) |
const |
|
protected |
Definition at line 313 of file MELALinearInterpFunc.cc.
318 if (val<*(range[0])) val = *(range[0]);
319 if (val>*(range[1])) val = *(range[1]);
◆ doFloor()
void MELALinearInterpFunc::doFloor |
( |
Bool_t |
flag | ) |
|
◆ evaluate()
Double_t MELALinearInterpFunc::evaluate |
( |
| ) |
const |
|
protected |
◆ getAnalyticalIntegral()
Int_t MELALinearInterpFunc::getAnalyticalIntegral |
( |
RooArgSet & |
allVars, |
|
|
RooArgSet & |
analVars, |
|
|
const char * |
rangeName = 0 |
|
) |
| const |
Definition at line 231 of file MELALinearInterpFunc.cc.
232 if (_forceNumInt)
return 0;
234 const Int_t xprime = 101;
237 RooArgSet Xdeps, Fcndeps;
238 RooRealVar* rrv_x =
dynamic_cast<RooRealVar*
>(
theXVar.absArg());
239 if (rrv_x==0)
theXVar.absArg()->leafNodeServerList(&Xdeps, 0,
true);
241 for (
int ix=0; ix<
FcnList.getSize(); ix++){
243 RooAbsReal
const* fcn =
dynamic_cast<const RooAbsReal*
>(
FcnList.at(ix));
244 fcn->leafNodeServerList(&tmpdeps, 0,
true);
245 Fcndeps.add(tmpdeps);
247 RooArgSet mirrorvars;
248 TIterator* iter = allVars.createIterator();
250 while ((var = (RooAbsArg*)iter->Next())){
251 RooRealVar* rrv_tmp =
dynamic_cast<RooRealVar*
>(var);
252 if (rrv_tmp==0)
continue;
255 isFound = (rrv_tmp==rrv_x);
258 TIterator* iter_deps = Xdeps.createIterator();
260 while ((var_deps = (RooAbsArg*)iter_deps->Next())){
261 RooRealVar* depvar =
dynamic_cast<RooRealVar*
>(var_deps);
262 if (depvar==0)
continue;
263 if (depvar==rrv_tmp){ isFound=
true;
break; }
267 if (!isFound) mirrorvars.add(*var);
271 Int_t codetmp = fcn->getAnalyticalIntegral(mirrorvars, analVars, rangeName);
272 if (codetmp!=0) code *= codetmp;
277 if (Fcndeps.find(*rrv_x)==0){
278 if (matchArgs(allVars, analVars,
theXVar)) code *= xprime;
284 cout <<
"MELALinearInterpFunc(" << GetName() <<
")::getAnalyticalIntegral code = " << code << endl;
◆ getKappa()
Definition at line 130 of file MELALinearInterpFunc.cc.
132 vector<MELALinearInterpFunc::T>
const* coord=&
XList;
134 if (Int_t(coord->size())>(bin+1)) diff = coord->at(bin+1)-coord->at(bin);
◆ getTVar()
◆ getWhichBin()
Int_t MELALinearInterpFunc::getWhichBin |
( |
const T & |
val | ) |
const |
|
protected |
Definition at line 109 of file MELALinearInterpFunc.cc.
113 vector<MELALinearInterpFunc::T>
const* coord=&
XList;
118 valjpo = coord->at(0);
119 for (Int_t j=0; j<np-1; j++){
121 valjpo = coord->at(j+1);
122 if (val<valjpo && val>=valj){ bin=j;
break; }
124 if (bin==-1 && val>=valjpo) bin=np-2;
125 else if (bin==-1) bin=0;
◆ interpolateFcn()
Definition at line 147 of file MELALinearInterpFunc.cc.
148 const Int_t xprime = 101;
149 const bool intAlongX=(code>0 && code%xprime==0);
152 Int_t coderem = (intAlongX ? code/xprime : code);
153 if (coderem==1) coderem=0;
156 if (intAlongX)
cout <<
"MELALinearInterpFunc(" << GetName() <<
")::interpolateFcn integrates using code = " << code <<
", coderem = " << coderem << endl;
157 else cout <<
"MELALinearInterpFunc(" << GetName() <<
")::interpolateFcn evaluates using code = " << code <<
", coderem = " << coderem << endl;
161 Int_t xbin=-1, xbinmin=-1, xbinmax=-1;
180 if (coderem==0) fcnval =
dynamic_cast<const RooAbsReal*
>(
FcnList.at(0))->getVal();
183 if (intAlongX) res *= (txmax-txmin);
186 for (
int ix=0; ix<nxbins; ix++){
188 (xbin>=0 && ix!=xbin)
190 (xbinmin>=0 && xbinmax>=xbinmin && !(xbinmin<=ix && ix<=xbinmax))
195 if (ix==xbinmin) txlow=txmin;
196 if (ix==xbinmax) txhigh=txmax;
202 for (
unsigned int j=0; j<2; j++) fcnval[j] = dynamic_cast<const RooAbsReal*>(
FcnList.at(ix+j))->getVal();
205 for (
unsigned int j=0; j<2; j++) fcnval[j] = dynamic_cast<const RooAbsReal*>(
FcnList.at(ix+j))->analyticalIntegral(coderem, rangeName);
209 if (intAlongX) segval += (fcnval[1] - fcnval[0])*(pow(txhigh, 2)-pow(txlow, 2))/2.;
210 else segval += (fcnval[1] - fcnval[0])*txhigh;
214 <<
"MELALinearInterpFunc(" << GetName() <<
")::interpolateFcn evaluated bin " << ix
215 <<
" with txlow = " << txlow <<
", txhigh = " << txhigh <<
", fcnval[0] = " << fcnval[0] <<
", fcnval[1] = " << fcnval[1]
◆ npoints()
unsigned int MELALinearInterpFunc::npoints |
( |
| ) |
const |
|
inlineprotected |
◆ setEvalFloor()
◆ setIntFloor()
◆ setRangeValidity()
void MELALinearInterpFunc::setRangeValidity |
( |
const T |
valmin, |
|
|
const T |
valmax |
|
) |
| |
◆ setVerbosity()
◆ testRangeValidity()
Bool_t MELALinearInterpFunc::testRangeValidity |
( |
const T & |
val | ) |
const |
|
protected |
Definition at line 300 of file MELALinearInterpFunc.cc.
304 return (*(range[0])>*(range[1]) || (val>=*(range[0]) && val<=*(range[1])));
◆ FcnList
RooListProxy MELALinearInterpFunc::FcnList |
|
protected |
◆ floorEval
T MELALinearInterpFunc::floorEval |
|
protected |
◆ floorInt
T MELALinearInterpFunc::floorInt |
|
protected |
◆ leafDepsList
RooListProxy MELALinearInterpFunc::leafDepsList |
|
protected |
◆ rangeXmax
T MELALinearInterpFunc::rangeXmax |
|
protected |
◆ rangeXmin
T MELALinearInterpFunc::rangeXmin |
|
protected |
◆ theXVar
RooRealProxy MELALinearInterpFunc::theXVar |
|
protected |
◆ useFloor
Bool_t MELALinearInterpFunc::useFloor |
|
protected |
◆ verbosity
◆ XList
std::vector<T> MELALinearInterpFunc::XList |
|
protected |
The documentation for this class was generated from the following files: