66using std::vector, std::setw, std::istream, std::ostream;
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());
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) <<
TString::Format(
"%+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) <<
TString::Format(
"%+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) " :
"" );
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);
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;
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;
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);
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 https://root.cern/manual/tmva/" <<
Endl;
1354 case kIsometricWelcomeMsg:
1355 logger <<
" ___ ___ ___ ___ " <<
Endl;
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 <<
Endl;
1368 case kBlockWelcomeMsg:
1370 logger <<
"_|_|_|_|_| _| _| _| _| _|_| " <<
Endl;
1371 logger <<
" _| _|_| _|_| _| _| _| _| " <<
Endl;
1372 logger <<
" _| _| _| _| _| _| _|_|_|_| " <<
Endl;
1373 logger <<
" _| _| _| _| _| _| _| " <<
Endl;
1374 logger <<
" _| _| _| _| _| _| " <<
Endl <<
Endl;
1377 case kLeanWelcomeMsg:
1379 logger <<
"_/_/_/_/_/ _/ _/ _/ _/ _/_/ " <<
Endl;
1380 logger <<
" _/ _/_/ _/_/ _/ _/ _/ _/ " <<
Endl;
1381 logger <<
" _/ _/ _/ _/ _/ _/ _/_/_/_/ " <<
Endl;
1382 logger <<
" _/ _/ _/ _/ _/ _/ _/ " <<
Endl;
1383 logger <<
"_/ _/ _/ _/ _/ _/ " <<
Endl <<
Endl;
1386 case kLogoWelcomeMsg:
1388 logger <<
"_/_/_/_/_/ _| _| _| _| _|_| " <<
Endl;
1389 logger <<
" _/ _|_| _|_| _| _| _| _| " <<
Endl;
1390 logger <<
" _/ _| _| _| _| _| _|_|_|_| " <<
Endl;
1391 logger <<
" _/ _| _| _| _| _| _| " <<
Endl;
1392 logger <<
"_/ _| _| _| _| _| " <<
Endl <<
Endl;
1395 case kSmall1WelcomeMsg:
1396 logger <<
" _____ __ ____ ___ " <<
Endl;
1397 logger <<
"|_ _| \\/ \\ \\ / /_\\ " <<
Endl;
1398 logger <<
" | | | |\\/| |\\ V / _ \\ " <<
Endl;
1399 logger <<
" |_| |_| |_| \\_/_/ \\_\\" <<
Endl <<
Endl;
1402 case kSmall2WelcomeMsg:
1403 logger <<
" _____ __ ____ ___ " <<
Endl;
1404 logger <<
"|_ _| \\/ \\ \\ / / \\ " <<
Endl;
1405 logger <<
" | | | |\\/| |\\ \\ / / _ \\ " <<
Endl;
1406 logger <<
" | | | | | | \\ V / ___ \\ " <<
Endl;
1407 logger <<
" |_| |_| |_| \\_/_/ \\_\\ " <<
Endl <<
Endl;
1410 case kOriginalWelcomeMsgColor:
1411 logger << kINFO <<
"" << Color(
"red")
1412 <<
"_______________________________________" << Color(
"reset") <<
Endl;
1413 logger << kINFO <<
"" << Color(
"blue")
1414 << Color(
"red_bgd") << Color(
"bwhite") <<
" // " << Color(
"reset")
1415 << Color(
"white") << Color(
"blue_bgd")
1416 <<
"|\\ /|| \\ // /\\\\\\\\\\\\\\\\\\\\\\\\ \\ \\ \\ " << Color(
"reset") <<
Endl;
1417 logger << kINFO <<
""<< Color(
"blue")
1418 << Color(
"red_bgd") << Color(
"white") <<
"// " << Color(
"reset")
1419 << Color(
"white") << Color(
"blue_bgd")
1420 <<
"| \\/ || \\// /--\\\\\\\\\\\\\\\\\\\\\\\\ \\ \\ \\" << Color(
"reset") <<
Endl;
1423 case kOriginalWelcomeMsgBW:
1424 logger << kINFO <<
""
1425 <<
"_______________________________________" <<
Endl;
1426 logger << kINFO <<
" // "
1427 <<
"|\\ /|| \\ // /\\\\\\\\\\\\\\\\\\\\\\\\ \\ \\ \\ " <<
Endl;
1428 logger << kINFO <<
"// "
1429 <<
"| \\/ || \\// /--\\\\\\\\\\\\\\\\\\\\\\\\ \\ \\ \\" <<
Endl;
1433 logger << kFATAL <<
"unknown message type: " << msgType <<
Endl;
1445 logger <<
"A. Hoecker, P. Speckmayer, J. Stelzer, J. Therhaag, E. von Toerne, H. Voss" <<
Endl;
1446 logger <<
"\"TMVA - Toolkit for Multivariate Data Analysis\" PoS ACAT:040,2007. e-Print: physics/0703039" <<
Endl;
1450 logger <<
"@Article{TMVA2007," <<
Endl;
1451 logger <<
" author = \"Hoecker, Andreas and Speckmayer, Peter and Stelzer, Joerg " <<
Endl;
1452 logger <<
" and Therhaag, Jan and von Toerne, Eckhard and Voss, Helge\"," <<
Endl;
1453 logger <<
" title = \"{TMVA: Toolkit for multivariate data analysis}\"," <<
Endl;
1454 logger <<
" journal = \"PoS\"," <<
Endl;
1455 logger <<
" volume = \"ACAT\"," <<
Endl;
1456 logger <<
" year = \"2007\"," <<
Endl;
1457 logger <<
" pages = \"040\"," <<
Endl;
1458 logger <<
" eprint = \"physics/0703039\"," <<
Endl;
1459 logger <<
" archivePrefix = \"arXiv\"," <<
Endl;
1460 logger <<
" SLACcitation = \"%%CITATION = PHYSICS/0703039;%%\"" <<
Endl;
1461 logger <<
"}" <<
Endl;
1465 logger <<
"%\\cite{TMVA2007}" <<
Endl;
1466 logger <<
"\\bibitem{TMVA2007}" <<
Endl;
1467 logger <<
" A.~Hoecker, P.~Speckmayer, J.~Stelzer, J.~Therhaag, E.~von Toerne, H.~Voss" <<
Endl;
1468 logger <<
" %``TMVA: Toolkit for multivariate data analysis,''" <<
Endl;
1469 logger <<
" PoS A {\\bf CAT} (2007) 040" <<
Endl;
1470 logger <<
" [arXiv:physics/0703039]." <<
Endl;
1471 logger <<
" %%CITATION = POSCI,ACAT,040;%%" <<
Endl;
1479 <<
"For citation information, please visit: http://tmva.sf.net/citeTMVA.html"
1488 return !(
h.GetXaxis()->GetXbins()->fN);
1493std::vector<TMatrixDSym*>*
1496 std::vector<Event*> eventVector;
1497 for (std::vector<const Event*>::const_iterator it = events.begin(), itEnd = events.end(); it != itEnd; ++it)
1499 eventVector.push_back (
new Event(*(*it)));
1501 std::vector<TMatrixDSym*>* returnValue = CalcCovarianceMatrices (eventVector, maxCls, transformBase);
1502 for (std::vector<Event*>::const_iterator it = eventVector.begin(), itEnd = eventVector.end(); it != itEnd; ++it)
1512std::vector<TMatrixDSym*>*
1515 if (events.empty()) {
1516 Log() << kWARNING <<
" Asked to calculate a covariance matrix for an empty event vectors.. sorry cannot do that -> return NULL"<<
Endl;
1520 UInt_t nvars=0, ntgts=0, nspcts=0;
1524 nvars =events.at(0)->GetNVariables ();
1525 ntgts =events.at(0)->GetNTargets ();
1526 nspcts=events.at(0)->GetNSpectators();
1531 Int_t matNum = maxCls;
1532 if (maxCls > 1 ) matNum++;
1534 std::vector<TVectorD*>*
vec =
new std::vector<TVectorD*>(matNum);
1535 std::vector<TMatrixD*>* mat2 =
new std::vector<TMatrixD*>(matNum);
1536 std::vector<Double_t> count(matNum);
1537 count.assign(matNum,0);
1543 for (cls = 0; cls < matNum ; cls++) {
1545 mat2->at(cls) =
new TMatrixD(nvars,nvars);
1549 for (ivar=0; ivar<nvars; ivar++) {
1551 for (jvar=0; jvar<nvars; jvar++) {
1552 (*m)(ivar, jvar) = 0;
1558 for (
UInt_t i=0; i<events.size(); i++) {
1561 const Event * ev = events[i];
1565 std::vector<Float_t>
input;
1566 std::vector<Char_t>
mask;
1568 if (transformBase) {
1571 for (ivar=0; ivar<nvars; ++ivar) {
1577 v =
vec->at(matNum-1);
1578 m = mat2->at(matNum-1);
1580 count.at(matNum-1)+=weight;
1581 for (ivar=0; ivar<nvars; ivar++) {
1584 (*v)(ivar) += xi*weight;
1585 (*m)(ivar, ivar) += (xi*xi*weight);
1587 for (jvar=ivar+1; jvar<nvars; jvar++) {
1589 (*m)(ivar, jvar) += (xi*xj*weight);
1590 (*m)(jvar, ivar) = (*
m)(ivar, jvar);
1595 count.at(cls)+=weight;
1598 for (ivar=0; ivar<nvars; ivar++) {
1600 (*v)(ivar) += xi*weight;
1601 (*m)(ivar, ivar) += (xi*xi*weight);
1603 for (jvar=ivar+1; jvar<nvars; jvar++) {
1605 (*m)(ivar, jvar) += (xi*xj*weight);
1606 (*m)(jvar, ivar) = (*
m)(ivar, jvar);
1612 std::vector<TMatrixDSym*>* mat =
new std::vector<TMatrixDSym*>(matNum);
1613 for (cls = 0; cls < matNum; cls++) {
1620 for (ivar=0; ivar<nvars; ivar++) {
1621 for (jvar=0; jvar<nvars; jvar++) {
1622 (*(mat->at(cls)))(ivar, jvar) = (*
m)(ivar, jvar)/
n - (*
v)(ivar)*(*
v)(jvar)/(
n*
n);
1640template <
typename Iterator,
typename WeightIterator>
1647 while ( first != last )
1658 ::Error(
"TMVA::Tools::Mean",
"sum of weights <= 0 ?! that's a bit too much of negative event weights :) ");
1664 while ( first != last )
1670 sum += (*w) * (*first);
1676 ::Error(
"TMVA::Tools::Mean",
"sum of weights <= 0 ?! that's a bit too much of negative event weights :) ");
1686template <
typename T>
1701template <
typename Iterator,
typename WeightIterator>
1712 while ( first != last ) {
1715 sum2 += adouble*adouble;
1722 while ( first != last ) {
1724 sum += adouble * (*w);
1725 sum2 += adouble*adouble * (*w);
1742template <
typename T>
1765 for (
Int_t ibinEnd=1, ibin=cumulativeDist->
GetNbinsX(); ibin >=ibinEnd ; ibin--){
1767 if (val>0) inverseSum += val;
1769 inverseSum = 1/inverseSum;
1771 for (
Int_t ibinEnd=1, ibin=cumulativeDist->
GetNbinsX(); ibin >=ibinEnd ; ibin--){
1773 if (val>0) partialSum += val;
1776 return cumulativeDist;
1782 const char *val = xmlengine().GetAttr(node, attrname);
1783 if (val ==
nullptr) {
1784 const char *nodename = xmlengine().GetNodeName(node);
1785 Log() << kFATAL <<
"Trying to read non-existing attribute '" << attrname <<
"' from xml node '" << nodename <<
"'"
1794 const char *val = xmlengine().GetAttr(node, attrname);
1795 if (val ==
nullptr) {
1796 const char *nodename = xmlengine().GetNodeName(node);
1797 Log() << kFATAL <<
"Trying to read non-existing attribute '" << attrname <<
"' from xml node '" << nodename <<
"'"
1806 const char *val = xmlengine().GetAttr(node, attrname);
1807 if (val ==
nullptr) {
1808 const char *nodename = xmlengine().GetNodeName(node);
1809 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.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t mask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t child
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t format
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char mx
TMatrixTSym< Double_t > TMatrixDSym
TMatrixT< Double_t > TMatrixD
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
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.
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
TObject * Clone(const char *newname="") const override
Make a complete copy of the underlying object.
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.
void SetBinContent(Int_t bin, Double_t content) override
Set bin content.
Double_t Integral(Option_t *option="") const override
Return integral of bin contents.
void PutStats(Double_t *stats) override
Replace current statistics with the values in array stats.
void Add(TObject *obj) override
TObject * At(Int_t idx) const override
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
TMatrixT< Element > & Transpose(const TMatrixT< Element > &source)
Transpose matrix source.
TMatrixTBase< Element > & ResizeTo(Int_t nrows, Int_t ncols, Int_t=-1) override
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=nullptr)
Invert the matrix and calculate its determinant.
void Mult(const TMatrixT< Element > &a, const TMatrixT< Element > &b)
General matrix multiplication. Replace this matrix with 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)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
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)
Double_t RMS(Long64_t n, const T *a, const Double_t *w=nullptr)
Returns the Standard Deviation of an array a with length n.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Log(Double_t x)
Returns the natural logarithm of x.
Double_t Sqrt(Double_t x)
Returns the square root of x.
Double_t Mean(Long64_t n, const T *a, const Double_t *w=nullptr)
Returns the weighted mean of an array a with length n.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
static uint64_t sum(uint64_t i)