#ifndef __CINT__ #include "Riostream.h" #include "TApplication.h" #include "/usr/local/include/root/TPythia6.h" //#include "TPythia6.h" #include "TFile.h" #include "TError.h" #include "TTree.h" #include "TClonesArray.h" #include "TH1.h" #include "TF1.h" #include "TStyle.h" #include "TLatex.h" #include "TCanvas.h" #include using namespace std; #endif // This function loads the needed libraries if we're executing from // an interactive session. void loadLibraries() { #ifdef __CINT__ // Load the Event Generator abstraction library, Pythia 6 // library, and the Pythia 6 interface library. gSystem->Load("libEG"); gSystem->Load("$HOME/pythia6/libPythia6"); gSystem->Load("libEGPythia6"); #endif } main() { // Load needed libraries loadLibraries(); // creating TPythia6 TPythia6* pythia = new TPythia6(); // Light SM Higgs pythia->SetMSEL(18); // MSEL = 16,17,18 pythia->SetPMAS(25,1,120.0); // mass of Higgs // LHC conditions pythia->Initialize("CMS","p","p",14000); // create the output file TFile* outputFile = new TFile("ppH_MSEL18_1000.root","RECREATE"); // create the event tree TTree* eventTree = new TTree("eventTree","Tree with the events"); // set the address of the particle data TClonesArray* particles = (TClonesArray*)pythia->GetListOfParticles(); // tell the tree where the data is TBranch* branch = eventTree->Branch("branch",&particles); cout << "generating particles..." << endl; Int_t numEvt = 1000; for(Int_t i=0; iPylist(1); } // save this event eventTree->Fill(); particles->Clear(); } eventTree->Print(); // save events to file ppmm.root outputFile->Write(); pythia->Pystat(1); }