95using std::numeric_limits, std::nothrow, std::map;
116 fFoamType(kSeparate),
123 fFillFoamWithOrigWeights(
kFALSE),
124 fDTSeparation(kFoam),
155 fFoamType(kSeparate),
162 fFillFoamWithOrigWeights(
kFALSE),
163 fDTSeparation(kFoam),
170 if(strlen(
name) > 128)
171 Log() << kFATAL <<
"Name too long " <<
name.Data() <<
Endl;
183 delete fVariableNames;
185 if (fDistr)
delete fDistr;
186 if (fPseRan)
delete fPseRan;
187 if (fXmin) {
delete [] fXmin; fXmin=0; }
188 if (fXmax) {
delete [] fXmax; fXmax=0; }
192 for(
Int_t i=0; i<fNCells; i++)
delete fCells[i];
222 , fFoamType(kSeparate)
229 , fFillFoamWithOrigWeights(
kFALSE)
230 , fDTSeparation(kFoam)
237 Log() << kFATAL <<
"COPY CONSTRUCTOR NOT IMPLEMENTED" <<
Endl;
250 Log() << kFATAL <<
"<SetDim>: Dimension is zero or negative!" <<
Endl;
253 if (fXmin)
delete [] fXmin;
254 if (fXmax)
delete [] fXmax;
264 if (idim<0 || idim>=GetTotDim())
265 Log() << kFATAL <<
"<SetXmin>: Dimension out of bounds!" <<
Endl;
275 if (idim<0 || idim>=GetTotDim())
276 Log() << kFATAL <<
"<SetXmax>: Dimension out of bounds!" <<
Endl;
293 if(fPseRan==0) Log() << kFATAL <<
"Random number generator not set" <<
Endl;
294 if(fDistr==0) Log() << kFATAL <<
"Distribution function not set" <<
Endl;
295 if(fDim==0) Log() << kFATAL <<
"Zero dimension not allowed" <<
Endl;
302 if(fRvec==0) Log() << kFATAL <<
"Cannot initialize buffer fRvec" <<
Endl;
306 if(fAlpha==0) Log() << kFATAL <<
"Cannot initialize buffer fAlpha" <<
Endl;
311 fInhiDiv =
new Int_t[fDim];
312 for(
Int_t i=0; i<fDim; i++) fInhiDiv[i]=0;
316 fMaskDiv =
new Int_t[fDim];
317 for(
Int_t i=0; i<fDim; i++) fMaskDiv[i]=1;
321 for(
Int_t i=0; i<fDim; i++){
323 hname = fName+
TString(
"_HistEdge_");
325 htitle =
TString(
"Edge Histogram No. ");
327 (*fHistEdg)[i] =
new TH1D(hname.
Data(),htitle.
Data(),fNBin,0.0, 1.0);
328 ((
TH1D*)(*fHistEdg)[i])->Sumw2();
354 for(
Int_t i=0; i<fNCells; i++)
delete fCells[i];
360 Log() << kFATAL <<
"not enough memory to create " << fNCells
363 for(
Int_t i=0; i<fNCells; i++){
365 fCells[i]->SetSerial(i);
374 for(
Long_t iCell=0; iCell<=fLastCe; iCell++){
375 Explore( fCells[iCell] );
386 if (fLastCe==fNCells){
387 Log() << kFATAL <<
"Too many cells" <<
Endl;
391 cell = fCells[fLastCe];
393 cell->
Fill(status, parent, 0, 0);
446 cell->
GetHcub(cellPosi,cellSize);
456 for (
Int_t idim = 0; idim < fDim; ++idim)
457 vol_scale *= fXmax[idim] - fXmin[idim];
463 toteventsOld = GetCellElement(cell, 0);
474 for (i=0;i<fDim;i++) ((
TH1D *)(*fHistEdg)[i])->Reset();
478 for (iev=0;iev<fNSampl;iev++){
481 if (fDim>0)
for (j=0; j<fDim; j++) xRand[j]= cellPosi[j] +fAlpha[j]*(cellSize[j]);
483 wt = dx*Eval(xRand, event_density);
484 totevents += event_density;
488 for (k=0; k<fDim; k++) {
490 ((
TH1D *)(*fHistEdg)[nProj])->Fill(xproj,wt);
498 if (ceSum[3]>wt) ceSum[3]=wt;
499 if (ceSum[4]<wt) ceSum[4]=wt;
501 if (ceSum[1]>0) nevEff = ceSum[0]*ceSum[0]/ceSum[1];
503 if ( nevEff >= fNBin*fEvPerBin)
break;
507 if (fNSampl>0) totevents /= fNSampl;
511 if (cell==fCells[0] && ceSum[0]<=0.0){
513 Log() << kFATAL <<
"No events were found during exploration of "
514 <<
"root cell. Please check PDEFoam parameters nSampl "
515 <<
"and VolFrac." <<
Endl;
517 Log() << kWARNING <<
"Negative number of events found during "
518 <<
"exploration of root cell" <<
Endl;
523 for (k=0; k<fDim;k++){
525 if ( fInhiDiv[k]==1) fMaskDiv[k] =0;
532 Double_t intTrue = ceSum[0]/(nevMC+0.000001);
535 if (kBest == -1) Varedu(ceSum,kBest,xBest,yBest);
536 intDriv =sqrt(ceSum[1]/nevMC) -intTrue;
543 SetCellElement(cell, 0, totevents);
547 for (parent = cell->
GetPare(); parent!=0; parent = parent->
GetPare()){
550 parent->
SetIntg( parIntg +intTrue -intOld );
551 parent->
SetDriv( parDriv +intDriv -driOld );
552 SetCellElement( parent, 0, GetCellElement(parent, 0) + totevents - toteventsOld);
569 Double_t ssw = sqrt(sswAll)/sqrt(nent);
577 for(
Int_t kProj=0; kProj<fDim; kProj++) {
578 if( fMaskDiv[kProj]) {
585 for(
Int_t jLo=1; jLo<=fNBin; jLo++) {
588 for(
Int_t jUp=jLo; jUp<=fNBin;jUp++) {
590 asswIn += Sqr(((
TH1D *)(*fHistEdg)[kProj])->GetBinError( jUp));
595 if ( (xUp-xLo) < std::numeric_limits<double>::epsilon()) sswIn=0.;
596 else sswIn = sqrt(asswIn) /sqrt(nent*(xUp-xLo)) *(xUp-xLo);
597 if ( (1.0-xUp+xLo) < std::numeric_limits<double>::epsilon()) sswOut=0.;
598 else if ( sswAll-asswIn < std::numeric_limits<double>::epsilon()) sswOut=0.;
599 else sswOut= sqrt(sswAll-asswIn)/sqrt(nent*(1.0-xUp+xLo)) *(1.0-xUp+xLo);
600 if( (sswIn+sswOut) < sswtBest) {
601 sswtBest = sswIn+sswOut;
618 if(iLo == 0) xBest=yBest;
619 if(iUp == fNBin) yBest=xBest;
624 if( (kBest >= fDim) || (kBest<0) )
625 Log() << kFATAL <<
"Something wrong with kBest" <<
Endl;
635 fPseRan->RndmArray(fDim,fRvec);
636 for(
Int_t k=0; k<fDim; k++) fAlpha[k] = fRvec[k];
656 for(i=0; i<=fLastCe; i++) {
657 if( fCells[i]->GetStat() == 1 ) {
659 driv = fCells[i]->GetDriv();
660 if (driv < std::numeric_limits<float>::epsilon())
665 if (xDiv <= std::numeric_limits<Double_t>::epsilon() ||
666 xDiv >= 1.0 - std::numeric_limits<Double_t>::epsilon())
670 if (GetMaxDepth() > 0)
671 bCutMaxDepth = fCells[i]->GetDepth() < GetMaxDepth();
675 bCutNmin = GetCellElement(fCells[i], 0) > GetNmin();
678 if(driv > drivMax && bCutNmin && bCutMaxDepth) {
687 Log() << kVERBOSE <<
"Warning: No cell with more than "
688 << GetNmin() <<
" events found!" <<
Endl;
689 else if (!bCutMaxDepth)
690 Log() << kVERBOSE <<
"Warning: Maximum depth reached: "
691 << GetMaxDepth() <<
Endl;
693 Log() << kWARNING <<
"<PDEFoam::PeekMax>: no more candidate cells (drivMax>0) found for further splitting." <<
Endl;
714 if(fLastCe+1 >= fNCells) Log() << kFATAL <<
"Buffer limit is reached, fLastCe=fnBuf" <<
Endl;
721 if( kBest<0 || kBest>=fDim ) Log() << kFATAL <<
"Wrong kBest" <<
Endl;
727 Int_t d1 = CellFill(1, cell);
728 Int_t d2 = CellFill(1, cell);
732 Explore( (fCells[d1]) );
733 Explore( (fCells[d2]) );
748 std::vector<Double_t> xvec;
749 xvec.reserve(GetTotDim());
750 for (
Int_t idim = 0; idim < GetTotDim(); ++idim)
751 xvec.push_back( VarTransformInvers(idim, xRand[idim]) );
753 return GetDistr()->Density(xvec, event_density);
764 fTimer->Init(fNCells);
769 while ( (fLastCe+2) < fNCells ) {
772 if ( (iCell<0) || (iCell>fLastCe) ) {
773 Log() << kVERBOSE <<
"Break: "<< fLastCe+1 <<
" cells created" <<
Endl;
775 for (
Long_t jCell=fLastCe+1; jCell<fNCells; jCell++)
776 delete fCells[jCell];
780 newCell = fCells[iCell];
784 if ( Divide( newCell )==0)
break;
789 Log() << kVERBOSE << GetNActiveCells() <<
" active cells created" <<
Endl;
799 if(fDim==0) Log() << kFATAL <<
"SetInhiDiv: fDim=0" <<
Endl;
801 fInhiDiv =
new Int_t[ fDim ];
802 for(
Int_t i=0; i<fDim; i++) fInhiDiv[i]=0;
805 if( ( 0<=iDim) && (iDim<fDim)) {
806 fInhiDiv[iDim] = inhiDiv;
808 Log() << kFATAL <<
"Wrong iDim" <<
Endl;
819 Int_t errors, warnings;
823 errors = 0; warnings = 0;
824 if (level==1) Log() << kVERBOSE <<
"Performing consistency checks for created foam" <<
Endl;
825 for(iCell=1; iCell<=fLastCe; iCell++) {
826 cell = fCells[iCell];
831 if (level==1) Log() << kFATAL <<
"ERROR: Cell's no %d has only one daughter " << iCell <<
Endl;
835 if (level==1) Log() << kFATAL <<
"ERROR: Cell's no %d has no daughter and is inactive " << iCell <<
Endl;
839 if (level==1) Log() << kFATAL <<
"ERROR: Cell's no %d has two daughters and is active " << iCell <<
Endl;
843 if( (cell->
GetPare())!=fCells[0] ) {
846 if (level==1) Log() << kFATAL <<
"ERROR: Cell's no %d parent not pointing to this cell " << iCell <<
Endl;
854 if (level==1) Log() << kFATAL <<
"ERROR: Cell's no %d daughter 0 not pointing to this cell " << iCell <<
Endl;
860 if (level==1) Log() << kFATAL <<
"ERROR: Cell's no %d daughter 1 not pointing to this cell " << iCell <<
Endl;
865 if(level==1) Log() << kFATAL <<
"ERROR: Cell no. " << iCell <<
" has Volume of <1E-50" <<
Endl;
870 for(iCell=0; iCell<=fLastCe; iCell++) {
871 cell = fCells[iCell];
874 if(level==1) Log() << kFATAL <<
"ERROR: Cell no. " << iCell <<
" is active but Volume is 0 " <<
Endl;
879 Log() << kVERBOSE <<
"Check has found " << errors <<
" errors and " << warnings <<
" warnings." <<
Endl;
882 Info(
"CheckAll",
"Check - found total %d errors \n",errors);
892 if (iCell < 0 || iCell > fLastCe) {
893 Log() << kWARNING <<
"<PrintCell(iCell=" << iCell
894 <<
")>: cell number " << iCell <<
" out of bounds!"
900 fCells[iCell]->GetHcub(cellPosi,cellSize);
901 Int_t kBest = fCells[iCell]->GetBest();
902 Double_t xBest = fCells[iCell]->GetXdiv();
904 Log() <<
"Cell[" << iCell <<
"]={ ";
905 Log() <<
" " << fCells[iCell] <<
" " <<
Endl;
906 Log() <<
" Xdiv[abs. coord.]="
907 << VarTransformInvers(kBest,cellPosi[kBest] + xBest*cellSize[kBest])
909 Log() <<
" Abs. coord. = (";
910 for (
Int_t idim=0; idim<fDim; idim++) {
911 Log() <<
"dim[" << idim <<
"]={"
912 << VarTransformInvers(idim,cellPosi[idim]) <<
","
913 << VarTransformInvers(idim,cellPosi[idim] + cellSize[idim])
918 Log() <<
")" <<
Endl;
919 fCells[iCell]->
Print(
"1");
921 Log() <<
"Elements: [";
925 if (i>0) Log() <<
", ";
926 Log() << GetCellElement(fCells[iCell], i);
930 Log() <<
"]" <<
Endl;
939 for(
Long_t iCell=0; iCell<=fLastCe; iCell++)
953 std::vector<Float_t> values = ev->
GetValues();
954 std::vector<Float_t> tvalues = VarTransform(values);
959 SetCellElement(cell, 0, GetCellElement(cell, 0) + wt);
960 SetCellElement(cell, 1, GetCellElement(cell, 1) + wt*wt);
970 Log() << kVERBOSE <<
"Delete cell elements" <<
Endl;
971 for (
Long_t iCell = 0; iCell < fNCells; ++iCell) {
972 TObject* elements = fCells[iCell]->GetElement();
975 fCells[iCell]->SetElement(NULL);
1013 std::vector<Float_t> txvec(VarTransform(xvec));
1015 return GetCellValue(FindCell(txvec), cv);
1017 return kernel->
Estimate(
this, txvec, cv);
1041 std::map<Int_t,Float_t> txvec;
1042 for (std::map<Int_t,Float_t>::const_iterator it=xvec.begin(); it!=xvec.end(); ++it)
1043 txvec.insert(std::pair<Int_t, Float_t>(it->first, VarTransform(it->first, it->second)));
1046 std::vector<PDEFoamCell*> cells = FindCells(txvec);
1049 std::vector<Float_t> cell_values;
1050 cell_values.reserve(cells.size());
1051 for (std::vector<PDEFoamCell*>::const_iterator cell_it=cells.begin();
1052 cell_it != cells.end(); ++cell_it)
1053 cell_values.push_back(GetCellValue(*cell_it, cv));
1077 PDEFoamVect cellPosi0(GetTotDim()), cellSize0(GetTotDim());
1085 cell0->
GetHcub(cellPosi0,cellSize0);
1087 if (xvec.at(idim)<=cellPosi0[idim]+cellSize0[idim])
1115 PDEFoamVect cellPosi0(GetTotDim()), cellSize0(GetTotDim());
1123 map<Int_t, Float_t>::const_iterator it = txvec.find(idim);
1125 if (it != txvec.end()){
1129 cell0->
GetHcub(cellPosi0,cellSize0);
1131 if (it->second <= cellPosi0[idim] + cellSize0[idim])
1137 FindCells(txvec, cell->
GetDau0(), cells);
1138 FindCells(txvec, cell->
GetDau1(), cells);
1142 cells.push_back(cell);
1163 std::map<Int_t, Float_t> txvec_map;
1164 for (
UInt_t i=0; i<txvec.size(); ++i)
1165 txvec_map.insert(std::pair<Int_t, Float_t>(i, txvec.at(i)));
1168 std::vector<PDEFoamCell*> cells(0);
1171 FindCells(txvec_map, fCells[0], cells);
1194 std::vector<PDEFoamCell*> cells(0);
1197 FindCells(txvec, fCells[0], cells);
1216 if ( GetTotDim()!=1 )
1217 Log() << kFATAL <<
"<Draw1Dim>: function can only be used for 1-dimensional foams!"
1223 h1=
new TH1D(hname,
"1-dimensional Foam", nbin, fXmin[0], fXmax[0]);
1225 if (!
h1) Log() << kFATAL <<
"ERROR: Can not create histo" << hname <<
Endl;
1230 std::vector<Float_t> txvec;
1233 if (kernel != NULL) {
1235 val = kernel->
Estimate(
this, txvec, cell_value);
1237 val = GetCellValue(FindCell(txvec), cell_value);
1268 if ((idim1>=GetTotDim()) || (idim1<0) ||
1269 (idim2>=GetTotDim()) || (idim2<0) ||
1271 Log() << kFATAL <<
"<Project2>: wrong dimensions given: "
1272 << idim1 <<
", " << idim2 <<
Endl;
1278 Log() << kWARNING <<
"Warning: number of bins too big: " << nbin
1279 <<
" Using 1000 bins for each dimension instead." <<
Endl;
1281 }
else if (nbin<1) {
1282 Log() << kWARNING <<
"Wrong bin number: " << nbin
1283 <<
"; set nbin=50" <<
Endl;
1293 h1 =
new TH2D(hname.
Data(),
TString::Format(
"var%d vs var%d",idim1,idim2).
Data(), nbin, fXmin[idim1], fXmax[idim1], nbin, fXmin[idim2], fXmax[idim2]);
1295 if (!
h1) Log() << kFATAL <<
"ERROR: Can not create histo" << hname <<
Endl;
1303 std::map<Int_t, Float_t> txvec;
1309 std::vector<TMVA::PDEFoamCell*> cells = FindCells(txvec);
1314 for (std::vector<TMVA::PDEFoamCell*>::const_iterator it = cells.begin();
1315 it != cells.end(); ++it) {
1317 PDEFoamVect cellPosi(GetTotDim()), cellSize(GetTotDim());
1318 (*it)->GetHcub(cellPosi,cellSize);
1321 std::vector<Float_t> tvec;
1322 for (
Int_t i=0; i<GetTotDim(); ++i) {
1323 if ( i != idim1 && i != idim2 )
1324 tvec.push_back(cellPosi[i] + 0.5*cellSize[i]);
1326 tvec.push_back(txvec[i]);
1328 if (kernel != NULL) {
1330 sum_cv += kernel->
Estimate(
this, tvec, cell_value);
1332 sum_cv += GetCellValue(FindCell(tvec), cell_value);
1357 return GetCellElement(cell, 0);
1360 return GetCellElement(cell, 1);
1362 case kValueDensity: {
1365 if (volume > numeric_limits<double>::epsilon()) {
1366 return GetCellValue(cell, kValue)/volume;
1370 Log() << kWARNING <<
"<GetCellDensity(cell)>: ERROR: cell volume"
1371 <<
" negative or zero!"
1372 <<
" ==> return cell density 0!"
1373 <<
" cell volume=" << volume
1374 <<
" cell entries=" << GetCellValue(cell, kValue) <<
Endl;
1376 Log() << kWARNING <<
"<GetCellDensity(cell)>: WARNING: cell volume"
1377 <<
" close to zero!"
1378 <<
" cell volume: " << volume <<
Endl;
1400 Log() << kFATAL <<
"<GetCellValue>: unknown cell value" <<
Endl;
1442 Log() << kFATAL <<
"<SetCellElement> ERROR: cell element is not a TVectorD*" <<
Endl;
1458 Log() << kINFO <<
"Elapsed time: " + fTimer->GetElapsedTime()
1465 if (fNCells >= 100) modulo =
Int_t(fNCells/100);
1466 if (fLastCe%modulo == 0) fTimer->DrawProgressBar( fLastCe );
1509 if (GetTotDim() != 2)
1510 Log() << kFATAL <<
"RootPlot2dim() can only be used with "
1511 <<
"two-dimensional foams!" <<
Endl;
1514 ECellValue cell_value = kValue;
1518 cell_value = kValue;
1519 }
else if (opt.
Contains(
"rms_ov_mean")){
1520 cell_value = kRmsOvMean;
1527 plotcellnumber =
kTRUE;
1530 std::ofstream outfile(
filename, std::ios::out);
1532 outfile<<
"{" << std::endl;
1537 outfile <<
"TColor *graycolors[100];" << std::endl;
1538 outfile <<
"for (Int_t i=0.; i<100; i++)" << std::endl;
1539 outfile <<
" graycolors[i]=new TColor(1000+i, 1-(Float_t)i/100.,1-(Float_t)i/100.,1-(Float_t)i/100.);"<< std::endl;
1542 outfile <<
"cMap = new TCanvas(\"" << fName <<
"\",\"Cell Map for "
1543 << fName <<
"\",600,600);" << std::endl;
1545 outfile<<
"TBox*a=new TBox();"<<std::endl;
1546 outfile<<
"a->SetFillStyle(0);"<<std::endl;
1547 outfile<<
"a->SetLineWidth(4);"<<std::endl;
1548 outfile<<
"TBox *b1=new TBox();"<<std::endl;
1549 outfile<<
"TText*t=new TText();"<<std::endl;
1551 outfile << (colors ?
"gStyle->SetPalette(1, 0);" :
"gStyle->SetPalette(0);")
1553 outfile <<
"b1->SetFillStyle(1001);"<<std::endl;
1554 outfile<<
"TBox *b2=new TBox();"<<std::endl;
1555 outfile <<
"b2->SetFillStyle(0);"<<std::endl;
1558 outfile <<
"b1->SetFillStyle(0);"<<std::endl;
1570 for (
Long_t iCell=1; iCell<=fLastCe; iCell++) {
1571 if ( fCells[iCell]->GetStat() == 1) {
1572 Float_t value = GetCellValue(fCells[iCell], cell_value);
1579 outfile <<
"// observed minimum and maximum of distribution: " << std::endl;
1580 outfile <<
"// Float_t zmin = "<< zmin <<
";" << std::endl;
1581 outfile <<
"// Float_t zmax = "<< zmax <<
";" << std::endl;
1584 outfile <<
"// used minimum and maximum of distribution (taking into account log scale if applicable): " << std::endl;
1585 outfile <<
"Float_t zmin = "<< zmin <<
";" << std::endl;
1586 outfile <<
"Float_t zmax = "<< zmax <<
";" << std::endl;
1592 Float_t scale = (ncolors-1)/(zmax - zmin);
1593 PDEFoamVect cellPosi(GetTotDim()), cellSize(GetTotDim());
1597 outfile <<
"// =========== Rectangular cells ==========="<< std::endl;
1598 for (
Long_t iCell=1; iCell<=fLastCe; iCell++) {
1599 if ( fCells[iCell]->GetStat() == 1) {
1600 fCells[iCell]->GetHcub(cellPosi,cellSize);
1601 x1 = offs+lpag*(cellPosi[0]);
1602 y1 = offs+lpag*(cellPosi[1]);
1603 x2 = offs+lpag*(cellPosi[0]+cellSize[0]);
1604 y2 = offs+lpag*(cellPosi[1]+cellSize[1]);
1608 Float_t value = GetCellValue(fCells[iCell], cell_value);
1618 outfile <<
"b1->SetFillColor(" << color <<
");" << std::endl;
1622 outfile<<
"b1->DrawBox("<<
x1<<
","<<
y1<<
","<<
x2<<
","<<
y2<<
");"<<std::endl;
1624 outfile<<
"b2->DrawBox("<<
x1<<
","<<
y1<<
","<<
x2<<
","<<
y2<<
");"<<std::endl;
1627 if (plotcellnumber) {
1628 outfile<<
"t->SetTextColor(4);"<<std::endl;
1630 outfile<<
"t->SetTextSize(0.025);"<<std::endl;
1631 else if(fLastCe<251)
1632 outfile<<
"t->SetTextSize(0.015);"<<std::endl;
1634 outfile<<
"t->SetTextSize(0.008);"<<std::endl;
1635 x = offs+lpag*(cellPosi[0]+0.5*cellSize[0]);
1636 y = offs+lpag*(cellPosi[1]+0.5*cellSize[1]);
1637 outfile<<
"t->DrawText("<<
x<<
","<<
y<<
","<<
"\""<<iCell<<
"\""<<
");"<<std::endl;
1641 outfile<<
"// ============== End Rectangles ==========="<< std::endl;
1643 outfile <<
"}" << std::endl;
1654 GetDistr()->FillBinarySearchTree(ev);
1663 if(fDistr)
delete fDistr;
static const Float_t kVlow
static const Float_t kHigh
int Int_t
Signed integer 4 bytes (int)
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
float Float_t
Float 4 bytes (float)
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
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 filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmin
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 x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t wmax
Option_t Option_t TPoint TPoint const char y1
R__EXTERN TStyle * gStyle
TVectorT< Double_t > TVectorD
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
TDirectory::TContext keeps track and restore the current directory.
1-D histogram with a double per channel (see TH1 documentation)
virtual Double_t GetBinCenter(Int_t bin) const
Return bin center for 1D histogram.
virtual Int_t GetNbinsY() const
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.
2-D histogram with a double per channel (see TH1 documentation)
std::vector< Float_t > & GetValues()
ostringstream derivative to redirect and format output
void Fill(Int_t, PDEFoamCell *, PDEFoamCell *, PDEFoamCell *)
Fills in certain data into newly allocated cell.
void SetDau0(PDEFoamCell *Daug)
void SetXdiv(Double_t Xdiv)
void SetElement(TObject *fobj)
void CalcVolume()
Calculates volume of the cell using size params which are calculated.
PDEFoamCell * GetPare() const
PDEFoamCell * GetDau1() const
PDEFoamCell * GetDau0() const
void SetDau1(PDEFoamCell *Daug)
Double_t GetVolume() const
TObject * GetElement() const
void SetDriv(Double_t Driv)
void GetHcub(PDEFoamVect &, PDEFoamVect &) const
Provides size and position of the cell These parameter are calculated by analyzing information in all...
void SetIntg(Double_t Intg)
void Print(Option_t *option) const override
Printout of the cell geometry parameters for the debug purpose.
This class is the abstract kernel interface for PDEFoam.
virtual Float_t Estimate(PDEFoam *, std::vector< Float_t > &, ECellValue)=0
Implementation of PDEFoam.
Double_t GetCellElement(const PDEFoamCell *cell, UInt_t i) const
Returns cell element i of cell 'cell'.
void DeleteBinarySearchTree()
Delete the foam's density estimator, which contains the binary search tree.
void MakeAlpha()
Internal subprogram used by Create.
TObjArray * fVariableNames
collection of all variable names
virtual Float_t GetCellValue(const std::vector< Float_t > &xvec, ECellValue cv, PDEFoamKernelBase *)
This function finds the cell, which corresponds to the given untransformed event vector 'xvec' and re...
void OutputGrow(Bool_t finished=false)
Overridden function of PDEFoam to avoid native foam output.
void SetCellElement(PDEFoamCell *cell, UInt_t i, Double_t value)
Set cell element i of cell to value.
Int_t Divide(PDEFoamCell *)
Internal subprogram used by Create.
void PrintCell(Long_t iCell=0)
Prints geometry of and elements of 'iCell', as well as relations to parent and daughter cells.
void ResetCellElements()
Remove the cell elements from all cells.
void Grow()
Internal subprogram used by Create.
TH1D * Draw1Dim(ECellValue cell_value, Int_t nbin, PDEFoamKernelBase *kernel=nullptr)
Draws 1-dimensional foam (= histogram)
Double_t Eval(Double_t *xRand, Double_t &event_density)
Internal subprogram.
void PrintCells()
Prints geometry of ALL cells of the FOAM.
void SetXmax(Int_t idim, Double_t wmax)
set upper foam bound in dimension idim
virtual ~PDEFoam()
Default destructor.
PDEFoam()
Default constructor for streamer, user should not use it.
virtual TH2D * Project2(Int_t idim1, Int_t idim2, ECellValue cell_value=kValue, PDEFoamKernelBase *kernel=nullptr, UInt_t nbin=50)
Project foam variable idim1 and variable idim2 to histogram.
virtual Bool_t CellValueIsUndefined(PDEFoamCell *)
Returns true, if the value of the given cell is undefined.
virtual void FillFoamCells(const Event *ev, Float_t wt)
This function fills a weight 'wt' into the PDEFoam cell, which corresponds to the given event 'ev'.
void Create()
Basic initialization of FOAM invoked by the user.
void SetInhiDiv(Int_t, Int_t)
This can be called before Create, after setting kDim It defines which variables are excluded in the p...
void InitCells()
Internal subprogram used by Create.
PDEFoamCell * FindCell(const std::vector< Float_t > &) const
Find cell that contains 'xvec' (in foam coordinates [0,1]).
void FillBinarySearchTree(const Event *ev)
Insert event to internal foam's density estimator PDEFoamDensityBase.
virtual void Explore(PDEFoamCell *Cell)
Internal subprogram used by Create.
void SetXmin(Int_t idim, Double_t wmin)
set lower foam bound in dimension idim
std::vector< TMVA::PDEFoamCell * > FindCells(const std::vector< Float_t > &) const
Find all cells, that contain txvec.
void Varedu(Double_t[5], Int_t &, Double_t &, Double_t &)
Internal subprogram used by Create.
Int_t CellFill(Int_t, PDEFoamCell *)
Internal subprogram used by Create.
Long_t PeekMax()
Internal subprogram used by Create.
void RootPlot2dim(const TString &filename, TString opt, Bool_t createCanvas=kTRUE, Bool_t colors=kTRUE)
Debugging tool which plots the cells of a 2-dimensional PDEFoam as rectangles in C++ format readable ...
void CheckAll(Int_t)
User utility, miscellaneous and debug.
void SetDim(Int_t kDim)
Sets dimension of cubical space.
Timing information for training and evaluation of MVA methods.
Mother of all ROOT objects.
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
Random number generator class based on M.
const char * Data() const
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
void SetPalette(Int_t ncolors=kBird, Int_t *colors=nullptr, Float_t alpha=1.)
See TColor::SetPalette.
Int_t GetColorPalette(Int_t i) const
Return color number i in current palette.
Int_t GetNumberOfColors() const
Return number of colors in the color palette.
TVectorT< Element > & Zero()
Set vector elements to zero.
TVectorT< Element > & ResizeTo(Int_t lwb, Int_t upb)
Resize the vector to [lwb:upb] .
MsgLogger & Endl(MsgLogger &ml)
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.