CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
JetMatchingHook Class Reference

#include <JetMatchingHook.h>

Inheritance diagram for JetMatchingHook:

Public Member Functions

virtual void beforeHadronization (lhef::LHEEvent *lhee)
 
bool canVetoPartonLevel () override
 
bool doVetoPartonLevel (const Pythia8::Event &event) override
 
virtual void init (lhef::LHERunInfo *runInfo)
 
bool initAfterBeams () override
 
 JetMatchingHook (const edm::ParameterSet &, Pythia8::Info *)
 
void resetMatchingStatus ()
 
void setEventNumber (int ievt)
 
 ~JetMatchingHook () override
 

Protected Member Functions

 JetMatchingHook ()
 
void setLHEEvent (lhef::LHEEvent *lhee)
 
void setLHERunInfo (lhef::LHERunInfo *lheri)
 

Protected Attributes

lhef::LHEEventfEventBlock
 
int fEventNumber
 
Pythia8::Info * fInfoPtr
 
bool fIsInitialized
 
Py8toJetInputfJetInputFill
 
gen::JetMatchingfJetMatching
 
lhef::LHERunInfofRunBlock
 

Detailed Description

Definition at line 18 of file JetMatchingHook.h.

Constructor & Destructor Documentation

JetMatchingHook::JetMatchingHook ( const edm::ParameterSet ,
Pythia8::Info *   
)
JetMatchingHook::~JetMatchingHook ( )
override

Definition at line 56 of file JetMatchingHook.cc.

References fJetMatching.

56  {
57  if (fJetMatching)
58  delete fJetMatching;
59 }
gen::JetMatching * fJetMatching
JetMatchingHook::JetMatchingHook ( )
inlineprotected

Definition at line 53 of file JetMatchingHook.h.

53 : UserHooks() {}

Member Function Documentation

void JetMatchingHook::beforeHadronization ( lhef::LHEEvent lhee)
virtual

Definition at line 72 of file JetMatchingHook.cc.

References gen::JetMatching::beforeHadronisation(), gen::JetMatching::beforeHadronisationExec(), fJetMatching, and setLHEEvent().

Referenced by resetMatchingStatus().

72  {
73  setLHEEvent(lhee);
75 
76  // here we'll have to adjust, if needed, for "massless" particles
77  // from earlier Madgraph version(s)
78  // also, we'll have to setup elements of the Py6 fortran array
79  // VINT(357), VINT(358), VINT(360) and VINT(390)
80  // if ( fJetMatching->getMatchingScheme() == "Madgraph" )
81  // {
82  //
83  // }
84 
86 
87  return;
88 }
void setLHEEvent(lhef::LHEEvent *lhee)
virtual void beforeHadronisation(const lhef::LHEEvent *event)
Definition: JetMatching.cc:21
virtual void beforeHadronisationExec()
Definition: JetMatching.cc:23
gen::JetMatching * fJetMatching
bool JetMatchingHook::canVetoPartonLevel ( )
inlineoverride

Definition at line 30 of file JetMatchingHook.h.

References doVetoPartonLevel().

30 { return true; }
bool JetMatchingHook::doVetoPartonLevel ( const Pythia8::Event &  event)
override

Definition at line 90 of file JetMatchingHook.cc.

References fEventBlock, Py8toJetInput::fillJetAlgoInput(), fJetInputFill, fJetMatching, gen::JetMatching::getPartonList(), hepeup_, gen::JetMatching::isMatchingDone(), gen::JetMatching::match(), and HEPEUP_::nup.

Referenced by canVetoPartonLevel().

92 {
93  // event.list();
94 
95  // extract "hardest" event - the output will go into workEvent,
96  // which is a data mamber of base class UserHooks
97  //
98  subEvent(event, true);
99 
100  if (!hepeup_.nup || fJetMatching->isMatchingDone()) {
101  return true;
102  }
103 
104  //
105  // bool jmtch = fJetMatching->match( 0, 0, true ); // true if veto-ed, false if accepted (not veto-ed)
106  std::vector<fastjet::PseudoJet> jetInput =
108  bool jmtch = fJetMatching->match(fEventBlock, &jetInput);
109  if (jmtch) {
110  return true;
111  }
112 
113  // Do not veto events that got this far
114  //
115  return false;
116 }
virtual const std::vector< fastjet::PseudoJet > fillJetAlgoInput(const Event &, const Event &, const lhef::LHEEvent *lhee=nullptr, const std::vector< int > *partonList=nullptr)
Definition: Py8toJetInput.cc:7
lhef::LHEEvent * fEventBlock
struct HEPEUP_ hepeup_
Py8toJetInput * fJetInputFill
virtual int match(const lhef::LHEEvent *partonLevel, const std::vector< fastjet::PseudoJet > *jetInput)=0
virtual const std::vector< int > * getPartonList()
Definition: JetMatching.h:76
bool isMatchingDone()
Definition: JetMatching.h:74
gen::JetMatching * fJetMatching
Definition: event.py:1
void JetMatchingHook::init ( lhef::LHERunInfo runInfo)
virtual

