74 _cov(reduceToConditional ? fr.conditionalCovarianceMatrix(xvec) : fr.reducedCovarianceMatrix(xvec)),
81 list<string> munames ;
93 for (list<string>::iterator iter=munames.begin() ; iter!=munames.end() ; ++iter) {
155 RooAbsPdf(other,
name), _aicMap(other._aicMap), _x(
"x",this,other._x), _mu(
"mu",this,other._mu),
156 _cov(other._cov), _covI(other._covI), _det(other._det), _z(other._z)
188 return exp(-0.5*alpha) ;
209 analVars.
add(allVars) ;
219 <<
" observables, analytical integration is only implemented for the first 127 observables" << endl ;
236 <<
") Advertising analytical integral over " << xi->
GetName() <<
" as range is >" <<
_z <<
" sigma" << endl ;
242 <<
_z <<
" sigma, relying on numeric integral" << endl ;
252 <<
") Advertising analytical integral over " <<
pi->GetName() <<
" as range is >" <<
_z <<
" sigma" << endl ;
258 <<
_z <<
" sigma, relying on numeric integral" << endl ;
320 map<int,AnaIntData>::iterator iter =
_anaIntCache.find(code) ;
322 return iter->second ;
328 vector<int> map1,map2 ;
354 TMatrixD S22bar = S11 - S12*S22inv*S21 ;
361 cacheData.
pmap = map1 ;
362 cacheData.
nint = map2.size() ;
375 generateVars.
add(directVars) ;
383 <<
" observables, partial internal generation is only implemented for the first 127 observables" << endl ;
395 generateVars.
add(*arg) ;
437 vector<int>& omap = gd.
omap ;
443 for(
Int_t k= 0; k <nobs; k++) {
474 for (
int i=0 ; i<nobs ; i++) {
502 map<int,GenData>::iterator iter =
_genCache.find(code) ;
504 return iter->second ;
523 cacheData.
omap[i] = i ;
532 vector<int> map1, map2 ;
548 TMatrixD S22bar = S11 - S12 * (S22Inv * S21) ;
557 TVectorD mu1(map1.size()),mu2(map2.size()) ;
559 for (
UInt_t i=0 ; i<map1.size() ; i++) {
560 mu1(i) =
_muVec(map1[i]) ;
562 for (
UInt_t i=0 ; i<map2.size() ; i++) {
563 mu2(i) =
_muVec(map2[i]) ;
572 cacheData.
omap = map1 ;
573 cacheData.
pmap = map2 ;
576 cacheData.
mu1 = mu1 ;
577 cacheData.
mu2 = mu2 ;
579 cacheData.
S12S22I = S12S22Inv ;
597 cout <<
"RooMultiVarGaussian::decodeCode(" <<
GetName() <<
") ERROR don't have bit pattern for code " << code << endl ;
598 throw string(
"RooMultiVarGaussian::decodeCode() ERROR don't have bit pattern for code") ;
621 S11.
ResizeTo(map1.size(),map1.size()) ;
622 S12.
ResizeTo(map1.size(),map2.size()) ;
623 S21.
ResizeTo(map2.size(),map1.size()) ;
624 S22.
ResizeTo(map2.size(),map2.size()) ;
626 for (
UInt_t i=0 ; i<map1.size() ; i++) {
627 for (
UInt_t j=0 ; j<map1.size() ; j++)
628 S11(i,j) = input(map1[i],map1[j]) ;
629 for (
UInt_t j=0 ; j<map2.size() ; j++)
630 S12(i,j) = input(map1[i],map2[j]) ;
632 for (
UInt_t i=0 ; i<map2.size() ; i++) {
633 for (
UInt_t j=0 ; j<map1.size() ; j++)
634 S21(i,j) = input(map2[i],map1[j]) ;
635 for (
UInt_t j=0 ; j<map2.size() ; j++)
636 S22(i,j) = input(map2[i],map2[j]) ;
644 if (ibit<32) {
b0 |= (1<<ibit) ; return ; }
645 if (ibit<64) {
b1 |= (1<<(ibit-32)) ; return ; }
646 if (ibit<96) {
b2 |= (1<<(ibit-64)) ; return ; }
647 if (ibit<128) {
b3 |= (1<<(ibit-96)) ; return ; }
652 if (ibit<32)
return (b0 & (1<<ibit)) ;
653 if (ibit<64)
return (b1 & (1<<(ibit-32))) ;
654 if (ibit<96)
return (b2 & (1<<(ibit-64))) ;
655 if (ibit<128)
return (b3 & (1<<(ibit-96))) ;
static const double x2[5]
double pow(double, double)
char * Form(const char *fmt,...)
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
virtual TObject * Clone(const char *newname=0) const
Make a clone of an object using the Streamer facility.
Bool_t contains(const RooAbsArg &var) const
virtual Bool_t remove(const RooAbsArg &var, Bool_t silent=kFALSE, Bool_t matchByNameOnly=kFALSE)
Remove the specified argument from our list.
RooAbsArg * find(const char *name) const
Find object with given name in list.
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
virtual Double_t getMax(const char *name=0) const
void setConstant(Bool_t value=kTRUE)
virtual Double_t getMin(const char *name=0) const
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Double_t getVal(const RooArgSet *set=0) const
Evaluate object. Returns either cached value or triggers a recalculation.
RooAbsArg * at(Int_t idx) const
RooArgSet is a container object that can hold multiple RooAbsArg objects.
virtual Bool_t add(const RooAbsCollection &col, Bool_t silent=kFALSE)
Add a collection of arguments to this collection by calling add() for each element in the source coll...
RooFitResult is a container class to hold the input and output of a PDF fit to a dataset.
const RooArgList & floatParsFinal() const
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE)
Reimplementation of standard RooArgList::add()
virtual Bool_t addOwned(RooAbsArg &var, Bool_t silent=kFALSE)
Reimplementation of standard RooArgList::addOwned()
Bool_t getBit(Int_t ibit)
Bool_t operator==(const BitBlock &other)
Multivariate Gaussian p.d.f.
void decodeCode(Int_t code, std::vector< int > &map1, std::vector< int > &map2) const
Decode analytical integration/generation code into index map of integrated/generated (map2) and non-i...
std::vector< BitBlock > _aicMap
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
static void blockDecompose(const TMatrixD &input, const std::vector< int > &map1, const std::vector< int > &map2, TMatrixDSym &S11, TMatrixD &S12, TMatrixD &S21, TMatrixDSym &S22)
Block decomposition of covI according to given maps of observables.
AnaIntData & anaIntData(Int_t code) const
Check if cache entry was previously created.
std::map< int, GenData > _genCache
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Handle full integral here.
void generateEvent(Int_t code)
Retrieve generator config from cache.
GenData & genData(Int_t code) const
WVE – CHECK THAT GENDATA IS VALID GIVEN CURRENT VALUES OF _MU.
Int_t getGenerator(const RooArgSet &directVars, RooArgSet &generateVars, Bool_t staticInitOK=kTRUE) const
Special case: generate all observables.
std::map< int, AnaIntData > _anaIntCache
void initGenerator(Int_t code)
Clear the GenData cache as its content is not invariant under changes in the mu vector.
Double_t evaluate() const
Do not persist.
static Double_t gaussian(TRandom *generator=randomGenerator())
Return a Gaussian random variable with mean 0 and variance 1.
RooRealVar represents a fundamental (non-derived) real valued object.
virtual void setVal(Double_t value)
Set value of variable to 'value'.
Cholesky Decomposition class.
const TMatrixD & GetU() const
virtual Bool_t Decompose()
Matrix A is decomposed in component U so that A = U^T * U If the decomposition succeeds,...
virtual Double_t Determinant() const
TMatrixTSym< Element > & Invert(Double_t *det=0)
Invert the matrix and calculate its determinant Notice that the LU decomposition is used instead of B...
virtual TMatrixTBase< Element > & ResizeTo(Int_t nrows, Int_t ncols, Int_t=-1)
Set size of the matrix to nrows x ncols New dynamic elements are created, the overlapping part of the...
virtual TMatrixTBase< Element > & ResizeTo(Int_t nrows, Int_t ncols, Int_t=-1)
Set size of the matrix to nrows x ncols New dynamic elements are created, the overlapping part of the...
TMatrixT< Element > & Invert(Double_t *det=0)
Invert the matrix and calculate its determinant.
virtual const char * GetName() const
Returns name of object.
TVectorT< Element > & ResizeTo(Int_t lwb, Int_t upb)
Resize the vector to [lwb:upb] .
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
RooConstVar & RooConst(Double_t val)
static constexpr double pi