24 TFoamCell::TFoamCell()
34 TFoamCell::TFoamCell(Int_t kDim)
51 Error(
"TFoamCell",
"Dimension has to be >0 \n ");
57 TFoamCell::TFoamCell(TFoamCell &From): TObject(From)
59 Error(
"TFoamCell",
"+++++ NEVER USE Copy constructor for TFoamCell \n");
60 fStatus = From.fStatus;
61 fParent = From.fParent;
62 fDaught0 = From.fDaught0;
63 fDaught1 = From.fDaught1;
66 fVolume = From.fVolume;
67 fIntegral = From.fIntegral;
69 fPrimary = From.fPrimary;
75 TFoamCell::~TFoamCell()
82 TFoamCell& TFoamCell::operator=(
const TFoamCell &From)
84 Info(
"TFoamCell",
"operator=\n ");
85 if (&From ==
this)
return *
this;
86 fStatus = From.fStatus;
87 fParent = From.fParent;
88 fDaught0 = From.fDaught0;
89 fDaught1 = From.fDaught1;
92 fVolume = From.fVolume;
93 fIntegral = From.fIntegral;
95 fPrimary = From.fPrimary;
103 void TFoamCell::Fill(Int_t Status, TFoamCell *Parent, TFoamCell *Daugh1, TFoamCell *Daugh2)
116 void TFoamCell::GetHcub( TFoamVect &cellPosi, TFoamVect &cellSize)
const
119 const TFoamCell *pCell,*dCell;
120 cellPosi = 0.0; cellSize=1.0;
123 pCell = dCell->GetPare();
124 if( pCell== 0)
break;
125 Int_t kDiv = pCell->fBest;
126 Double_t xDivi = pCell->fXdiv;
127 if(dCell == pCell->GetDau0() ) {
128 cellSize[kDiv] *=xDivi;
129 cellPosi[kDiv] *=xDivi;
130 }
else if( dCell == pCell->GetDau1() ) {
131 cellSize[kDiv] *=(1.0-xDivi);
132 cellPosi[kDiv] =cellPosi[kDiv]*(1.0-xDivi)+xDivi;
134 Error(
"GetHcub ",
"Something wrong with linked tree \n");
145 void TFoamCell::GetHSize( TFoamVect &cellSize)
const
148 const TFoamCell *pCell,*dCell;
152 pCell = dCell->GetPare();
153 if( pCell== 0)
break;
154 Int_t kDiv = pCell->fBest;
155 Double_t xDivi = pCell->fXdiv;
156 if(dCell == pCell->GetDau0() ) {
157 cellSize[kDiv]=cellSize[kDiv]*xDivi;
158 }
else if(dCell == pCell->GetDau1() ) {
159 cellSize[kDiv]=cellSize[kDiv]*(1.0-xDivi);
161 Error(
"GetHSize ",
"Something wrong with linked tree \n");
170 void TFoamCell::CalcVolume(
void)
175 TFoamVect cellSize(fDim);
177 for(k=0; k<fDim; k++) volu *= cellSize[k];
185 void TFoamCell::Print(Option_t *option)
const
187 if(!option) Error(
"Print",
"No option set\n");
189 std::cout <<
" Status= "<< fStatus <<
",";
190 std::cout <<
" Volume= "<< fVolume <<
",";
191 std::cout <<
" TrueInteg= " << fIntegral <<
",";
192 std::cout <<
" DriveInteg= "<< fDrive <<
",";
193 std::cout <<
" PrimInteg= " << fPrimary <<
",";
194 std::cout<< std::endl;
195 std::cout <<
" Xdiv= "<<fXdiv<<
",";
196 std::cout <<
" Best= "<<fBest<<
",";
197 std::cout <<
" Parent= {"<< (GetPare() ? GetPare()->GetSerial() : -1) <<
"} ";
198 std::cout <<
" Daught0= {"<< (GetDau0() ? GetDau0()->GetSerial() : -1 )<<
"} ";
199 std::cout <<
" Daught1= {"<< (GetDau1() ? GetDau1()->GetSerial() : -1 )<<
"} ";
200 std::cout<< std::endl;
204 TFoamVect cellPosi(fDim); TFoamVect cellSize(fDim);
205 GetHcub(cellPosi,cellSize);
206 std::cout <<
" Posi= "; cellPosi.Print(
"1"); std::cout<<
","<< std::endl;
207 std::cout <<
" Size= "; cellSize.Print(
"1"); std::cout<<
","<< std::endl;