48 ClassImp(TMVA::PDEFoamCell);
53 TMVA::PDEFoamCell::PDEFoamCell()
73 TMVA::PDEFoamCell::PDEFoamCell(Int_t kDim)
89 Error(
"PDEFoamCell",
"Dimension has to be >0" );
95 TMVA::PDEFoamCell::PDEFoamCell(
const PDEFoamCell &cell)
98 fSerial (cell.fSerial),
99 fStatus (cell.fStatus),
100 fParent (cell.fParent),
101 fDaught0 (cell.fDaught0),
102 fDaught1 (cell.fDaught1),
105 fVolume (cell.fVolume),
106 fIntegral(cell.fIntegral),
107 fDrive (cell.fDrive),
108 fElement (cell.fElement)
110 Error(
"PDEFoamCell",
"COPY CONSTRUCTOR NOT IMPLEMENTED" );
116 TMVA::PDEFoamCell::~PDEFoamCell()
123 void TMVA::PDEFoamCell::Fill(Int_t status, PDEFoamCell *parent, PDEFoamCell *daugh1, PDEFoamCell *daugh2)
140 void TMVA::PDEFoamCell::GetHcub( PDEFoamVect &cellPosi, PDEFoamVect &cellSize)
const
143 const PDEFoamCell *pCell,*dCell;
144 cellPosi = 0.0; cellSize=1.0;
147 pCell = dCell->GetPare();
148 if( pCell== 0)
break;
149 Int_t kDiv = pCell->fBest;
150 Double_t xDivi = pCell->fXdiv;
151 if(dCell == pCell->GetDau0() ) {
152 cellSize[kDiv] *=xDivi;
153 cellPosi[kDiv] *=xDivi;
154 }
else if( dCell == pCell->GetDau1() ) {
155 cellSize[kDiv] *=(1.0-xDivi);
156 cellPosi[kDiv] =cellPosi[kDiv]*(1.0-xDivi)+xDivi;
158 Error(
"GetHcub ",
"Something wrong with linked tree \n");
169 void TMVA::PDEFoamCell::GetHSize( PDEFoamVect &cellSize)
const
172 const PDEFoamCell *pCell,*dCell;
176 pCell = dCell->GetPare();
177 if( pCell== 0)
break;
178 Int_t kDiv = pCell->fBest;
179 Double_t xDivi = pCell->fXdiv;
180 if(dCell == pCell->GetDau0() ) {
181 cellSize[kDiv]=cellSize[kDiv]*xDivi;
182 }
else if(dCell == pCell->GetDau1() ) {
183 cellSize[kDiv]=cellSize[kDiv]*(1.0-xDivi);
185 Error(
"GetHSize ",
"Something wrong with linked tree \n");
194 void TMVA::PDEFoamCell::CalcVolume(
void)
199 PDEFoamVect cellSize(fDim);
201 for(k=0; k<fDim; k++) volu *= cellSize[k];
210 UInt_t TMVA::PDEFoamCell::GetDepth()
217 PDEFoamCell *cell =
this;
218 while ((cell=cell->GetPare()) != 0){
227 UInt_t TMVA::PDEFoamCell::GetTreeDepth(UInt_t depth)
232 UInt_t depth0 = 0, depth1 = 0;
233 if (GetDau0() != NULL)
234 depth0 = GetDau0()->GetTreeDepth(depth+1);
235 if (GetDau1() != NULL)
236 depth1 = GetDau1()->GetTreeDepth(depth+1);
238 return (depth0 > depth1 ? depth0 : depth1);
244 void TMVA::PDEFoamCell::Print(Option_t *option)
const
246 if (!option) Error(
"Print",
"No option set\n");
248 std::cout <<
" Status= "<< fStatus <<
",";
249 std::cout <<
" Volume= "<< fVolume <<
",";
250 std::cout <<
" TrueInteg= " << fIntegral <<
",";
251 std::cout <<
" DriveInteg= "<< fDrive <<
",";
252 std::cout << std::endl;;
253 std::cout <<
" Xdiv= "<<fXdiv<<
",";
254 std::cout <<
" Best= "<<fBest<<
",";
255 std::cout <<
" Parent= {"<< (GetPare() ? GetPare()->GetSerial() : -1) <<
"} ";
256 std::cout <<
" Daught0= {"<< (GetDau0() ? GetDau0()->GetSerial() : -1 )<<
"} ";
257 std::cout <<
" Daught1= {"<< (GetDau1() ? GetDau1()->GetSerial() : -1 )<<
"} ";
258 std::cout << std::endl;;
262 PDEFoamVect cellPosi(fDim); PDEFoamVect cellSize(fDim);
263 GetHcub(cellPosi,cellSize);
264 std::cout <<
" Posi= "; cellPosi.Print(
"1"); std::cout<<
","<< std::endl;;
265 std::cout <<
" Size= "; cellSize.Print(
"1"); std::cout<<
","<< std::endl;;