10 #if defined(__CINT__) && !defined(__MAKECINT__)
12 std::cout <<
"Using ACliC to run this macro since it uses custom classes" << std::endl;
43 for(i = 0 ; i<nDim ; i++){
44 R1=R1+(Xarg[i] -pos1)*(Xarg[i] -pos1);
45 R2=R2+(Xarg[i] -pos2)*(Xarg[i] -pos2);
51 Fun1 =
exp(-(R1*R1)/(Gam1*Gam1))/xn1;
52 Fun2 =
exp(-(R2*R2)/(Gam2*Gam2))/xn2;
53 return 0.5e0*(Fun1+ Fun2);
61 TFile RootFile(
"foam_demo.root",
"RECREATE",
"histograms");
80 cout<<
"***** Demonstration Program for Foam version "<<FoamX->
GetVersion()<<
" *****"<<endl;
93 FoamX->
Write(
"FoamX");
96 cout <<
"====== Initialization done, entering MC loop" << endl;
101 TH1D *hst_Wt =
new TH1D(
"hst_Wt" ,
"Main weight of Foam",25,0,1.25);
104 for(loop=0; loop<NevTot; loop++){
110 hst_Wt->
Fill(MCwt,1.0);
112 cout<<
"MCwt= "<<MCwt<<
", ";
114 for (
Int_t k=0 ; k<kDim ; k++) cout<<MCvect[k]<<
" "; cout<< endl;
116 if( ((loop)%100000)==0 ){
117 cout<<
" loop= "<<loop<<endl;
122 cout <<
"====== Events generated, entering Finalize" << endl;
124 hst_Wt->
Print(
"all");
131 Effic=0;
if(WtMax>0) Effic=AveWt/WtMax;
132 cout <<
"================================================================" << endl;
133 cout <<
" MCresult= " << MCresult <<
" +- " << MCerror <<
" RelErr= "<< MCerror/MCresult << endl;
134 cout <<
" Dispersion/<wt>= " << Sigma/AveWt << endl;
135 cout <<
" <wt>/WtMax= " << Effic <<
", for epsilon = "<<eps << endl;
136 cout <<
" nCalls (initialization only) = " << nCalls << endl;
137 cout <<
"================================================================" << endl;
144 cout <<
"***** End of Demonstration Program *****" << endl;
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
virtual void ls(Option_t *option="") const
List file contents.
Random number generator class based on M.
virtual void GetWtParams(Double_t, Double_t &, Double_t &, Double_t &)
May be called optionally after the MC run.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual void MakeEvent()
User subprogram.
virtual void SetChat(Int_t Chat)
virtual void SetSeed(UInt_t seed=0)
Set the random generator seed.
virtual const char * UnixPathName(const char *unixpathname)
Convert from a Unix pathname to a local pathname.
This is the base class for the ROOT Random number generators.
virtual int CompileMacro(const char *filename, Option_t *opt="", const char *library_name="", const char *build_dir="", UInt_t dirmode=0)
This method compiles and loads a shared library containing the code from the file "filename"...
virtual void SetOptRej(Int_t OptRej)
virtual void SetnBin(Int_t nBin)
virtual void Finalize(Double_t &, Double_t &)
May be called optionally by the user after the MC run.
virtual void GetMCwt(Double_t &)
User may get weight MC weight using this method.
virtual const char * GetVersion() const
virtual void Print(Option_t *option="") const
Print some global quantities for this histogram.
virtual void GetMCvect(Double_t *)
User may get generated MC point/vector with help of this method.
R__EXTERN TSystem * gSystem
virtual Int_t Write(const char *name=0, Int_t opt=0, Int_t bufsiz=0)
Write memory objects to this file.
virtual Double_t Density(Int_t ndim, Double_t *)=0
virtual void Initialize()
Basic initialization of FOAM invoked by the user.
virtual Long_t GetnCalls() const
ClassDef(TFoamIntegrand, 1)
virtual void SetnSampl(Long_t nSampl)
1-D histogram with a double per channel (see TH1 documentation)}
virtual void SetnCells(Long_t nCells)
virtual void SetPseRan(TRandom *PseRan)
virtual void SetOptDrive(Int_t OptDrive)
virtual void Sumw2(Bool_t flag=kTRUE)
Create structure to store sum of squares of weights.
virtual void SetEvPerBin(Int_t EvPerBin)
virtual void SetRho(TFoamIntegrand *Rho)
User may use this method to set the distribution object.
virtual void GetIntegMC(Double_t &, Double_t &)
User subprogram.
virtual void Close(Option_t *option="")
Close a file.
virtual void SetkDim(Int_t kDim)