ATLAS Offline Software
QCDVetoedShower.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "UserHooksUtils.h"
7 #include <stdexcept>
8 #include <iostream>
9 
10 namespace Pythia8{
11  class QCDVetoedShower;
12 }
13 
15 
16 namespace Pythia8{
17 
36  class QCDVetoedShower : public UserHooks{
37 
38  public:
39 
41 
42  std::cout<<"*******************************************************************"<<std::endl;
43  std::cout<<"* *"<<std::endl;
44  std::cout<<"* Using vetoed shower for PoWHEG QCD production! *"<<std::endl;
45  std::cout<<"* *"<<std::endl;
46  std::cout<<"*******************************************************************"<<std::endl;
47 
48  }
49 
51 
58  bool doVetoMPIStep(int nMPI, const Event &evt){
59 
60  // Only do anything on the first call.
61  if(nMPI > 1) return false;
62 
63  m_powhegScale = infoPtr->QRen();
64 
65  m_powhegLegs.clear();
66  // start the loop at 1, since entry 0 represents the event as a whole
67  for(int ii=1; ii != evt.size(); ++ii){
68  // here Event::isFinal refers to whether the particle can still decay/radiate, or whether it is an internal leg
69  if(evt[ii].isFinal()){
70  m_powhegLegs.push_back(ii);
71  }
72  }
73 
74  return false;
75  }
76 
83  bool doVetoISREmission(int, const Event &evt, int iSys){
84 
85  // only veto emissions from the hard system
86  if(iSys != 0) return false;
87 
89 
90  return checkEmission(emission, evt);
91 
92  }
93 
98  bool doVetoFSREmission(int, const Event &evt, int iSys, bool){
99 
100  // only veto emissions from the hard system
101  if(iSys != 0) return false;
102 
103  size_t emission = Pythia8_UserHooks::findLastFSREmission(evt);
104 
105  return checkEmission(emission, evt);
106  }
107 
109  bool canVetoMPIStep(){return true;}
111  int numberVetoMPIStep(){return 1;}
113  bool canVetoISREmission(){return true;}
115  bool canVetoFSREmission(){return true;}
116 
117  private:
118 
119  bool checkEmission(size_t emission, const Event &evt){
120  // Veto if above the POWHEG scale
121  if (evt[emission].pT() > m_powhegScale) return true;
122 
123  // determine pT relative to each outgoing PoWHEG leg and veto if above veto scale
124 
125  for(std::vector<size_t>::const_iterator legIndex = m_powhegLegs.begin();
126  legIndex != m_powhegLegs.end(); ++legIndex){
127 
128  if(Pythia8_UserHooks::pTLeg(emission, *legIndex, evt) > m_powhegScale)return true;
129  }
130  return false;
131  }
132 
134  // Indices of the PoWHEG legs in the event record
135  std::vector<size_t> m_powhegLegs;
136  };
137 }
138 
CalculateHighPtTerm.pT
pT
Definition: ICHEP2016/CalculateHighPtTerm.py:57
Pythia8::QCDVetoedShower::doVetoFSREmission
bool doVetoFSREmission(int, const Event &evt, int iSys, bool)
This is similar to the ISR veto.
Definition: QCDVetoedShower.cxx:98
Pythia8::QCDVetoedShower::canVetoISREmission
bool canVetoISREmission()
Switch on veto of ISR.
Definition: QCDVetoedShower.cxx:113
Pythia8::QCDVetoedShower::doVetoISREmission
bool doVetoISREmission(int, const Event &evt, int iSys)
This is called after the generation of each new ISR emission Can use it to test if the last generated...
Definition: QCDVetoedShower.cxx:83
Event
Definition: trigbs_orderedMerge.cxx:42
Pythia8::QCDVetoedShower::checkEmission
bool checkEmission(size_t emission, const Event &evt)
Definition: QCDVetoedShower.cxx:119
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
Pythia8_UserHooks::UserHooksFactory::Creator
Definition: UserHooksFactory.h:54
Pythia8::QCDVetoedShower::canVetoFSREmission
bool canVetoFSREmission()
Switch off veto of FSR.
Definition: QCDVetoedShower.cxx:115
UserHooksFactory.h
Pythia8
Author: James Monk (jmonk@cern.ch)
Definition: IPythia8Custom.h:13
Pythia8::QCDVetoedShower
This UserHook should be used when showering QCD jets generated with PoWHEG-box.
Definition: QCDVetoedShower.cxx:36
Pythia8::QCDVetoedShower::~QCDVetoedShower
~QCDVetoedShower()
Definition: QCDVetoedShower.cxx:50
qcdVetoedShowerCreator
Pythia8_UserHooks::UserHooksFactory::Creator< Pythia8::QCDVetoedShower > qcdVetoedShowerCreator("QCDVetoedShower")
Pythia8_UserHooks::pTLeg
double pTLeg(const Pythia8::Particle &leg, const Pythia8::Particle &comparison)
Definition: UserHooksUtils.h:50
Pythia8_UserHooks::findLastISREmission
size_t findLastISREmission(const Pythia8::Event &evt)
Definition: UserHooksUtils.h:80
Pythia8::QCDVetoedShower::numberVetoMPIStep
int numberVetoMPIStep()
Call doVetoMIStep once.
Definition: QCDVetoedShower.cxx:111
UserHooksUtils.h
Pythia8::QCDVetoedShower::canVetoMPIStep
bool canVetoMPIStep()
Switch on calling of doVetoMPIStep.
Definition: QCDVetoedShower.cxx:109
Pythia8::QCDVetoedShower::doVetoMPIStep
bool doVetoMPIStep(int nMPI, const Event &evt)
doVetoMPIStep is called immediately after the MPI generation In this case it never actually vetoes th...
Definition: QCDVetoedShower.cxx:58
Pythia8::QCDVetoedShower::m_powhegLegs
std::vector< size_t > m_powhegLegs
Definition: QCDVetoedShower.cxx:135
Pythia8::QCDVetoedShower::QCDVetoedShower
QCDVetoedShower()
Definition: QCDVetoedShower.cxx:40
Pythia8::QCDVetoedShower::m_powhegScale
double m_powhegScale
Definition: QCDVetoedShower.cxx:133
Pythia8_UserHooks::findLastFSREmission
size_t findLastFSREmission(const Pythia8::Event &evt)
Definition: UserHooksUtils.h:89