Cov. matrix
36 NamedParameter<string> constrain((
"ConstrainMulti"+label).c_str(), (
string)
"" , (
char*) 0);
37 string constrain_s = constrain;
38 vector<string> constrain_v =
split(constrain_s,
" ");
41 NamedParameter<string> corr((
"ConstrainMulti"+label+
"_corr").c_str(),(
string)
"", (
char*) 0);
45 TMatrixDSym cov(constrain_v.size());
47 for(
int i=0; i < cov.GetNcols(); i++){
48 for(
int j=i; j < cov.GetNcols(); j++){
49 cov(i,j) = corr_v[index];
50 cov(j,i) = corr_v[index];
60 if(constrain_v.size() * (constrain_v.size()+1)/2 != corr_v.size()) {
61 cout <<
"ERROR in Neg2LLMultiConstraint::Inconsistent number of parameters and cov. matrix" << endl;
65 _x =
new RooArgList();
66 _mu =
new RooArgList();
67 vector<double> sigma_v;
69 for(
int j= 0; j < constrain_v.size();j++){
71 cout <<
"Adding gauss constraint for parameter: " << constrain_v[j] << endl;
74 double sigma = -99999;
76 for(
unsigned int i=0; i <
_mps->
size(); i++){
84 cout <<
"ERROR in Neg2LLMultiConstraint::Parameter not found" << endl;
88 RooRealVar* x =
new RooRealVar((constrain_v[j]).c_str(), (constrain_v[j]).c_str(),mean);
90 _mu->add(RooRealConstant::value(mean));
91 sigma_v.push_back(sigma);
95 for(
int i=0; i < cov.GetNcols(); i++){
96 for(
int j=0; j < cov.GetNcols(); j++){
97 cov(i,j) = cov(i,j) * sigma_v[i] * sigma_v[j];
100 _cov =
new TMatrixDSym(cov);
107 TDecompChol tdc(*
_cov);
109 TMatrixD U = tdc.GetU();
110 _UT =
new TMatrixD(TMatrixD::kTransposed,U);
vector< double > splitValues(string s, string delimiter)
IMinuitParameter * getParPtr(unsigned int i)
unsigned int size() const
virtual const std::string & name() const =0
virtual double mean() const =0
Minimisable(MinuitParameterSet *mps=0)
RooMultiVarGaussian * _gauss_cov
TMatrixTSym< double > * _cov
MinuitParameterSet * _mps
vector< string > split(string s, string delimiter)