hepmc - Blame information for rev 65

Subversion Repositories:
Rev:
Rev Author Line No. Line
2 garren 1 //////////////////////////////////////////////////////////////////////////
2 // Matt.Dobbs@Cern.CH, October 2002
3 // example of generating events with Herwig using HepMC/HerwigWrapper.h
4 // Events are read into the HepMC event record from the FORTRAN HEPEVT
5 // common block using the IO_HERWIG strategy.
6 //////////////////////////////////////////////////////////////////////////
65 garren 7 /// To Compile: go to the HepMC directory and type:
8 /// gmake examples/example_MyHerwig.exe
9 ///
10 /// In this example the precision and number of entries for the HEPEVT
11 /// fortran common block are explicitly defined to correspond to those
12 /// used in the Herwig version of the HEPEVT common block.
13 /// If you get funny output from HEPEVT in your own code, probably you have
14 /// set these values incorrectly!
15 ///
2 garren 16  
17 #include <iostream>
18 #include "HepMC/HerwigWrapper.h"
19 #include "HepMC/IO_HERWIG.h"
20 #include "HepMC/GenEvent.h"
21 #include "HepMC/HEPEVT_Wrapper.h"
22  
23 int main() {
24     //
25     //........................................HEPEVT
26     // Herwig 6.4 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     //.......................................INITIALIZATIONS
34  
35     hwproc.PBEAM1 = 7000.; // energy of beam1
36     hwproc.PBEAM2 = 7000.; // energy of beam2
37     // 1610 = gg->H--> WW, 1706 = qq-->ttbar, 2510 = ttH -> ttWW
38     hwproc.IPROC = 1706; // qq -> ttbar production
39     hwproc.MAXEV = 100; // number of events
40     // tell it what the beam particles are:
41     for ( unsigned int i = 0; i < 8; ++i ) {
42         hwbmch.PART1[i] = (i < 1) ? 'P' : ' ';
43         hwbmch.PART2[i] = (i < 1) ? 'P' : ' ';
44     }
45     hwigin();    // INITIALISE OTHER COMMON BLOCKS
46     hwevnt.MAXPR = 1; // number of events to print
47     hwuinc(); // compute parameter-dependent constants
48     hweini(); // initialise elementary process
49  
50     //........................................HepMC INITIALIZATIONS
51     //
52     // Instantiate an IO strategy for reading from HEPEVT.
53     HepMC::IO_HERWIG hepevtio;
54     //
55     //........................................EVENT LOOP
56     for ( int i = 1; i <= hwproc.MAXEV; i++ ) {
57         if ( i%50==1 ) std::cout << "Processing Event Number "
58                                  << i << std::endl;
59         // initialise event
60         hwuine();
61         // generate hard subprocess
62         hwepro();
63         // generate parton cascades
64         hwbgen();
65         // do heavy object decays
66         hwdhob();
67         // do cluster formation
68         hwcfor();
69         // do cluster decays
70         hwcdec();
71         // do unstable particle decays
72         hwdhad();
73         // do heavy flavour hadron decays
74         hwdhvy();
75         // add soft underlying event if needed
76         hwmevt();
77         // finish event
78         hwufne();
79         HepMC::GenEvent* evt = hepevtio.read_next_event();
80         // add some information to the event
81         evt->set_event_number(i);
82         evt->set_signal_process_id(20);
83         if (i<=hwevnt.MAXPR) {
84             std::cout << "\n\n This is the FIXED version of HEPEVT as "
85                       << "coded in IO_HERWIG " << std::endl;
86             HepMC::HEPEVT_Wrapper::print_hepevt();
87             evt->print();
88         }
89  
90         // we also need to delete the created event from memory
91         delete evt;
92     }
93     //........................................TERMINATION
94     hwefin();
95  
96     return 0;
97 }