GeneratorInterface
Core
interface
FortranCallback.h
Go to the documentation of this file.
1
#ifndef gen_FortranCallback_h
2
#define gen_FortranCallback_h
3
4
#include "
SimDataFormats/GeneratorProducts/interface/LHECommonBlocks.h
"
5
6
#include "
GeneratorInterface/LHEInterface/interface/LHERunInfo.h
"
7
#include "
GeneratorInterface/LHEInterface/interface/LHEEvent.h
"
8
9
namespace
HepMC
{
10
class
GenEvent;
11
}
12
13
namespace
gen
{
14
15
class
FortranCallback
{
16
public
:
17
static
FortranCallback
*
getInstance
();
18
19
//void setLHEEvent(lhef::LHEEvent* lhev) { fPartonLevel = lhev; }
20
void
setLHERunInfo
(
lhef::LHERunInfo
* lheri) {
fRunBlock
= lheri; }
21
void
setLHEEvent
(
lhef::LHEEvent
* lhee) {
fEventBlock
= lhee; }
22
23
void
resetIterationsPerEvent
() {
fIterationsPerEvent
= 0; }
24
25
void
fillHeader
();
26
void
fillEvent
();
27
28
int
getIterationsPerEvent
()
const
{
return
fIterationsPerEvent
; }
29
30
private
:
31
// ctor
32
33
FortranCallback
();
34
35
// data member(s)
36
37
lhef::LHERunInfo
*
fRunBlock
;
38
lhef::LHEEvent
*
fEventBlock
;
39
int
fIterationsPerEvent
;
40
41
static
FortranCallback
*
fInstance
;
42
};
43
44
// --** Implementation **---
45
46
inline
FortranCallback::FortranCallback
()
47
// : fPartonLevel(0)
48
: fRunBlock(nullptr), fEventBlock(nullptr), fIterationsPerEvent(0) {}
49
50
inline
void
FortranCallback::fillHeader
() {
51
if
(
fRunBlock
==
nullptr
)
52
return
;
53
54
//const lhef::HEPRUP* heprup = &(fRunBlock->heprup());
55
const
lhef::HEPRUP
* heprup =
fRunBlock
->
getHEPRUP
();
56
57
lhef::CommonBlocks::fillHEPRUP
(heprup);
58
59
return
;
60
}
61
62
inline
void
FortranCallback::fillEvent
() {
63
//if ( fPartonLevel == 0 ) return;
64
//const lhef::HEPEUP* hepeup = fPartonLevel->getHEPEUP();
65
66
if
(
fEventBlock
==
nullptr
)
67
return
;
68
69
const
lhef::HEPEUP
* hepeup =
fEventBlock
->
getHEPEUP
();
70
71
if
(
fIterationsPerEvent
++) {
72
hepeup_
.
nup
= 0;
73
return
;
74
}
75
76
lhef::CommonBlocks::fillHEPEUP
(hepeup);
77
78
return
;
79
}
80
81
}
// namespace gen
82
83
#endif
lhef::LHEEvent::getHEPEUP
const HEPEUP * getHEPEUP() const
Definition:
LHEEvent.h:38
gen::FortranCallback
Definition:
FortranCallback.h:15
gen::FortranCallback::fEventBlock
lhef::LHEEvent * fEventBlock
Definition:
FortranCallback.h:38
gen::FortranCallback::getInstance
static FortranCallback * getInstance()
Definition:
FortranCallback.cc:6
gen::FortranCallback::fillHeader
void fillHeader()
Definition:
FortranCallback.h:50
lhef::CommonBlocks::fillHEPEUP
static void fillHEPEUP(const HEPEUP *hepeup)
Definition:
LHECommonBlocks.h:60
hepeup_
struct HEPEUP_ hepeup_
gen::FortranCallback::setLHEEvent
void setLHEEvent(lhef::LHEEvent *lhee)
Definition:
FortranCallback.h:21
gen
Definition:
PythiaDecays.h:13
gen::FortranCallback::FortranCallback
FortranCallback()
Definition:
FortranCallback.h:46
gen::FortranCallback::resetIterationsPerEvent
void resetIterationsPerEvent()
Definition:
FortranCallback.h:23
lhef::LHERunInfo
Definition:
LHERunInfo.h:25
LHERunInfo.h
gen::FortranCallback::setLHERunInfo
void setLHERunInfo(lhef::LHERunInfo *lheri)
Definition:
FortranCallback.h:20
lhef::LHEEvent
Definition:
LHEEvent.h:23
lhef::CommonBlocks::fillHEPRUP
static void fillHEPRUP(const HEPRUP *heprup)
Definition:
LHECommonBlocks.h:41
lhef::HEPRUP
Definition:
LesHouches.h:22
lhef::HEPEUP
Definition:
LesHouches.h:138
lhef::LHERunInfo::getHEPRUP
const HEPRUP * getHEPRUP() const
Definition:
LHERunInfo.h:51
gen::FortranCallback::fInstance
static FortranCallback * fInstance
Definition:
FortranCallback.h:41
HepMC
Definition:
GenParticle.h:15
HEPEUP_::nup
int nup
Definition:
LHECommonBlocks.h:21
LHEEvent.h
gen::FortranCallback::fRunBlock
lhef::LHERunInfo * fRunBlock
Definition:
FortranCallback.h:37
gen::FortranCallback::fillEvent
void fillEvent()
Definition:
FortranCallback.h:62
gen::FortranCallback::getIterationsPerEvent
int getIterationsPerEvent() const
Definition:
FortranCallback.h:28
gen::FortranCallback::fIterationsPerEvent
int fIterationsPerEvent
Definition:
FortranCallback.h:39
LHECommonBlocks.h
Generated for CMSSW Reference Manual by
1.8.16