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 64 of file JetMatchingHook.cc.

References fJetMatching.

65 {
66  if ( fJetMatching ) delete fJetMatching;
67 }
gen::JetMatching * fJetMatching
JetMatchingHook::JetMatchingHook ( )
inlineprotected

Definition at line 46 of file JetMatchingHook.h.

46 : UserHooks() {}

Member Function Documentation

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

Definition at line 86 of file JetMatchingHook.cc.

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

Referenced by resetMatchingStatus().

87 {
88 
89  setLHEEvent( lhee );
91 
92  // here we'll have to adjust, if needed, for "massless" particles
93  // from earlier Madgraph version(s)
94  // also, we'll have to setup elements of the Py6 fortran array
95  // VINT(357), VINT(358), VINT(360) and VINT(390)
96  // if ( fJetMatching->getMatchingScheme() == "Madgraph" )
97  // {
98  //
99  // }
100 
102 
103  return;
104 
105 }
void setLHEEvent(lhef::LHEEvent *lhee)
virtual void beforeHadronisation(const lhef::LHEEvent *event)
Definition: JetMatching.cc:31
virtual void beforeHadronisationExec()
Definition: JetMatching.cc:35
gen::JetMatching * fJetMatching
bool JetMatchingHook::canVetoPartonLevel ( )
inlineoverride

Definition at line 33 of file JetMatchingHook.h.

References doVetoPartonLevel().

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

Definition at line 108 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().

110 {
111 
112  // event.list();
113 
114  // extract "hardest" event - the output will go into workEvent,
115  // which is a data mamber of base class UserHooks
116  //
117  subEvent(event,true);
118 
119  if ( !hepeup_.nup || fJetMatching->isMatchingDone() )
120  {
121  return true;
122  }
123 
124  //
125  // bool jmtch = fJetMatching->match( 0, 0, true ); // true if veto-ed, false if accepted (not veto-ed)
126  std::vector<fastjet::PseudoJet> jetInput = fJetInputFill->fillJetAlgoInput( event, workEvent,
127  fEventBlock,
129  bool jmtch = fJetMatching->match( fEventBlock, &jetInput );
130  if ( jmtch )
131  {
132  return true;
133  }
134 
135  // Do not veto events that got this far
136  //
137  return false;
138 
139 }
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:8
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:78
bool isMatchingDone()
Definition: JetMatching.h:76
gen::JetMatching * fJetMatching
Definition: event.py:1
void JetMatchingHook::init ( lhef::LHERunInfo runInfo)
virtual

Definition at line 69 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().

70 {
71 
72  setLHERunInfo( runInfo );
73  if ( !fRunBlock )
74  {
75  throw cms::Exception("JetMatching")
76  << "Invalid RunInfo" << std::endl;
77 
78  }
79  fJetMatching->init( runInfo );
80  double etaMax = fJetMatching->getJetEtaMax();
81  fJetInputFill->setJetEtaMax( etaMax );
82  return;
83 
84 }
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:27
lhef::LHERunInfo * fRunBlock
bool JetMatchingHook::initAfterBeams ( )
inlineoverride

Definition at line 39 of file JetMatchingHook.h.

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

39 { if ( fIsInitialized ) return true; fJetMatching->initAfterBeams(); fIsInitialized=true; return true; }
virtual bool initAfterBeams()
Definition: JetMatching.h:61
gen::JetMatching * fJetMatching
void JetMatchingHook::resetMatchingStatus ( )
inline

Definition at line 40 of file JetMatchingHook.h.

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

40 { fJetMatching->resetMatchingStatus(); return; }
void resetMatchingStatus()
Definition: JetMatching.h:75
gen::JetMatching * fJetMatching
void JetMatchingHook::setEventNumber ( int  ievt)
inline

Definition at line 36 of file JetMatchingHook.h.

References fEventNumber, init(), and reco::return().

36 { fEventNumber = ievt; return ; }
return(e1-e2)*(e1-e2)+dp *dp
void JetMatchingHook::setLHEEvent ( lhef::LHEEvent lhee)
inlineprotected

Definition at line 55 of file JetMatchingHook.h.

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

Referenced by beforeHadronization().

55  {
56  fEventBlock=lhee;
57  if ( fEventBlock == nullptr ) return;
58  const lhef::HEPEUP* hepeup = fEventBlock->getHEPEUP();
60  return;
61  }
lhef::LHEEvent * fEventBlock
const HEPEUP * getHEPEUP() const
Definition: LHEEvent.h:43
static void fillHEPEUP(const HEPEUP *hepeup)
void JetMatchingHook::setLHERunInfo ( lhef::LHERunInfo lheri)
inlineprotected

Definition at line 48 of file JetMatchingHook.h.

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

Referenced by init().

48  {
49  fRunBlock=lheri;
50  if ( fRunBlock == nullptr ) return;
51  const lhef::HEPRUP* heprup = fRunBlock->getHEPRUP();
53  return;
54  }
const HEPRUP * getHEPRUP() const
Definition: LHERunInfo.h:52
static void fillHEPRUP(const HEPRUP *heprup)
lhef::LHERunInfo * fRunBlock

Member Data Documentation

lhef::LHEEvent* JetMatchingHook::fEventBlock
protected

Definition at line 66 of file JetMatchingHook.h.

Referenced by doVetoPartonLevel(), and setLHEEvent().

int JetMatchingHook::fEventNumber
protected

Definition at line 67 of file JetMatchingHook.h.

Referenced by setEventNumber().

Pythia8::Info* JetMatchingHook::fInfoPtr
protected

Definition at line 69 of file JetMatchingHook.h.

bool JetMatchingHook::fIsInitialized
protected

Definition at line 77 of file JetMatchingHook.h.

Referenced by initAfterBeams().

Py8toJetInput* JetMatchingHook::fJetInputFill
protected

Definition at line 72 of file JetMatchingHook.h.

Referenced by doVetoPartonLevel(), and init().

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

Definition at line 65 of file JetMatchingHook.h.

Referenced by init(), and setLHERunInfo().