00001
00002
00003
00004
00005
00006
00007
00008 Int_t foam_demopers()
00009 {
00010 gSystem->Load("libFoam.so");
00011 gROOT->ProcessLine(".L foam_demo.C+");
00012
00013 cout<<"====================== TestVector ================================"<<endl;
00014 TFile fileA("foam_demo.root");
00015 fileA.cd();
00016 cout<<"------------------------------------------------------------------"<<endl;
00017 fileA.ls();
00018 cout<<"------------------------------------------------------------------"<<endl;
00019 fileA.Map();
00020 cout<<"------------------------------------------------------------------"<<endl;
00021 fileA.ShowStreamerInfo();
00022 cout<<"------------------------------------------------------------------"<<endl;
00023 fileA.GetListOfKeys()->Print();
00024 cout<<"------------------------------------------------------------------"<<endl;
00025
00026 TFoam *FoamX = (TFoam*)fileA.Get("FoamX");
00027
00028
00029 FoamX->CheckAll(1);
00030
00031 Double_t *MCvect =new Double_t[2];
00032
00033 for(long loop=0; loop<50000; loop++){
00034 FoamX->MakeEvent();
00035 FoamX->GetMCvect( MCvect);
00036 Double_t x=MCvect[0];
00037 Double_t y=MCvect[1];
00038 if(loop<10) cout<<"(x,y) = ( "<< x <<", "<< y <<" )"<<endl;
00039 }
00040
00041 Double_t IntNorm, Errel;
00042 FoamX->Finalize( IntNorm, Errel);
00043 Double_t MCresult, MCerror;
00044 FoamX->GetIntegMC( MCresult, MCerror);
00045 cout << " MCresult= " << MCresult << " +- " << MCerror <<endl;
00046 cout<<"===================== TestPers FINISHED ======================="<<endl;
00047 return 0;
00048 }
00049
00050
00051