ATLAS Offline Software
Loading...
Searching...
No Matches
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
10namespace Pythia8{
11 class QCDVetoedShower;
12}
13
15
16namespace 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
88 size_t emission = Pythia8_UserHooks::findLastISREmission(evt);
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
Pythia8_UserHooks::UserHooksFactory::Creator< Pythia8::QCDVetoedShower > qcdVetoedShowerCreator("QCDVetoedShower")
This UserHook should be used when showering QCD jets generated with PoWHEG-box.
bool canVetoMPIStep()
Switch on calling of doVetoMPIStep.
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...
bool doVetoMPIStep(int nMPI, const Event &evt)
doVetoMPIStep is called immediately after the MPI generation In this case it never actually vetoes th...
int numberVetoMPIStep()
Call doVetoMIStep once.
bool checkEmission(size_t emission, const Event &evt)
bool canVetoISREmission()
Switch on veto of ISR.
std::vector< size_t > m_powhegLegs
bool doVetoFSREmission(int, const Event &evt, int iSys, bool)
This is similar to the ISR veto.
bool canVetoFSREmission()
Switch off veto of FSR.
size_t findLastISREmission(const Pythia8::Event &evt)
size_t findLastFSREmission(const Pythia8::Event &evt)
double pTLeg(const Pythia8::Particle &leg, const Pythia8::Particle &comparison)
Author: James Monk (jmonk@cern.ch)