96#define BXOPE std::cout<<\
97"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"<<std::endl<<\
99#define BXTXT(text) std::cout<<\
100"F "<<std::setw(40)<< text <<" F"<<std::endl
101#define BX1I(name,numb,text) std::cout<<\
102"F "<<std::setw(10)<<name<<" = "<<std::setw(10)<<numb<<" = " <<std::setw(50)<<text<<" F"<<std::endl
103#define BX1F(name,numb,text) std::cout<<"F "<<std::setw(10)<<name<<\
104 " = "<<std::setw(15)<<std::setprecision(8)<<numb<<" = "<<std::setw(40)<<text<<" F"<<std::endl
105#define BX2F(name,numb,err,text) std::cout<<"F "<<std::setw(10)<<name<<\
106" = "<<std::setw(15)<<std::setprecision(8)<<numb<<" +- "<<std::setw(15)<<std::setprecision(8)<<err<< \
107 " = "<<std::setw(25)<<text<<" F"<<std::endl
108#define BXCLO std::cout<<\
110"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"<<std::endl
113static const Double_t gHigh= 1.0e150;
114static const Double_t gVlow=-1.0e150;
116#define SW2 setprecision(7) << std::setw(12)
125 FoamIntegrandFunction(FunctionPtr func) : fFunc(func) {}
127 ~FoamIntegrandFunction()
override {}
131 return fFunc(nDim,
x);
145 fDim(0), fNCells(0), fRNmax(0),
146 fOptDrive(0), fChat(0), fOptRej(0),
147 fNBin(0), fNSampl(0), fEvPerBin(0),
148 fMaskDiv(nullptr), fInhiDiv(nullptr), fOptPRD(0), fXdivPRD(nullptr),
149 fNoAct(0), fLastCe(0),
150 fMCMonit(nullptr), fMaxWtRej(0), fPrimAcu(nullptr),
151 fHistEdg(nullptr), fHistDbg(nullptr), fHistWt(nullptr),
152 fMCvect(nullptr), fMCwt(0), fRvec(nullptr),
153 fRho(nullptr), fMethodCall(nullptr), fPseRan(nullptr),
154 fNCalls(0), fNEffev(0),
155 fSumWt(0), fSumWt2(0),
156 fSumOve(0), fNevGen(0),
157 fWtMax(0), fWtMin(0),
158 fPrime(0), fMCresult(0), fMCerror(0),
166 fDim(0), fNCells(0), fRNmax(0),
167 fOptDrive(0), fChat(0), fOptRej(0),
168 fNBin(0), fNSampl(0), fEvPerBin(0),
169 fMaskDiv(nullptr), fInhiDiv(nullptr), fOptPRD(0), fXdivPRD(nullptr),
170 fNoAct(0), fLastCe(0),
171 fMCMonit(nullptr), fMaxWtRej(0), fPrimAcu(nullptr),
172 fHistEdg(nullptr), fHistDbg(nullptr), fHistWt(nullptr),
173 fMCvect(nullptr), fMCwt(0), fRvec(nullptr),
174 fRho(nullptr), fMethodCall(nullptr), fPseRan(nullptr),
175 fNCalls(0), fNEffev(0),
176 fSumWt(0), fSumWt2(0),
177 fSumOve(0), fNevGen(0),
178 fWtMax(0), fWtMin(0),
179 fPrime(0), fMCresult(0), fMCerror(0),
182 if(strlen(Name) >129) {
183 Error(
"TFoam",
"Name too long %s \n",Name);
186 fDate=
" Release date: 2005.04.10";
259 if (
fRho &&
dynamic_cast<FoamIntegrandFunction*
>(
fRho) )
delete fRho;
268 Error(
"TFoam",
"COPY CONSTRUCTOR NOT IMPLEMENTED \n");
327 BXTXT(
"****************************************");
328 BXTXT(
"****** TFoam::Initialize ******");
329 BXTXT(
"****************************************");
332 BX1I(
" kDim",
fDim,
" Dimension of the hyper-cubical space ");
333 BX1I(
" nCells",
fNCells,
" Requested number of Cells (half of them active) ");
334 BX1I(
" nSampl",
fNSampl,
" No of MC events in exploration of a cell ");
335 BX1I(
" nBin",
fNBin,
" No of bins in histograms, MC exploration of cell ");
336 BX1I(
" EvPerBin",
fEvPerBin,
" Maximum No effective_events/bin, MC exploration ");
337 BX1I(
" OptDrive",
fOptDrive,
" Type of Driver =1,2 for Sigma,WtMax ");
338 BX1I(
" OptRej",
fOptRej,
" MC rejection on/off for OptRej=0,1 ");
339 BX1F(
" MaxWtRej",
fMaxWtRej,
" Maximum wt in rejection for wt=1 evts");
343 if(
fPseRan==
nullptr)
Error(
"Initialize",
"Random number generator not set \n");
344 if(
fRho==
nullptr &&
fMethodCall==
nullptr )
Error(
"Initialize",
"Distribution function not set \n");
345 if(
fDim==0)
Error(
"Initialize",
"Zero dimension not allowed \n");
353 if(
fRvec==
nullptr)
Error(
"Initialize",
"Cannot initialize buffer fRvec \n");
357 if(
fAlpha==
nullptr)
Error(
"Initialize",
"Cannot initialize buffer fAlpha \n" );
360 if(
fMCvect==
nullptr)
Error(
"Initialize",
"Cannot initialize buffer fMCvect \n" );
378 fHistWt =
new TH1D(
"HistWt",
"Histogram of MC weight",100,0.0, 1.5*
fMaxWtRej);
383 hname=
fName+TString(
"_HistEdge_");
385 htitle=TString(
"Edge Histogram No. ");
388 (*fHistEdg)[i] =
new TH1D(hname.
Data(),htitle.
Data(),
fNBin,0.0, 1.0);
394 hname=
fName+TString(
"_HistDebug_");
396 htitle=TString(
"Debug Histogram ");
398 (*fHistDbg)[i] =
new TH1D(hname.
Data(),htitle.
Data(),
fNBin,0.0, 1.0);
423 fMCMonit =
new TFoamMaxwt(5.0,1000);
428 BXTXT(
"*** TFoam::Initialize FINISHED!!! ***");
429 BX1I(
" nCalls",
fNCalls,
"Total number of function calls ");
430 BX1F(
" XPrime",
fPrime,
"Primary total integral ");
431 BX1F(
" XDiver",driver,
"Driver total integral ");
432 BX1F(
" mcResult",
fMCresult,
"Estimate of the true MC Integral ");
457 if(
fCells==
nullptr)
Error(
"InitCells",
"Cannot initialize CELLS \n" );
478 Error(
"CellFill",
"Too many cells\n");
485 cell->
Fill(Status, parent,
nullptr,
nullptr);
528 TFoamVect cellSize(
fDim);
529 TFoamVect cellPosi(
fDim);
531 cell->
GetHcub(cellPosi,cellSize);
563 for(j=0; j<
fDim; j++)
564 xRand[j]= cellPosi[j] +
fAlpha[j]*(cellSize[j]);
571 for(k=0; k<
fDim; k++) {
573 ((TH1D *)(*
fHistEdg)[nProj])->Fill(xproj,wt);
582 if (ceSum[3]>wt) ceSum[3]=wt;
583 if (ceSum[4]<wt) ceSum[4]=wt;
585 nevEff = ceSum[1] == 0. ? 0. : ceSum[0]*ceSum[0]/ceSum[1];
590 for(k=0; k<
fDim;k++){
598 for(k=0; k<
fDim; k++) {
600 rmax= cellPosi[k] +cellSize[k];
606 if( (rmin +1
e-99 <rdiv) && (rdiv< rmax -1
e-99)) {
608 xBest= (rdiv-cellPosi[k])/cellSize[k] ;
620 Double_t intTrue = ceSum[0]/(nevMC+0.000001);
626 if(kBest == -1)
Varedu(ceSum,kBest,xBest,yBest);
628 intDriv =
sqrt(ceSum[1]/nevMC) -intTrue;
629 intPrim =
sqrt(ceSum[1]/nevMC);
632 if(kBest == -1)
Carver(kBest,xBest,yBest);
633 intDriv =ceSum[4] -intTrue;
637 Error(
"Explore",
"Wrong fOptDrive = \n" );
651 for(parent = cell->
GetPare(); parent!=
nullptr; parent = parent->
GetPare()){
654 parent->
SetIntg( parIntg +intTrue -intOld );
655 parent->
SetDriv( parDriv +intDriv -driOld );
676 Double_t swIn,swOut,sswIn,sswOut,xLo,xUp;
682 for(
Int_t kProj=0; kProj<
fDim; kProj++) {
693 aswIn += ((TH1D *)(*
fHistEdg)[kProj])->GetBinContent(jUp);
694 asswIn +=
Sqr(((TH1D *)(*
fHistEdg)[kProj])->GetBinError( jUp));
698 swOut = (swAll-aswIn)/nent;
699 sswIn =
sqrt(asswIn) /
sqrt(nent*(xUp-xLo)) *(xUp-xLo);
700 sswOut=
sqrt(sswAll-asswIn)/
sqrt(nent*(1.0-xUp+xLo)) *(1.0-xUp+xLo);
701 if( (sswIn+sswOut) < sswtBest) {
702 sswtBest = sswIn+sswOut;
704 sigmIn = sswIn -swIn;
705 sigmOut = sswOut-swOut;
718 if( ((iBin-0.5)/
fNBin > xMin) && ((iBin-0.5)/
fNBin < xMax) ){
719 ((TH1D *)(*
fHistDbg)[kProj])->SetBinContent(iBin,sigmIn/(xMax-xMin));
721 ((TH1D *)(*
fHistDbg)[kProj])->SetBinContent(iBin,sigmOut/(1-xMax+xMin));
729 if(iLo == 0) xBest=yBest;
730 if(iUp ==
fNBin) yBest=xBest;
736 if( (kBest >=
fDim) || (kBest<0) )
Error(
"Varedu",
"Something wrong with kBest - kBest = %d dim = %d\n",kBest,
fDim);
749 Double_t carve,carvTot,carvMax,carvOne,binMax;
750 Int_t jLow,jUp,iLow,iUp;
756 if(bins==
nullptr)
Error(
"Carver",
"Cannot initialize buffer Bins \n" );
763 for(kProj=0; kProj<
fDim; kProj++)
769 for(iBin=0; iBin<
fNBin;iBin++){
770 bins[iBin]= ((TH1D *)(*
fHistEdg)[kProj])->GetBinContent(iBin+1);
778 for(iBin=0;iBin<
fNBin;iBin++){
779 carvTot = carvTot + (binMax-bins[iBin]);
787 for(iBin=0; iBin<
fNBin;iBin++) {
791 for(j=iBin; j>-1; j-- ) {
792 if(theBin< bins[j])
break;
799 for(j=iBin; j<
fNBin; j++) {
800 if(theBin< bins[j])
break;
806 carve = (iUp-iLow+1)*(binMax-theBin);
807 if( carve > carvOne) {
814 if( carvTot > carvMax) {
821 if(jLow == 0 ) xBest = yBest;
822 if(jUp ==
fNBin-1) yBest = xBest;
829 for(iBin=0; iBin<
fNBin; iBin++)
830 ((TH1D *)(*
fHistDbg)[kProj])->SetBinContent(iBin+1,binMax);
831 for(iBin=jLow; iBin<jUp+1; iBin++)
832 ((TH1D *)(*
fHistDbg)[kProj])->SetBinContent(iBin+1,yLevel);
834 if( (kBest >=
fDim) || (kBest<0) )
Error(
"Carver",
"Something wrong with kBest - kBest = %d dim = %d\n",kBest,
fDim);
864 if( (iCell<0) || (iCell>
fLastCe) ) {
865 Error(
"Grow",
"Wrong iCell \n");
876 std::cout<<
fDim<<std::flush;
878 std::cout<<
"."<<std::flush;
879 if( (
fLastCe%(100*kEcho))==0) std::cout<<
"|"<<
fLastCe<<std::endl<<std::flush;
883 if(
Divide( newCell )==0)
break;
886 std::cout<<std::endl<<std::flush;
903 if(
getCell(i)->GetStat() == 1 ) {
914 std::cout <<
"STOP in TFoam::PeekMax: not found iCell=" << iCell << std::endl;
939 if( kBest<0 || kBest>=
fDim )
Error(
"Divide",
"Wrong kBest \n");
975 for(iCell=0; iCell<=
fLastCe; iCell++) {
976 if (
getCell(iCell)->GetStat()==1) {
983 if(
fPrime == 0.)
Error(
"MakeActiveList",
"Integrand function is zero \n" );
986 if(
fPrimAcu==
nullptr )
Error(
"MakeActiveList",
"Cant allocate fCellsAct or fPrimAcu \n");
989 for(iCell=0; iCell<
fNoAct; iCell++) {
1006 Info(
"ResetPseRan",
"Resetting random number generator \n");
1020 Error(
"SetRho",
"Bad function \n" );
1031 if (
fRho &&
dynamic_cast<FoamIntegrandFunction*
>(
fRho) )
delete fRho;
1032 fRho=
new FoamIntegrandFunction(fun);
1034 Error(
"SetRho",
"Bad function \n" );
1049 Info(
"ResetRho",
"!!! Resetting distribution function !!!\n");
1091 hit = lo + (
Int_t)( (
hi-lo)*(random-flo)/(fhi-flo)+0.5);
1131 TFoamVect cellPosi(
fDim); TFoamVect cellSize(
fDim);
1132 rCell->
GetHcub(cellPosi,cellSize);
1133 for(j=0; j<
fDim; j++)
1213 mcError = mcResult *mCerelat;
1245 fMCMonit->GetMCeff(eps, mCeff, wtLim);
1260 Double_t mCerelat= mcError/mcResult;
1267 if(wtMax>0.0) mCeff=aveWt/wtMax;
1268 mcEf2 =
sigma/aveWt;
1272 BXTXT(
"****************************************");
1273 BXTXT(
"****** TFoam::Finalize ******");
1274 BXTXT(
"****************************************");
1275 BX1I(
" NevGen",
fNevGen,
"Number of generated events in the MC generation ");
1276 BX1I(
" nCalls",
fNCalls,
"Total number of function calls ");
1277 BXTXT(
"----------------------------------------");
1278 BX1F(
" AveWt",aveWt,
"Average MC weight ");
1279 BX1F(
" WtMin",
fWtMin,
"Minimum MC weight (absolute) ");
1280 BX1F(
" WtMax",
fWtMax,
"Maximum MC weight (absolute) ");
1281 BXTXT(
"----------------------------------------");
1282 BX1F(
" XPrime",
fPrime,
"Primary total integral, R_prime ");
1283 BX1F(
" XDiver",driver,
"Driver total integral, R_loss ");
1284 BXTXT(
"----------------------------------------");
1285 BX2F(
" IntMC", mcResult, mcError,
"Result of the MC Integral");
1286 BX1F(
" mCerelat", mCerelat,
"Relative error of the MC integral ");
1287 BX1F(
" <w>/WtMax",mCeff,
"MC efficiency, acceptance rate");
1288 BX1F(
" Sigma/<w>",mcEf2,
"MC efficiency, variance/ave_wt");
1289 BX1F(
" WtMax",wtMax,
"WtMax(esp= 0.0005) ");
1290 BX1F(
" Sigma",
sigma,
"variance of MC weight ");
1293 BX1F(
"<OveW>/<W>",avOve,
"Contrib. of events wt>MaxWtRej");
1311 if(
fDim==0)
Error(
"TFoam",
"SetInhiDiv: fDim=0 \n");
1317 if( ( 0<=iDim) && (iDim<
fDim)) {
1320 Error(
"SetInhiDiv:",
"Wrong iDim \n");
1341 if(
fDim<=0)
Error(
"SetXdivPRD",
"fDim=0 \n");
1342 if( len<1 )
Error(
"SetXdivPRD",
"len<1 \n");
1349 if( ( 0<=iDim) && (iDim<
fDim)) {
1352 Error(
"SetXdivPRD",
"Second allocation of XdivPRD not allowed \n");
1353 fXdivPRD[iDim] =
new TFoamVect(len);
1354 for(i=0; i<len; i++) {
1358 Error(
"SetXdivPRD",
"Wrong iDim \n");
1361 std::cout<<
" SetXdivPRD, idim= "<<iDim<<
" len= "<<len<<
" "<<std::endl;
1362 for(i=0; i<len; i++) {
1363 if (iDim <
fDim) std::cout<< (*
fXdivPRD[iDim])[i] <<
" ";
1365 std::cout<<std::endl;
1366 for(i=0; i<len; i++) std::cout<< xDiv[i] <<
" ";
1367 std::cout<<std::endl;
1379 Int_t errors, warnings;
1383 errors = 0; warnings = 0;
1384 if (level==1) std::cout <<
"///////////////////////////// FOAM_Checks /////////////////////////////////" << std::endl;
1385 for(iCell=1; iCell<=
fLastCe; iCell++) {
1388 if( ((cell->
GetDau0()==
nullptr) && (cell->
GetDau1()!=
nullptr) ) ||
1391 if (level==1)
Error(
"CheckAll",
"ERROR: Cell's no %ld has only one daughter \n",iCell);
1395 if (level==1)
Error(
"CheckAll",
"ERROR: Cell's no %ld has no daughter and is inactive \n",iCell);
1399 if (level==1)
Error(
"CheckAll",
"ERROR: Cell's no %ld has two daughters and is active \n",iCell);
1406 if (level==1)
Error(
"CheckAll",
"ERROR: Cell's no %ld parent not pointing to this cell\n ",iCell);
1411 if(cell->
GetDau0()!=
nullptr) {
1412 if(cell != (cell->
GetDau0())->GetPare()) {
1414 if (level==1)
Error(
"CheckAll",
"ERROR: Cell's no %ld daughter 0 not pointing to this cell \n",iCell);
1417 if(cell->
GetDau1()!=
nullptr) {
1418 if(cell != (cell->
GetDau1())->GetPare()) {
1420 if (level==1)
Error(
"CheckAll",
"ERROR: Cell's no %ld daughter 1 not pointing to this cell \n",iCell);
1426 for(iCell=0; iCell<=
fLastCe; iCell++) {
1430 if(level==1)
Warning(
"CheckAll",
"Warning: Cell no. %ld is active but empty \n", iCell);
1435 Info(
"CheckAll",
"Check has found %d errors and %d warnings \n",errors, warnings);
1438 Info(
"CheckAll",
"Check - found total %d errors \n",errors);
1449 for(iCell=0; iCell<=
fLastCe; iCell++) {
1450 std::cout<<
"Cell["<<iCell<<
"]={ ";
1452 std::cout<<std::endl;
1454 std::cout<<
"}"<<std::endl;
1464 std::ofstream outfile(filename, std::ios::out);
1469 outfile<<
"{" << std::endl;
1470 outfile<<
"cMap = new TCanvas(\"Map1\",\" Cell Map \",600,600);"<<std::endl;
1472 outfile<<
"TBox*a=new TBox();"<<std::endl;
1473 outfile<<
"a->SetFillStyle(0);"<<std::endl;
1474 outfile<<
"a->SetLineWidth(4);"<<std::endl;
1475 outfile<<
"a->SetLineColor(2);"<<std::endl;
1476 outfile<<
"a->DrawBox("<<offs<<
","<<offs<<
","<<(offs+lpag)<<
","<<(offs+lpag)<<
");"<<std::endl;
1478 outfile<<
"TText*t=new TText();"<<std::endl;
1479 outfile<<
"t->SetTextColor(4);"<<std::endl;
1481 outfile<<
"t->SetTextSize(0.025);"<<std::endl;
1483 outfile<<
"t->SetTextSize(0.015);"<<std::endl;
1485 outfile<<
"t->SetTextSize(0.008);"<<std::endl;
1487 outfile<<
"TBox*b=new TBox();"<<std::endl;
1488 outfile <<
"b->SetFillStyle(0);"<<std::endl;
1491 TFoamVect cellPosi(
fDim); TFoamVect cellSize(
fDim);
1492 outfile <<
"// =========== Rectangular cells ==========="<< std::endl;
1493 for(iCell=1; iCell<=
fLastCe; iCell++) {
1494 if(
getCell(iCell)->GetStat() == 1) {
1496 x1 = offs+lpag*( cellPosi[0]); y1 = offs+lpag*( cellPosi[1]);
1497 x2 = offs+lpag*(cellPosi[0]+cellSize[0]); y2 = offs+lpag*(cellPosi[1]+cellSize[1]);
1500 outfile<<
"b->DrawBox("<<x1<<
","<<y1<<
","<<x2<<
","<<y2<<
");"<<std::endl;
1503 x = offs+lpag*(cellPosi[0]+0.5*cellSize[0]);
y = offs+lpag*(cellPosi[1]+0.5*cellSize[1]);
1508 outfile<<
"// ============== End Rectangles ==========="<< std::endl;
1512 outfile <<
"}" << std::endl;
1520 Info(
"LinkCells",
"VOID function for backward compatibility \n");
1527 if(
fCells[i]->GetCells() ==
nullptr) {
int Int_t
Signed integer 4 bytes (int).
long Longptr_t
Integer large enough to hold a pointer (platform-dependent).
char Char_t
Character 1 byte (char).
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
double Double_t
Double 8 bytes.
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
#define BX1F(name, numb, text)
#define BX1I(name, numb, text)
#define BX2F(name, numb, err, text)
void SetXdiv(Double_t Xdiv)
TFoamCell * GetDau1() const
void CalcVolume()
Calculates volume of the cell using size params which are calculated.
Double_t GetVolume() const
TFoamCell * GetDau0() const
void Print(Option_t *option) const override
Printout of the cell geometry parameters for the debug purpose.
void GetHcub(TFoamVect &, TFoamVect &) const
Provides size and position of the cell These parameter are calculated by analyzing information in all...
TFoamCell * GetPare() const
void Fill(Int_t, TFoamCell *, TFoamCell *, TFoamCell *)
Fills in certain data into newly allocated cell.
void SetDau1(TFoamCell *Daug)
void SetPrim(Double_t Prim)
void SetDriv(Double_t Driv)
void SetIntg(Double_t Intg)
void SetDau0(TFoamCell *Daug)
Abstract class representing n-dimensional real positive integrand function.
virtual Double_t Density(Int_t ndim, Double_t *)=0
TFoamCell * getCell(std::size_t i) const
virtual void SetXdivPRD(Int_t, Int_t, Double_t[])
virtual void SetInhiDiv(Int_t, Int_t)
virtual void Finalize(Double_t &, Double_t &)
virtual void ResetRho(TFoamIntegrand *Rho)
TString fName
Name of a given instance of the FOAM class.
virtual void LinkCells(void)
TH1D * fHistWt
Histogram of the MC wt.
TFoamIntegrand * fRho
! Pointer to the user-defined integrand function/distribution
TRandom * fPseRan
Pointer to user-defined generator of pseudorandom numbers.
Double_t fMCerror
and its error
Double_t fPrime
Primary integral R' (R=R'<wt>).
Int_t fChat
Chat=0,1,2 chat level in output, Chat=1 normal level.
Double_t fNevGen
Total number of the generated MC events.
Double_t fSumWt2
Total sum of wt and wt^2.
TFoamVect ** fXdivPRD
! Lists of division values encoded in one vector per direction
virtual void GenerCel2(TFoamCell *&)
virtual Int_t Divide(TFoamCell *)
virtual void SetRhoInt(Double_t(*fun)(Int_t, Double_t *))
virtual void CheckAll(Int_t)
TFoamMaxwt * fMCMonit
Monitor of the MC weight for measuring MC efficiency.
Int_t fRNmax
Maximum No. of the rand. numb. requested at once.
Int_t * fInhiDiv
! [fDim] Flags for inhibiting cell division
Long_t fNCalls
Total number of the function calls.
Double_t fWtMin
Maximum/Minimum MC weight.
virtual void GetIntegMC(Double_t &, Double_t &)
Int_t fEvPerBin
Maximum number of effective (wt=1) events per bin.
Double_t fMaxWtRej
Maximum weight in rejection for getting wt=1 events.
Int_t fNCells
Maximum number of cells.
Double_t * fRvec
[fRNmax] random number vector from r.n. generator fDim+1 maximum elements
virtual void MakeActiveList()
Double_t * fAlpha
[fDim] Internal parameters of the hyper-rectangle
Int_t fOptDrive
Optimization switch =1,2 for variance or maximum weight optimization.
virtual void RootPlot2dim(Char_t *)
TMethodCall * fMethodCall
! ROOT's pointer to user-defined global distribution function
virtual void PrintCells()
Double_t Sqr(Double_t x) const
virtual void Carver(Int_t &, Double_t &, Double_t &)
Int_t fLastCe
Index of the last cell.
Int_t fOptPRD
Option switch for predefined division, for quick check.
TObjArray * fHistDbg
Histograms of wt, for debug.
Double_t fSumOve
Total Sum of overweighted events.
virtual void SetRho(TFoamIntegrand *Rho)
virtual void Initialize()
std::vector< Long_t > fCellsAct
Index of active cells, constructed at the end of foam build-up.
virtual void GetIntNorm(Double_t &, Double_t &)
virtual Double_t GetMCwt()
Int_t * fMaskDiv
! [fDim] Dynamic Mask for cell division
Int_t fNoAct
Number of active cells.
Long_t fNEffev
Total number of effective events (wt=1) in the foam buildup.
Int_t fOptRej
Switch =0 for weighted events; =1 for unweighted events in MC.
Double_t * fPrimAcu
[fNoAct] Array of cumulative probability of all active cells
Double_t * fMCvect
[fDim] Generated MC vector for the outside user
TString fVersion
Actual version of the FOAM like (1.01m).
virtual void GetWtParams(Double_t, Double_t &, Double_t &, Double_t &)
Int_t fDim
Dimension of the integration/simulation space.
Int_t fNSampl
No. of MC events, when dividing (exploring) cell.
TString fDate
Release date of FOAM.
TFoamCell ** fCells
[fNCells] Array of ALL cells
virtual void SetPseRan(TRandom *PseRan)
virtual void Explore(TFoamCell *Cell)
virtual void Varedu(Double_t[5], Int_t &, Double_t &, Double_t &)
virtual void ResetPseRan(TRandom *PseRan)
virtual void GetMCvect(Double_t *)
TObjArray * fHistEdg
Histograms of wt, one for each cell edge.
Double_t fMCresult
True Integral R from MC series.
virtual Double_t Eval(Double_t *)
virtual Int_t CellFill(Int_t, TFoamCell *)
Int_t fNBin
No. of bins in the edge histogram for cell MC exploration.
virtual Double_t MCgenerate(Double_t *MCvect)
Mother of all ROOT objects.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
This is the base class for the ROOT Random number generators.
const char * Data() const
VecExpr< UnaryOp< Sqrt< T >, VecExpr< A, T, D >, T >, T, D > sqrt(const VecExpr< A, T, D > &rhs)
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
static uint64_t sum(uint64_t i)