95#define BXOPE std::cout<<\
96"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"<<std::endl<<\
98#define BXTXT(text) std::cout<<\
99"F "<<std::setw(40)<< text <<" F"<<std::endl
100#define BX1I(name,numb,text) std::cout<<\
101"F "<<std::setw(10)<<name<<" = "<<std::setw(10)<<numb<<" = " <<std::setw(50)<<text<<" F"<<std::endl
102#define BX1F(name,numb,text) std::cout<<"F "<<std::setw(10)<<name<<\
103 " = "<<std::setw(15)<<std::setprecision(8)<<numb<<" = "<<std::setw(40)<<text<<" F"<<std::endl
104#define BX2F(name,numb,err,text) std::cout<<"F "<<std::setw(10)<<name<<\
105" = "<<std::setw(15)<<std::setprecision(8)<<numb<<" +- "<<std::setw(15)<<std::setprecision(8)<<err<< \
106 " = "<<std::setw(25)<<text<<" F"<<std::endl
107#define BXCLO std::cout<<\
109"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"<<std::endl
115#define SW2 setprecision(7) << std::setw(12)
124 FoamIntegrandFunction(FunctionPtr func) : fFunc(func) {}
126 virtual ~FoamIntegrandFunction() {}
130 return fFunc(nDim,
x);
144 fDim(0), fNCells(0), fRNmax(0),
145 fOptDrive(0), fChat(0), fOptRej(0),
146 fNBin(0), fNSampl(0), fEvPerBin(0),
147 fMaskDiv(0), fInhiDiv(0), fOptPRD(0), fXdivPRD(0),
148 fNoAct(0), fLastCe(0), fCells(0),
149 fMCMonit(0), fMaxWtRej(0), fCellsAct(0), fPrimAcu(0),
150 fHistEdg(0), fHistDbg(0), fHistWt(0),
151 fMCvect(0), fMCwt(0), fRvec(0),
152 fRho(0), fMethodCall(0), fPseRan(0),
153 fNCalls(0), fNEffev(0),
154 fSumWt(0), fSumWt2(0),
155 fSumOve(0), fNevGen(0),
156 fWtMax(0), fWtMin(0),
157 fPrime(0), fMCresult(0), fMCerror(0),
165 fDim(0), fNCells(0), fRNmax(0),
166 fOptDrive(0), fChat(0), fOptRej(0),
167 fNBin(0), fNSampl(0), fEvPerBin(0),
168 fMaskDiv(0), fInhiDiv(0), fOptPRD(0), fXdivPRD(0),
169 fNoAct(0), fLastCe(0), fCells(0),
170 fMCMonit(0), fMaxWtRej(0), fCellsAct(0), fPrimAcu(0),
171 fHistEdg(0), fHistDbg(0), fHistWt(0),
172 fMCvect(0), fMCwt(0), fRvec(0),
173 fRho(0), fMethodCall(0), fPseRan(0),
174 fNCalls(0), fNEffev(0),
175 fSumWt(0), fSumWt2(0),
176 fSumOve(0), fNevGen(0),
177 fWtMax(0), fWtMin(0),
178 fPrime(0), fMCresult(0), fMCerror(0),
181 if(strlen(
Name) >129) {
182 Error(
"TFoam",
"Name too long %s \n",
Name);
185 fDate=
" Release date: 2005.04.10";
261 if (
fRho &&
dynamic_cast<FoamIntegrandFunction*
>(
fRho) )
delete fRho;
270 Error(
"TFoam",
"COPY CONSTRUCTOR NOT IMPLEMENTED \n");
330 BXTXT(
"****************************************");
331 BXTXT(
"****** TFoam::Initialize ******");
332 BXTXT(
"****************************************");
335 BX1I(
" kDim",
fDim,
" Dimension of the hyper-cubical space ");
336 BX1I(
" nCells",
fNCells,
" Requested number of Cells (half of them active) ");
337 BX1I(
" nSampl",
fNSampl,
" No of MC events in exploration of a cell ");
338 BX1I(
" nBin",
fNBin,
" No of bins in histograms, MC exploration of cell ");
339 BX1I(
" EvPerBin",
fEvPerBin,
" Maximum No effective_events/bin, MC exploration ");
340 BX1I(
" OptDrive",
fOptDrive,
" Type of Driver =1,2 for Sigma,WtMax ");
341 BX1I(
" OptRej",
fOptRej,
" MC rejection on/off for OptRej=0,1 ");
342 BX1F(
" MaxWtRej",
fMaxWtRej,
" Maximum wt in rejection for wt=1 evts");
346 if(
fPseRan==0)
Error(
"Initialize",
"Random number generator not set \n");
348 if(
fDim==0)
Error(
"Initialize",
"Zero dimension not allowed \n");
356 if(
fRvec==0)
Error(
"Initialize",
"Cannot initialize buffer fRvec \n");
360 if(
fAlpha==0)
Error(
"Initialize",
"Cannot initialize buffer fAlpha \n" );
363 if(
fMCvect==0)
Error(
"Initialize",
"Cannot initialize buffer fMCvect \n" );
388 htitle=
TString(
"Edge Histogram No. ");
399 htitle=
TString(
"Debug Histogram ");
431 BXTXT(
"*** TFoam::Initialize FINISHED!!! ***");
432 BX1I(
" nCalls",
fNCalls,
"Total number of function calls ");
433 BX1F(
" XPrime",
fPrime,
"Primary total integral ");
434 BX1F(
" XDiver",driver,
"Driver total integral ");
435 BX1F(
" mcResult",
fMCresult,
"Estimate of the true MC Integral ");
461 if(
fCells==0)
Error(
"InitCells",
"Cannot initialize CELLS \n" );
482 Error(
"CellFill",
"Too many cells\n");
489 cell->
Fill(Status, parent, 0, 0);
535 cell->
GetHcub(cellPosi,cellSize);
567 for(j=0; j<
fDim; j++)
568 xRand[j]= cellPosi[j] +
fAlpha[j]*(cellSize[j]);
575 for(k=0; k<
fDim; k++) {
586 if (ceSum[3]>wt) ceSum[3]=wt;
587 if (ceSum[4]<wt) ceSum[4]=wt;
589 nevEff = ceSum[1] == 0. ? 0. : ceSum[0]*ceSum[0]/ceSum[1];
594 for(k=0; k<
fDim;k++){
602 for(k=0; k<
fDim; k++) {
604 rmax= cellPosi[k] +cellSize[k];
610 if( (rmin +1
e-99 <rdiv) && (rdiv< rmax -1
e-99)) {
612 xBest= (rdiv-cellPosi[k])/cellSize[k] ;
624 Double_t intTrue = ceSum[0]/(nevMC+0.000001);
630 if(kBest == -1)
Varedu(ceSum,kBest,xBest,yBest);
632 intDriv =
sqrt(ceSum[1]/nevMC) -intTrue;
633 intPrim =
sqrt(ceSum[1]/nevMC);
636 if(kBest == -1)
Carver(kBest,xBest,yBest);
637 intDriv =ceSum[4] -intTrue;
641 Error(
"Explore",
"Wrong fOptDrive = \n" );
655 for(parent = cell->
GetPare(); parent!=0; parent = parent->
GetPare()){
658 parent->
SetIntg( parIntg +intTrue -intOld );
659 parent->
SetDriv( parDriv +intDriv -driOld );
680 Double_t swIn,swOut,sswIn,sswOut,xLo,xUp;
686 for(
Int_t kProj=0; kProj<
fDim; kProj++) {
697 aswIn += ((
TH1D *)(*
fHistEdg)[kProj])->GetBinContent(jUp);
702 swOut = (swAll-aswIn)/nent;
703 sswIn =
sqrt(asswIn) /
sqrt(nent*(xUp-xLo)) *(xUp-xLo);
704 sswOut=
sqrt(sswAll-asswIn)/
sqrt(nent*(1.0-xUp+xLo)) *(1.0-xUp+xLo);
705 if( (sswIn+sswOut) < sswtBest) {
706 sswtBest = sswIn+sswOut;
708 sigmIn = sswIn -swIn;
709 sigmOut = sswOut-swOut;
722 if( ((iBin-0.5)/
fNBin > xMin) && ((iBin-0.5)/
fNBin < xMax) ){
723 ((
TH1D *)(*
fHistDbg)[kProj])->SetBinContent(iBin,sigmIn/(xMax-xMin));
725 ((
TH1D *)(*
fHistDbg)[kProj])->SetBinContent(iBin,sigmOut/(1-xMax+xMin));
733 if(iLo == 0) xBest=yBest;
734 if(iUp ==
fNBin) yBest=xBest;
740 if( (kBest >=
fDim) || (kBest<0) )
Error(
"Varedu",
"Something wrong with kBest - kBest = %d dim = %d\n",kBest,
fDim);
753 Double_t carve,carvTot,carvMax,carvOne,binMax,binTot;
754 Int_t jLow,jUp,iLow,iUp;
760 if(bins==0)
Error(
"Carver",
"Cannot initialize buffer Bins \n" );
767 for(kProj=0; kProj<
fDim; kProj++)
773 for(iBin=0; iBin<
fNBin;iBin++){
774 bins[iBin]= ((
TH1D *)(*
fHistEdg)[kProj])->GetBinContent(iBin+1);
783 for(iBin=0;iBin<
fNBin;iBin++){
784 carvTot = carvTot + (binMax-bins[iBin]);
793 for(iBin=0; iBin<
fNBin;iBin++) {
797 for(j=iBin; j>-1; j-- ) {
798 if(theBin< bins[j])
break;
805 for(j=iBin; j<
fNBin; j++) {
806 if(theBin< bins[j])
break;
812 carve = (iUp-iLow+1)*(binMax-theBin);
813 if( carve > carvOne) {
820 if( carvTot > carvMax) {
827 if(jLow == 0 ) xBest = yBest;
828 if(jUp ==
fNBin-1) yBest = xBest;
835 for(iBin=0; iBin<
fNBin; iBin++)
836 ((
TH1D *)(*fHistDbg)[kProj])->SetBinContent(iBin+1,binMax);
837 for(iBin=jLow; iBin<jUp+1; iBin++)
838 ((
TH1D *)(*fHistDbg)[kProj])->SetBinContent(iBin+1,yLevel);
840 if( (kBest >=
fDim) || (kBest<0) )
Error(
"Carver",
"Something wrong with kBest - kBest = %d dim = %d\n",kBest,
fDim);
870 if( (iCell<0) || (iCell>
fLastCe) ) {
871 Error(
"Grow",
"Wrong iCell \n");
882 std::cout<<
fDim<<std::flush;
884 std::cout<<
"."<<std::flush;
885 if( (
fLastCe%(100*kEcho))==0) std::cout<<
"|"<<
fLastCe<<std::endl<<std::flush;
889 if(
Divide( newCell )==0)
break;
892 std::cout<<std::endl<<std::flush;
909 if(
fCells[i]->GetStat() == 1 ) {
920 std::cout <<
"STOP in TFoam::PeekMax: not found iCell=" << iCell << std::endl;
945 if( kBest<0 || kBest>=
fDim )
Error(
"Divide",
"Wrong kBest \n");
983 for(iCell=0; iCell<=
fLastCe; iCell++) {
984 if (
fCells[iCell]->GetStat()==1) {
991 if(
fNoAct !=
n)
Error(
"MakeActiveList",
"Wrong fNoAct \n" );
992 if(
fPrime == 0.)
Error(
"MakeActiveList",
"Integrand function is zero \n" );
998 for(iCell=0; iCell<
fNoAct; iCell++) {
1015 Info(
"ResetPseRan",
"Resetting random number generator \n");
1029 Error(
"SetRho",
"Bad function \n" );
1040 if (
fRho &&
dynamic_cast<FoamIntegrandFunction*
>(
fRho) )
delete fRho;
1041 fRho=
new FoamIntegrandFunction(fun);
1043 Error(
"SetRho",
"Bad function \n" );
1058 Info(
"ResetRho",
"!!! Resetting distribution function !!!\n");
1075 paramArr[1]=(
Long_t)xRand;
1100 hit = lo + (
Int_t)( (
hi-lo)*(random-flo)/(fhi-flo)+0.5);
1141 rCell->
GetHcub(cellPosi,cellSize);
1142 for(j=0; j<
fDim; j++)
1222 mcError = mcResult *mCerelat;
1267 Double_t mCerelat= mcError/mcResult;
1274 if(wtMax>0.0) mCeff=aveWt/wtMax;
1275 mcEf2 =
sigma/aveWt;
1279 BXTXT(
"****************************************");
1280 BXTXT(
"****** TFoam::Finalize ******");
1281 BXTXT(
"****************************************");
1282 BX1I(
" NevGen",
fNevGen,
"Number of generated events in the MC generation ");
1283 BX1I(
" nCalls",
fNCalls,
"Total number of function calls ");
1284 BXTXT(
"----------------------------------------");
1285 BX1F(
" AveWt",aveWt,
"Average MC weight ");
1286 BX1F(
" WtMin",
fWtMin,
"Minimum MC weight (absolute) ");
1287 BX1F(
" WtMax",
fWtMax,
"Maximum MC weight (absolute) ");
1288 BXTXT(
"----------------------------------------");
1289 BX1F(
" XPrime",
fPrime,
"Primary total integral, R_prime ");
1290 BX1F(
" XDiver",driver,
"Driver total integral, R_loss ");
1291 BXTXT(
"----------------------------------------");
1292 BX2F(
" IntMC", mcResult, mcError,
"Result of the MC Integral");
1293 BX1F(
" mCerelat", mCerelat,
"Relative error of the MC integral ");
1294 BX1F(
" <w>/WtMax",mCeff,
"MC efficiency, acceptance rate");
1295 BX1F(
" Sigma/<w>",mcEf2,
"MC efficiency, variance/ave_wt");
1296 BX1F(
" WtMax",wtMax,
"WtMax(esp= 0.0005) ");
1297 BX1F(
" Sigma",
sigma,
"variance of MC weight ");
1300 BX1F(
"<OveW>/<W>",avOve,
"Contrib. of events wt>MaxWtRej");
1318 if(
fDim==0)
Error(
"TFoam",
"SetInhiDiv: fDim=0 \n");
1324 if( ( 0<=iDim) && (iDim<
fDim)) {
1327 Error(
"SetInhiDiv:",
"Wrong iDim \n");
1348 if(
fDim<=0)
Error(
"SetXdivPRD",
"fDim=0 \n");
1349 if( len<1 )
Error(
"SetXdivPRD",
"len<1 \n");
1356 if( ( 0<=iDim) && (iDim<
fDim)) {
1359 Error(
"SetXdivPRD",
"Second allocation of XdivPRD not allowed \n");
1361 for(i=0; i<len; i++) {
1365 Error(
"SetXdivPRD",
"Wrong iDim \n");
1368 std::cout<<
" SetXdivPRD, idim= "<<iDim<<
" len= "<<len<<
" "<<std::endl;
1369 for(i=0; i<len; i++) {
1370 if (iDim <
fDim) std::cout<< (*
fXdivPRD[iDim])[i] <<
" ";
1372 std::cout<<std::endl;
1373 for(i=0; i<len; i++) std::cout<< xDiv[i] <<
" ";
1374 std::cout<<std::endl;
1386 Int_t errors, warnings;
1390 errors = 0; warnings = 0;
1391 if (level==1) std::cout <<
"///////////////////////////// FOAM_Checks /////////////////////////////////" << std::endl;
1392 for(iCell=1; iCell<=
fLastCe; iCell++) {
1398 if (level==1)
Error(
"CheckAll",
"ERROR: Cell's no %ld has only one daughter \n",iCell);
1402 if (level==1)
Error(
"CheckAll",
"ERROR: Cell's no %ld has no daughter and is inactive \n",iCell);
1406 if (level==1)
Error(
"CheckAll",
"ERROR: Cell's no %ld has two daughters and is active \n",iCell);
1413 if (level==1)
Error(
"CheckAll",
"ERROR: Cell's no %ld parent not pointing to this cell\n ",iCell);
1421 if (level==1)
Error(
"CheckAll",
"ERROR: Cell's no %ld daughter 0 not pointing to this cell \n",iCell);
1427 if (level==1)
Error(
"CheckAll",
"ERROR: Cell's no %ld daughter 1 not pointing to this cell \n",iCell);
1433 for(iCell=0; iCell<=
fLastCe; iCell++) {
1437 if(level==1)
Warning(
"CheckAll",
"Warning: Cell no. %ld is active but empty \n", iCell);
1442 Info(
"CheckAll",
"Check has found %d errors and %d warnings \n",errors, warnings);
1445 Info(
"CheckAll",
"Check - found total %d errors \n",errors);
1456 for(iCell=0; iCell<=
fLastCe; iCell++) {
1457 std::cout<<
"Cell["<<iCell<<
"]={ ";
1459 std::cout<<std::endl;
1461 std::cout<<
"}"<<std::endl;
1471 std::ofstream outfile(filename, std::ios::out);
1476 outfile<<
"{" << std::endl;
1477 outfile<<
"cMap = new TCanvas(\"Map1\",\" Cell Map \",600,600);"<<std::endl;
1479 outfile<<
"TBox*a=new TBox();"<<std::endl;
1480 outfile<<
"a->SetFillStyle(0);"<<std::endl;
1481 outfile<<
"a->SetLineWidth(4);"<<std::endl;
1482 outfile<<
"a->SetLineColor(2);"<<std::endl;
1483 outfile<<
"a->DrawBox("<<offs<<
","<<offs<<
","<<(offs+lpag)<<
","<<(offs+lpag)<<
");"<<std::endl;
1485 outfile<<
"TText*t=new TText();"<<std::endl;
1486 outfile<<
"t->SetTextColor(4);"<<std::endl;
1488 outfile<<
"t->SetTextSize(0.025);"<<std::endl;
1490 outfile<<
"t->SetTextSize(0.015);"<<std::endl;
1492 outfile<<
"t->SetTextSize(0.008);"<<std::endl;
1494 outfile<<
"TBox*b=new TBox();"<<std::endl;
1495 outfile <<
"b->SetFillStyle(0);"<<std::endl;
1499 outfile <<
"// =========== Rectangular cells ==========="<< std::endl;
1500 for(iCell=1; iCell<=
fLastCe; iCell++) {
1501 if(
fCells[iCell]->GetStat() == 1) {
1503 x1 = offs+lpag*( cellPosi[0]); y1 = offs+lpag*( cellPosi[1]);
1504 x2 = offs+lpag*(cellPosi[0]+cellSize[0]); y2 = offs+lpag*(cellPosi[1]+cellSize[1]);
1507 outfile<<
"b->DrawBox("<<
x1<<
","<<y1<<
","<<
x2<<
","<<y2<<
");"<<std::endl;
1510 x = offs+lpag*(cellPosi[0]+0.5*cellSize[0]);
y = offs+lpag*(cellPosi[1]+0.5*cellSize[1]);
1511 outfile<<
"t->DrawText("<<
x<<
","<<
y<<
","<<
"\""<<iCell<<
"\""<<
");"<<std::endl;
1515 outfile<<
"// ============== End Rectangles ==========="<< std::endl;
1519 outfile <<
"}" << std::endl;
1527 Info(
"LinkCells",
"VOID function for backward compatibility \n");
static const double x2[5]
static const double x1[5]
#define BX1F(name, numb, text)
#define BX1I(name, numb, text)
#define BX2F(name, numb, err, text)
static const Double_t gVlow
static const Double_t gHigh
float type_of_call hi(const int &, const int &)
void SetXdiv(Double_t Xdiv)
TFoamCell * GetDau1() const
void CalcVolume()
Calculates volume of the cell using size params which are calculated.
void Print(Option_t *option) const
Printout of the cell geometry parameters for the debug purpose.
Double_t GetVolume() const
TFoamCell * GetDau0() const
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 SetSerial(Int_t Serial)
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
Small auxiliary class for controlling MC weight.
void Fill(Double_t)
Filling analyzed weight.
void GetMCeff(Double_t, Double_t &, Double_t &)
Calculates Efficiency= aveWt/wtLim for a given tolerance level epsilon<<1 using information stored in...
Auxiliary class TFoamVect of n-dimensional vector, with dynamic allocation used for the cartesian geo...
TFoam is the main class of the multi-dimensional general purpose Monte Carlo event generator (integra...
virtual void MakeActiveList()
Internal method used by Initialize.
virtual void CheckAll(Int_t)
User utility, miscellaneous and debug.
TString fName
Name of a given instance of the FOAM class.
virtual Int_t Divide(TFoamCell *)
Internal method used by Initialize.
virtual void PrintCells()
Prints geometry of ALL cells of the FOAM.
TH1D * fHistWt
Histogram of the MC wt.
virtual void GetMCvect(Double_t *)
User may get generated MC point/vector with help of this method.
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.
virtual void InitCells()
Internal method used by Initialize.
Double_t fNevGen
Total number of the generated MC events.
virtual void MakeEvent()
User method.
Double_t fSumWt2
Total sum of wt and wt^2.
TFoamVect ** fXdivPRD
! Lists of division values encoded in one vector per direction
virtual Long_t PeekMax()
Internal method used by Initialize.
virtual void GenerCel2(TFoamCell *&)
Internal method.
virtual void Initialize()
Basic initialization of FOAM invoked by the user.
virtual void GetIntNorm(Double_t &, Double_t &)
User method.
TRefArray * fCellsAct
Array of pointers to active cells, constructed at the end of foam build-up.
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.
virtual Double_t GetMCwt()
User may get weight MC weight using this method.
Double_t fWtMin
Maximum/Minimum MC weight.
virtual void ResetRho(TFoamIntegrand *Rho)
User may optionally reset the distribution using this method.
Int_t fEvPerBin
Maximum number of effective (wt=1) events per bin.
virtual void GetIntegMC(Double_t &, Double_t &)
User method.
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 RootPlot2dim(Char_t *)
Debugging tool which plots 2-dimensional cells as rectangles in C++ format readable for root.
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 Explore(TFoamCell *Cell)
Internal method used by Initialize.
virtual Double_t Eval(Double_t *)
Internal method.
virtual void MakeAlpha()
Internal method used by Initialize.
virtual void ResetPseRan(TRandom *PseRan)
User may optionally reset random number generator using this method.
TMethodCall * fMethodCall
! ROOT's pointer to user-defined global distribution function
Double_t Sqr(Double_t x) const
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.
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...
Double_t fSumOve
Total Sum of overweighted events.
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 ~TFoam()
Default destructor.
Int_t * fMaskDiv
! [fDim] Dynamic Mask for cell division
virtual void LinkCells(void)
virtual void SetRho(TFoamIntegrand *Rho)
User may use this method to set the distribution object.
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...
Int_t fNoAct
Number of active cells.
virtual void Finalize(Double_t &, Double_t &)
May be called optionally by the user after the MC run.
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
virtual Double_t MCgenerate(Double_t *MCvect)
User method which generates MC event and returns MC weight.
Double_t * fMCvect
[fDim] Generated MC vector for the outside user
TString fVersion
Actual version of the FOAM like (1.01m)
virtual Int_t CellFill(Int_t, TFoamCell *)
Internal method used by Initialize.
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)
TObjArray * fHistEdg
Histograms of wt, one for each cell edge.
Double_t fMCresult
True Integral R from MC series.
virtual void GetWtParams(Double_t, Double_t &, Double_t &, Double_t &)
May be called optionally after the MC run.
Int_t fNBin
No. of bins in the edge histogram for cell MC exploration.
virtual void Grow()
Internal method used by Initialize.
TFoam()
Default constructor for streamer, user should not use it.
virtual void Varedu(Double_t[], Int_t &, Double_t &, Double_t &)
Internal method used by Initialize.
virtual void Carver(Int_t &, Double_t &, Double_t &)
Internal method used by Initialize.
1-D histogram with a double per channel (see TH1 documentation)}
virtual void Reset(Option_t *option="")
Reset.
static void AddDirectory(Bool_t add=kTRUE)
Sets the flag controlling the automatic add of histograms in memory.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
static Bool_t AddDirectoryStatus()
Static function: cannot be inlined on Windows/NT.
void Execute(const char *, const char *, int *=0)
Execute method on this object with the given parameter string, e.g.
void SetParamPtrs(void *paramArr, Int_t nparam=-1)
ParamArr is an array containing the function argument values.
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
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.
virtual void RndmArray(Int_t n, Float_t *array)
Return an array of n random numbers uniformly distributed in ]0,1].
virtual Double_t Rndm()
Machine independent random number generator.
An array of references to TObjects.
TObject * At(Int_t idx) const
const char * Data() const
Short_t Max(Short_t a, Short_t b)
Short_t Min(Short_t a, Short_t b)
static long int sum(long int i)