1 #include "../interface/TestProposal.h"
7 #include <RooStats/RooStatsUtils.h>
10 RooStats::ProposalFunction(),
18 RooStats::ProposalFunction(),
20 poiDivisor_(divisor_),
21 alwaysStepMe_(alwaysStepMe)
23 if (alwaysStepMe.getSize() > 1) poiDivisor_ /=
sqrt(
double(alwaysStepMe.getSize()));
30 RooStats::SetParameters(&x, &xPrime);
31 RooLinkedListIter it(xPrime.iterator());
33 int n = xPrime.getSize(),
j = floor(RooRandom::uniform()*n);
34 for (
int i = 0; (var = (RooRealVar*)it.Next()) !=
NULL; ++
i) {
37 double val = var->getVal(),
max = var->getMax(),
min = var->getMin(), len =
max -
min;
38 val += RooRandom::gaussian() * len * divisor_;
39 while (val >
max) val -= len;
40 while (val < min) val += len;
46 for (RooRealVar *poi = (RooRealVar*)it.Next(); poi !=
NULL; poi = (RooRealVar*)it.Next()) {
47 RooRealVar *var = (RooRealVar*) xPrime.find(poi->GetName());
48 double val = var->getVal(),
max = var->getMax(),
min = var->getMin(), len =
max -
min;
49 val += RooRandom::gaussian() * len * poiDivisor_;
50 while (val >
max) val -= len;
51 while (val < min) val += len;
virtual void Propose(RooArgSet &xPrime, RooArgSet &x)
ClassDef(TestProposal, 1) private RooArgList alwaysStepMe_
const T & max(const T &a, const T &b)
virtual Bool_t IsSymmetric(RooArgSet &x1, RooArgSet &x2)
virtual Double_t GetProposalDensity(RooArgSet &x1, RooArgSet &x2)