Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fixed broken tutorials
  • Loading branch information
pmiquelm committed Aug 18, 2016
commit 87155f568bc1d39e3d91c57577c44e93bb607fba
28 changes: 14 additions & 14 deletions tutorials/foam/foam_demo.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
///
/// To run this macro type from CINT command line
///
/// ~~~ {.cpp}
/// ```cpp
/// root [0] gSystem->Load("libFoam.so")
/// root [1] .x foam_demo.C+
/// ~~~
/// ```
///
/// \macro_code
///
Expand Down Expand Up @@ -60,7 +60,7 @@ Int_t foam_demo()
TFile RootFile("foam_demo.root","RECREATE","histograms");
long loop;
Double_t MCresult,MCerror,MCwt;
//=========================================================
//-----------------------------------------
long NevTot = 50000; // Total MC statistics
Int_t kDim = 2; // total dimension
Int_t nCells = 500; // Number of Cells
Expand All @@ -70,12 +70,12 @@ Int_t foam_demo()
Int_t OptDrive = 2; // (D=2) Option, type of Drive =0,1,2 for TrueVol,Sigma,WtMax
Int_t EvPerBin = 25; // Maximum events (equiv.) per bin in buid-up
Int_t Chat = 1; // Chat level
//=========================================================
//-----------------------------------------
TRandom *PseRan = new TRandom3(); // Create random number generator
TFoam *FoamX = new TFoam("FoamX"); // Create Simulator
TFoamIntegrand *rho= new TFDISTR();
PseRan->SetSeed(4357);
//=========================================================
//-----------------------------------------
cout<<"***** Demonstration Program for Foam version "<<FoamX->GetVersion()<<" *****"<<endl;
FoamX->SetkDim( kDim); // Mandatory!!!
FoamX->SetnCells( nCells); // optional
Expand All @@ -85,21 +85,21 @@ Int_t foam_demo()
FoamX->SetOptDrive( OptDrive); // optional
FoamX->SetEvPerBin( EvPerBin); // optional
FoamX->SetChat( Chat); // optional
//===============================
//-----------------------------------------
FoamX->SetRho(rho);
FoamX->SetPseRan(PseRan);
FoamX->Initialize(); // Initialize simulator
FoamX->Write("FoamX"); // Writing Foam on the disk, TESTING PERSISTENCY!!!
//===============================
//-----------------------------------------
long nCalls=FoamX->GetnCalls();
cout << "====== Initialization done, entering MC loop" << endl;
//======================================================================
//-----------------------------------------
//cout<<" About to start MC loop: "; cin.getline(question,20);
Double_t *MCvect =new Double_t[kDim]; // vector generated in the MC run
//======================================================================
//-----------------------------------------
TH1D *hst_Wt = new TH1D("hst_Wt" , "Main weight of Foam",25,0,1.25);
hst_Wt->Sumw2();
//======================================================================
//-----------------------------------------
for(loop=0; loop<NevTot; loop++){
/*===============================*/
FoamX->MakeEvent(); // generate MC event
Expand All @@ -116,8 +116,9 @@ Int_t foam_demo()
cout<<" loop= "<<loop<<endl;
}
}
//======================================================================
//======================================================================

//-----------------------------------------

cout << "====== Events generated, entering Finalize" << endl;

hst_Wt->Print("all");
Expand All @@ -143,7 +144,6 @@ Int_t foam_demo()
cout << "***** End of Demonstration Program *****" << endl;

return 0;
} // end of Demo
}

#endif

2 changes: 1 addition & 1 deletion tutorials/graphs/graphstruct.C
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
///
/// \author Olivier Couet

void graphstruct()
TCanvas * graphstruct()
{
TGraphStruct *gs = new TGraphStruct();

Expand Down