67#if __cplusplus > 199711L
75#if __cplusplus > 199711L
79 if(!
fgTools.compare_exchange_strong(expected,tmp)) {
92#if __cplusplus > 199711L
93 if (fgTools != 0) {
delete fgTools.load(); fgTools=0; }
95 if (fgTools != 0) {
delete fgTools; fgTools=0; }
103 fRegexp(
"$&|!%^&()'<>?= "),
139 if ((
S->GetNbinsX() !=
B->GetNbinsX()) || (
S->GetNbinsX() <= 0)) {
140 Log() << kFATAL <<
"<GetSeparation> signal and background"
141 <<
" histograms have different number of bins: "
142 <<
S->GetNbinsX() <<
" : " <<
B->GetNbinsX() <<
Endl;
145 if (
S->GetXaxis()->GetXmin() !=
B->GetXaxis()->GetXmin() ||
146 S->GetXaxis()->GetXmax() !=
B->GetXaxis()->GetXmax() ||
147 S->GetXaxis()->GetXmax() <=
S->GetXaxis()->GetXmin()) {
148 Log() << kINFO <<
S->GetXaxis()->GetXmin() <<
" " <<
B->GetXaxis()->GetXmin()
149 <<
" " <<
S->GetXaxis()->GetXmax() <<
" " <<
B->GetXaxis()->GetXmax()
150 <<
" " <<
S->GetXaxis()->GetXmax() <<
" " <<
S->GetXaxis()->GetXmin() <<
Endl;
151 Log() << kFATAL <<
"<GetSeparation> signal and background"
152 <<
" histograms have different or invalid dimensions:" <<
Endl;
155 Int_t nstep =
S->GetNbinsX();
156 Double_t intBin = (
S->GetXaxis()->GetXmax() -
S->GetXaxis()->GetXmin())/nstep;
157 Double_t nS =
S->GetSumOfWeights()*intBin;
158 Double_t nB =
B->GetSumOfWeights()*intBin;
160 if (nS > 0 && nB > 0) {
161 for (
Int_t bin=0; bin<nstep; bin++) {
165 if (
s +
b > 0) separation += (
s -
b)*(
s -
b)/(
s +
b);
167 separation *= (0.5*intBin);
170 Log() << kWARNING <<
"<GetSeparation> histograms with zero entries: "
171 << nS <<
" : " << nB <<
" cannot compute separation"
191 Log() << kFATAL <<
"<GetSeparation> Mismatch in PDF limits: "
198 for (
Int_t bin=0; bin<nstep; bin++) {
203 if (
s +
b > 0) separation += (
s -
b)*(
s -
b)/(
s +
b);
205 separation *= (0.5*intBin);
220 Log() << kFATAL <<
"<Tools::ComputeStat> value vector is zero pointer" <<
Endl;
222 if ( events.size() != valVec->size() )
223 Log() << kWARNING <<
"<Tools::ComputeStat> event and value vector have different lengths "
224 << events.size() <<
"!=" << valVec->size() <<
Endl;
240 xmin_ = *std::min( valVec->begin(), valVec->end() );
241 xmax_ = *std::max( valVec->begin(), valVec->end() );
244 for (
Int_t ievt=0; ievt<entries; ievt++) {
249 wgtVecS[nEventsS] = events[ievt]->GetWeight();
250 varVecS[nEventsS++] = theVar;
253 wgtVecB[nEventsB] = events[ievt]->GetWeight();
254 varVecB[nEventsB++] = theVar;
296 d->Mult( (*si), (*symMat) ); (*d) *= (*s);
301 for (i=0; i<
n; i++) {
302 for (j=0; j<
n; j++) {
304 (i == j && (*
d)(i,i) < 0)) {
306 Log() << kWARNING <<
"<GetSQRootMatrix> error in matrix diagonalization; printed S and B" <<
Endl;
312 for (i=0; i<
n; i++)
for (j=0; j<
n; j++)
if (j != i) (*d)(i,j) = 0;
318 sqrtMat->
Mult( (*
s), (*
d) );
338 if (covMat == 0)
return 0;
342 Log() << kFATAL <<
"<GetCorrelationMatrix> input matrix not quadratic" <<
Endl;
346 for (
Int_t ivar=0; ivar<nvar; ivar++) {
347 for (
Int_t jvar=0; jvar<nvar; jvar++) {
349 Double_t d = (*covMat)(ivar, ivar)*(*covMat)(jvar, jvar);
351 (*corrMat)(ivar, jvar) = (*covMat)(ivar, jvar)/
TMath::Sqrt(
d);
353 Log() <<
"<GetCorrelationMatrix> zero variances for variables "
354 <<
"(" << ivar <<
", " << jvar <<
")" <<
Endl;
355 (*corrMat)(ivar, jvar) = 0;
359 <<
" Element corr("<<ivar<<
","<<ivar<<
")=" << (*corrMat)(ivar,jvar)
361 <<
" cov("<<ivar<<
","<<ivar<<
")=" <<(*covMat)(ivar, ivar)
362 <<
" cov("<<jvar<<
","<<jvar<<
")=" <<(*covMat)(jvar, jvar)
367 else (*corrMat)(ivar, ivar) = 1.0;
396 if (!theHist)
return 0;
402 if (w > 0) theHist->
Scale( norm/w );
418 while (formatString.
Length()>0) {
419 if (formatString.
First(
sep) == -1) {
427 formatString.
Remove(0,posSep+1);
455 vector<Int_t>* nodes )
462 Log() << kFATAL <<
"<ParseANNOptionString> unrecognized option string: " << theOptions <<
Endl;
466 nodes->push_back( atoi( ((
TObjString*)list->
At(0))->GetString() ) );
474 if (
s.Length() > 1) nodes->push_back( nvar + atoi(&
s[1]) );
475 else nodes->push_back( nvar );
477 else if ((
a = atoi(
s )) > 0) nodes->push_back( atoi(
s ) );
479 Log() << kFATAL <<
"<ParseANNOptionString> unrecognized option string: " << theOptions <<
Endl;
501 Double_t dev = 0.5*(ys - yh)/(ys + yh);
503 Log() << kFATAL <<
"<CheckSplines> Spline failed sanity criterion; "
504 <<
" relative deviation from histogram: " << dev
505 <<
" in (bin, value): (" << ibin <<
", " <<
x <<
")" <<
Endl;
519 if (
a.size() !=
b.size()) {
522 vector<Double_t> result(
a.size());
523 for (
UInt_t i=0; i<
a.size();i++) result[i]=
a[i]-
b[i];
532 for (
UInt_t i=0; i<
v.size();i++)
v[i]*=
f;
540 for (
UInt_t i=0; i<
v.size();i++)
v[i]*=
f;
553 UInt_t sizeofarray=
v[0].size();
554 for (
UInt_t i=0; i<sizeofarray; i++) {
555 for (
UInt_t j=sizeofarray-1; j>i; j--) {
556 if (
v[0][j-1] >
v[0][j]) {
557 for (
UInt_t k=0; k< nArrays; k++) {
558 temp =
v[k][j-1];
v[k][j-1] =
v[k][j];
v[k][j] = temp;
561 TString temps = (*vs)[j-1]; (*vs)[j-1] = (*vs)[j]; (*vs)[j] = temps;
580 UInt_t sizeofarray=
v[0].size();
581 for (
UInt_t i=0; i<sizeofarray; i++) {
582 for (
UInt_t j=sizeofarray-1; j>i; j--) {
583 if (
v[0][j-1] <
v[0][j]) {
584 for (
UInt_t k=0; k< nArrays; k++) {
585 temp =
v[k][j-1];
v[k][j-1] =
v[k][j];
v[k][j] = temp;
588 TString temps = (*vs)[j-1]; (*vs)[j-1] = (*vs)[j]; (*vs)[j] = temps;
603 if (
hi == 0)
return -1;
611 Int_t maxBinX =
h.GetNbinsX();
612 Int_t maxBinY =
h.GetNbinsY();
613 for (
Int_t x = 1;
x <= maxBinX;
x++) {
614 for (
Int_t y = 1;
y <= maxBinY;
y++) {
618 if (p_x > 0. && p_y > 0. && p_xy > 0.){
619 mutualInfo += p_xy*
TMath::Log(p_xy / (p_x * p_y));
634 if (
hi == 0.)
return -1;
642 Double_t y_mean =
h.ProjectionY()->GetMean();
643 for (
Int_t ix=1; ix<=
h.GetNbinsX(); ix++) {
644 corrRatio += (
h.Integral(ix,ix,1,
h.GetNbinsY())/
hi)*
pow((GetYMean_binX(
h,ix)-y_mean),2);
646 corrRatio /=
pow(
h.ProjectionY()->GetRMS(),2);
655 if (
h.Integral(bin_x,bin_x,1,
h.GetNbinsY()) == 0.) {
return 0;}
657 TH1* py =
h.ProjectionY();
658 for (
Int_t y = 1;
y <=
h.GetNbinsY();
y++){
661 y_bin_mean /=
h.Integral(bin_x,bin_x,1,
h.GetNbinsY());
671 if (
h.GetNbinsX() !=
h.GetNbinsY()) {
672 Log() << kFATAL <<
"<TransposeHist> cannot transpose non-quadratic histogram" <<
Endl;
676 for (
Int_t ix=1; ix <=
h.GetNbinsX(); ix++){
677 for (
Int_t iy=1; iy <=
h.GetNbinsY(); iy++){
686 h.GetStats(stats_old);
687 stats_new[0] = stats_old[0];
688 stats_new[1] = stats_old[1];
689 stats_new[2] = stats_old[4];
690 stats_new[3] = stats_old[5];
691 stats_new[4] = stats_old[2];
692 stats_new[5] = stats_old[3];
693 stats_new[6] = stats_old[6];
694 transposedHisto->
PutStats(stats_new);
696 return transposedHisto;
708 s.ReplaceAll(
" ",
"");
709 if (
s.Contains(
"silent") && !
s.Contains(
"silent=f")) {
710 if (!
s.Contains(
"!silent") ||
s.Contains(
"silent=t")) isSilent =
kTRUE;
725 s.ReplaceAll(
" ",
"");
726 std::vector<TString>
v = SplitString(
s,
':' );
727 for (std::vector<TString>::iterator it =
v.begin(); it !=
v.end(); ++it) {
728 if ((*it ==
"v" || *it ==
"verbose") && !it->Contains(
"!")) isVerbose =
kTRUE;
739 vector< vector<Double_t> > vtemp;
741 UsefulSortDescending(vtemp);
750 vector<vector<Double_t> > vtemp;
752 UsefulSortAscending(vtemp);
761 if (
v.empty())
return -1;
764 for (
UInt_t i=0; i<
v.size(); i++){
778 if (
v.empty())
return -1;
781 for (
UInt_t i=0; i<
v.size(); i++){
841 static const TString gClr_none =
"" ;
842 static const TString gClr_white =
"\033[1;37m";
843 static const TString gClr_black =
"\033[30m";
844 static const TString gClr_blue =
"\033[34m";
845 static const TString gClr_red =
"\033[1;31m" ;
846 static const TString gClr_yellow =
"\033[1;33m";
847 static const TString gClr_darkred =
"\033[31m";
848 static const TString gClr_darkgreen =
"\033[32m";
849 static const TString gClr_darkyellow =
"\033[33m";
851 static const TString gClr_bold =
"\033[1m" ;
852 static const TString gClr_black_b =
"\033[30m" ;
853 static const TString gClr_lblue_b =
"\033[1;34m" ;
854 static const TString gClr_cyan_b =
"\033[0;36m" ;
855 static const TString gClr_lgreen_b =
"\033[1;32m";
857 static const TString gClr_blue_bg =
"\033[44m";
858 static const TString gClr_red_bg =
"\033[1;41m";
859 static const TString gClr_whiteonblue =
"\033[1;44m";
860 static const TString gClr_whiteongreen =
"\033[1;42m";
861 static const TString gClr_grey_bg =
"\033[47m";
863 static const TString gClr_reset =
"\033[0m";
865 if (!
gConfig().UseColor())
return gClr_none;
867 if (
c ==
"white" )
return gClr_white;
868 if (
c ==
"blue" )
return gClr_blue;
869 if (
c ==
"black" )
return gClr_black;
870 if (
c ==
"lightblue")
return gClr_cyan_b;
871 if (
c ==
"yellow")
return gClr_yellow;
872 if (
c ==
"red" )
return gClr_red;
873 if (
c ==
"dred" )
return gClr_darkred;
874 if (
c ==
"dgreen")
return gClr_darkgreen;
875 if (
c ==
"lgreenb")
return gClr_lgreen_b;
876 if (
c ==
"dyellow")
return gClr_darkyellow;
878 if (
c ==
"bold")
return gClr_bold;
879 if (
c ==
"bblack")
return gClr_black_b;
881 if (
c ==
"blue_bgd")
return gClr_blue_bg;
882 if (
c ==
"red_bgd" )
return gClr_red_bg;
884 if (
c ==
"white_on_blue" )
return gClr_whiteonblue;
885 if (
c ==
"white_on_green")
return gClr_whiteongreen;
887 if (
c ==
"reset")
return gClr_reset;
889 std::cout <<
"Unknown color " <<
c << std::endl;
904 if ((
UInt_t)values.size() != nvar) {
905 logger << kFATAL <<
"<FormattedOutput> fatal error with dimensions: "
906 << values.size() <<
" OR " <<
" != " << nvar <<
Endl;
911 std::vector<UInt_t> vLengths;
920 UInt_t clen = maxL + maxV + 3;
923 for (
UInt_t i=0; i<clen; i++) logger <<
"-";
927 logger << setw(maxL) << titleVars <<
":";
928 logger << setw(maxV+1) << titleValues <<
":";
930 for (
UInt_t i=0; i<clen; i++) logger <<
"-";
934 for (
UInt_t irow=0; irow<nvar; irow++) {
935 logger << setw(maxL) << V[irow] <<
":";
936 logger << setw(maxV+1) <<
Form( format.
Data(), values[irow] );
941 for (
UInt_t i=0; i<clen; i++) logger <<
"-";
953 logger << kFATAL <<
"<FormattedOutput> fatal error with dimensions: "
960 std::vector<UInt_t> vLengths;
961 for (
UInt_t ivar=0; ivar<nvar; ivar++) {
968 for (
UInt_t icol=0; icol<nvar; icol++) clen += vLengths[icol]+1;
971 for (
UInt_t i=0; i<clen; i++) logger <<
"-";
975 logger << setw(maxL+1) <<
" ";
976 for (
UInt_t icol=0; icol<nvar; icol++) logger << setw(vLengths[icol]+1) << V[icol];
980 for (
UInt_t irow=0; irow<nvar; irow++) {
981 logger << setw(maxL) << V[irow] <<
":";
982 for (
UInt_t icol=0; icol<nvar; icol++) {
983 logger << setw(vLengths[icol]+1) <<
Form(
"%+1.3f", M(irow,icol) );
989 for (
UInt_t i=0; i<clen; i++) logger <<
"-";
997 const std::vector<TString>& vert,
const std::vector<TString>& horiz,
1001 UInt_t nvvar = vert.size();
1002 UInt_t nhvar = horiz.size();
1007 std::vector<UInt_t> vLengths;
1008 for (
UInt_t ivar=0; ivar<nvvar; ivar++) {
1016 std::vector<UInt_t> hLengths;
1017 for (
UInt_t ivar=0; ivar<nhvar; ivar++) {
1019 maxLh =
TMath::Max( hLengths.back(), maxLh );
1023 for (
UInt_t icol=0; icol<nhvar; icol++) clen += hLengths[icol]+1;
1026 for (
UInt_t i=0; i<clen; i++) logger <<
"-";
1030 logger << setw(maxL+1) <<
" ";
1031 for (
UInt_t icol=0; icol<nhvar; icol++) logger << setw(hLengths[icol]+1) << horiz[icol];
1035 for (
UInt_t irow=0; irow<nvvar; irow++) {
1036 logger << setw(maxL) << vert[irow] <<
":";
1037 for (
UInt_t icol=0; icol<nhvar; icol++) {
1038 logger << setw(hLengths[icol]+1) <<
Form(
"%+1.3f", M(irow,icol) );
1044 for (
UInt_t i=0; i<clen; i++) logger <<
"-";
1053 return ( unit ==
"" ? title : ( title +
" [" + unit +
"]" ) );
1061 TString retval = ( normalised ?
"(1/N) " :
"" );
1062 retval +=
Form(
"dN_{ }/^{ }%.3g %s",
h.GetXaxis()->GetBinWidth(1), unit.
Data() );
1071 os << val <<
" :: ";
1073 for (
int i=0; i<4; i++) {
1074 Int_t ic = *((
char*)
c+i)-
'\0';
1092 for (
int i=0; i<4; i++) {
1094 *((
char*)ap+i) =
'\0'+
c[i];
1107 return xmlengine().HasAttr(node, attrname);
1115 if (!HasAttr(node, attrname)) {
1116 const char * nodename = xmlengine().GetNodeName(node);
1117 Log() << kFATAL <<
"Trying to read non-existing attribute '" << attrname <<
"' from xml node '" << nodename <<
"'" <<
Endl;
1119 const char* val = xmlengine().GetAttr(node, attrname);
1128 if( node == 0 )
return;
1137 if( !isRootNode && parent == 0 )
return 0;
1144 if( node == 0 )
return kFALSE;
1153 void* par = xmlengine().GetParent(child);
1163 void* ch = xmlengine().GetChild(parent);
1164 if (childname != 0) {
1165 while (ch!=0 && strcmp(xmlengine().GetNodeName(ch),childname) != 0) ch = xmlengine().GetNext(ch);
1175 void* ch = xmlengine().GetNext(prevchild);
1176 if (childname != 0) {
1177 while (ch!=0 && strcmp(xmlengine().GetNodeName(ch),childname)!=0) ch = xmlengine().GetNext(ch);
1187 return xmlengine().GetNodeContent(node);
1195 return xmlengine().GetNodeName(node);
1203 return xmlengine().AddRawLine( node, raw );
1212 std::vector<TString> splitV;
1216 while (splitOpt.
Length()>0) {
1218 splitV.push_back(splitOpt);
1223 splitV.push_back(toSave);
1236 std::stringstream
s;
1246 std::stringstream
s;
1256 void* matnode = xmlengine().NewChild(node, 0,
name);
1257 xmlengine().NewAttr(matnode,0,
"Rows", StringFromInt(mat->
GetNrows()) );
1258 xmlengine().NewAttr(matnode,0,
"Columns", StringFromInt(mat->
GetNcols()) );
1259 std::stringstream
s;
1262 s <<
Form(
"%5.15e ", (*mat)[row][col] );
1265 xmlengine().AddRawLine( matnode,
s.str().c_str() );
1273 WriteTMatrixDToXML( node,
name, &mat );
1281 ReadTMatrixDFromXML( node,
name, &mat );
1282 for (
int i=0;i<vec->
GetNoElements();++i) (*vec)[i] = mat[0][i];
1289 if (strcmp(xmlengine().GetNodeName(node),
name)!=0){
1290 Log() << kWARNING <<
"Possible Error: Name of matrix in weight file"
1291 <<
" does not match name of matrix passed as argument!" <<
Endl;
1294 ReadAttr( node,
"Rows", nrows );
1295 ReadAttr( node,
"Columns", ncols );
1297 Log() << kWARNING <<
"Possible Error: Dimension of matrix in weight file"
1298 <<
" does not match dimension of matrix passed as argument!" <<
Endl;
1301 const char* content = xmlengine().GetNodeContent(node);
1302 std::stringstream
s(content);
1303 for (
Int_t row = 0; row<nrows; row++) {
1304 for (
Int_t col = 0; col<ncols; col++) {
1305 s >> (*mat)[row][col];
1315 std::cout << std::endl;
1316 std::cout <<
Color(
"bold") <<
"TMVA -- Toolkit for Multivariate Data Analysis" <<
Color(
"reset") << std::endl;
1318 std::cout <<
" " <<
"Copyright (C) 2005-2010 CERN, MPI-K Heidelberg, Us of Bonn and Victoria" << std::endl;
1319 std::cout <<
" " <<
"Home page: http://tmva.sf.net" << std::endl;
1320 std::cout <<
" " <<
"Citation info: http://tmva.sf.net/citeTMVA.html" << std::endl;
1321 std::cout <<
" " <<
"License: http://tmva.sf.net/LICENSE" << std::endl << std::endl;
1338 static const char *
const months[] = {
"Jan",
"Feb",
"Mar",
"Apr",
"May",
1339 "Jun",
"Jul",
"Aug",
"Sep",
"Oct",
1342 Int_t iday = idatqq%100;
1343 Int_t imonth = (idatqq/100)%100;
1344 Int_t iyear = (idatqq/10000);
1345 TString versionDate =
Form(
"%s %d, %4d",months[imonth-1],iday,iyear);
1348 logger <<
"You are running ROOT Version: " <<
gROOT->GetVersion() <<
", " << versionDate <<
Endl;
1359 case kStandardWelcomeMsg:
1360 logger <<
Color(
"white") <<
"TMVA -- Toolkit for Multivariate Analysis" <<
Color(
"reset") <<
Endl;
1361 logger <<
"Copyright (C) 2005-2006 CERN, LAPP & MPI-K Heidelberg and Victoria U." <<
Endl;
1362 logger <<
"Home page http://tmva.sourceforge.net" <<
Endl;
1363 logger <<
"All rights reserved, please read http://tmva.sf.net/license.txt" <<
Endl <<
Endl;
1366 case kIsometricWelcomeMsg:
1367 logger <<
" ___ ___ ___ ___ " <<
Endl;
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 <<
Endl;
1380 case kBlockWelcomeMsg:
1382 logger <<
"_|_|_|_|_| _| _| _| _| _|_| " <<
Endl;
1383 logger <<
" _| _|_| _|_| _| _| _| _| " <<
Endl;
1384 logger <<
" _| _| _| _| _| _| _|_|_|_| " <<
Endl;
1385 logger <<
" _| _| _| _| _| _| _| " <<
Endl;
1386 logger <<
" _| _| _| _| _| _| " <<
Endl <<
Endl;
1389 case kLeanWelcomeMsg:
1391 logger <<
"_/_/_/_/_/ _/ _/ _/ _/ _/_/ " <<
Endl;
1392 logger <<
" _/ _/_/ _/_/ _/ _/ _/ _/ " <<
Endl;
1393 logger <<
" _/ _/ _/ _/ _/ _/ _/_/_/_/ " <<
Endl;
1394 logger <<
" _/ _/ _/ _/ _/ _/ _/ " <<
Endl;
1395 logger <<
"_/ _/ _/ _/ _/ _/ " <<
Endl <<
Endl;
1398 case kLogoWelcomeMsg:
1400 logger <<
"_/_/_/_/_/ _| _| _| _| _|_| " <<
Endl;
1401 logger <<
" _/ _|_| _|_| _| _| _| _| " <<
Endl;
1402 logger <<
" _/ _| _| _| _| _| _|_|_|_| " <<
Endl;
1403 logger <<
" _/ _| _| _| _| _| _| " <<
Endl;
1404 logger <<
"_/ _| _| _| _| _| " <<
Endl <<
Endl;
1407 case kSmall1WelcomeMsg:
1408 logger <<
" _____ __ ____ ___ " <<
Endl;
1409 logger <<
"|_ _| \\/ \\ \\ / /_\\ " <<
Endl;
1410 logger <<
" | | | |\\/| |\\ V / _ \\ " <<
Endl;
1411 logger <<
" |_| |_| |_| \\_/_/ \\_\\" <<
Endl <<
Endl;
1414 case kSmall2WelcomeMsg:
1415 logger <<
" _____ __ ____ ___ " <<
Endl;
1416 logger <<
"|_ _| \\/ \\ \\ / / \\ " <<
Endl;
1417 logger <<
" | | | |\\/| |\\ \\ / / _ \\ " <<
Endl;
1418 logger <<
" | | | | | | \\ V / ___ \\ " <<
Endl;
1419 logger <<
" |_| |_| |_| \\_/_/ \\_\\ " <<
Endl <<
Endl;
1422 case kOriginalWelcomeMsgColor:
1423 logger << kINFO <<
"" <<
Color(
"red")
1424 <<
"_______________________________________" <<
Color(
"reset") <<
Endl;
1425 logger << kINFO <<
"" <<
Color(
"blue")
1428 <<
"|\\ /|| \\ // /\\\\\\\\\\\\\\\\\\\\\\\\ \\ \\ \\ " <<
Color(
"reset") <<
Endl;
1429 logger << kINFO <<
""<<
Color(
"blue")
1432 <<
"| \\/ || \\// /--\\\\\\\\\\\\\\\\\\\\\\\\ \\ \\ \\" <<
Color(
"reset") <<
Endl;
1435 case kOriginalWelcomeMsgBW:
1436 logger << kINFO <<
""
1437 <<
"_______________________________________" <<
Endl;
1438 logger << kINFO <<
" // "
1439 <<
"|\\ /|| \\ // /\\\\\\\\\\\\\\\\\\\\\\\\ \\ \\ \\ " <<
Endl;
1440 logger << kINFO <<
"// "
1441 <<
"| \\/ || \\// /--\\\\\\\\\\\\\\\\\\\\\\\\ \\ \\ \\" <<
Endl;
1445 logger << kFATAL <<
"unknown message type: " << msgType <<
Endl;
1457 logger <<
"A. Hoecker, P. Speckmayer, J. Stelzer, J. Therhaag, E. von Toerne, H. Voss" <<
Endl;
1458 logger <<
"\"TMVA - Toolkit for Multivariate Data Analysis\" PoS ACAT:040,2007. e-Print: physics/0703039" <<
Endl;
1462 logger <<
"@Article{TMVA2007," <<
Endl;
1463 logger <<
" author = \"Hoecker, Andreas and Speckmayer, Peter and Stelzer, Joerg " <<
Endl;
1464 logger <<
" and Therhaag, Jan and von Toerne, Eckhard and Voss, Helge\"," <<
Endl;
1465 logger <<
" title = \"{TMVA: Toolkit for multivariate data analysis}\"," <<
Endl;
1466 logger <<
" journal = \"PoS\"," <<
Endl;
1467 logger <<
" volume = \"ACAT\"," <<
Endl;
1468 logger <<
" year = \"2007\"," <<
Endl;
1469 logger <<
" pages = \"040\"," <<
Endl;
1470 logger <<
" eprint = \"physics/0703039\"," <<
Endl;
1471 logger <<
" archivePrefix = \"arXiv\"," <<
Endl;
1472 logger <<
" SLACcitation = \"%%CITATION = PHYSICS/0703039;%%\"" <<
Endl;
1473 logger <<
"}" <<
Endl;
1477 logger <<
"%\\cite{TMVA2007}" <<
Endl;
1478 logger <<
"\\bibitem{TMVA2007}" <<
Endl;
1479 logger <<
" A.~Hoecker, P.~Speckmayer, J.~Stelzer, J.~Therhaag, E.~von Toerne, H.~Voss" <<
Endl;
1480 logger <<
" %``TMVA: Toolkit for multivariate data analysis,''" <<
Endl;
1481 logger <<
" PoS A {\\bf CAT} (2007) 040" <<
Endl;
1482 logger <<
" [arXiv:physics/0703039]." <<
Endl;
1483 logger <<
" %%CITATION = POSCI,ACAT,040;%%" <<
Endl;
1491 <<
"For citation information, please visit: http://tmva.sf.net/citeTMVA.html"
1500 return !(
h.GetXaxis()->GetXbins()->fN);
1505std::vector<TMatrixDSym*>*
1508 std::vector<Event*> eventVector;
1509 for (std::vector<const Event*>::const_iterator it = events.begin(), itEnd = events.end(); it != itEnd; ++it)
1511 eventVector.push_back (
new Event(*(*it)));
1513 std::vector<TMatrixDSym*>* returnValue = CalcCovarianceMatrices (eventVector, maxCls, transformBase);
1514 for (std::vector<Event*>::const_iterator it = eventVector.begin(), itEnd = eventVector.end(); it != itEnd; ++it)
1524std::vector<TMatrixDSym*>*
1527 if (events.empty()) {
1528 Log() << kWARNING <<
" Asked to calculate a covariance matrix for an empty event vectors.. sorry cannot do that -> return NULL"<<
Endl;
1532 UInt_t nvars=0, ntgts=0, nspcts=0;
1536 nvars =events.at(0)->GetNVariables ();
1537 ntgts =events.at(0)->GetNTargets ();
1538 nspcts=events.at(0)->GetNSpectators();
1543 Int_t matNum = maxCls;
1544 if (maxCls > 1 ) matNum++;
1546 std::vector<TVectorD*>* vec =
new std::vector<TVectorD*>(matNum);
1547 std::vector<TMatrixD*>* mat2 =
new std::vector<TMatrixD*>(matNum);
1548 std::vector<Double_t> count(matNum);
1549 count.assign(matNum,0);
1555 for (cls = 0; cls < matNum ; cls++) {
1556 vec->at(cls) =
new TVectorD(nvars);
1557 mat2->at(cls) =
new TMatrixD(nvars,nvars);
1561 for (ivar=0; ivar<nvars; ivar++) {
1563 for (jvar=0; jvar<nvars; jvar++) {
1564 (*m)(ivar, jvar) = 0;
1570 for (
UInt_t i=0; i<events.size(); i++) {
1573 const Event * ev = events[i];
1577 std::vector<Float_t> input;
1578 std::vector<Char_t> mask;
1580 if (transformBase) {
1581 transformBase->
GetInput (ev, input, mask);
1583 for (ivar=0; ivar<nvars; ++ivar) {
1584 input.push_back (ev->
GetValue(ivar));
1589 v = vec->at(matNum-1);
1590 m = mat2->at(matNum-1);
1592 count.at(matNum-1)+=weight;
1593 for (ivar=0; ivar<nvars; ivar++) {
1596 (*v)(ivar) += xi*weight;
1597 (*m)(ivar, ivar) += (xi*xi*weight);
1599 for (jvar=ivar+1; jvar<nvars; jvar++) {
1601 (*m)(ivar, jvar) += (xi*xj*weight);
1602 (*m)(jvar, ivar) = (*
m)(ivar, jvar);
1607 count.at(cls)+=weight;
1610 for (ivar=0; ivar<nvars; ivar++) {
1612 (*v)(ivar) += xi*weight;
1613 (*m)(ivar, ivar) += (xi*xi*weight);
1615 for (jvar=ivar+1; jvar<nvars; jvar++) {
1617 (*m)(ivar, jvar) += (xi*xj*weight);
1618 (*m)(jvar, ivar) = (*
m)(ivar, jvar);
1624 std::vector<TMatrixDSym*>* mat =
new std::vector<TMatrixDSym*>(matNum);
1625 for (cls = 0; cls < matNum; cls++) {
1632 for (ivar=0; ivar<nvars; ivar++) {
1633 for (jvar=0; jvar<nvars; jvar++) {
1634 (*(mat->at(cls)))(ivar, jvar) = (*
m)(ivar, jvar)/
n - (*
v)(ivar)*(*
v)(jvar)/(
n*
n);
1652template <
typename Iterator,
typename WeightIterator>
1660 while (
first != last )
1672 ::Error(
"TMVA::Tools::Mean",
"sum of weights <= 0 ?! that's a bit too much of negative event weights :) ");
1678 while (
first != last )
1684 sum += (*w) * (*first);
1691 ::Error(
"TMVA::Tools::Mean",
"sum of weights <= 0 ?! that's a bit too much of negative event weights :) ");
1701template <
typename T>
1716template <
typename Iterator,
typename WeightIterator>
1727 while (
first != last ) {
1730 sum2 += adouble*adouble;
1737 while (
first != last ) {
1739 sum += adouble * (*w);
1740 sum2 += adouble*adouble * (*w);
1757template <
typename T>
1773 TH1* cumulativeDist= (
TH1*)
h->Clone(
Form(
"%sCumul",
h->GetTitle()));
1780 for (
Int_t ibinEnd=1, ibin=cumulativeDist->
GetNbinsX(); ibin >=ibinEnd ; ibin--){
1782 if (val>0) inverseSum += val;
1784 inverseSum = 1/inverseSum;
1786 for (
Int_t ibinEnd=1, ibin=cumulativeDist->
GetNbinsX(); ibin >=ibinEnd ; ibin--){
1788 if (val>0) partialSum += val;
1791 return cumulativeDist;
1797 const char *val = xmlengine().GetAttr(node, attrname);
1798 if (val ==
nullptr) {
1799 const char *nodename = xmlengine().GetNodeName(node);
1800 Log() << kFATAL <<
"Trying to read non-existing attribute '" << attrname <<
"' from xml node '" << nodename <<
"'"
1809 const char *val = xmlengine().GetAttr(node, attrname);
1810 if (val ==
nullptr) {
1811 const char *nodename = xmlengine().GetNodeName(node);
1812 Log() << kFATAL <<
"Trying to read non-existing attribute '" << attrname <<
"' from xml node '" << nodename <<
"'"
1821 const char *val = xmlengine().GetAttr(node, attrname);
1822 if (val ==
nullptr) {
1823 const char *nodename = xmlengine().GetNodeName(node);
1824 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.
RooCmdArg Color(Color_t color)
RooArgSet S(const RooAbsArg &v1)
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)