119 #include "Riostream.h" 121 #include "TRefArray.h" 122 #include "TMethodCall.h" 125 #include "TInterpreter.h" 130 #define BXOPE std::cout<<\ 131 "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"<<std::endl<<\ 133 #define BXTXT(text) std::cout<<\ 134 "F "<<std::setw(40)<< text <<" F"<<std::endl 135 #define BX1I(name,numb,text) std::cout<<\ 136 "F "<<std::setw(10)<<name<<" = "<<std::setw(10)<<numb<<" = " <<std::setw(50)<<text<<" F"<<std::endl 137 #define BX1F(name,numb,text) std::cout<<"F "<<std::setw(10)<<name<<\ 138 " = "<<std::setw(15)<<std::setprecision(8)<<numb<<" = "<<std::setw(40)<<text<<" F"<<std::endl 139 #define BX2F(name,numb,err,text) std::cout<<"F "<<std::setw(10)<<name<<\ 140 " = "<<std::setw(15)<<std::setprecision(8)<<numb<<" +- "<<std::setw(15)<<std::setprecision(8)<<err<< \ 141 " = "<<std::setw(25)<<text<<" F"<<std::endl 142 #define BXCLO std::cout<<\ 144 "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"<<std::endl 147 static const Double_t
gHigh= 1.0e150;
148 static const Double_t
gVlow=-1.0e150;
150 #define SW2 setprecision(7) << std::setw(12) 157 typedef Double_t (*FunctionPtr)(Int_t, Double_t*);
159 FoamIntegrandFunction(FunctionPtr func) : fFunc(func) {}
161 virtual ~FoamIntegrandFunction() {}
164 Double_t
Density (Int_t nDim, Double_t *
x) {
165 return fFunc(nDim,x);
179 fDim(0), fNCells(0), fRNmax(0),
180 fOptDrive(0), fChat(0), fOptRej(0),
181 fNBin(0), fNSampl(0), fEvPerBin(0),
182 fMaskDiv(0), fInhiDiv(0), fOptPRD(0), fXdivPRD(0),
183 fNoAct(0), fLastCe(0), fCells(0),
184 fMCMonit(0), fMaxWtRej(0), fCellsAct(0), fPrimAcu(0),
185 fHistEdg(0), fHistDbg(0), fHistWt(0),
186 fMCvect(0), fMCwt(0), fRvec(0),
187 fRho(0), fMethodCall(0), fPseRan(0),
188 fNCalls(0), fNEffev(0),
189 fSumWt(0), fSumWt2(0),
190 fSumOve(0), fNevGen(0),
191 fWtMax(0), fWtMin(0),
192 fPrime(0), fMCresult(0), fMCerror(0),
216 if(strlen(Name) >129) {
217 Error(
"TFoam",
"Name too long %s \n",Name);
220 fDate=
" Release date: 2005.04.10";
296 if (
fRho && dynamic_cast<FoamIntegrandFunction*>(
fRho) )
delete fRho;
305 Error(
"TFoam",
"COPY CONSTRUCTOR NOT IMPLEMENTED \n");
359 Bool_t addStatus = TH1::AddDirectoryStatus();
360 TH1::AddDirectory(kFALSE);
365 BXTXT(
"****************************************");
366 BXTXT(
"****** TFoam::Initialize ******");
367 BXTXT(
"****************************************");
370 BX1I(
" kDim",
fDim,
" Dimension of the hyper-cubical space ");
371 BX1I(
" nCells",
fNCells,
" Requested number of Cells (half of them active) ");
372 BX1I(
" nSampl",
fNSampl,
" No of MC events in exploration of a cell ");
373 BX1I(
" nBin",
fNBin,
" No of bins in histograms, MC exploration of cell ");
374 BX1I(
" EvPerBin",
fEvPerBin,
" Maximum No effective_events/bin, MC exploration ");
375 BX1I(
" OptDrive",
fOptDrive,
" Type of Driver =1,2 for Sigma,WtMax ");
376 BX1I(
" OptRej",
fOptRej,
" MC rejection on/off for OptRej=0,1 ");
377 BX1F(
" MaxWtRej",
fMaxWtRej,
" Maximum wt in rejection for wt=1 evts");
381 if(
fPseRan==0) Error(
"Initialize",
"Random number generator not set \n");
382 if(
fRho==0 &&
fMethodCall==0 ) Error(
"Initialize",
"Distribution function not set \n");
383 if(
fDim==0) Error(
"Initialize",
"Zero dimension not allowed \n");
391 if(
fRvec==0) Error(
"Initialize",
"Cannot initialize buffer fRvec \n");
395 if(
fAlpha==0) Error(
"Initialize",
"Cannot initialize buffer fAlpha \n" );
398 if(
fMCvect==0) Error(
"Initialize",
"Cannot initialize buffer fMCvect \n" );
416 fHistWt =
new TH1D(
"HistWt",
"Histogram of MC weight",100,0.0, 1.5*
fMaxWtRej);
421 hname=
fName+TString(
"_HistEdge_");
423 htitle=TString(
"Edge Histogram No. ");
426 (*fHistEdg)[i] =
new TH1D(hname.Data(),htitle.Data(),
fNBin,0.0, 1.0);
432 hname=
fName+TString(
"_HistDebug_");
434 htitle=TString(
"Debug Histogram ");
436 (*fHistDbg)[i] =
new TH1D(hname.Data(),htitle.Data(),
fNBin,0.0, 1.0);
466 BXTXT(
"*** TFoam::Initialize FINISHED!!! ***");
467 BX1I(
" nCalls",
fNCalls,
"Total number of function calls ");
468 BX1F(
" XPrime",
fPrime,
"Primary total integral ");
469 BX1F(
" XDiver",driver,
"Driver total integral ");
470 BX1F(
" mcResult",
fMCresult,
"Estimate of the true MC Integral ");
474 TH1::AddDirectory(addStatus);
496 if(
fCells==0) Error(
"InitCells",
"Cannot initialize CELLS \n" );
504 for(Long_t iCell=0; iCell<=
fLastCe; iCell++){
517 Error(
"CellFill",
"Too many cells\n");
524 cell->
Fill(Status, parent, 0, 0);
528 Double_t xInt2,xDri2;
556 Double_t wt, dx, xBest=0, yBest=0;
557 Double_t intOld, driOld;
563 Double_t ceSum[5], xproj;
568 cell->
GetHcub(cellPosi,cellSize);
572 Double_t *xRand =
new Double_t[
fDim];
600 for(j=0; j<
fDim; j++)
601 xRand[j]= cellPosi[j] +
fAlpha[j]*(cellSize[j]);
608 for(k=0; k<
fDim; k++) {
610 ((TH1D *)(*
fHistEdg)[nProj])->Fill(xproj,wt);
619 if (ceSum[3]>wt) ceSum[3]=wt;
620 if (ceSum[4]<wt) ceSum[4]=wt;
622 nevEff = ceSum[0]*ceSum[0]/ceSum[1];
627 for(k=0; k<
fDim;k++){
633 Double_t rmin,rmax,rdiv;
635 for(k=0; k<
fDim; k++) {
637 rmax= cellPosi[k] +cellSize[k];
643 if( (rmin +1
e-99 <rdiv) && (rdiv< rmax -1
e-99)) {
645 xBest= (rdiv-cellPosi[k])/cellSize[k] ;
657 Double_t intTrue = ceSum[0]/(nevMC+0.000001);
663 if(kBest == -1)
Varedu(ceSum,kBest,xBest,yBest);
665 intDriv =
sqrt(ceSum[1]/nevMC) -intTrue;
666 intPrim =
sqrt(ceSum[1]/nevMC);
669 if(kBest == -1)
Carver(kBest,xBest,yBest);
670 intDriv =ceSum[4] -intTrue;
674 Error(
"Explore",
"Wrong fOptDrive = \n" );
687 Double_t parIntg, parDriv;
688 for(parent = cell->
GetPare(); parent!=0; parent = parent->
GetPare()){
691 parent->
SetIntg( parIntg +intTrue -intOld );
692 parent->
SetDriv( parDriv +intDriv -driOld );
705 void TFoam::Varedu(Double_t ceSum[5], Int_t &kBest, Double_t &xBest, Double_t &yBest)
707 Double_t nent = ceSum[2];
708 Double_t swAll = ceSum[0];
709 Double_t sswAll = ceSum[1];
710 Double_t ssw =
sqrt(sswAll)/
sqrt(nent);
712 Double_t swIn,swOut,sswIn,sswOut,xLo,xUp;
716 Double_t maxGain=0.0;
718 for(Int_t kProj=0; kProj<
fDim; kProj++) {
721 Double_t sigmIn =0.0; Double_t sigmOut =0.0;
722 Double_t sswtBest =
gHigh;
724 Double_t xMin=0.0; Double_t xMax=0.0;
726 for(Int_t jLo=1; jLo<=
fNBin; jLo++) {
727 Double_t aswIn=0; Double_t asswIn=0;
728 for(Int_t jUp=jLo; jUp<=
fNBin;jUp++) {
729 aswIn += ((TH1D *)(*
fHistEdg)[kProj])->GetBinContent(jUp);
730 asswIn +=
Sqr(((TH1D *)(*
fHistEdg)[kProj])->GetBinError( jUp));
734 swOut = (swAll-aswIn)/nent;
735 sswIn =
sqrt(asswIn) /
sqrt(nent*(xUp-xLo)) *(xUp-xLo);
736 sswOut=
sqrt(sswAll-asswIn)/
sqrt(nent*(1.0-xUp+xLo)) *(1.0-xUp+xLo);
737 if( (sswIn+sswOut) < sswtBest) {
738 sswtBest = sswIn+sswOut;
740 sigmIn = sswIn -swIn;
741 sigmOut = sswOut-swOut;
747 Int_t iLo = (Int_t) (
fNBin*xMin);
748 Int_t iUp = (Int_t) (
fNBin*xMax);
753 for(Int_t iBin=1;iBin<=
fNBin;iBin++) {
754 if( ((iBin-0.5)/
fNBin > xMin) && ((iBin-0.5)/
fNBin < xMax) ){
755 ((TH1D *)(*
fHistDbg)[kProj])->SetBinContent(iBin,sigmIn/(xMax-xMin));
757 ((TH1D *)(*
fHistDbg)[kProj])->SetBinContent(iBin,sigmOut/(1-xMax+xMin));
765 if(iLo == 0) xBest=yBest;
766 if(iUp ==
fNBin) yBest=xBest;
772 if( (kBest >= fDim) || (kBest<0) ) Error(
"Varedu",
"Something wrong with kBest - kBest = %d dim = %d\n",kBest,fDim);
784 Double_t carve,carvTot,carvMax,carvOne,binMax,binTot;
785 Int_t jLow,jUp,iLow,iUp;
790 Double_t *bins =
new Double_t[
fNBin];
791 if(bins==0) Error(
"Carver",
"Cannot initialize buffer Bins \n" );
798 for(kProj=0; kProj<
fDim; kProj++)
804 for(iBin=0; iBin<
fNBin;iBin++){
805 bins[iBin]= ((TH1D *)(*
fHistEdg)[kProj])->GetBinContent(iBin+1);
806 binMax = TMath::Max( binMax, bins[iBin]);
814 for(iBin=0;iBin<
fNBin;iBin++){
815 carvTot = carvTot + (binMax-bins[iBin]);
823 Double_t yLevel =
gVlow;
824 for(iBin=0; iBin<
fNBin;iBin++) {
828 for(j=iBin; j>-1; j-- ) {
829 if(theBin< bins[j])
break;
836 for(j=iBin; j<
fNBin; j++) {
837 if(theBin< bins[j])
break;
843 carve = (iUp-iLow+1)*(binMax-theBin);
844 if( carve > carvOne) {
851 if( carvTot > carvMax) {
856 xBest = ((Double_t)(jLow))/fNBin;
857 yBest = ((Double_t)(jUp+1))/fNBin;
858 if(jLow == 0 ) xBest = yBest;
859 if(jUp == fNBin-1) yBest = xBest;
866 for(iBin=0; iBin<
fNBin; iBin++)
867 ((TH1D *)(*fHistDbg)[kProj])->SetBinContent(iBin+1,binMax);
868 for(iBin=jLow; iBin<jUp+1; iBin++)
869 ((TH1D *)(*fHistDbg)[kProj])->SetBinContent(iBin+1,yLevel);
871 if( (kBest >= fDim) || (kBest<0) ) Error(
"Carver",
"Something wrong with kBest - kBest = %d dim = %d\n",kBest,fDim);
901 if( (iCell<0) || (iCell>
fLastCe) ) Error(
"Grow",
"Wrong iCell \n");
910 std::cout<<
fDim<<std::flush;
912 std::cout<<
"."<<std::flush;
913 if( (
fLastCe%(100*kEcho))==0) std::cout<<
"|"<<
fLastCe<<std::endl<<std::flush;
917 if(
Divide( newCell )==0)
break;
920 std::cout<<std::endl<<std::flush;
933 Double_t drivMax, driv;
937 if(
fCells[i]->GetStat() == 1 ) {
938 driv = TMath::Abs(
fCells[i]->GetDriv());
948 std::cout <<
"STOP in TFoam::PeekMax: not found iCell=" << iCell << std::endl;
966 if(
fLastCe+1 >=
fNCells) Error(
"Divide",
"Buffer limit is reached, fLastCe=fnBuf \n");
972 if( kBest<0 || kBest>=
fDim ) Error(
"Divide",
"Wrong kBest \n");
1009 for(iCell=0; iCell<=
fLastCe; iCell++) {
1010 if (
fCells[iCell]->GetStat()==1) {
1017 if(
fNoAct != n) Error(
"MakeActiveList",
"Wrong fNoAct \n" );
1018 if(
fPrime == 0.) Error(
"MakeActiveList",
"Integrand function is zero \n" );
1021 if(
fCellsAct==0 ||
fPrimAcu==0 ) Error(
"MakeActiveList",
"Cant allocate fCellsAct or fPrimAcu \n");
1024 for(iCell=0; iCell<
fNoAct; iCell++) {
1040 Info(
"ResetPseRan",
"Resetting random number generator \n");
1054 Error(
"SetRho",
"Bad function \n" );
1065 if (
fRho && dynamic_cast<FoamIntegrandFunction*>(
fRho) )
delete fRho;
1066 fRho=
new FoamIntegrandFunction(fun);
1068 Error(
"SetRho",
"Bad function \n" );
1082 Info(
"ResetRho",
"!!! Resetting distribution function !!!\n");
1098 paramArr[0]=(Long_t)
fDim;
1099 paramArr[1]=(Long_t)xRand;
1117 Double_t fhit, flo, fhi;
1124 hit = lo + (Int_t)( (hi-lo)*(random-flo)/(fhi-flo)+0.5);
1155 Double_t wt,dx,mcwt;
1165 rCell->
GetHcub(cellPosi,cellSize);
1166 for(j=0; j<
fDim; j++)
1204 for ( Int_t k=0 ; k<
fDim ; k++) *(MCvect +k) =
fMCvect[k];
1246 mcError = mcResult *mCerelat;
1259 Double_t intMC,errMC;
1275 Double_t mCeff, wtLim;
1289 Double_t mcResult,mcError;
1291 Double_t mCerelat= mcError/mcResult;
1294 Double_t eps = 0.0005;
1295 Double_t mCeff, mcEf2, wtMax, aveWt, sigma;
1298 if(wtMax>0.0) mCeff=aveWt/wtMax;
1299 mcEf2 = sigma/aveWt;
1303 BXTXT(
"****************************************");
1304 BXTXT(
"****** TFoam::Finalize ******");
1305 BXTXT(
"****************************************");
1306 BX1I(
" NevGen",
fNevGen,
"Number of generated events in the MC generation ");
1307 BX1I(
" nCalls",
fNCalls,
"Total number of function calls ");
1308 BXTXT(
"----------------------------------------");
1309 BX1F(
" AveWt",aveWt,
"Average MC weight ");
1310 BX1F(
" WtMin",
fWtMin,
"Minimum MC weight (absolute) ");
1311 BX1F(
" WtMax",
fWtMax,
"Maximum MC weight (absolute) ");
1312 BXTXT(
"----------------------------------------");
1313 BX1F(
" XPrime",
fPrime,
"Primary total integral, R_prime ");
1314 BX1F(
" XDiver",driver,
"Driver total integral, R_loss ");
1315 BXTXT(
"----------------------------------------");
1316 BX2F(
" IntMC", mcResult, mcError,
"Result of the MC Integral");
1317 BX1F(
" mCerelat", mCerelat,
"Relative error of the MC integral ");
1318 BX1F(
" <w>/WtMax",mCeff,
"MC efficiency, acceptance rate");
1319 BX1F(
" Sigma/<w>",mcEf2,
"MC efficiency, variance/ave_wt");
1320 BX1F(
" WtMax",wtMax,
"WtMax(esp= 0.0005) ");
1321 BX1F(
" Sigma",sigma,
"variance of MC weight ");
1324 BX1F(
"<OveW>/<W>",avOve,
"Contrib. of events wt>MaxWtRej");
1342 if(
fDim==0) Error(
"TFoam",
"SetInhiDiv: fDim=0 \n");
1348 if( ( 0<=iDim) && (iDim<
fDim)) {
1351 Error(
"SetInhiDiv:",
"Wrong iDim \n");
1367 if(
fDim<=0) Error(
"SetXdivPRD",
"fDim=0 \n");
1368 if( len<1 ) Error(
"SetXdivPRD",
"len<1 \n");
1375 if( ( 0<=iDim) && (iDim<
fDim)) {
1378 Error(
"SetXdivPRD",
"Second allocation of XdivPRD not allowed \n");
1380 for(i=0; i<len; i++) {
1384 Error(
"SetXdivPRD",
"Wrong iDim \n");
1387 std::cout<<
" SetXdivPRD, idim= "<<iDim<<
" len= "<<len<<
" "<<std::endl;
1388 for(i=0; i<len; i++) {
1389 if (iDim <
fDim) std::cout<< (*
fXdivPRD[iDim])[i] <<
" ";
1391 std::cout<<std::endl;
1392 for(i=0; i<len; i++) std::cout<< xDiv[i] <<
" ";
1393 std::cout<<std::endl;
1405 Int_t errors, warnings;
1409 errors = 0; warnings = 0;
1410 if (level==1) std::cout <<
"///////////////////////////// FOAM_Checks /////////////////////////////////" << std::endl;
1411 for(iCell=1; iCell<=
fLastCe; iCell++) {
1417 if (level==1) Error(
"CheckAll",
"ERROR: Cell's no %ld has only one daughter \n",iCell);
1421 if (level==1) Error(
"CheckAll",
"ERROR: Cell's no %ld has no daughter and is inactive \n",iCell);
1425 if (level==1) Error(
"CheckAll",
"ERROR: Cell's no %ld has two daughters and is active \n",iCell);
1432 if (level==1) Error(
"CheckAll",
"ERROR: Cell's no %ld parent not pointing to this cell\n ",iCell);
1438 if(cell != (cell->
GetDau0())->GetPare()) {
1440 if (level==1) Error(
"CheckAll",
"ERROR: Cell's no %ld daughter 0 not pointing to this cell \n",iCell);
1444 if(cell != (cell->
GetDau1())->GetPare()) {
1446 if (level==1) Error(
"CheckAll",
"ERROR: Cell's no %ld daughter 1 not pointing to this cell \n",iCell);
1452 for(iCell=0; iCell<=
fLastCe; iCell++) {
1456 if(level==1) Warning(
"CheckAll",
"Warning: Cell no. %ld is active but empty \n", iCell);
1461 Info(
"CheckAll",
"Check has found %d errors and %d warnings \n",errors, warnings);
1464 Info(
"CheckAll",
"Check - found total %d errors \n",errors);
1475 for(iCell=0; iCell<=
fLastCe; iCell++) {
1476 std::cout<<
"Cell["<<iCell<<
"]={ ";
1478 std::cout<<std::endl;
1480 std::cout<<
"}"<<std::endl;
1490 std::ofstream outfile(filename, std::ios::out);
1491 Double_t x1,y1,x2,y2,
x,
y;
1494 Double_t lpag =1-2*offs;
1495 outfile<<
"{" << std::endl;
1496 outfile<<
"cMap = new TCanvas(\"Map1\",\" Cell Map \",600,600);"<<std::endl;
1498 outfile<<
"TBox*a=new TBox();"<<std::endl;
1499 outfile<<
"a->SetFillStyle(0);"<<std::endl;
1500 outfile<<
"a->SetLineWidth(4);"<<std::endl;
1501 outfile<<
"a->SetLineColor(2);"<<std::endl;
1502 outfile<<
"a->DrawBox("<<offs<<
","<<offs<<
","<<(offs+lpag)<<
","<<(offs+lpag)<<
");"<<std::endl;
1504 outfile<<
"TText*t=new TText();"<<std::endl;
1505 outfile<<
"t->SetTextColor(4);"<<std::endl;
1507 outfile<<
"t->SetTextSize(0.025);"<<std::endl;
1509 outfile<<
"t->SetTextSize(0.015);"<<std::endl;
1511 outfile<<
"t->SetTextSize(0.008);"<<std::endl;
1513 outfile<<
"TBox*b=new TBox();"<<std::endl;
1514 outfile <<
"b->SetFillStyle(0);"<<std::endl;
1518 outfile <<
"// =========== Rectangular cells ==========="<< std::endl;
1519 for(iCell=1; iCell<=
fLastCe; iCell++) {
1520 if(
fCells[iCell]->GetStat() == 1) {
1522 x1 = offs+lpag*( cellPosi[0]); y1 = offs+lpag*( cellPosi[1]);
1523 x2 = offs+lpag*(cellPosi[0]+cellSize[0]); y2 = offs+lpag*(cellPosi[1]+cellSize[1]);
1526 outfile<<
"b->DrawBox("<<x1<<
","<<y1<<
","<<x2<<
","<<y2<<
");"<<std::endl;
1529 x = offs+lpag*(cellPosi[0]+0.5*cellSize[0]); y = offs+lpag*(cellPosi[1]+0.5*cellSize[1]);
1530 outfile<<
"t->DrawText("<<x<<
","<<y<<
","<<
"\""<<iCell<<
"\""<<
");"<<std::endl;
1534 outfile<<
"// ============== End Rectangles ==========="<< std::endl;
1538 outfile <<
"}" << std::endl;
1546 Info(
"LinkCells",
"VOID function for backward compatibility \n");
Int_t fNoAct
Lists of division values encoded in one vector per direction.
virtual void CheckAll(Int_t)
User utility, miscellaneous and debug.
virtual void RootPlot2dim(Char_t *)
Debugging tool which plots 2-dimensional cells as rectangles in C++ format readable for root...
#define BX2F(name, numb, err, text)
virtual void LinkCells(void)
virtual Long_t PeekMax()
Internal subprogram used by Initialize.
virtual void GetWtParams(Double_t, Double_t &, Double_t &, Double_t &)
May be called optionally after the MC run.
Int_t fOptPRD
[fDim] Flags for inhibiting cell division
void SetDau1(TFoamCell *Daug)
virtual void RndmArray(Int_t n, Float_t *array)
Return an array of n random numbers uniformly distributed in ]0,1].
virtual void Varedu(Double_t [], Int_t &, Double_t &, Double_t &)
Internal subrogram used by Initialize.
virtual Double_t MCgenerate(Double_t *MCvect)
User subprogram which generates MC event and returns MC weight.
void Print(Option_t *option) const
Printout of the cell geometry parameters for the debug purpose.
virtual void MakeEvent()
User subprogram.
TFoamCell * GetDau1() const
virtual ~TFoam()
Default destructor.
virtual void SetRhoInt(Double_t(*fun)(Int_t, Double_t *))
User may use this method to set the distribution object as a global function pointer (and not as an i...
void GetMCeff(Double_t, Double_t &, Double_t &)
Calculates Efficiency= aveWt/wtLim for a given tolerance level epsilon<<1 using information stored in...
virtual void GenerCel2(TFoamCell *&)
Internal subprogram.
virtual void MakeActiveList()
Internal subrogram used by Initialize.
you should not use this method at all Int_t y
virtual void Grow()
Internal subrogram used by Initialize.
virtual void SetXdivPRD(Int_t, Int_t, Double_t[])
This should be called before Initialize, after setting kDim It predefines values of the cell division...
virtual Double_t GetMCwt()
User may get weight MC weight using this method.
virtual void ResetRho(TFoamIntegrand *Rho)
User may optionally reset the distribution using this method Usually it is done when FOAM object is r...
TMethodCall * fMethodCall
Pointer to the user-defined integrand function/distribution.
This is the base class for the ROOT Random number generators.
virtual void PrintCells()
Prints geometry of ALL cells of the FOAM.
#define BX1I(name, numb, text)
Double_t Sqr(Double_t x) const
void CalcVolume()
Calculates volume of the cell using size params which are calculated.
TFoamCell * GetDau0() const
virtual void Finalize(Double_t &, Double_t &)
May be called optionally by the user after the MC run.
virtual Double_t Rndm()
Machine independent random number generator.
void SetXdiv(Double_t Xdiv)
virtual void MakeAlpha()
Internal subrogram used by Initialize.
void SetDriv(Double_t Driv)
virtual void GetMCvect(Double_t *)
User may get generated MC point/vector with help of this method.
virtual void SetInhiDiv(Int_t, Int_t)
This can be called before Initialize, after setting kDim It defines which variables are excluded in t...
virtual Double_t Density(Int_t ndim, Double_t *)=0
void SetIntg(Double_t Intg)
Double_t GetVolume() const
virtual void Initialize()
Basic initialization of FOAM invoked by the user.
TFoamCell * GetPare() const
* x
Deprecated and error prone model selection interface.
static const Double_t gVlow
void Fill(Int_t, TFoamCell *, TFoamCell *, TFoamCell *)
Fills in certain data into newly allocated cell.
virtual void Carver(Int_t &, Double_t &, Double_t &)
Internal subrogram used by Initialize.
void GetHcub(TFoamVect &, TFoamVect &) const
Provides size and position of the cell These parameter are calculated by analyzing information in all...
virtual void SetPseRan(TRandom *PseRan)
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
virtual void InitCells()
Internal subprogram used by Initialize.
void SetSerial(Int_t Serial)
virtual Int_t CellFill(Int_t, TFoamCell *)
Internal subprogram used by Initialize.
virtual void GetIntNorm(Double_t &, Double_t &)
User subprogram.
virtual void Explore(TFoamCell *Cell)
Internal subprogram used by Initialize.
void SetPrim(Double_t Prim)
virtual void ResetPseRan(TRandom *PseRan)
User may optionally reset random number generator using this method Usually it is done when FOAM obje...
void Fill(Double_t)
Filling analyzed weight.
#define BX1F(name, numb, text)
virtual Double_t Eval(Double_t *)
Internal subprogram.
virtual Int_t Divide(TFoamCell *)
Internal subrogram used by Initialize.
static const Double_t gHigh
Int_t * fInhiDiv
[fDim] Dynamic Mask for cell division
void SetDau0(TFoamCell *Daug)
virtual void SetRho(TFoamIntegrand *Rho)
User may use this method to set the distribution object.
virtual void GetIntegMC(Double_t &, Double_t &)
User subprogram.
TFoam()
Default constructor for streamer, user should not use it.
TRandom * fPseRan
ROOT's pointer to user-defined global distribution function.