fake.C
void fake(Int_t nevents=10)
{
// Example of macro illustrating how to use the automatic
// Geant to Root conversion classes.
// This example requires only the standard Root (not Zebra or Geant)
// Uses simulated data to fill the new classes
gROOT->Reset();
gSystem->Load("libghlib.so"); //load conversion library
// Open the root output file
TFile file("star.root","recreate","Run root file",2);
StarRun run("run"); // create main object to run Run
run.Init(); // Initialise event (maker histograms,etc)
run.MakeTree("KHD"); // Create the Root tree
for (Int_t i=0; i<nevents; i++) {
if (i%1 == 0) printf("In loop:%dn",i);
run.FakeKine(100,20); //Generate random tracks
run.FakeHits(10,5); //Generate random hits
run.FillTree(); //Fill the Root trees
run.Clear(); // Clear all event lists
}
run.Finish();
// save objects in Root file
run.TreeK()->Print();
run.TreeH()->Print();
// run.TreeD()->Print();
run.Write(); //save main Run object (and run parameters)
}
ROOT page - Class index - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.