Logo ROOT  
Reference Guide
MnGlobalCorrelationCoeff.cxx
Go to the documentation of this file.
1 // @(#)root/minuit2:$Id$
2 // Authors: M. Winkler, F. James, L. Moneta, A. Zsenei 2003-2005
3 
4 /**********************************************************************
5  * *
6  * Copyright (c) 2005 LCG ROOT Math team, CERN/PH-SFT *
7  * *
8  **********************************************************************/
9 
11 #include "Minuit2/MnPrint.h"
12 #include <cmath>
13 
14 namespace ROOT {
15 
16 namespace Minuit2 {
17 
19  : fGlobalCC(std::vector<double>()), fValid(true)
20 {
21  // constructor: calculate global correlation given a symmetric matrix
22  MnPrint print("MnGlobalCorrelationCoeff");
23 
25  int ifail = Invert(inv);
26  if (ifail != 0) {
27  print.Warn("inversion of matrix fails");
28  fValid = false;
29  } else {
30 
31  unsigned int n = cov.Nrow();
32  fGlobalCC.reserve(n);
33  for (unsigned int i = 0; i < n; i++) {
34  double denom = inv(i, i) * cov(i, i);
35  if (denom < 1. && denom > 0.)
36  fGlobalCC.push_back(0.);
37  else
38  fGlobalCC.push_back(std::sqrt(1. - 1. / denom));
39  }
40  }
41 }
42 
43 } // namespace Minuit2
44 
45 } // namespace ROOT
n
const Int_t n
Definition: legend1.C:16
ROOT::Minuit2::Invert
int Invert(LASymMatrix &)
Definition: LaInverse.cxx:21
ROOT::Minuit2::MnGlobalCorrelationCoeff::fValid
bool fValid
Definition: MnGlobalCorrelationCoeff.h:40
ROOT::Minuit2::MnGlobalCorrelationCoeff::fGlobalCC
std::vector< double > fGlobalCC
Definition: MnGlobalCorrelationCoeff.h:39
ROOT::Minuit2::LASymMatrix
Class describing a symmetric matrix of size n.
Definition: LASymMatrix.h:45
inv
void inv(rsa_NUMBER *, rsa_NUMBER *, rsa_NUMBER *)
Definition: rsaaux.cxx:949
ROOT::Minuit2::MnPrint::Warn
void Warn(const Ts &... args)
Definition: MnPrint.h:126
ROOT::Minuit2::MnGlobalCorrelationCoeff::MnGlobalCorrelationCoeff
MnGlobalCorrelationCoeff()
Definition: MnGlobalCorrelationCoeff.h:28
double
double
Definition: Converters.cxx:921
sqrt
double sqrt(double)
ROOT::Minuit2::LASymMatrix::Nrow
unsigned int Nrow() const
Definition: LASymMatrix.h:274
MnPrint.h
ROOT
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: EExecutionPolicy.hxx:4
MnGlobalCorrelationCoeff.h
ROOT::Minuit2::MnPrint
Definition: MnPrint.h:73