75 if(!
fgTools.compare_exchange_strong(expected,tmp)) {
85 if (fgTools != 0) {
delete fgTools.load(); fgTools=0; }
92 fRegexp(
"$&|!%^&()'<>?= "),
128 if ((S->GetNbinsX() != B->
GetNbinsX()) || (S->GetNbinsX() <= 0)) {
129 Log() << kFATAL <<
"<GetSeparation> signal and background"
130 <<
" histograms have different number of bins: "
136 S->GetXaxis()->GetXmax() <= S->GetXaxis()->GetXmin()) {
137 Log() << kINFO << S->GetXaxis()->GetXmin() <<
" " << B->
GetXaxis()->
GetXmin()
139 <<
" " << S->GetXaxis()->GetXmax() <<
" " << S->GetXaxis()->GetXmin() <<
Endl;
140 Log() << kFATAL <<
"<GetSeparation> signal and background"
141 <<
" histograms have different or invalid dimensions:" <<
Endl;
144 Int_t nstep = S->GetNbinsX();
145 Double_t intBin = (S->GetXaxis()->GetXmax() - S->GetXaxis()->GetXmin())/nstep;
146 Double_t nS = S->GetSumOfWeights()*intBin;
149 if (nS > 0 && nB > 0) {
150 for (
Int_t bin=0; bin<nstep; bin++) {
154 if (s +
b > 0) separation += (s -
b)*(s -
b)/(s +
b);
156 separation *= (0.5*intBin);
159 Log() << kWARNING <<
"<GetSeparation> histograms with zero entries: "
160 << nS <<
" : " << nB <<
" cannot compute separation"
180 Log() << kFATAL <<
"<GetSeparation> Mismatch in PDF limits: "
187 for (
Int_t bin=0; bin<nstep; bin++) {
192 if (s +
b > 0) separation += (s -
b)*(s -
b)/(s +
b);
194 separation *= (0.5*intBin);
209 Log() << kFATAL <<
"<Tools::ComputeStat> value vector is zero pointer" <<
Endl;
211 if ( events.size() != valVec->size() )
212 Log() << kWARNING <<
"<Tools::ComputeStat> event and value vector have different lengths "
213 << events.size() <<
"!=" << valVec->size() <<
Endl;
229 xmin_ = *std::min( valVec->begin(), valVec->end() );
230 xmax_ = *std::max( valVec->begin(), valVec->end() );
233 for (
Int_t ievt=0; ievt<entries; ievt++) {
237 if (
Int_t(events[ievt]->GetClass()) == signalClass ){
238 wgtVecS[nEventsS] = events[ievt]->GetWeight();
239 varVecS[nEventsS++] = theVar;
242 wgtVecB[nEventsB] = events[ievt]->GetWeight();
243 varVecB[nEventsB++] = theVar;
285 d->Mult( (*si), (*symMat) ); (*d) *= (*s);
290 for (i=0; i<
n; i++) {
291 for (j=0; j<
n; j++) {
293 (i == j && (*
d)(i,i) < 0)) {
295 Log() << kWARNING <<
"<GetSQRootMatrix> error in matrix diagonalization; printed S and B" <<
Endl;
301 for (i=0; i<
n; i++)
for (j=0; j<
n; j++)
if (j != i) (*d)(i,j) = 0;
307 sqrtMat->
Mult( (*s), (*
d) );
327 if (covMat == 0)
return 0;
331 Log() << kFATAL <<
"<GetCorrelationMatrix> input matrix not quadratic" <<
Endl;
335 for (
Int_t ivar=0; ivar<nvar; ivar++) {
336 for (
Int_t jvar=0; jvar<nvar; jvar++) {
338 Double_t d = (*covMat)(ivar, ivar)*(*covMat)(jvar, jvar);
340 (*corrMat)(ivar, jvar) = (*covMat)(ivar, jvar)/
TMath::Sqrt(
d);
342 Log() <<
"<GetCorrelationMatrix> zero variances for variables "
343 <<
"(" << ivar <<
", " << jvar <<
")" <<
Endl;
344 (*corrMat)(ivar, jvar) = 0;
348 <<
" Element corr("<<ivar<<
","<<ivar<<
")=" << (*corrMat)(ivar,jvar)
350 <<
" cov("<<ivar<<
","<<ivar<<
")=" <<(*covMat)(ivar, ivar)
351 <<
" cov("<<jvar<<
","<<jvar<<
")=" <<(*covMat)(jvar, jvar)
356 else (*corrMat)(ivar, ivar) = 1.0;
385 if (!theHist)
return 0;
391 if (w > 0) theHist->
Scale( norm/w );
405 while (formatString.
First(sep)==0) formatString.
Remove(0,1);
407 while (formatString.
Length()>0) {
408 if (formatString.
First(sep) == -1) {
416 formatString.
Remove(0,posSep+1);
418 while (formatString.
First(sep)==0) formatString.
Remove(0,1);
444 vector<Int_t>* nodes )
451 Log() << kFATAL <<
"<ParseANNOptionString> unrecognized option string: " << theOptions <<
Endl;
455 nodes->push_back( atoi( ((
TObjString*)list->
At(0))->GetString() ) );
463 if (s.
Length() > 1) nodes->push_back( nvar + atoi(&s[1]) );
464 else nodes->push_back( nvar );
466 else if ((
a = atoi( s )) > 0) nodes->push_back( atoi(s ) );
468 Log() << kFATAL <<
"<ParseANNOptionString> unrecognized option string: " << theOptions <<
Endl;
490 Double_t dev = 0.5*(ys - yh)/(ys + yh);
492 Log() << kFATAL <<
"<CheckSplines> Spline failed sanity criterion; "
493 <<
" relative deviation from histogram: " << dev
494 <<
" in (bin, value): (" << ibin <<
", " <<
x <<
")" <<
Endl;
508 if (
a.size() !=
b.size()) {
511 vector<Double_t> result(
a.size());
512 for (
UInt_t i=0; i<
a.size();i++) result[i]=
a[i]-
b[i];
521 for (
UInt_t i=0; i<
v.size();i++)
v[i]*=
f;
529 for (
UInt_t i=0; i<
v.size();i++)
v[i]*=
f;
542 UInt_t sizeofarray=
v[0].size();
543 for (
UInt_t i=0; i<sizeofarray; i++) {
544 for (
UInt_t j=sizeofarray-1; j>i; j--) {
545 if (
v[0][j-1] >
v[0][j]) {
546 for (
UInt_t k=0; k< nArrays; k++) {
547 temp =
v[k][j-1];
v[k][j-1] =
v[k][j];
v[k][j] = temp;
550 TString temps = (*vs)[j-1]; (*vs)[j-1] = (*vs)[j]; (*vs)[j] = temps;
569 UInt_t sizeofarray=
v[0].size();
570 for (
UInt_t i=0; i<sizeofarray; i++) {
571 for (
UInt_t j=sizeofarray-1; j>i; j--) {
572 if (
v[0][j-1] <
v[0][j]) {
573 for (
UInt_t k=0; k< nArrays; k++) {
574 temp =
v[k][j-1];
v[k][j-1] =
v[k][j];
v[k][j] = temp;
577 TString temps = (*vs)[j-1]; (*vs)[j-1] = (*vs)[j]; (*vs)[j] = temps;
592 if (
hi == 0)
return -1;
600 Int_t maxBinX =
h.GetNbinsX();
601 Int_t maxBinY =
h.GetNbinsY();
602 for (
Int_t x = 1;
x <= maxBinX;
x++) {
603 for (
Int_t y = 1;
y <= maxBinY;
y++) {
607 if (p_x > 0. && p_y > 0. && p_xy > 0.){
608 mutualInfo += p_xy*
TMath::Log(p_xy / (p_x * p_y));
623 if (
hi == 0.)
return -1;
631 Double_t y_mean =
h.ProjectionY()->GetMean();
632 for (
Int_t ix=1; ix<=
h.GetNbinsX(); ix++) {
633 corrRatio += (
h.Integral(ix,ix,1,
h.GetNbinsY())/
hi)*pow((GetYMean_binX(
h,ix)-y_mean),2);
635 corrRatio /= pow(
h.ProjectionY()->GetRMS(),2);
644 if (
h.Integral(bin_x,bin_x,1,
h.GetNbinsY()) == 0.) {
return 0;}
646 TH1* py =
h.ProjectionY();
647 for (
Int_t y = 1;
y <=
h.GetNbinsY();
y++){
650 y_bin_mean /=
h.Integral(bin_x,bin_x,1,
h.GetNbinsY());
660 if (
h.GetNbinsX() !=
h.GetNbinsY()) {
661 Log() << kFATAL <<
"<TransposeHist> cannot transpose non-quadratic histogram" <<
Endl;
665 for (
Int_t ix=1; ix <=
h.GetNbinsX(); ix++){
666 for (
Int_t iy=1; iy <=
h.GetNbinsY(); iy++){
675 h.GetStats(stats_old);
676 stats_new[0] = stats_old[0];
677 stats_new[1] = stats_old[1];
678 stats_new[2] = stats_old[4];
679 stats_new[3] = stats_old[5];
680 stats_new[4] = stats_old[2];
681 stats_new[5] = stats_old[3];
682 stats_new[6] = stats_old[6];
683 transposedHisto->
PutStats(stats_new);
685 return transposedHisto;
715 std::vector<TString>
v = SplitString( s,
':' );
716 for (std::vector<TString>::iterator it =
v.begin(); it !=
v.end(); ++it) {
717 if ((*it ==
"v" || *it ==
"verbose") && !it->Contains(
"!")) isVerbose =
kTRUE;
728 vector< vector<Double_t> > vtemp;
730 UsefulSortDescending(vtemp);
739 vector<vector<Double_t> > vtemp;
741 UsefulSortAscending(vtemp);
750 if (
v.empty())
return -1;
753 for (
UInt_t i=0; i<
v.size(); i++){
767 if (
v.empty())
return -1;
770 for (
UInt_t i=0; i<
v.size(); i++){
830 static const TString gClr_none =
"" ;
831 static const TString gClr_white =
"\033[1;37m";
832 static const TString gClr_black =
"\033[30m";
833 static const TString gClr_blue =
"\033[34m";
834 static const TString gClr_red =
"\033[1;31m" ;
835 static const TString gClr_yellow =
"\033[1;33m";
836 static const TString gClr_darkred =
"\033[31m";
837 static const TString gClr_darkgreen =
"\033[32m";
838 static const TString gClr_darkyellow =
"\033[33m";
840 static const TString gClr_bold =
"\033[1m" ;
841 static const TString gClr_black_b =
"\033[30m" ;
842 static const TString gClr_lblue_b =
"\033[1;34m" ;
843 static const TString gClr_cyan_b =
"\033[0;36m" ;
844 static const TString gClr_lgreen_b =
"\033[1;32m";
846 static const TString gClr_blue_bg =
"\033[44m";
847 static const TString gClr_red_bg =
"\033[1;41m";
848 static const TString gClr_whiteonblue =
"\033[1;44m";
849 static const TString gClr_whiteongreen =
"\033[1;42m";
850 static const TString gClr_grey_bg =
"\033[47m";
852 static const TString gClr_reset =
"\033[0m";
854 if (!
gConfig().UseColor())
return gClr_none;
856 if (
c ==
"white" )
return gClr_white;
857 if (
c ==
"blue" )
return gClr_blue;
858 if (
c ==
"black" )
return gClr_black;
859 if (
c ==
"lightblue")
return gClr_cyan_b;
860 if (
c ==
"yellow")
return gClr_yellow;
861 if (
c ==
"red" )
return gClr_red;
862 if (
c ==
"dred" )
return gClr_darkred;
863 if (
c ==
"dgreen")
return gClr_darkgreen;
864 if (
c ==
"lgreenb")
return gClr_lgreen_b;
865 if (
c ==
"dyellow")
return gClr_darkyellow;
867 if (
c ==
"bold")
return gClr_bold;
868 if (
c ==
"bblack")
return gClr_black_b;
870 if (
c ==
"blue_bgd")
return gClr_blue_bg;
871 if (
c ==
"red_bgd" )
return gClr_red_bg;
873 if (
c ==
"white_on_blue" )
return gClr_whiteonblue;
874 if (
c ==
"white_on_green")
return gClr_whiteongreen;
876 if (
c ==
"reset")
return gClr_reset;
878 std::cout <<
"Unknown color " <<
c << std::endl;
893 if ((
UInt_t)values.size() != nvar) {
894 logger << kFATAL <<
"<FormattedOutput> fatal error with dimensions: "
895 << values.size() <<
" OR " <<
" != " << nvar <<
Endl;
900 std::vector<UInt_t> vLengths;
909 UInt_t clen = maxL + maxV + 3;
912 for (
UInt_t i=0; i<clen; i++) logger <<
"-";
916 logger << setw(maxL) << titleVars <<
":";
917 logger << setw(maxV+1) << titleValues <<
":";
919 for (
UInt_t i=0; i<clen; i++) logger <<
"-";
923 for (
UInt_t irow=0; irow<nvar; irow++) {
924 logger << setw(maxL) << V[irow] <<
":";
925 logger << setw(maxV+1) <<
Form( format.
Data(), values[irow] );
930 for (
UInt_t i=0; i<clen; i++) logger <<
"-";
942 logger << kFATAL <<
"<FormattedOutput> fatal error with dimensions: "
949 std::vector<UInt_t> vLengths;
950 for (
UInt_t ivar=0; ivar<nvar; ivar++) {
957 for (
UInt_t icol=0; icol<nvar; icol++) clen += vLengths[icol]+1;
960 for (
UInt_t i=0; i<clen; i++) logger <<
"-";
964 logger << setw(maxL+1) <<
" ";
965 for (
UInt_t icol=0; icol<nvar; icol++) logger << setw(vLengths[icol]+1) << V[icol];
969 for (
UInt_t irow=0; irow<nvar; irow++) {
970 logger << setw(maxL) << V[irow] <<
":";
971 for (
UInt_t icol=0; icol<nvar; icol++) {
972 logger << setw(vLengths[icol]+1) <<
Form(
"%+1.3f", M(irow,icol) );
978 for (
UInt_t i=0; i<clen; i++) logger <<
"-";
986 const std::vector<TString>& vert,
const std::vector<TString>& horiz,
990 UInt_t nvvar = vert.size();
991 UInt_t nhvar = horiz.size();
996 std::vector<UInt_t> vLengths;
997 for (
UInt_t ivar=0; ivar<nvvar; ivar++) {
1005 std::vector<UInt_t> hLengths;
1006 for (
UInt_t ivar=0; ivar<nhvar; ivar++) {
1008 maxLh =
TMath::Max( hLengths.back(), maxLh );
1012 for (
UInt_t icol=0; icol<nhvar; icol++) clen += hLengths[icol]+1;
1015 for (
UInt_t i=0; i<clen; i++) logger <<
"-";
1019 logger << setw(maxL+1) <<
" ";
1020 for (
UInt_t icol=0; icol<nhvar; icol++) logger << setw(hLengths[icol]+1) << horiz[icol];
1024 for (
UInt_t irow=0; irow<nvvar; irow++) {
1025 logger << setw(maxL) << vert[irow] <<
":";
1026 for (
UInt_t icol=0; icol<nhvar; icol++) {
1027 logger << setw(hLengths[icol]+1) <<
Form(
"%+1.3f", M(irow,icol) );
1033 for (
UInt_t i=0; i<clen; i++) logger <<
"-";
1042 return ( unit ==
"" ? title : ( title +
" [" + unit +
"]" ) );
1050 TString retval = ( normalised ?
"(1/N) " :
"" );
1051 retval +=
Form(
"dN_{ }/^{ }%.3g %s",
h.GetXaxis()->GetBinWidth(1), unit.
Data() );
1060 os << val <<
" :: ";
1062 for (
int i=0; i<4; i++) {
1063 Int_t ic = *((
char*)
c+i)-
'\0';
1081 for (
int i=0; i<4; i++) {
1083 *((
char*)ap+i) =
'\0'+
c[i];
1096 return xmlengine().HasAttr(node, attrname);
1104 if (!HasAttr(node, attrname)) {
1105 const char * nodename = xmlengine().GetNodeName(node);
1106 Log() << kFATAL <<
"Trying to read non-existing attribute '" << attrname <<
"' from xml node '" << nodename <<
"'" <<
Endl;
1108 const char* val = xmlengine().GetAttr(node, attrname);
1117 if( node == 0 )
return;
1126 if( !isRootNode && parent == 0 )
return 0;
1133 if( node == 0 )
return kFALSE;
1142 void* par = xmlengine().GetParent(child);
1152 void* ch = xmlengine().GetChild(parent);
1153 if (childname != 0) {
1154 while (ch!=0 && strcmp(xmlengine().GetNodeName(ch),childname) != 0) ch = xmlengine().GetNext(ch);
1164 void* ch = xmlengine().GetNext(prevchild);
1165 if (childname != 0) {
1166 while (ch!=0 && strcmp(xmlengine().GetNodeName(ch),childname)!=0) ch = xmlengine().GetNext(ch);
1176 return xmlengine().GetNodeContent(node);
1184 return xmlengine().GetNodeName(node);
1192 return xmlengine().AddRawLine( node, raw );
1201 std::vector<TString> splitV;
1205 while (splitOpt.
Length()>0) {
1206 if ( !splitOpt.
Contains(separator) ) {
1207 splitV.push_back(splitOpt);
1211 TString toSave = splitOpt(0,splitOpt.
First(separator));
1212 splitV.push_back(toSave);
1213 splitOpt = splitOpt(splitOpt.
First(separator),splitOpt.
Length());
1225 std::stringstream s;
1227 return TString(s.str().c_str());
1235 std::stringstream s;
1236 s <<
Form(
"%5.8e",
d );
1237 return TString(s.str().c_str());
1245 void* matnode = xmlengine().NewChild(node, 0,
name);
1246 xmlengine().NewAttr(matnode,0,
"Rows", StringFromInt(mat->
GetNrows()) );
1247 xmlengine().NewAttr(matnode,0,
"Columns", StringFromInt(mat->
GetNcols()) );
1248 std::stringstream s;
1251 s <<
Form(
"%5.15e ", (*mat)[row][col] );
1254 xmlengine().AddRawLine( matnode, s.str().c_str() );
1262 WriteTMatrixDToXML( node,
name, &mat );
1270 ReadTMatrixDFromXML( node,
name, &mat );
1271 for (
int i=0;i<
vec->GetNoElements();++i) (*
vec)[i] = mat[0][i];
1278 if (strcmp(xmlengine().GetNodeName(node),
name)!=0){
1279 Log() << kWARNING <<
"Possible Error: Name of matrix in weight file"
1280 <<
" does not match name of matrix passed as argument!" <<
Endl;
1283 ReadAttr( node,
"Rows", nrows );
1284 ReadAttr( node,
"Columns", ncols );
1286 Log() << kWARNING <<
"Possible Error: Dimension of matrix in weight file"
1287 <<
" does not match dimension of matrix passed as argument!" <<
Endl;
1290 const char* content = xmlengine().GetNodeContent(node);
1291 std::stringstream s(content);
1292 for (
Int_t row = 0; row<nrows; row++) {
1293 for (
Int_t col = 0; col<ncols; col++) {
1294 s >> (*mat)[row][col];
1304 std::cout << std::endl;
1305 std::cout << Color(
"bold") <<
"TMVA -- Toolkit for Multivariate Data Analysis" << Color(
"reset") << std::endl;
1307 std::cout <<
" " <<
"Copyright (C) 2005-2010 CERN, MPI-K Heidelberg, Us of Bonn and Victoria" << std::endl;
1308 std::cout <<
" " <<
"Home page: http://tmva.sf.net" << std::endl;
1309 std::cout <<
" " <<
"Citation info: http://tmva.sf.net/citeTMVA.html" << std::endl;
1310 std::cout <<
" " <<
"License: http://tmva.sf.net/LICENSE" << std::endl << std::endl;
1327 static const char *
const months[] = {
"Jan",
"Feb",
"Mar",
"Apr",
"May",
1328 "Jun",
"Jul",
"Aug",
"Sep",
"Oct",
1331 Int_t iday = idatqq%100;
1332 Int_t imonth = (idatqq/100)%100;
1333 Int_t iyear = (idatqq/10000);
1334 TString versionDate =
Form(
"%s %d, %4d",months[imonth-1],iday,iyear);
1337 logger <<
"You are running ROOT Version: " <<
gROOT->GetVersion() <<
", " << versionDate <<
Endl;
1348 case kStandardWelcomeMsg:
1349 logger << Color(
"white") <<
"TMVA -- Toolkit for Multivariate Analysis" << Color(
"reset") <<
Endl;
1350 logger <<
"Copyright (C) 2005-2006 CERN, LAPP & MPI-K Heidelberg and Victoria U." <<
Endl;
1351 logger <<
"Home page http://tmva.sourceforge.net" <<
Endl;
1352 logger <<
"All rights reserved, please read http://tmva.sf.net/license.txt" <<
Endl <<
Endl;
1355 case kIsometricWelcomeMsg:
1356 logger <<
" ___ ___ ___ ___ " <<
Endl;
1357 logger <<
" /\\ \\ /\\__\\ /\\__\\ /\\ \\ " <<
Endl;
1358 logger <<
" \\:\\ \\ /::| | /:/ / /::\\ \\ " <<
Endl;
1359 logger <<
" \\:\\ \\ /:|:| | /:/ / /:/\\:\\ \\ " <<
Endl;
1360 logger <<
" /::\\ \\ /:/|:|__|__ /:/__/ ___ /::\\~\\:\\ \\ " <<
Endl;
1361 logger <<
" /:/\\:\\__\\ /:/ |::::\\__\\ |:| | /\\__\\ /:/\\:\\ \\:\\__\\ " <<
Endl;
1362 logger <<
" /:/ \\/__/ \\/__/~~/:/ / |:| |/:/ / \\/__\\:\\/:/ / " <<
Endl;
1363 logger <<
"/:/ / /:/ / |:|__/:/ / \\::/ / " <<
Endl;
1364 logger <<
"\\/__/ /:/ / \\::::/__/ /:/ / " <<
Endl;
1365 logger <<
" /:/ / ~~~~ /:/ / " <<
Endl;
1366 logger <<
" \\/__/ \\/__/ " <<
Endl <<
Endl;
1369 case kBlockWelcomeMsg:
1371 logger <<
"_|_|_|_|_| _| _| _| _| _|_| " <<
Endl;
1372 logger <<
" _| _|_| _|_| _| _| _| _| " <<
Endl;
1373 logger <<
" _| _| _| _| _| _| _|_|_|_| " <<
Endl;
1374 logger <<
" _| _| _| _| _| _| _| " <<
Endl;
1375 logger <<
" _| _| _| _| _| _| " <<
Endl <<
Endl;
1378 case kLeanWelcomeMsg:
1380 logger <<
"_/_/_/_/_/ _/ _/ _/ _/ _/_/ " <<
Endl;
1381 logger <<
" _/ _/_/ _/_/ _/ _/ _/ _/ " <<
Endl;
1382 logger <<
" _/ _/ _/ _/ _/ _/ _/_/_/_/ " <<
Endl;
1383 logger <<
" _/ _/ _/ _/ _/ _/ _/ " <<
Endl;
1384 logger <<
"_/ _/ _/ _/ _/ _/ " <<
Endl <<
Endl;
1387 case kLogoWelcomeMsg:
1389 logger <<
"_/_/_/_/_/ _| _| _| _| _|_| " <<
Endl;
1390 logger <<
" _/ _|_| _|_| _| _| _| _| " <<
Endl;
1391 logger <<
" _/ _| _| _| _| _| _|_|_|_| " <<
Endl;
1392 logger <<
" _/ _| _| _| _| _| _| " <<
Endl;
1393 logger <<
"_/ _| _| _| _| _| " <<
Endl <<
Endl;
1396 case kSmall1WelcomeMsg:
1397 logger <<
" _____ __ ____ ___ " <<
Endl;
1398 logger <<
"|_ _| \\/ \\ \\ / /_\\ " <<
Endl;
1399 logger <<
" | | | |\\/| |\\ V / _ \\ " <<
Endl;
1400 logger <<
" |_| |_| |_| \\_/_/ \\_\\" <<
Endl <<
Endl;
1403 case kSmall2WelcomeMsg:
1404 logger <<
" _____ __ ____ ___ " <<
Endl;
1405 logger <<
"|_ _| \\/ \\ \\ / / \\ " <<
Endl;
1406 logger <<
" | | | |\\/| |\\ \\ / / _ \\ " <<
Endl;
1407 logger <<
" | | | | | | \\ V / ___ \\ " <<
Endl;
1408 logger <<
" |_| |_| |_| \\_/_/ \\_\\ " <<
Endl <<
Endl;
1411 case kOriginalWelcomeMsgColor:
1412 logger << kINFO <<
"" << Color(
"red")
1413 <<
"_______________________________________" << Color(
"reset") <<
Endl;
1414 logger << kINFO <<
"" << Color(
"blue")
1415 << Color(
"red_bgd") << Color(
"bwhite") <<
" // " << Color(
"reset")
1416 << Color(
"white") << Color(
"blue_bgd")
1417 <<
"|\\ /|| \\ // /\\\\\\\\\\\\\\\\\\\\\\\\ \\ \\ \\ " << Color(
"reset") <<
Endl;
1418 logger << kINFO <<
""<< Color(
"blue")
1419 << Color(
"red_bgd") << Color(
"white") <<
"// " << Color(
"reset")
1420 << Color(
"white") << Color(
"blue_bgd")
1421 <<
"| \\/ || \\// /--\\\\\\\\\\\\\\\\\\\\\\\\ \\ \\ \\" << Color(
"reset") <<
Endl;
1424 case kOriginalWelcomeMsgBW:
1425 logger << kINFO <<
""
1426 <<
"_______________________________________" <<
Endl;
1427 logger << kINFO <<
" // "
1428 <<
"|\\ /|| \\ // /\\\\\\\\\\\\\\\\\\\\\\\\ \\ \\ \\ " <<
Endl;
1429 logger << kINFO <<
"// "
1430 <<
"| \\/ || \\// /--\\\\\\\\\\\\\\\\\\\\\\\\ \\ \\ \\" <<
Endl;
1434 logger << kFATAL <<
"unknown message type: " << msgType <<
Endl;
1446 logger <<
"A. Hoecker, P. Speckmayer, J. Stelzer, J. Therhaag, E. von Toerne, H. Voss" <<
Endl;
1447 logger <<
"\"TMVA - Toolkit for Multivariate Data Analysis\" PoS ACAT:040,2007. e-Print: physics/0703039" <<
Endl;
1451 logger <<
"@Article{TMVA2007," <<
Endl;
1452 logger <<
" author = \"Hoecker, Andreas and Speckmayer, Peter and Stelzer, Joerg " <<
Endl;
1453 logger <<
" and Therhaag, Jan and von Toerne, Eckhard and Voss, Helge\"," <<
Endl;
1454 logger <<
" title = \"{TMVA: Toolkit for multivariate data analysis}\"," <<
Endl;
1455 logger <<
" journal = \"PoS\"," <<
Endl;
1456 logger <<
" volume = \"ACAT\"," <<
Endl;
1457 logger <<
" year = \"2007\"," <<
Endl;
1458 logger <<
" pages = \"040\"," <<
Endl;
1459 logger <<
" eprint = \"physics/0703039\"," <<
Endl;
1460 logger <<
" archivePrefix = \"arXiv\"," <<
Endl;
1461 logger <<
" SLACcitation = \"%%CITATION = PHYSICS/0703039;%%\"" <<
Endl;
1462 logger <<
"}" <<
Endl;
1466 logger <<
"%\\cite{TMVA2007}" <<
Endl;
1467 logger <<
"\\bibitem{TMVA2007}" <<
Endl;
1468 logger <<
" A.~Hoecker, P.~Speckmayer, J.~Stelzer, J.~Therhaag, E.~von Toerne, H.~Voss" <<
Endl;
1469 logger <<
" %``TMVA: Toolkit for multivariate data analysis,''" <<
Endl;
1470 logger <<
" PoS A {\\bf CAT} (2007) 040" <<
Endl;
1471 logger <<
" [arXiv:physics/0703039]." <<
Endl;
1472 logger <<
" %%CITATION = POSCI,ACAT,040;%%" <<
Endl;
1480 <<
"For citation information, please visit: http://tmva.sf.net/citeTMVA.html"
1489 return !(
h.GetXaxis()->GetXbins()->fN);
1494std::vector<TMatrixDSym*>*
1497 std::vector<Event*> eventVector;
1498 for (std::vector<const Event*>::const_iterator it = events.begin(), itEnd = events.end(); it != itEnd; ++it)
1500 eventVector.push_back (
new Event(*(*it)));
1502 std::vector<TMatrixDSym*>* returnValue = CalcCovarianceMatrices (eventVector, maxCls, transformBase);
1503 for (std::vector<Event*>::const_iterator it = eventVector.begin(), itEnd = eventVector.end(); it != itEnd; ++it)
1513std::vector<TMatrixDSym*>*
1516 if (events.empty()) {
1517 Log() << kWARNING <<
" Asked to calculate a covariance matrix for an empty event vectors.. sorry cannot do that -> return NULL"<<
Endl;
1521 UInt_t nvars=0, ntgts=0, nspcts=0;
1525 nvars =events.at(0)->GetNVariables ();
1526 ntgts =events.at(0)->GetNTargets ();
1527 nspcts=events.at(0)->GetNSpectators();
1532 Int_t matNum = maxCls;
1533 if (maxCls > 1 ) matNum++;
1535 std::vector<TVectorD*>*
vec =
new std::vector<TVectorD*>(matNum);
1536 std::vector<TMatrixD*>* mat2 =
new std::vector<TMatrixD*>(matNum);
1537 std::vector<Double_t> count(matNum);
1538 count.assign(matNum,0);
1544 for (cls = 0; cls < matNum ; cls++) {
1546 mat2->at(cls) =
new TMatrixD(nvars,nvars);
1550 for (ivar=0; ivar<nvars; ivar++) {
1552 for (jvar=0; jvar<nvars; jvar++) {
1553 (*m)(ivar, jvar) = 0;
1559 for (
UInt_t i=0; i<events.size(); i++) {
1562 const Event * ev = events[i];
1566 std::vector<Float_t> input;
1567 std::vector<Char_t> mask;
1569 if (transformBase) {
1570 transformBase->
GetInput (ev, input, mask);
1572 for (ivar=0; ivar<nvars; ++ivar) {
1573 input.push_back (ev->
GetValue(ivar));
1578 v =
vec->at(matNum-1);
1579 m = mat2->at(matNum-1);
1581 count.at(matNum-1)+=weight;
1582 for (ivar=0; ivar<nvars; ivar++) {
1585 (*v)(ivar) += xi*weight;
1586 (*m)(ivar, ivar) += (xi*xi*weight);
1588 for (jvar=ivar+1; jvar<nvars; jvar++) {
1590 (*m)(ivar, jvar) += (xi*xj*weight);
1591 (*m)(jvar, ivar) = (*
m)(ivar, jvar);
1596 count.at(cls)+=weight;
1599 for (ivar=0; ivar<nvars; ivar++) {
1601 (*v)(ivar) += xi*weight;
1602 (*m)(ivar, ivar) += (xi*xi*weight);
1604 for (jvar=ivar+1; jvar<nvars; jvar++) {
1606 (*m)(ivar, jvar) += (xi*xj*weight);
1607 (*m)(jvar, ivar) = (*
m)(ivar, jvar);
1613 std::vector<TMatrixDSym*>* mat =
new std::vector<TMatrixDSym*>(matNum);
1614 for (cls = 0; cls < matNum; cls++) {
1621 for (ivar=0; ivar<nvars; ivar++) {
1622 for (jvar=0; jvar<nvars; jvar++) {
1623 (*(mat->at(cls)))(ivar, jvar) = (*
m)(ivar, jvar)/
n - (*
v)(ivar)*(*
v)(jvar)/(
n*
n);
1641template <
typename Iterator,
typename WeightIterator>
1649 while (
first != last )
1661 ::Error(
"TMVA::Tools::Mean",
"sum of weights <= 0 ?! that's a bit too much of negative event weights :) ");
1667 while (
first != last )
1673 sum += (*w) * (*first);
1680 ::Error(
"TMVA::Tools::Mean",
"sum of weights <= 0 ?! that's a bit too much of negative event weights :) ");
1690template <
typename T>
1705template <
typename Iterator,
typename WeightIterator>
1716 while (
first != last ) {
1719 sum2 += adouble*adouble;
1726 while (
first != last ) {
1728 sum += adouble * (*w);
1729 sum2 += adouble*adouble * (*w);
1746template <
typename T>
1769 for (
Int_t ibinEnd=1, ibin=cumulativeDist->
GetNbinsX(); ibin >=ibinEnd ; ibin--){
1771 if (val>0) inverseSum += val;
1773 inverseSum = 1/inverseSum;
1775 for (
Int_t ibinEnd=1, ibin=cumulativeDist->
GetNbinsX(); ibin >=ibinEnd ; ibin--){
1777 if (val>0) partialSum += val;
1780 return cumulativeDist;
1786 const char *val = xmlengine().GetAttr(node, attrname);
1787 if (val ==
nullptr) {
1788 const char *nodename = xmlengine().GetNodeName(node);
1789 Log() << kFATAL <<
"Trying to read non-existing attribute '" << attrname <<
"' from xml node '" << nodename <<
"'"
1798 const char *val = xmlengine().GetAttr(node, attrname);
1799 if (val ==
nullptr) {
1800 const char *nodename = xmlengine().GetNodeName(node);
1801 Log() << kFATAL <<
"Trying to read non-existing attribute '" << attrname <<
"' from xml node '" << nodename <<
"'"
1810 const char *val = xmlengine().GetAttr(node, attrname);
1811 if (val ==
nullptr) {
1812 const char *nodename = xmlengine().GetNodeName(node);
1813 Log() << kFATAL <<
"Trying to read non-existing attribute '" << attrname <<
"' from xml node '" << nodename <<
"'"
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
TMatrixTSym< Double_t > TMatrixDSym
TMatrixT< Double_t > TMatrixD
char * Form(const char *fmt,...)
TVectorT< Double_t > TVectorD
#define TMVA_RELEASE_DATE
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
1-D histogram with a float per channel (see TH1 documentation)}
TH1 is the base class of all histogram classes in ROOT.
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
TObject * Clone(const char *newname=0) const
Make a complete copy of the underlying object.
virtual Int_t GetNbinsX() const
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual void Scale(Double_t c1=1, Option_t *option="")
Multiply this histogram by a constant c1.
virtual Int_t GetSumw2N() const
virtual Double_t GetSumOfWeights() const
Return the sum of weights excluding under/overflows.
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
2-D histogram with a float per channel (see TH1 documentation)}
Service class for 2-D histogram classes.
virtual void PutStats(Double_t *stats)
Replace current statistics with the values in array stats.
virtual Double_t Integral(Option_t *option="") const
Return integral of bin contents.
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content.
virtual void Add(TObject *obj)
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
Float_t GetValue(UInt_t ivar) const
return value of i'th variable
Double_t GetWeight() const
return the event weight - depending on whether the flag IgnoreNegWeightsInTraining is or not.
ostringstream derivative to redirect and format output
PDF wrapper for histograms; uses user-defined spline interpolation.
Double_t GetVal(Double_t x) const
returns value PDF(x)
const TMatrixD & GetEigenVectors() const
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.
TMatrixT< Element > & Transpose(const TMatrixT< Element > &source)
Transpose matrix source.
void Mult(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
General matrix multiplication. Create a matrix C such that C = A * B.
Collectable string class.
Base class for spline implementation containing the Draw/Paint methods.
virtual Double_t Eval(Double_t x) const =0
void ToLower()
Change string to lower-case.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
void ToUpper()
Change string to upper case.
TString & Remove(Ssiz_t pos)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
A TTree represents a columnar dataset.
virtual Long64_t Project(const char *hname, const char *varexp, const char *selection="", Option_t *option="", Long64_t nentries=kMaxEntries, Long64_t firstentry=0)
Make a projection of a tree using selections.
XMLNodePointer_t NewChild(XMLNodePointer_t parent, XMLNsPointer_t ns, const char *name, const char *content=nullptr)
create new child element for parent node
XMLAttrPointer_t NewAttr(XMLNodePointer_t xmlnode, XMLNsPointer_t, const char *name, const char *value)
creates new attribute for xmlnode, namespaces are not supported for attributes
Bool_t AddComment(XMLNodePointer_t parent, const char *comment)
Adds comment line to the node.
MsgLogger & Endl(MsgLogger &ml)
Short_t Max(Short_t a, Short_t b)
Double_t Mean(Long64_t n, const T *a, const Double_t *w=0)
Return the weighted mean of an array a with length n.
Double_t Sqrt(Double_t x)
Double_t RMS(Long64_t n, const T *a, const Double_t *w=0)
Return the Standard Deviation of an array a with length n.
static uint64_t sum(uint64_t i)