This simple macro demonstrates persistency of FOAM object.
First run macro foam_demo.C to create file foam_demo.root with FOAM object.
Next type root -l foam_demopers.C
from shell command line
{
macroName.
Append(
"/foam/foam_demo.C");
cout<<"====================== TestVector ================================"<<endl;
TFile fileA(
"foam_demo.root");
fileA.cd();
cout<<"------------------------------------------------------------------"<<endl;
fileA.ls();
cout<<"------------------------------------------------------------------"<<endl;
fileA.Map();
cout<<"------------------------------------------------------------------"<<endl;
fileA.ShowStreamerInfo();
cout<<"------------------------------------------------------------------"<<endl;
fileA.GetListOfKeys()->Print();
cout<<"------------------------------------------------------------------"<<endl;
for(long loop=0; loop<50000; loop++){
if(loop<10) cout<<
"(x,y) = ( "<<
x <<
", "<<
y <<
" )"<<endl;
}
cout << " MCresult= " << MCresult << " +- " << MCerror <<endl;
cout<<"===================== TestPers FINISHED ======================="<<endl;
return 0;
}
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
virtual void CheckAll(Int_t)
User utility, miscellaneous and debug.
virtual void GetMCvect(Double_t *)
User may get generated MC point/vector with help of this method.
virtual void MakeEvent()
User subprogram.
virtual void GetIntegMC(Double_t &, Double_t &)
User subprogram.
virtual void SetRho(TFoamIntegrand *Rho)
User may use this method to set the distribution object.
virtual void Finalize(Double_t &, Double_t &)
May be called optionally by the user after the MC run.
const char * Data() const
TString & Append(const char *cs)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
- Author
- Stascek Jadach
Definition in file foam_demopers.C.