CMS 3D CMS Logo

FortranCallback.h
Go to the documentation of this file.
1 #ifndef gen_FortranCallback_h
2 #define gen_FortranCallback_h
3 
5 
8 
9 namespace HepMC {
10  class GenEvent;
11 }
12 
13 namespace gen {
14 
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 
24 
25  void fillHeader();
26  void fillEvent();
27 
29 
30  private:
31  // ctor
32 
34 
35  // data member(s)
36 
40 
42  };
43 
44  // --** Implementation **---
45 
47 
49  // : fPartonLevel(0)
50  : fRunBlock(nullptr), fEventBlock(nullptr), fIterationsPerEvent(0) {}
51 
53  if (fInstance == nullptr)
55  return fInstance;
56  }
57 
59  if (fRunBlock == nullptr)
60  return;
61 
62  //const lhef::HEPRUP* heprup = &(fRunBlock->heprup());
63  const lhef::HEPRUP* heprup = fRunBlock->getHEPRUP();
64 
66 
67  return;
68  }
69 
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 
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