hepmc - Blame information for rev 422

Subversion Repositories:
Rev:
Rev Author Line No. Line
2 garren 1 //////////////////////////////////////////////////////////////////////////
2 // Matt.Dobbs@Cern.CH, December 1999
3 // November 2000, updated to use Pythia 6.1
4 // example of generating events with Pythia
5 // using HepMC/PythiaWrapper.h
6 // Events are read into the HepMC event record from the FORTRAN HEPEVT
7 // common block using the IO_HEPEVT strategy -- nothing is done with them.
8 // This program is just used to find the total time required to transfer
9 // from HEPEVT into the HepMC event record.
10 //////////////////////////////////////////////////////////////////////////
11 // To Compile: go to the HepMC directory and type:
12 // gmake examples/example_MyPythiaOnlyTo HepMC.exe
13 //
14 // See comments in examples/example_MyPythia.cxx regarding the HEPEVT wrapper.
15 //
16  
17 #include <iostream>
18 #include "HepMC/PythiaWrapper.h"
19 #include "HepMC/IO_HEPEVT.h"
20 #include "HepMC/GenEvent.h"
76 garren 21 #include "PythiaHelper.h"
22  
2 garren 23 int main() {    
24     //
25     //........................................HEPEVT
26     // Pythia 6.1 uses HEPEVT with 4000 entries and 8-byte floating point
27     //  numbers. We need to explicitly pass this information to the
28     //  HEPEVT_Wrapper.
29     //
30     HepMC::HEPEVT_Wrapper::set_max_number_entries(4000);
31     HepMC::HEPEVT_Wrapper::set_sizeof_real(8);
32     // 
33     //........................................PYTHIA INITIALIZATIONS
76 garren 34     initPythia();
2 garren 35     //
36     //........................................HepMC INITIALIZATIONS
37     //
38     // Instantiate an IO strategy for reading from HEPEVT.
39     HepMC::IO_HEPEVT hepevtio;
40     //
422 garren 41     HepMC::GenCrossSection xs;
42     //
2 garren 43     //........................................EVENT LOOP
44     for ( int i = 1; i <= 100; i++ ) {
45         if ( i%50==1 ) std::cout << "Processing Event Number "
46                                  << i << std::endl;
47         call_pyevnt();      // generate one event with Pythia
48         // pythia pyhepc routine convert common PYJETS in common HEPEVT
49         call_pyhepc( 1 );
50         HepMC::GenEvent* evt = hepevtio.read_next_event();
422 garren 51         // define the units (Pythia uses GeV and mm)
52         evt->use_units(HepMC::Units::GEV, HepMC::Units::MM);
103 garren 53         // set number of multi parton interactions
54         evt->set_mpi( pypars.msti[31-1] );
422 garren 55         // set cross section information
56         xs.set_cross_section( pyint5.xsec[2][0] );
57         evt->set_cross_section( xs );
2 garren 58         //
59         //.......................USER WOULD PROCESS EVENT HERE
60         //
61         // we also need to delete the created event from memory
62         delete evt;
63     }
64     //........................................TERMINATION
65     // write out some information from Pythia to the screen
66     call_pystat( 1 );    
67  
68     return 0;
69 }
70  
71  
72