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
FortranCallback
*
FortranCallback::fInstance
=
nullptr
;
47
48
FortranCallback::FortranCallback
()
49
// : fPartonLevel(0)
50
: fRunBlock(nullptr), fEventBlock(nullptr), fIterationsPerEvent(0) {}
51
52
FortranCallback
*
FortranCallback::getInstance
() {
53
if
(
fInstance
==
nullptr
)
54
fInstance
=
new
FortranCallback
;
55
return
fInstance
;
56
}
57
58
void
FortranCallback::fillHeader
() {
59
if
(
fRunBlock
==
nullptr
)
60
return
;
61
62
//const lhef::HEPRUP* heprup = &(fRunBlock->heprup());
63
const
lhef::HEPRUP
* heprup =
fRunBlock
->
getHEPRUP
();
64
65
lhef::CommonBlocks::fillHEPRUP
(heprup);
66
67
return
;
68
}
69
70
void
FortranCallback::fillEvent
() {
71
//if ( fPartonLevel == 0 ) return;
72
//const lhef::HEPEUP* hepeup = fPartonLevel->getHEPEUP();
73
74
if
(
fEventBlock
==
nullptr
)
75
return
;
76
77
const
lhef::HEPEUP
* hepeup =
fEventBlock
->
getHEPEUP
();
78
79
if
(
fIterationsPerEvent
++) {
80
hepeup_
.
nup
= 0;
81
return
;
82
}
83
84
lhef::CommonBlocks::fillHEPEUP
(hepeup);
85
86
return
;
87
}
88
89
}
// namespace gen
90
91
#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.h:52
gen::FortranCallback::fillHeader
void fillHeader()
Definition:
FortranCallback.h:58
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:48
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:70
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