ATLAS Offline Software
Loading...
Searching...
No Matches
PoWHEGVetoedShower.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{
12}
13
15
16namespace Pythia8{
17
34 class PoWHEGVetoedShower : public UserHooks{
35
36 public:
37
39
40 std::cout<<"*******************************************************************"<<std::endl;
41 std::cout<<"* *"<<std::endl;
42 std::cout<<"* Using new PoWHEG author scale definition for QCD production! *"<<std::endl;
43 std::cout<<"* *"<<std::endl;
44 std::cout<<"*******************************************************************"<<std::endl;
45
46 }
47
49
56 bool doVetoMPIStep(int nMPI, const Event &evt){
57
58 // Only do anything on the first call.
59 if(nMPI > 1) return false;
60
61 m_powhegScale = infoPtr->QRen();;
62
63 // momentum components to boost to CMS frame
64 double pxCMS = 0.;
65 double pyCMS = 0.;
66 double pzCMS = 0.;
67 double eCMS = 0.;
68
69 std::vector<Particle> powhegLegs;
70
71 // Find the entries corresponding to outgoing legs from PoWHEG
72 // start the loop at 1, since entry 0 represents the event as a whole
73 for(int ii=1; ii != evt.size(); ++ii){
74
75 // status -21 is the incoming hard partons
76 if(evt[ii].status() == -21){
77 pxCMS += evt[ii].px();
78 pyCMS += evt[ii].py();
79 pzCMS += evt[ii].pz();
80 eCMS += evt[ii].e();
81 }
82
83 // here Event::isFinal refers to whether the particle can still decay/radiate, or whether it is an internal leg
84 if(evt[ii].isFinal()){
85 powhegLegs.push_back(Particle(evt[ii]));
86 }
87 }
88
89 // compare the pT of each leg to the powheg scale.
90 // Set the scale to the lowest (or leave the scale unchanged if it is already lower)
91 for(std::vector<Particle>::const_iterator leg=powhegLegs.begin();
92 leg != powhegLegs.end(); ++leg){
93 if(leg->pT() < m_powhegScale )m_powhegScale = leg->pT();
94 }
95
96 double norm = -1./eCMS;
97 pxCMS *= norm;
98 pyCMS *= norm;
99 pzCMS *= norm;
100
101 // boost all outgoing legs to the CMS frame
102 for(std::vector<Particle>::iterator leg=powhegLegs.begin();
103 leg != powhegLegs.end(); ++leg){
104 leg->bst(pxCMS, pyCMS, pzCMS);
105 }
106
107 for(std::vector<Particle>::const_iterator leg=powhegLegs.begin();
108 leg != powhegLegs.end(); ++leg){
109
110 if(leg->pT() < m_powhegScale )m_powhegScale = leg->pT();
111
112 // calculate the pT relative to each other leg
113 // if any such pT is lower than the current scale, reset the scale to that value
114 for(std::vector<Particle>::const_iterator otherLeg = powhegLegs.begin();
115 otherLeg != powhegLegs.end(); ++otherLeg){
116 if(otherLeg == leg) continue;
117
118 double pTLeg = Pythia8_UserHooks::pTLeg(*leg, *otherLeg);
119
120 if(pTLeg < m_powhegScale) m_powhegScale = pTLeg;
121 }
122 }
123
124// std::cout<<m_powhegScale<<" "<<infoPtr->QRen()<<std::endl;
125
126
127 return false;
128 }
129
136 bool doVetoISREmission(int, const Event &evt, int iSys){
137
138 // only veto emissions from the hard system
139 if(iSys != 0) return false;
140
141 size_t emission = Pythia8_UserHooks::findLastISREmission(evt);
142
143 // Veto emission above the veto scale
144 if(evt[emission].pT() > m_powhegScale) return true;
145
146 return false;
147 }
148
152 bool doVetoFSREmission(int, const Event &evt, int iSys, bool){
153
154 // only veto emissions from the hard system
155 if(iSys != 0) return false;
156
157 size_t emission = Pythia8_UserHooks::findLastFSREmission(evt);
158
159 // Veto if above the POWHEG scale
160 if (evt[emission].pT() > m_powhegScale) return true;
161
162 return false;
163 }
164
166 bool canVetoMPIStep(){return true;}
168 int numberVetoMPIStep(){return 1;}
170 bool canVetoISREmission(){return true;}
172 bool canVetoFSREmission(){return true;}
173
174 private:
175
177
178 };
179}
180
Pythia8_UserHooks::UserHooksFactory::Creator< Pythia8::PoWHEGVetoedShower > powhegVetoedShowerCreator("PoWHEGVetoedShower")
This UserHook should be used when showering QCD jets generated with PoWHEG-box.
bool doVetoFSREmission(int, const Event &evt, int iSys, bool)
This is similar to the ISR veto.
int numberVetoMPIStep()
Call doVetoMIStep once.
bool canVetoFSREmission()
Switch off veto of FSR.
bool doVetoMPIStep(int nMPI, const Event &evt)
doVetoMPIStep is called immediately after the MPI generation In this case it never actually vetoes th...
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 canVetoMPIStep()
Switch on calling of doVetoMPIStep.
bool canVetoISREmission()
Switch on veto of ISR.
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)