/***************************************************************************** * Project: RooFit * * * * This code was autogenerated by RooClassFactory * *****************************************************************************/ // Your description goes here... #include "Riostream.h" #include "RooClusterPdf.h" #include "RooAbsReal.h" #include "RooAbsCategory.h" #include #include "TMath.h" #include "RooListProxy.h" #include "RooRealProxy.h" #include "TMatrixDSym.h" #include "TMatrixD.h" #include "TVectorD.h" ClassImp(RooClusterPdf) RooClusterPdf::RooClusterPdf(const char *name, const char *title, const RooArgList& xvec, RooAbsReal& _frac, const RooArgList& muvec, const TMatrixDSym& covMatrix, const TMatrixDSym& covMatrixPad ) : RooAbsPdf(name,title), x("x","Observables",this,kTRUE,kFALSE), frac("frac","fraction",this,_frac), mu("mu","Offset vector",this,kTRUE,kFALSE), cov(covMatrix), covI(covMatrix), covPad(covMatrixPad), covIPad(covMatrixPad) { x.add(xvec) ; mu.add(muvec); det = covMatrix.Determinant() ; detPad = covMatrixPad.Determinant() ; // Invert covariance matrix covI.Invert() ; covIPad.Invert(); syncMuVec(); } RooClusterPdf::RooClusterPdf(const RooClusterPdf& other, const char* name) : RooAbsPdf(other,name), x("x",this,other.x), mu("muY",this,other.mu), det(other.det), detPad(other.detPad), cov(other.cov), covI(other.covI), covPad(other.covPad), covIPad(other.covIPad), frac("frac",this,other.frac) { syncMuVec(); } //Int_t RooG2DimGauss::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* /*rangeName*/) const /* { if (matchArgs(allVars,analVars,x)) return 1 ; return 0 ; } Double_t RooClusterPdf::analyticalIntegral(Int_t code, const char* rangeName) const { assert(code==1) ; } */ Double_t RooClusterPdf::evaluate() const { double retval=0; // Represent observables as vector TVectorD xVec(x.getSize()) ; for (int i=0 ; igetVal() ; } syncMuVec(); TVectorD x_to_mu(xVec - muVec); TVectorD x_to_mu_norm(x_to_mu); //std::cout<<"x_to_mu_norm("<0) { std::cout<<"bigger than\n"; } else{std::cout<<"smaller than\n";} cov.Print(); muVec.Print(); */ //TVectorD x_to_mu_anti(x_to_mu); //x_to_mu_anti*=-1; //std::cout<getVal() ; } } double RooClusterPdf::cutCov(TMatrixDSym acov, TVectorD avec) const { double cutVal=0; if(TMath::Sqrt(avec.Norm2Sqr())!=0) { avec*=1./TMath::Sqrt(avec.Norm2Sqr()); } else { std::cout<<"error in cutCov: length of avec==0\n"; return cutVal; } cutVal=acov.Similarity(avec); if(cutVal!=0) { cutVal=1./TMath::Sqrt(fabs(cutVal)); } else { std::cout<<"error in cutCov: cut with cov ==0\n"; cutVal=0; } return cutVal; }