3
// This is the implementation of the non-inlined, non-templated member
4
// functions of the HepMCFortran class.
7
#include "HepMCFortran.h"
8
#include "ThePEG/PDT/EnumParticles.h"
9
#include "ThePEG/Repository/EventGenerator.h"
10
#include "ThePEG/EventRecord/Event.h"
11
#include "ThePEG/Interface/ClassDocumentation.h"
12
#include "ThePEG/Config/HepMCHelper.h"
14
#include "HepMC/IO_HEPEVT.h"
15
#include "HepMC/HEPEVT_Wrapper.h"
16
#include "HepMC/IO_BaseClass.h"
18
using namespace Herwig;
19
using namespace MCatNLO;
26
#define cevwgt cevwgt_
29
//void foranalysis_();
36
void HepMCFortran::analyze(tEventPtr event, long ieve, int loop, int state) {
37
AnalysisHandler::analyze(event, ieve, loop, state);
39
//define the IO_HEPEVT
40
_hepevtio = new HepMC::IO_HEPEVT;
42
//choose units to be GeV and MM
43
Energy eUnit; Length lUnit;
44
eUnit = GeV; lUnit = millimeter;
46
//convert the event from the Herwig++ format to the HepMC format and write it to the common block
47
HepMC::GenEvent * hepevtf = HepMCConverter<HepMC::GenEvent>::convert(*event, false,eUnit, lUnit);
48
_hepevtio->write_event(hepevtf);
50
cevwgt.EVWGT=hepevtf->weights()[0];
53
//call the FORTRAN analysis for this event (see example file foranalysis.f)
61
IBPtr HepMCFortran::clone() const {
62
return new_ptr(*this);
65
IBPtr HepMCFortran::fullclone() const {
66
return new_ptr(*this);
69
NoPIOClassDescription<HepMCFortran> HepMCFortran::initHepMCFortran;
70
// Definition of the static class description member.
72
void HepMCFortran::Init() {
74
static ClassDocumentation<HepMCFortran> documentation
75
("There is no documentation for the HepMCFortran class");
79
void HepMCFortran::dofinish() {
80
AnalysisHandler::dofinish();
86
void HepMCFortran::doinitrun() {
87
AnalysisHandler::doinitrun();