105 static const
Float_t kHigh= FLT_MAX;
136 fFillFoamWithOrigWeights(
kFALSE),
137 fDTSeparation(
kFoam),
140 fTimer(new
Timer(0, "PDEFoam", kTRUE)),
146 fVariableNames->SetOwner(kTRUE);
175 fFillFoamWithOrigWeights(
kFALSE),
176 fDTSeparation(
kFoam),
183 if(strlen(name) > 128)
196 delete fVariableNames;
198 if (fDistr)
delete fDistr;
199 if (fPseRan)
delete fPseRan;
200 if (fXmin) {
delete [] fXmin; fXmin=0; }
201 if (fXmax) {
delete [] fXmax; fXmax=0; }
205 for(
Int_t i=0; i<fNCells; i++)
delete fCells[i];
242 , fFillFoamWithOrigWeights(
kFALSE)
243 , fDTSeparation(
kFoam)
250 Log() <<
kFATAL <<
"COPY CONSTRUCTOR NOT IMPLEMENTED" <<
Endl;
263 Log() <<
kFATAL <<
"<SetDim>: Dimension is zero or negative!" <<
Endl;
266 if (fXmin)
delete [] fXmin;
267 if (fXmax)
delete [] fXmax;
277 if (idim<0 || idim>=GetTotDim())
278 Log() <<
kFATAL <<
"<SetXmin>: Dimension out of bounds!" <<
Endl;
288 if (idim<0 || idim>=GetTotDim())
289 Log() <<
kFATAL <<
"<SetXmax>: Dimension out of bounds!" <<
Endl;
307 if(fPseRan==0)
Log() <<
kFATAL <<
"Random number generator not set" <<
Endl;
308 if(fDistr==0)
Log() <<
kFATAL <<
"Distribution function not set" <<
Endl;
309 if(fDim==0)
Log() <<
kFATAL <<
"Zero dimension not allowed" <<
Endl;
316 if(fRvec==0)
Log() <<
kFATAL <<
"Cannot initialize buffer fRvec" <<
Endl;
320 if(fAlpha==0)
Log() <<
kFATAL <<
"Cannot initialize buffer fAlpha" <<
Endl;
325 fInhiDiv =
new Int_t[fDim];
326 for(
Int_t i=0; i<fDim; i++) fInhiDiv[i]=0;
330 fMaskDiv =
new Int_t[fDim];
331 for(
Int_t i=0; i<fDim; i++) fMaskDiv[i]=1;
335 for(
Int_t i=0; i<fDim; i++){
337 hname = fName+
TString(
"_HistEdge_");
339 htitle = TString(
"Edge Histogram No. ");
341 (*fHistEdg)[i] =
new TH1D(hname.
Data(),htitle.
Data(),fNBin,0.0, 1.0);
342 ((
TH1D*)(*fHistEdg)[i])->Sumw2();
370 for(
Int_t i=0; i<fNCells; i++)
delete fCells[i];
376 Log() <<
kFATAL <<
"not enough memory to create " << fNCells
379 for(
Int_t i=0; i<fNCells; i++){
381 fCells[i]->SetSerial(i);
390 for(
Long_t iCell=0; iCell<=fLastCe; iCell++){
391 Explore( fCells[iCell] );
402 if (fLastCe==fNCells){
407 cell = fCells[fLastCe];
409 cell->
Fill(status, parent, 0, 0);
462 cell->
GetHcub(cellPosi,cellSize);
472 for (
Int_t idim = 0; idim < fDim; ++idim)
473 vol_scale *= fXmax[idim] - fXmin[idim];
479 toteventsOld = GetCellElement(cell, 0);
490 for (i=0;i<fDim;i++) ((
TH1D *)(*fHistEdg)[i])->Reset();
494 for (iev=0;iev<fNSampl;iev++){
497 if (fDim>0)
for (j=0; j<fDim; j++) xRand[j]= cellPosi[j] +fAlpha[j]*(cellSize[j]);
499 wt = dx*
Eval(xRand, event_density);
500 totevents += event_density;
504 for (k=0; k<fDim; k++) {
506 ((
TH1D *)(*fHistEdg)[nProj])->Fill(xproj,wt);
514 if (ceSum[3]>wt) ceSum[3]=wt;
515 if (ceSum[4]<wt) ceSum[4]=wt;
517 if (ceSum[1]>0) nevEff = ceSum[0]*ceSum[0]/ceSum[1];
519 if ( nevEff >= fNBin*fEvPerBin)
break;
523 if (fNSampl>0) totevents /= fNSampl;
527 if (cell==fCells[0] && ceSum[0]<=0.0){
529 Log() <<
kFATAL <<
"No events were found during exploration of "
530 <<
"root cell. Please check PDEFoam parameters nSampl "
531 <<
"and VolFrac." <<
Endl;
533 Log() <<
kWARNING <<
"Negative number of events found during "
534 <<
"exploration of root cell" <<
Endl;
539 for (k=0; k<fDim;k++){
541 if ( fInhiDiv[k]==1) fMaskDiv[k] =0;
548 Double_t intTrue = ceSum[0]/(nevMC+0.000001);
551 if (kBest == -1) Varedu(ceSum,kBest,xBest,yBest);
552 intDriv =
sqrt(ceSum[1]/nevMC) -intTrue;
559 SetCellElement(cell, 0, totevents);
563 for (parent = cell->
GetPare(); parent!=0; parent = parent->
GetPare()){
566 parent->
SetIntg( parIntg +intTrue -intOld );
567 parent->
SetDriv( parDriv +intDriv -driOld );
568 SetCellElement( parent, 0, GetCellElement(parent, 0) + totevents - toteventsOld);
593 for(
Int_t kProj=0; kProj<fDim; kProj++) {
594 if( fMaskDiv[kProj]) {
601 for(
Int_t jLo=1; jLo<=fNBin; jLo++) {
603 for(
Int_t jUp=jLo; jUp<=fNBin;jUp++) {
604 aswIn += ((
TH1D *)(*fHistEdg)[kProj])->GetBinContent(jUp);
605 asswIn += Sqr(((
TH1D *)(*fHistEdg)[kProj])->GetBinError( jUp));
611 else sswIn =
sqrt(asswIn) /
sqrt(nent*(xUp-xLo)) *(xUp-xLo);
614 else sswOut=
sqrt(sswAll-asswIn)/
sqrt(nent*(1.0-xUp+xLo)) *(1.0-xUp+xLo);
615 if( (sswIn+sswOut) < sswtBest) {
616 sswtBest = sswIn+sswOut;
633 if(iLo == 0) xBest=yBest;
634 if(iUp == fNBin) yBest=xBest;
639 if( (kBest >= fDim) || (kBest<0) )
650 fPseRan->RndmArray(fDim,fRvec);
651 for(
Int_t k=0; k<fDim; k++) fAlpha[k] = fRvec[k];
671 for(i=0; i<=fLastCe; i++) {
672 if( fCells[i]->GetStat() == 1 ) {
674 driv = fCells[i]->GetDriv();
685 if (GetMaxDepth() > 0)
686 bCutMaxDepth = fCells[i]->GetDepth() < GetMaxDepth();
690 bCutNmin = GetCellElement(fCells[i], 0) > GetNmin();
693 if(driv > drivMax && bCutNmin && bCutMaxDepth) {
702 Log() <<
kVERBOSE <<
"Warning: No cell with more than "
703 << GetNmin() <<
" events found!" <<
Endl;
704 else if (!bCutMaxDepth)
705 Log() <<
kVERBOSE <<
"Warning: Maximum depth reached: "
706 << GetMaxDepth() <<
Endl;
708 Log() <<
kWARNING <<
"<PDEFoam::PeekMax>: no more candidate cells (drivMax>0) found for further splitting." <<
Endl;
729 if(fLastCe+1 >= fNCells)
Log() <<
kFATAL <<
"Buffer limit is reached, fLastCe=fnBuf" <<
Endl;
736 if( kBest<0 || kBest>=fDim )
Log() <<
kFATAL <<
"Wrong kBest" <<
Endl;
742 Int_t d1 = CellFill(1, cell);
743 Int_t d2 = CellFill(1, cell);
747 Explore( (fCells[d1]) );
748 Explore( (fCells[d2]) );
763 std::vector<Double_t> xvec;
764 xvec.reserve(GetTotDim());
765 for (
Int_t idim = 0; idim < GetTotDim(); ++idim)
766 xvec.push_back( VarTransformInvers(idim, xRand[idim]) );
768 return GetDistr()->Density(xvec, event_density);
779 fTimer->Init(fNCells);
784 while ( (fLastCe+2) < fNCells ) {
787 if ( (iCell<0) || (iCell>fLastCe) ) {
788 Log() <<
kVERBOSE <<
"Break: "<< fLastCe+1 <<
" cells created" <<
Endl;
790 for (
Long_t jCell=fLastCe+1; jCell<fNCells; jCell++)
791 delete fCells[jCell];
795 newCell = fCells[iCell];
799 if ( Divide( newCell )==0)
break;
804 Log() <<
kVERBOSE << GetNActiveCells() <<
" active cells created" <<
Endl;
816 fInhiDiv =
new Int_t[ fDim ];
817 for(
Int_t i=0; i<fDim; i++) fInhiDiv[i]=0;
820 if( ( 0<=iDim) && (iDim<fDim)) {
821 fInhiDiv[iDim] = inhiDiv;
834 Int_t errors, warnings;
838 errors = 0; warnings = 0;
839 if (level==1)
Log() <<
kVERBOSE <<
"Performing consistency checks for created foam" <<
Endl;
840 for(iCell=1; iCell<=fLastCe; iCell++) {
841 cell = fCells[iCell];
846 if (level==1)
Log() <<
kFATAL <<
"ERROR: Cell's no %d has only one daughter " << iCell <<
Endl;
850 if (level==1)
Log() <<
kFATAL <<
"ERROR: Cell's no %d has no daughter and is inactive " << iCell <<
Endl;
854 if (level==1)
Log() <<
kFATAL <<
"ERROR: Cell's no %d has two daughters and is active " << iCell <<
Endl;
858 if( (cell->
GetPare())!=fCells[0] ) {
861 if (level==1)
Log() <<
kFATAL <<
"ERROR: Cell's no %d parent not pointing to this cell " << iCell <<
Endl;
867 if(cell != (cell->
GetDau0())->GetPare()) {
869 if (level==1)
Log() <<
kFATAL <<
"ERROR: Cell's no %d daughter 0 not pointing to this cell " << iCell <<
Endl;
873 if(cell != (cell->
GetDau1())->GetPare()) {
875 if (level==1)
Log() <<
kFATAL <<
"ERROR: Cell's no %d daughter 1 not pointing to this cell " << iCell <<
Endl;
880 if(level==1)
Log() <<
kFATAL <<
"ERROR: Cell no. " << iCell <<
" has Volume of <1E-50" <<
Endl;
885 for(iCell=0; iCell<=fLastCe; iCell++) {
886 cell = fCells[iCell];
889 if(level==1)
Log() <<
kFATAL <<
"ERROR: Cell no. " << iCell <<
" is active but Volume is 0 " <<
Endl;
894 Log() <<
kVERBOSE <<
"Check has found " << errors <<
" errors and " << warnings <<
" warnings." <<
Endl;
897 Info(
"CheckAll",
"Check - found total %d errors \n",errors);
907 if (iCell < 0 || iCell > fLastCe) {
909 <<
")>: cell number " << iCell <<
" out of bounds!"
915 fCells[iCell]->GetHcub(cellPosi,cellSize);
916 Int_t kBest = fCells[iCell]->GetBest();
917 Double_t xBest = fCells[iCell]->GetXdiv();
919 Log() <<
"Cell[" << iCell <<
"]={ ";
920 Log() <<
" " << fCells[iCell] <<
" " <<
Endl;
921 Log() <<
" Xdiv[abs. coord.]="
922 << VarTransformInvers(kBest,cellPosi[kBest] + xBest*cellSize[kBest])
924 Log() <<
" Abs. coord. = (";
925 for (
Int_t idim=0; idim<fDim; idim++) {
926 Log() <<
"dim[" << idim <<
"]={"
927 << VarTransformInvers(idim,cellPosi[idim]) <<
","
928 << VarTransformInvers(idim,cellPosi[idim] + cellSize[idim])
934 fCells[iCell]->
Print(
"1");
936 Log() <<
"Elements: [";
940 if (i>0)
Log() <<
", ";
941 Log() << GetCellElement(fCells[iCell], i);
954 for(
Long_t iCell=0; iCell<=fLastCe; iCell++)
968 std::vector<Float_t> values = ev->
GetValues();
969 std::vector<Float_t> tvalues = VarTransform(values);
974 SetCellElement(cell, 0, GetCellElement(cell, 0) + wt);
975 SetCellElement(cell, 1, GetCellElement(cell, 1) + wt*wt);
986 for (
Long_t iCell = 0; iCell < fNCells; ++iCell) {
987 TObject* elements = fCells[iCell]->GetElement();
990 fCells[iCell]->SetElement(
NULL);
1028 std::vector<Float_t> txvec(VarTransform(xvec));
1030 return GetCellValue(FindCell(txvec), cv);
1032 return kernel->
Estimate(
this, txvec, cv);
1056 std::map<Int_t,Float_t> txvec;
1057 for (std::map<Int_t,Float_t>::const_iterator it=xvec.begin(); it!=xvec.end(); ++it)
1058 txvec.insert(std::pair<Int_t, Float_t>(it->first, VarTransform(it->first, it->second)));
1061 std::vector<PDEFoamCell*> cells = FindCells(txvec);
1064 std::vector<Float_t> cell_values;
1065 cell_values.reserve(cells.size());
1066 for (std::vector<PDEFoamCell*>::const_iterator cell_it=cells.begin();
1067 cell_it != cells.end(); ++cell_it)
1068 cell_values.push_back(GetCellValue(*cell_it, cv));
1092 PDEFoamVect cellPosi0(GetTotDim()), cellSize0(GetTotDim());
1100 cell0->
GetHcub(cellPosi0,cellSize0);
1102 if (xvec.at(idim)<=cellPosi0[idim]+cellSize0[idim])
1130 PDEFoamVect cellPosi0(GetTotDim()), cellSize0(GetTotDim());
1138 map<Int_t, Float_t>::const_iterator it = txvec.find(idim);
1140 if (it != txvec.end()){
1144 cell0->
GetHcub(cellPosi0,cellSize0);
1146 if (it->second <= cellPosi0[idim] + cellSize0[idim])
1152 FindCells(txvec, cell->
GetDau0(), cells);
1153 FindCells(txvec, cell->
GetDau1(), cells);
1157 cells.push_back(cell);
1178 std::map<Int_t, Float_t> txvec_map;
1179 for (
UInt_t i=0; i<txvec.size(); ++i)
1180 txvec_map.insert(std::pair<Int_t, Float_t>(i, txvec.at(i)));
1183 std::vector<PDEFoamCell*> cells(0);
1186 FindCells(txvec_map, fCells[0], cells);
1209 std::vector<PDEFoamCell*> cells(0);
1212 FindCells(txvec, fCells[0], cells);
1231 if ( GetTotDim()!=1 )
1232 Log() <<
kFATAL <<
"<Draw1Dim>: function can only be used for 1-dimensional foams!"
1238 h1=
new TH1D(hname,
"1-dimensional Foam", nbin, fXmin[0], fXmax[0]);
1240 if (!h1)
Log() <<
kFATAL <<
"ERROR: Can not create histo" << hname <<
Endl;
1245 std::vector<Float_t> txvec;
1246 txvec.push_back( VarTransform(0, h1->
GetBinCenter(ibinx)) );
1248 if (kernel !=
NULL) {
1250 val = kernel->
Estimate(
this, txvec, cell_value);
1252 val = GetCellValue(FindCell(txvec), cell_value);
1283 if ((idim1>=GetTotDim()) || (idim1<0) ||
1284 (idim2>=GetTotDim()) || (idim2<0) ||
1286 Log() <<
kFATAL <<
"<Project2>: wrong dimensions given: "
1287 << idim1 <<
", " << idim2 <<
Endl;
1293 Log() <<
kWARNING <<
"Warning: number of bins too big: " << nbin
1294 <<
" Using 1000 bins for each dimension instead." <<
Endl;
1296 }
else if (nbin<1) {
1298 <<
"; set nbin=50" <<
Endl;
1308 h1=
new TH2D(hname.
Data(),
Form(
"var%d vs var%d",idim1,idim2), nbin, fXmin[idim1], fXmax[idim1], nbin, fXmin[idim2], fXmax[idim2]);
1310 if (!h1)
Log() <<
kFATAL <<
"ERROR: Can not create histo" << hname <<
Endl;
1318 std::map<Int_t, Float_t> txvec;
1324 std::vector<TMVA::PDEFoamCell*> cells = FindCells(txvec);
1329 for (std::vector<TMVA::PDEFoamCell*>::const_iterator it = cells.begin();
1330 it != cells.end(); ++it) {
1332 PDEFoamVect cellPosi(GetTotDim()), cellSize(GetTotDim());
1333 (*it)->GetHcub(cellPosi,cellSize);
1336 std::vector<Float_t> tvec;
1337 for (
Int_t i=0; i<GetTotDim(); ++i) {
1338 if ( i != idim1 && i != idim2 )
1339 tvec.push_back(cellPosi[i] + 0.5*cellSize[i]);
1341 tvec.push_back(txvec[i]);
1343 if (kernel !=
NULL) {
1345 sum_cv += kernel->
Estimate(
this, tvec, cell_value);
1347 sum_cv += GetCellValue(FindCell(tvec), cell_value);
1372 return GetCellElement(cell, 0);
1375 return GetCellElement(cell, 1);
1381 return GetCellValue(cell,
kValue)/volume;
1385 Log() <<
kWARNING <<
"<GetCellDensity(cell)>: ERROR: cell volume"
1386 <<
" negative or zero!"
1387 <<
" ==> return cell density 0!"
1388 <<
" cell volume=" << volume
1389 <<
" cell entries=" << GetCellValue(cell,
kValue) <<
Endl;
1391 Log() <<
kWARNING <<
"<GetCellDensity(cell)>: WARNING: cell volume"
1392 <<
" close to zero!"
1393 <<
" cell volume: " << volume <<
Endl;
1415 Log() <<
kFATAL <<
"<GetCellValue>: unknown cell value" <<
Endl;
1457 Log() <<
kFATAL <<
"<SetCellElement> ERROR: cell element is not a TVectorD*" <<
Endl;
1473 Log() <<
kINFO <<
"Elapsed time: " + fTimer->GetElapsedTime()
1480 if (fNCells >= 100) modulo =
Int_t(fNCells/100);
1481 if (fLastCe%modulo == 0) fTimer->DrawProgressBar( fLastCe );
1524 if (GetTotDim() != 2)
1525 Log() <<
kFATAL <<
"RootPlot2dim() can only be used with "
1526 <<
"two-dimensional foams!" <<
Endl;
1534 }
else if (opt.
Contains(
"rms_ov_mean")){
1542 plotcellnumber =
kTRUE;
1547 outfile<<
"{" << std::endl;
1552 outfile <<
"TColor *graycolors[100];" << std::endl;
1553 outfile <<
"for (Int_t i=0.; i<100; i++)" << std::endl;
1554 outfile <<
" graycolors[i]=new TColor(1000+i, 1-(Float_t)i/100.,1-(Float_t)i/100.,1-(Float_t)i/100.);"<< std::endl;
1557 outfile <<
"cMap = new TCanvas(\"" << fName <<
"\",\"Cell Map for "
1558 << fName <<
"\",600,600);" << std::endl;
1560 outfile<<
"TBox*a=new TBox();"<<std::endl;
1561 outfile<<
"a->SetFillStyle(0);"<<std::endl;
1562 outfile<<
"a->SetLineWidth(4);"<<std::endl;
1563 outfile<<
"TBox *b1=new TBox();"<<std::endl;
1564 outfile<<
"TText*t=new TText();"<<std::endl;
1566 outfile << (colors ?
"gStyle->SetPalette(1, 0);" :
"gStyle->SetPalette(0);")
1568 outfile <<
"b1->SetFillStyle(1001);"<<std::endl;
1569 outfile<<
"TBox *b2=new TBox();"<<std::endl;
1570 outfile <<
"b2->SetFillStyle(0);"<<std::endl;
1573 outfile <<
"b1->SetFillStyle(0);"<<std::endl;
1585 for (
Long_t iCell=1; iCell<=fLastCe; iCell++) {
1586 if ( fCells[iCell]->GetStat() == 1) {
1587 Float_t value = GetCellValue(fCells[iCell], cell_value);
1594 outfile <<
"// observed minimum and maximum of distribution: " << std::endl;
1595 outfile <<
"// Float_t zmin = "<< zmin <<
";" << std::endl;
1596 outfile <<
"// Float_t zmax = "<< zmax <<
";" << std::endl;
1599 outfile <<
"// used minimum and maximum of distribution (taking into account log scale if applicable): " << std::endl;
1600 outfile <<
"Float_t zmin = "<< zmin <<
";" << std::endl;
1601 outfile <<
"Float_t zmax = "<< zmax <<
";" << std::endl;
1607 Float_t scale = (ncolors-1)/(zmax - zmin);
1608 PDEFoamVect cellPosi(GetTotDim()), cellSize(GetTotDim());
1612 outfile <<
"// =========== Rectangular cells ==========="<< std::endl;
1613 for (
Long_t iCell=1; iCell<=fLastCe; iCell++) {
1614 if ( fCells[iCell]->GetStat() == 1) {
1615 fCells[iCell]->GetHcub(cellPosi,cellSize);
1616 x1 = offs+lpag*(cellPosi[0]);
1617 y1 = offs+lpag*(cellPosi[1]);
1618 x2 = offs+lpag*(cellPosi[0]+cellSize[0]);
1619 y2 = offs+lpag*(cellPosi[1]+cellSize[1]);
1623 Float_t value = GetCellValue(fCells[iCell], cell_value);
1630 color = 1000+(
Int_t((value-zmin)*scale));
1633 outfile <<
"b1->SetFillColor(" << color <<
");" << std::endl;
1637 outfile<<
"b1->DrawBox("<<x1<<
","<<y1<<
","<<x2<<
","<<y2<<
");"<<std::endl;
1639 outfile<<
"b2->DrawBox("<<x1<<
","<<y1<<
","<<x2<<
","<<y2<<
");"<<std::endl;
1642 if (plotcellnumber) {
1643 outfile<<
"t->SetTextColor(4);"<<std::endl;
1645 outfile<<
"t->SetTextSize(0.025);"<<std::endl;
1646 else if(fLastCe<251)
1647 outfile<<
"t->SetTextSize(0.015);"<<std::endl;
1649 outfile<<
"t->SetTextSize(0.008);"<<std::endl;
1650 x = offs+lpag*(cellPosi[0]+0.5*cellSize[0]);
1651 y = offs+lpag*(cellPosi[1]+0.5*cellSize[1]);
1652 outfile<<
"t->DrawText("<<x<<
","<<y<<
","<<
"\""<<iCell<<
"\""<<
");"<<std::endl;
1656 outfile<<
"// ============== End Rectangles ==========="<< std::endl;
1658 outfile <<
"}" << std::endl;
1669 GetDistr()->FillBinarySearchTree(ev);
1678 if(fDistr)
delete fDistr;
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'...
TVectorT< Element > & ResizeTo(Int_t lwb, Int_t upb)
Resize the vector to [lwb:upb] .
Random number generator class based on M.
MsgLogger & Endl(MsgLogger &ml)
void SetElement(TObject *fobj)
Long_t PeekMax()
Internal subprogram used by Create.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
TObjArray * fVariableNames
timer for graphical output
void OutputGrow(Bool_t finished=false)
message logger
R__EXTERN TStyle * gStyle
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
void Fill(Int_t, PDEFoamCell *, PDEFoamCell *, PDEFoamCell *)
Fills in certain data into newly allocated cell.
void Grow()
Internal subrogram used by Create.
static const char * filename()
static Bool_t AddDirectoryStatus()
static function: cannot be inlined on Windows/NT
void SetXmin(Int_t idim, Double_t wmin)
set lower foam bound in dimension idim
TObject * GetElement() const
virtual Int_t GetNbinsX() const
void SetCellElement(PDEFoamCell *cell, UInt_t i, Double_t value)
Set cell element i of cell to value.
Int_t Divide(PDEFoamCell *)
Internal subrogram used by Create.
TH1D * Draw1Dim(ECellValue cell_value, Int_t nbin, PDEFoamKernelBase *kernel=NULL)
Draws 1-dimensional foam (= histogram)
void CheckAll(Int_t)
User utility, miscellaneous and debug.
Double_t GetVolume() const
std::vector< TMVA::PDEFoamCell * > FindCells(const std::vector< Float_t > &) const
Find all cells, that contain txvec.
static void AddDirectory(Bool_t add=kTRUE)
Sets the flag controlling the automatic add of histograms in memory.
Int_t CellFill(Int_t, PDEFoamCell *)
Internal subprogram used by Create.
const char * Data() const
void MakeAlpha()
Internal subrogram used by Create.
virtual Bool_t CellValueIsUndefined(PDEFoamCell *)
Returns true, if the value of the given cell is undefined.
static const double x2[5]
virtual Float_t Estimate(PDEFoam *, std::vector< Float_t > &, ECellValue)=0
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 SetDau1(PDEFoamCell *Daug)
void Info(const char *location, const char *msgfmt,...)
Int_t GetNumberOfColors() const
Return number of colors in the color palette.
void ResetCellElements()
Remove the cell elements from all cells.
virtual void Explore(PDEFoamCell *Cell)
Internal subprogram used by Create.
TVectorT< Double_t > TVectorD
void Print(Option_t *option) const
Printout of the cell geometry parameters for the debug purpose.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
void InitCells()
Internal subprogram used by Create.
void PrintCells()
Prints geometry of ALL cells of the FOAM.
virtual Double_t GetBinCenter(Int_t bin) const
return bin center for 1D historam Better to use h1.GetXaxis().GetBinCenter(bin)
void Varedu(Double_t[], Int_t &, Double_t &, Double_t &)
Internal subrogram used by Create.
void SetXdiv(Double_t Xdiv)
void SetXmax(Int_t idim, Double_t wmax)
set upper foam bound in dimension idim
Double_t GetCellElement(const PDEFoamCell *cell, UInt_t i) const
Returns cell element i of cell 'cell'.
PDEFoamCell * GetPare() const
void CalcVolume()
Calculates volume of the cell using size params which are calculated.
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...
TVectorT< Element > & Zero()
Set vector elements to zero.
char * Form(const char *fmt,...)
void SetDriv(Double_t Driv)
void SetDim(Int_t kDim)
Sets dimension of cubical space.
1-D histogram with a double per channel (see TH1 documentation)}
void PrintCell(Long_t iCell=0)
Prints geometry of and elements of 'iCell', as well as relations to parent and daughter cells...
Int_t GetColorPalette(Int_t i) const
Return color number i in current palette.
Double_t Eval(Double_t *xRand, Double_t &event_density)
Internal subprogram.
static const double x1[5]
void Create()
Basic initialization of FOAM invoked by the user.
virtual TH2D * Project2(Int_t idim1, Int_t idim2, ECellValue cell_value=kValue, PDEFoamKernelBase *kernel=NULL, UInt_t nbin=50)
Project foam variable idim1 and variable idim2 to histogram.
ClassImp(TMVA::PDEFoam) static const Float_t kHigh
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...
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
Mother of all ROOT objects.
virtual Int_t GetNbinsY() const
void SetIntg(Double_t Intg)
Abstract ClassifierFactory template that handles arbitrary types.
void DeleteBinarySearchTree()
Delete the foam's density estimator, which contains the binary search tree.
std::vector< Float_t > & GetValues()
void FillBinarySearchTree(const Event *ev)
Insert event to internal foam's density estimator PDEFoamDensityBase.
PDEFoamCell * GetDau1() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual ~PDEFoam()
Default destructor.
PDEFoamCell * FindCell(const std::vector< Float_t > &) const
Find cell that contains 'xvec' (in foam coordinates [0,1]).
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content.
void SetDau0(PDEFoamCell *Daug)
static const Float_t kVlow
void GetHcub(PDEFoamVect &, PDEFoamVect &) const
Provides size and position of the cell These parameter are calculated by analyzing information in all...
void SetPalette(Int_t ncolors=kBird, Int_t *colors=0, Float_t alpha=1.)
See TColor::SetPalette.
void SetInhiDiv(Int_t, Int_t)
This can be called before Create, after setting kDim It defines which variables are excluded in the p...
PDEFoam()
Default constructor for streamer, user should not use it.
PDEFoamCell * GetDau0() const
2-D histogram with a double per channel (see TH1 documentation)}