00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 {
00018 UInt_t numEvents = 500;
00019 UInt_t numParticles = 100;
00020 UInt_t runNum = 1;
00021 Int_t sourceId = 7;
00022 UInt_t sequence = 4;
00023
00024 gObjectTable->Print();
00025
00026 if (!strcmp(gSystem->GetName(), "WinNT")) {
00027 gSystem->Load("mcRootData.dll");
00028 } else {
00029 gSystem->Load("libmcRootData.so");
00030 }
00031 TFile *f = new TFile("mc.root", "RECREATE");
00032 TTree *t = new TTree("Mc", "Mc");
00033 McEvent *ev = new McEvent();
00034 t->Branch("McEvent", "McEvent", &ev, 64000, 1);
00035
00036 gObjectTable->Print();
00037 TRandom randGen ;
00038 RAND_NUM = randGen.Rndm() ;
00039
00040 Int_t ievent;
00041 for (ievent = 0; ievent < numEvents; ievent++) {
00042 ev->Fake(ievent,runNum,RAND_NUM) ;
00043
00044 t->Fill();
00045 ev->Clear();
00046 }
00047
00048 delete ev;
00049
00050 printf("Here is the object table after creating events, storing them to file and deleting the objects\n");
00051 gObjectTable->Print();
00052
00053 f->Write();
00054 f->Close();
00055 delete f;
00056
00057 }
00058
00059