68#if __cplusplus > 199711L
76#if __cplusplus > 199711L
80 if(!
fgTools.compare_exchange_strong(expected,tmp)) {
93#if __cplusplus > 199711L
94 if (fgTools != 0) {
delete fgTools.load(); fgTools=0; }
96 if (fgTools != 0) {
delete fgTools; fgTools=0; }
104 fRegexp(
"$&|!%^&()'<>?= "),
140 if ((
S->GetNbinsX() !=
B->GetNbinsX()) || (
S->GetNbinsX() <= 0)) {
141 Log() << kFATAL <<
"<GetSeparation> signal and background"
142 <<
" histograms have different number of bins: "
143 <<
S->GetNbinsX() <<
" : " <<
B->GetNbinsX() <<
Endl;
146 if (
S->GetXaxis()->GetXmin() !=
B->GetXaxis()->GetXmin() ||
147 S->GetXaxis()->GetXmax() !=
B->GetXaxis()->GetXmax() ||
148 S->GetXaxis()->GetXmax() <=
S->GetXaxis()->GetXmin()) {
149 Log() << kINFO <<
S->GetXaxis()->GetXmin() <<
" " <<
B->GetXaxis()->GetXmin()
150 <<
" " <<
S->GetXaxis()->GetXmax() <<
" " <<
B->GetXaxis()->GetXmax()
151 <<
" " <<
S->GetXaxis()->GetXmax() <<
" " <<
S->GetXaxis()->GetXmin() <<
Endl;
152 Log() << kFATAL <<
"<GetSeparation> signal and background"
153 <<
" histograms have different or invalid dimensions:" <<
Endl;
156 Int_t nstep =
S->GetNbinsX();
157 Double_t intBin = (
S->GetXaxis()->GetXmax() -
S->GetXaxis()->GetXmin())/nstep;
158 Double_t nS =
S->GetSumOfWeights()*intBin;
159 Double_t nB =
B->GetSumOfWeights()*intBin;
161 if (nS > 0 && nB > 0) {
162 for (
Int_t bin=0; bin<nstep; bin++) {
166 if (
s +
b > 0) separation += (
s -
b)*(
s -
b)/(
s +
b);
168 separation *= (0.5*intBin);
171 Log() << kWARNING <<
"<GetSeparation> histograms with zero entries: "
172 << nS <<
" : " << nB <<
" cannot compute separation"
192 Log() << kFATAL <<
"<GetSeparation> Mismatch in PDF limits: "
199 for (
Int_t bin=0; bin<nstep; bin++) {
204 if (
s +
b > 0) separation += (
s -
b)*(
s -
b)/(
s +
b);
206 separation *= (0.5*intBin);
221 Log() << kFATAL <<
"<Tools::ComputeStat> value vector is zero pointer" <<
Endl;
223 if ( events.size() != valVec->size() )
224 Log() << kWARNING <<
"<Tools::ComputeStat> event and value vector have different lengths "
225 << events.size() <<
"!=" << valVec->size() <<
Endl;
241 xmin_ = *std::min( valVec->begin(), valVec->end() );
242 xmax_ = *std::max( valVec->begin(), valVec->end() );
245 for (
Int_t ievt=0; ievt<entries; ievt++) {
250 wgtVecS[nEventsS] = events[ievt]->GetWeight();
251 varVecS[nEventsS++] = theVar;
254 wgtVecB[nEventsB] = events[ievt]->GetWeight();
255 varVecB[nEventsB++] = theVar;
297 d->Mult( (*si), (*symMat) ); (*d) *= (*s);
302 for (i=0; i<
n; i++) {
303 for (j=0; j<
n; j++) {
305 (i == j && (*
d)(i,i) < 0)) {
307 Log() << kWARNING <<
"<GetSQRootMatrix> error in matrix diagonalization; printed S and B" <<
Endl;
313 for (i=0; i<
n; i++)
for (j=0; j<
n; j++)
if (j != i) (*d)(i,j) = 0;
319 sqrtMat->
Mult( (*
s), (*
d) );
339 if (covMat == 0)
return 0;
343 Log() << kFATAL <<
"<GetCorrelationMatrix> input matrix not quadratic" <<
Endl;
347 for (
Int_t ivar=0; ivar<nvar; ivar++) {
348 for (
Int_t jvar=0; jvar<nvar; jvar++) {
350 Double_t d = (*covMat)(ivar, ivar)*(*covMat)(jvar, jvar);
352 (*corrMat)(ivar, jvar) = (*covMat)(ivar, jvar)/
TMath::Sqrt(
d);
354 Log() <<
"<GetCorrelationMatrix> zero variances for variables "
355 <<
"(" << ivar <<
", " << jvar <<
")" <<
Endl;
356 (*corrMat)(ivar, jvar) = 0;
360 <<
" Element corr("<<ivar<<
","<<ivar<<
")=" << (*corrMat)(ivar,jvar)
362 <<
" cov("<<ivar<<
","<<ivar<<
")=" <<(*covMat)(ivar, ivar)
363 <<
" cov("<<jvar<<
","<<jvar<<
")=" <<(*covMat)(jvar, jvar)
368 else (*corrMat)(ivar, ivar) = 1.0;
397 if (!theHist)
return 0;
403 if (w > 0) theHist->
Scale( norm/w );
419 while (formatString.
Length()>0) {
420 if (formatString.
First(
sep) == -1) {
428 formatString.
Remove(0,posSep+1);
456 vector<Int_t>* nodes )
463 Log() << kFATAL <<
"<ParseANNOptionString> unrecognized option string: " << theOptions <<
Endl;
467 nodes->push_back( atoi( ((
TObjString*)list->
At(0))->GetString() ) );
475 if (
s.Length() > 1) nodes->push_back( nvar + atoi(&
s[1]) );
476 else nodes->push_back( nvar );
478 else if ((
a = atoi(
s )) > 0) nodes->push_back( atoi(
s ) );
480 Log() << kFATAL <<
"<ParseANNOptionString> unrecognized option string: " << theOptions <<
Endl;
502 Double_t dev = 0.5*(ys - yh)/(ys + yh);
504 Log() << kFATAL <<
"<CheckSplines> Spline failed sanity criterion; "
505 <<
" relative deviation from histogram: " << dev
506 <<
" in (bin, value): (" << ibin <<
", " <<
x <<
")" <<
Endl;
520 if (
a.size() !=
b.size()) {
523 vector<Double_t> result(
a.size());
524 for (
UInt_t i=0; i<
a.size();i++) result[i]=
a[i]-
b[i];
533 for (
UInt_t i=0; i<
v.size();i++)
v[i]*=
f;
541 for (
UInt_t i=0; i<
v.size();i++)
v[i]*=
f;
554 UInt_t sizeofarray=
v[0].size();
555 for (
UInt_t i=0; i<sizeofarray; i++) {
556 for (
UInt_t j=sizeofarray-1; j>i; j--) {
557 if (
v[0][j-1] >
v[0][j]) {
558 for (
UInt_t k=0; k< nArrays; k++) {
559 temp =
v[k][j-1];
v[k][j-1] =
v[k][j];
v[k][j] = temp;
562 TString temps = (*vs)[j-1]; (*vs)[j-1] = (*vs)[j]; (*vs)[j] = temps;
581 UInt_t sizeofarray=
v[0].size();
582 for (
UInt_t i=0; i<sizeofarray; i++) {
583 for (
UInt_t j=sizeofarray-1; j>i; j--) {
584 if (
v[0][j-1] <
v[0][j]) {
585 for (
UInt_t k=0; k< nArrays; k++) {
586 temp =
v[k][j-1];
v[k][j-1] =
v[k][j];
v[k][j] = temp;
589 TString temps = (*vs)[j-1]; (*vs)[j-1] = (*vs)[j]; (*vs)[j] = temps;
604 if (
hi == 0)
return -1;
612 Int_t maxBinX =
h.GetNbinsX();
613 Int_t maxBinY =
h.GetNbinsY();
614 for (
Int_t x = 1;
x <= maxBinX;
x++) {
615 for (
Int_t y = 1;
y <= maxBinY;
y++) {
619 if (p_x > 0. && p_y > 0. && p_xy > 0.){
620 mutualInfo += p_xy*
TMath::Log(p_xy / (p_x * p_y));
635 if (
hi == 0.)
return -1;
643 Double_t y_mean =
h.ProjectionY()->GetMean();
644 for (
Int_t ix=1; ix<=
h.GetNbinsX(); ix++) {
645 corrRatio += (
h.Integral(ix,ix,1,
h.GetNbinsY())/
hi)*
pow((GetYMean_binX(
h,ix)-y_mean),2);
647 corrRatio /=
pow(
h.ProjectionY()->GetRMS(),2);
656 if (
h.Integral(bin_x,bin_x,1,
h.GetNbinsY()) == 0.) {
return 0;}
658 TH1* py =
h.ProjectionY();
659 for (
Int_t y = 1;
y <=
h.GetNbinsY();
y++){
662 y_bin_mean /=
h.Integral(bin_x,bin_x,1,
h.GetNbinsY());
672 if (
h.GetNbinsX() !=
h.GetNbinsY()) {
673 Log() << kFATAL <<
"<TransposeHist> cannot transpose non-quadratic histogram" <<
Endl;
677 for (
Int_t ix=1; ix <=
h.GetNbinsX(); ix++){
678 for (
Int_t iy=1; iy <=
h.GetNbinsY(); iy++){
687 h.GetStats(stats_old);
688 stats_new[0] = stats_old[0];
689 stats_new[1] = stats_old[1];
690 stats_new[2] = stats_old[4];
691 stats_new[3] = stats_old[5];
692 stats_new[4] = stats_old[2];
693 stats_new[5] = stats_old[3];
694 stats_new[6] = stats_old[6];
695 transposedHisto->
PutStats(stats_new);
697 return transposedHisto;
709 s.ReplaceAll(
" ",
"");
710 if (
s.Contains(
"silent") && !
s.Contains(
"silent=f")) {
711 if (!
s.Contains(
"!silent") ||
s.Contains(
"silent=t")) isSilent =
kTRUE;
726 s.ReplaceAll(
" ",
"");
727 std::vector<TString>
v = SplitString(
s,
':' );
728 for (std::vector<TString>::iterator it =
v.begin(); it !=
v.end(); ++it) {
729 if ((*it ==
"v" || *it ==
"verbose") && !it->Contains(
"!")) isVerbose =
kTRUE;
740 vector< vector<Double_t> > vtemp;
742 UsefulSortDescending(vtemp);
751 vector<vector<Double_t> > vtemp;
753 UsefulSortAscending(vtemp);
762 if (
v.empty())
return -1;
765 for (
UInt_t i=0; i<
v.size(); i++){
779 if (
v.empty())
return -1;
782 for (
UInt_t i=0; i<
v.size(); i++){
842 static const TString gClr_none =
"" ;
843 static const TString gClr_white =
"\033[1;37m";
844 static const TString gClr_black =
"\033[30m";
845 static const TString gClr_blue =
"\033[34m";
846 static const TString gClr_red =
"\033[1;31m" ;
847 static const TString gClr_yellow =
"\033[1;33m";
848 static const TString gClr_darkred =
"\033[31m";
849 static const TString gClr_darkgreen =
"\033[32m";
850 static const TString gClr_darkyellow =
"\033[33m";
852 static const TString gClr_bold =
"\033[1m" ;
853 static const TString gClr_black_b =
"\033[30m" ;
854 static const TString gClr_lblue_b =
"\033[1;34m" ;
855 static const TString gClr_cyan_b =
"\033[0;36m" ;
856 static const TString gClr_lgreen_b =
"\033[1;32m";
858 static const TString gClr_blue_bg =
"\033[44m";
859 static const TString gClr_red_bg =
"\033[1;41m";
860 static const TString gClr_whiteonblue =
"\033[1;44m";
861 static const TString gClr_whiteongreen =
"\033[1;42m";
862 static const TString gClr_grey_bg =
"\033[47m";
864 static const TString gClr_reset =
"\033[0m";
866 if (!
gConfig().UseColor())
return gClr_none;
868 if (
c ==
"white" )
return gClr_white;
869 if (
c ==
"blue" )
return gClr_blue;
870 if (
c ==
"black" )
return gClr_black;
871 if (
c ==
"lightblue")
return gClr_cyan_b;
872 if (
c ==
"yellow")
return gClr_yellow;
873 if (
c ==
"red" )
return gClr_red;
874 if (
c ==
"dred" )
return gClr_darkred;
875 if (
c ==
"dgreen")
return gClr_darkgreen;
876 if (
c ==
"lgreenb")
return gClr_lgreen_b;
877 if (
c ==
"dyellow")
return gClr_darkyellow;
879 if (
c ==
"bold")
return gClr_bold;
880 if (
c ==
"bblack")
return gClr_black_b;
882 if (
c ==
"blue_bgd")
return gClr_blue_bg;
883 if (
c ==
"red_bgd" )
return gClr_red_bg;
885 if (
c ==
"white_on_blue" )
return gClr_whiteonblue;
886 if (
c ==
"white_on_green")
return gClr_whiteongreen;
888 if (
c ==
"reset")
return gClr_reset;
890 std::cout <<
"Unknown color " <<
c << std::endl;
905 if ((
UInt_t)values.size() != nvar) {
906 logger << kFATAL <<
"<FormattedOutput> fatal error with dimensions: "
907 << values.size() <<
" OR " <<
" != " << nvar <<
Endl;
912 std::vector<UInt_t> vLengths;
921 UInt_t clen = maxL + maxV + 3;
924 for (
UInt_t i=0; i<clen; i++) logger <<
"-";
928 logger << setw(maxL) << titleVars <<
":";
929 logger << setw(maxV+1) << titleValues <<
":";
931 for (
UInt_t i=0; i<clen; i++) logger <<
"-";
935 for (
UInt_t irow=0; irow<nvar; irow++) {
936 logger << setw(maxL) << V[irow] <<
":";
937 logger << setw(maxV+1) <<
Form( format.
Data(), values[irow] );
942 for (
UInt_t i=0; i<clen; i++) logger <<
"-";
954 logger << kFATAL <<
"<FormattedOutput> fatal error with dimensions: "
961 std::vector<UInt_t> vLengths;
962 for (
UInt_t ivar=0; ivar<nvar; ivar++) {
969 for (
UInt_t icol=0; icol<nvar; icol++) clen += vLengths[icol]+1;
972 for (
UInt_t i=0; i<clen; i++) logger <<
"-";
976 logger << setw(maxL+1) <<
" ";
977 for (
UInt_t icol=0; icol<nvar; icol++) logger << setw(vLengths[icol]+1) << V[icol];
981 for (
UInt_t irow=0; irow<nvar; irow++) {
982 logger << setw(maxL) << V[irow] <<
":";
983 for (
UInt_t icol=0; icol<nvar; icol++) {
984 logger << setw(vLengths[icol]+1) <<
Form(
"%+1.3f", M(irow,icol) );
990 for (
UInt_t i=0; i<clen; i++) logger <<
"-";
998 const std::vector<TString>& vert,
const std::vector<TString>& horiz,
1002 UInt_t nvvar = vert.size();
1003 UInt_t nhvar = horiz.size();
1008 std::vector<UInt_t> vLengths;
1009 for (
UInt_t ivar=0; ivar<nvvar; ivar++) {
1017 std::vector<UInt_t> hLengths;
1018 for (
UInt_t ivar=0; ivar<nhvar; ivar++) {
1020 maxLh =
TMath::Max( hLengths.back(), maxLh );
1024 for (
UInt_t icol=0; icol<nhvar; icol++) clen += hLengths[icol]+1;
1027 for (
UInt_t i=0; i<clen; i++) logger <<
"-";
1031 logger << setw(maxL+1) <<
" ";
1032 for (
UInt_t icol=0; icol<nhvar; icol++) logger << setw(hLengths[icol]+1) << horiz[icol];
1036 for (
UInt_t irow=0; irow<nvvar; irow++) {
1037 logger << setw(maxL) << vert[irow] <<
":";
1038 for (
UInt_t icol=0; icol<nhvar; icol++) {
1039 logger << setw(hLengths[icol]+1) <<
Form(
"%+1.3f", M(irow,icol) );
1045 for (
UInt_t i=0; i<clen; i++) logger <<
"-";
1054 return ( unit ==
"" ? title : ( title +
" [" + unit +
"]" ) );
1062 TString retval = ( normalised ?
"(1/N) " :
"" );
1063 retval +=
Form(
"dN_{ }/^{ }%.3g %s",
h.GetXaxis()->GetBinWidth(1), unit.
Data() );
1072 os << val <<
" :: ";
1074 for (
int i=0; i<4; i++) {
1075 Int_t ic = *((
char*)
c+i)-
'\0';
1093 for (
int i=0; i<4; i++) {
1095 *((
char*)ap+i) =
'\0'+
c[i];
1108 return xmlengine().HasAttr(node, attrname);
1116 if (!HasAttr(node, attrname)) {
1117 const char * nodename = xmlengine().GetNodeName(node);
1118 Log() << kFATAL <<
"Trying to read non-existing attribute '" << attrname <<
"' from xml node '" << nodename <<
"'" <<
Endl;
1120 const char* val = xmlengine().GetAttr(node, attrname);
1129 if( node == 0 )
return;
1138 if( !isRootNode && parent == 0 )
return 0;
1145 if( node == 0 )
return kFALSE;
1154 void* par = xmlengine().GetParent(child);
1164 void* ch = xmlengine().GetChild(parent);
1165 if (childname != 0) {
1166 while (ch!=0 && strcmp(xmlengine().GetNodeName(ch),childname) != 0) ch = xmlengine().GetNext(ch);
1176 void* ch = xmlengine().GetNext(prevchild);
1177 if (childname != 0) {
1178 while (ch!=0 && strcmp(xmlengine().GetNodeName(ch),childname)!=0) ch = xmlengine().GetNext(ch);
1188 return xmlengine().GetNodeContent(node);
1196 return xmlengine().GetNodeName(node);
1204 return xmlengine().AddRawLine( node, raw );
1213 std::vector<TString> splitV;
1217 while (splitOpt.
Length()>0) {
1218 if ( !splitOpt.
Contains(separator) ) {
1219 splitV.push_back(splitOpt);
1223 TString toSave = splitOpt(0,splitOpt.
First(separator));
1224 splitV.push_back(toSave);
1225 splitOpt = splitOpt(splitOpt.
First(separator),splitOpt.
Length());
1237 std::stringstream
s;
1247 std::stringstream
s;
1257 void* matnode = xmlengine().NewChild(node, 0,
name);
1258 xmlengine().NewAttr(matnode,0,
"Rows", StringFromInt(mat->
GetNrows()) );
1259 xmlengine().NewAttr(matnode,0,
"Columns", StringFromInt(mat->
GetNcols()) );
1260 std::stringstream
s;
1263 s <<
Form(
"%5.15e ", (*mat)[row][col] );
1266 xmlengine().AddRawLine( matnode,
s.str().c_str() );
1274 WriteTMatrixDToXML( node,
name, &mat );
1282 ReadTMatrixDFromXML( node,
name, &mat );
1283 for (
int i=0;i<vec->
GetNoElements();++i) (*vec)[i] = mat[0][i];
1290 if (strcmp(xmlengine().GetNodeName(node),
name)!=0){
1291 Log() << kWARNING <<
"Possible Error: Name of matrix in weight file"
1292 <<
" does not match name of matrix passed as argument!" <<
Endl;
1295 ReadAttr( node,
"Rows", nrows );
1296 ReadAttr( node,
"Columns", ncols );
1298 Log() << kWARNING <<
"Possible Error: Dimension of matrix in weight file"
1299 <<
" does not match dimension of matrix passed as argument!" <<
Endl;
1302 const char* content = xmlengine().GetNodeContent(node);
1303 std::stringstream
s(content);
1304 for (
Int_t row = 0; row<nrows; row++) {
1305 for (
Int_t col = 0; col<ncols; col++) {
1306 s >> (*mat)[row][col];
1316 std::cout << std::endl;
1317 std::cout <<
Color(
"bold") <<
"TMVA -- Toolkit for Multivariate Data Analysis" <<
Color(
"reset") << std::endl;
1319 std::cout <<
" " <<
"Copyright (C) 2005-2010 CERN, MPI-K Heidelberg, Us of Bonn and Victoria" << std::endl;
1320 std::cout <<
" " <<
"Home page: http://tmva.sf.net" << std::endl;
1321 std::cout <<
" " <<
"Citation info: http://tmva.sf.net/citeTMVA.html" << std::endl;
1322 std::cout <<
" " <<
"License: http://tmva.sf.net/LICENSE" << std::endl << std::endl;
1339 static const char *
const months[] = {
"Jan",
"Feb",
"Mar",
"Apr",
"May",
1340 "Jun",
"Jul",
"Aug",
"Sep",
"Oct",
1343 Int_t iday = idatqq%100;
1344 Int_t imonth = (idatqq/100)%100;
1345 Int_t iyear = (idatqq/10000);
1346 TString versionDate =
Form(
"%s %d, %4d",months[imonth-1],iday,iyear);
1349 logger <<
"You are running ROOT Version: " <<
gROOT->GetVersion() <<
", " << versionDate <<
Endl;
1360 case kStandardWelcomeMsg:
1361 logger <<
Color(
"white") <<
"TMVA -- Toolkit for Multivariate Analysis" <<
Color(
"reset") <<
Endl;
1362 logger <<
"Copyright (C) 2005-2006 CERN, LAPP & MPI-K Heidelberg and Victoria U." <<
Endl;
1363 logger <<
"Home page http://tmva.sourceforge.net" <<
Endl;
1364 logger <<
"All rights reserved, please read http://tmva.sf.net/license.txt" <<
Endl <<
Endl;
1367 case kIsometricWelcomeMsg:
1368 logger <<
" ___ ___ ___ ___ " <<
Endl;
1369 logger <<
" /\\ \\ /\\__\\ /\\__\\ /\\ \\ " <<
Endl;
1370 logger <<
" \\:\\ \\ /::| | /:/ / /::\\ \\ " <<
Endl;
1371 logger <<
" \\:\\ \\ /:|:| | /:/ / /:/\\:\\ \\ " <<
Endl;
1372 logger <<
" /::\\ \\ /:/|:|__|__ /:/__/ ___ /::\\~\\:\\ \\ " <<
Endl;
1373 logger <<
" /:/\\:\\__\\ /:/ |::::\\__\\ |:| | /\\__\\ /:/\\:\\ \\:\\__\\ " <<
Endl;
1374 logger <<
" /:/ \\/__/ \\/__/~~/:/ / |:| |/:/ / \\/__\\:\\/:/ / " <<
Endl;
1375 logger <<
"/:/ / /:/ / |:|__/:/ / \\::/ / " <<
Endl;
1376 logger <<
"\\/__/ /:/ / \\::::/__/ /:/ / " <<
Endl;
1377 logger <<
" /:/ / ~~~~ /:/ / " <<
Endl;
1378 logger <<
" \\/__/ \\/__/ " <<
Endl <<
Endl;
1381 case kBlockWelcomeMsg:
1383 logger <<
"_|_|_|_|_| _| _| _| _| _|_| " <<
Endl;
1384 logger <<
" _| _|_| _|_| _| _| _| _| " <<
Endl;
1385 logger <<
" _| _| _| _| _| _| _|_|_|_| " <<
Endl;
1386 logger <<
" _| _| _| _| _| _| _| " <<
Endl;
1387 logger <<
" _| _| _| _| _| _| " <<
Endl <<
Endl;
1390 case kLeanWelcomeMsg:
1392 logger <<
"_/_/_/_/_/ _/ _/ _/ _/ _/_/ " <<
Endl;
1393 logger <<
" _/ _/_/ _/_/ _/ _/ _/ _/ " <<
Endl;
1394 logger <<
" _/ _/ _/ _/ _/ _/ _/_/_/_/ " <<
Endl;
1395 logger <<
" _/ _/ _/ _/ _/ _/ _/ " <<
Endl;
1396 logger <<
"_/ _/ _/ _/ _/ _/ " <<
Endl <<
Endl;
1399 case kLogoWelcomeMsg:
1401 logger <<
"_/_/_/_/_/ _| _| _| _| _|_| " <<
Endl;
1402 logger <<
" _/ _|_| _|_| _| _| _| _| " <<
Endl;
1403 logger <<
" _/ _| _| _| _| _| _|_|_|_| " <<
Endl;
1404 logger <<
" _/ _| _| _| _| _| _| " <<
Endl;
1405 logger <<
"_/ _| _| _| _| _| " <<
Endl <<
Endl;
1408 case kSmall1WelcomeMsg:
1409 logger <<
" _____ __ ____ ___ " <<
Endl;
1410 logger <<
"|_ _| \\/ \\ \\ / /_\\ " <<
Endl;
1411 logger <<
" | | | |\\/| |\\ V / _ \\ " <<
Endl;
1412 logger <<
" |_| |_| |_| \\_/_/ \\_\\" <<
Endl <<
Endl;
1415 case kSmall2WelcomeMsg:
1416 logger <<
" _____ __ ____ ___ " <<
Endl;
1417 logger <<
"|_ _| \\/ \\ \\ / / \\ " <<
Endl;
1418 logger <<
" | | | |\\/| |\\ \\ / / _ \\ " <<
Endl;
1419 logger <<
" | | | | | | \\ V / ___ \\ " <<
Endl;
1420 logger <<
" |_| |_| |_| \\_/_/ \\_\\ " <<
Endl <<
Endl;
1423 case kOriginalWelcomeMsgColor:
1424 logger << kINFO <<
"" <<
Color(
"red")
1425 <<
"_______________________________________" <<
Color(
"reset") <<
Endl;
1426 logger << kINFO <<
"" <<
Color(
"blue")
1429 <<
"|\\ /|| \\ // /\\\\\\\\\\\\\\\\\\\\\\\\ \\ \\ \\ " <<
Color(
"reset") <<
Endl;
1430 logger << kINFO <<
""<<
Color(
"blue")
1433 <<
"| \\/ || \\// /--\\\\\\\\\\\\\\\\\\\\\\\\ \\ \\ \\" <<
Color(
"reset") <<
Endl;
1436 case kOriginalWelcomeMsgBW:
1437 logger << kINFO <<
""
1438 <<
"_______________________________________" <<
Endl;
1439 logger << kINFO <<
" // "
1440 <<
"|\\ /|| \\ // /\\\\\\\\\\\\\\\\\\\\\\\\ \\ \\ \\ " <<
Endl;
1441 logger << kINFO <<
"// "
1442 <<
"| \\/ || \\// /--\\\\\\\\\\\\\\\\\\\\\\\\ \\ \\ \\" <<
Endl;
1446 logger << kFATAL <<
"unknown message type: " << msgType <<
Endl;
1458 logger <<
"A. Hoecker, P. Speckmayer, J. Stelzer, J. Therhaag, E. von Toerne, H. Voss" <<
Endl;
1459 logger <<
"\"TMVA - Toolkit for Multivariate Data Analysis\" PoS ACAT:040,2007. e-Print: physics/0703039" <<
Endl;
1463 logger <<
"@Article{TMVA2007," <<
Endl;
1464 logger <<
" author = \"Hoecker, Andreas and Speckmayer, Peter and Stelzer, Joerg " <<
Endl;
1465 logger <<
" and Therhaag, Jan and von Toerne, Eckhard and Voss, Helge\"," <<
Endl;
1466 logger <<
" title = \"{TMVA: Toolkit for multivariate data analysis}\"," <<
Endl;
1467 logger <<
" journal = \"PoS\"," <<
Endl;
1468 logger <<
" volume = \"ACAT\"," <<
Endl;
1469 logger <<
" year = \"2007\"," <<
Endl;
1470 logger <<
" pages = \"040\"," <<
Endl;
1471 logger <<
" eprint = \"physics/0703039\"," <<
Endl;
1472 logger <<
" archivePrefix = \"arXiv\"," <<
Endl;
1473 logger <<
" SLACcitation = \"%%CITATION = PHYSICS/0703039;%%\"" <<
Endl;
1474 logger <<
"}" <<
Endl;
1478 logger <<
"%\\cite{TMVA2007}" <<
Endl;
1479 logger <<
"\\bibitem{TMVA2007}" <<
Endl;
1480 logger <<
" A.~Hoecker, P.~Speckmayer, J.~Stelzer, J.~Therhaag, E.~von Toerne, H.~Voss" <<
Endl;
1481 logger <<
" %``TMVA: Toolkit for multivariate data analysis,''" <<
Endl;
1482 logger <<
" PoS A {\\bf CAT} (2007) 040" <<
Endl;
1483 logger <<
" [arXiv:physics/0703039]." <<
Endl;
1484 logger <<
" %%CITATION = POSCI,ACAT,040;%%" <<
Endl;
1492 <<
"For citation information, please visit: http://tmva.sf.net/citeTMVA.html"
1501 return !(
h.GetXaxis()->GetXbins()->fN);
1506std::vector<TMatrixDSym*>*
1509 std::vector<Event*> eventVector;
1510 for (std::vector<const Event*>::const_iterator it = events.begin(), itEnd = events.end(); it != itEnd; ++it)
1512 eventVector.push_back (
new Event(*(*it)));
1514 std::vector<TMatrixDSym*>* returnValue = CalcCovarianceMatrices (eventVector, maxCls, transformBase);
1515 for (std::vector<Event*>::const_iterator it = eventVector.begin(), itEnd = eventVector.end(); it != itEnd; ++it)
1525std::vector<TMatrixDSym*>*
1528 if (events.empty()) {
1529 Log() << kWARNING <<
" Asked to calculate a covariance matrix for an empty event vectors.. sorry cannot do that -> return NULL"<<
Endl;
1533 UInt_t nvars=0, ntgts=0, nspcts=0;
1537 nvars =events.at(0)->GetNVariables ();
1538 ntgts =events.at(0)->GetNTargets ();
1539 nspcts=events.at(0)->GetNSpectators();
1544 Int_t matNum = maxCls;
1545 if (maxCls > 1 ) matNum++;
1547 std::vector<TVectorD*>* vec =
new std::vector<TVectorD*>(matNum);
1548 std::vector<TMatrixD*>* mat2 =
new std::vector<TMatrixD*>(matNum);
1549 std::vector<Double_t> count(matNum);
1550 count.assign(matNum,0);
1556 for (cls = 0; cls < matNum ; cls++) {
1557 vec->at(cls) =
new TVectorD(nvars);
1558 mat2->at(cls) =
new TMatrixD(nvars,nvars);
1562 for (ivar=0; ivar<nvars; ivar++) {
1564 for (jvar=0; jvar<nvars; jvar++) {
1565 (*m)(ivar, jvar) = 0;
1571 for (
UInt_t i=0; i<events.size(); i++) {
1574 const Event * ev = events[i];
1578 std::vector<Float_t> input;
1579 std::vector<Char_t> mask;
1581 if (transformBase) {
1582 transformBase->
GetInput (ev, input, mask);
1584 for (ivar=0; ivar<nvars; ++ivar) {
1585 input.push_back (ev->
GetValue(ivar));
1590 v = vec->at(matNum-1);
1591 m = mat2->at(matNum-1);
1593 count.at(matNum-1)+=weight;
1594 for (ivar=0; ivar<nvars; ivar++) {
1597 (*v)(ivar) += xi*weight;
1598 (*m)(ivar, ivar) += (xi*xi*weight);
1600 for (jvar=ivar+1; jvar<nvars; jvar++) {
1602 (*m)(ivar, jvar) += (xi*xj*weight);
1603 (*m)(jvar, ivar) = (*
m)(ivar, jvar);
1608 count.at(cls)+=weight;
1611 for (ivar=0; ivar<nvars; ivar++) {
1613 (*v)(ivar) += xi*weight;
1614 (*m)(ivar, ivar) += (xi*xi*weight);
1616 for (jvar=ivar+1; jvar<nvars; jvar++) {
1618 (*m)(ivar, jvar) += (xi*xj*weight);
1619 (*m)(jvar, ivar) = (*
m)(ivar, jvar);
1625 std::vector<TMatrixDSym*>* mat =
new std::vector<TMatrixDSym*>(matNum);
1626 for (cls = 0; cls < matNum; cls++) {
1633 for (ivar=0; ivar<nvars; ivar++) {
1634 for (jvar=0; jvar<nvars; jvar++) {
1635 (*(mat->at(cls)))(ivar, jvar) = (*
m)(ivar, jvar)/
n - (*
v)(ivar)*(*
v)(jvar)/(
n*
n);
1653template <
typename Iterator,
typename WeightIterator>
1661 while (
first != last )
1673 ::Error(
"TMVA::Tools::Mean",
"sum of weights <= 0 ?! that's a bit too much of negative event weights :) ");
1679 while (
first != last )
1685 sum += (*w) * (*first);
1692 ::Error(
"TMVA::Tools::Mean",
"sum of weights <= 0 ?! that's a bit too much of negative event weights :) ");
1702template <
typename T>
1717template <
typename Iterator,
typename WeightIterator>
1728 while (
first != last ) {
1731 sum2 += adouble*adouble;
1738 while (
first != last ) {
1740 sum += adouble * (*w);
1741 sum2 += adouble*adouble * (*w);
1758template <
typename T>
1774 TH1* cumulativeDist= (
TH1*)
h->Clone(
Form(
"%sCumul",
h->GetTitle()));
1781 for (
Int_t ibinEnd=1, ibin=cumulativeDist->
GetNbinsX(); ibin >=ibinEnd ; ibin--){
1783 if (val>0) inverseSum += val;
1785 inverseSum = 1/inverseSum;
1787 for (
Int_t ibinEnd=1, ibin=cumulativeDist->
GetNbinsX(); ibin >=ibinEnd ; ibin--){
1789 if (val>0) partialSum += val;
1792 return cumulativeDist;
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 <<
"'"
1822 const char *val = xmlengine().GetAttr(node, attrname);
1823 if (val ==
nullptr) {
1824 const char *nodename = xmlengine().GetNodeName(node);
1825 Log() << kFATAL <<
"Trying to read non-existing attribute '" << attrname <<
"' from xml node '" << nodename <<
"'"
void Error(const char *location, const char *msgfmt,...)
float type_of_call hi(const int &, const int &)
double pow(double, double)
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)}
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...
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-Dim 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
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)
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.
Int_t GetNoElements() const
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.
RooArgSet S(const RooAbsArg &v1)
RooCmdArg Color(Color_t color)
static constexpr double s
MsgLogger & Endl(MsgLogger &ml)
Short_t Max(Short_t a, Short_t b)
constexpr Double_t E()
Base of natural log:
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 long int sum(long int i)