Definition at line 61 of file JetMatchingHook.cc.

References ALCARECOTkAlBeamHalo_cff::etaMax, Exception, fJetInputFill, fJetMatching, fRunBlock, gen::JetMatching::getJetEtaMax(), gen::JetMatching::init(), Py8toJetInput::setJetEtaMax(), and setLHERunInfo().

Referenced by setEventNumber().

61  {
62  setLHERunInfo(runInfo);
63  if (!fRunBlock) {
64  throw cms::Exception("JetMatching") << "Invalid RunInfo" << std::endl;
65  }
66  fJetMatching->init(runInfo);
67  double etaMax = fJetMatching->getJetEtaMax();
68  fJetInputFill->setJetEtaMax(etaMax);
69  return;
70 }
virtual double getJetEtaMax() const =0
void setJetEtaMax(double max)
Definition: Py8toJetInput.h:25
Py8toJetInput * fJetInputFill
void setLHERunInfo(lhef::LHERunInfo *lheri)
gen::JetMatching * fJetMatching
virtual void init(const lhef::LHERunInfo *runInfo)
Definition: JetMatching.cc:19
lhef::LHERunInfo * fRunBlock
bool JetMatchingHook::initAfterBeams ( )
inlineoverride

Definition at line 39 of file JetMatchingHook.h.

References fIsInitialized, fJetMatching, and gen::JetMatching::initAfterBeams().

39  {
40  if (fIsInitialized)
41  return true;
43  fIsInitialized = true;
44  return true;
45  }
virtual bool initAfterBeams()
Definition: JetMatching.h:59
gen::JetMatching * fJetMatching
void JetMatchingHook::resetMatchingStatus ( )
inline

Definition at line 46 of file JetMatchingHook.h.

References beforeHadronization(), fJetMatching, and gen::JetMatching::resetMatchingStatus().

46  {
48  return;
49  }
void resetMatchingStatus()
Definition: JetMatching.h:73
gen::JetMatching * fJetMatching
void JetMatchingHook::setEventNumber ( int  ievt)
inline

Definition at line 33 of file JetMatchingHook.h.

References fEventNumber, and init().

33  {
34  fEventNumber = ievt;
35  return;
36  }
void JetMatchingHook::setLHEEvent ( lhef::LHEEvent lhee)
inlineprotected

Definition at line 63 of file JetMatchingHook.h.

References fEventBlock, lhef::CommonBlocks::fillHEPEUP(), and lhef::LHEEvent::getHEPEUP().

Referenced by beforeHadronization().

63  {
64  fEventBlock = lhee;
65  if (fEventBlock == nullptr)
66  return;
67  const lhef::HEPEUP* hepeup = fEventBlock->getHEPEUP();
69  return;
70  }
lhef::LHEEvent * fEventBlock
const HEPEUP * getHEPEUP() const
Definition: LHEEvent.h:38
static void fillHEPEUP(const HEPEUP *hepeup)
void JetMatchingHook::setLHERunInfo ( lhef::LHERunInfo lheri)
inlineprotected

Definition at line 55 of file JetMatchingHook.h.

References lhef::CommonBlocks::fillHEPRUP(), fRunBlock, and lhef::LHERunInfo::getHEPRUP().

Referenced by init().

55  {
56  fRunBlock = lheri;
57  if (fRunBlock == nullptr)
58  return;
59  const lhef::HEPRUP* heprup = fRunBlock->getHEPRUP();
61  return;
62  }
const HEPRUP * getHEPRUP() const
Definition: LHERunInfo.h:51
static void fillHEPRUP(const HEPRUP *heprup)
lhef::LHERunInfo * fRunBlock

Member Data Documentation

lhef::LHEEvent* JetMatchingHook::fEventBlock
protected

Definition at line 75 of file JetMatchingHook.h.

Referenced by doVetoPartonLevel(), and setLHEEvent().

int JetMatchingHook::fEventNumber
protected

Definition at line 76 of file JetMatchingHook.h.

Referenced by setEventNumber().

Pythia8::Info* JetMatchingHook::fInfoPtr
protected

Definition at line 78 of file JetMatchingHook.h.

bool JetMatchingHook::fIsInitialized
protected

Definition at line 86 of file JetMatchingHook.h.

Referenced by initAfterBeams().

Py8toJetInput* JetMatchingHook::fJetInputFill
protected

Definition at line 81 of file JetMatchingHook.h.

Referenced by doVetoPartonLevel(), and init().

gen::JetMatching* JetMatchingHook::fJetMatching
protected
lhef::LHERunInfo* JetMatchingHook::fRunBlock
protected

Definition at line 74 of file JetMatchingHook.h.

Referenced by init(), and setLHERunInfo().