ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Generators
Pythia8_i
src
UserHooks
VetoedShower.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
Pythia8_i/UserHooksFactory.h
"
6
#include <stdexcept>
7
#include <iostream>
8
9
namespace
Pythia8
{
10
class
VetoedShower
;
11
}
12
13
Pythia8_UserHooks::UserHooksFactory::Creator<Pythia8::VetoedShower>
vetoedShowerCreator
(
"VetoedShower"
);
14
15
namespace
Pythia8
{
16
17
18
class
VetoedShower
:
public
UserHooks{
19
20
public
:
21
22
VetoedShower
():
m_pTVeto
(0.),
m_doneISR
(false){
23
std::cout<<std::endl;
24
std::cout<<
"************************************************************************************************"
<<std::endl;
25
std::cout<<
"Pythia8::VetoedShower: *** WARNING: THIS USER HOOK IS NOT VALIDATED FOR QCD JET PRODUCTION!! ***"
<<std::endl;
26
std::cout<<
"************************************************************************************************"
<<std::endl;
27
std::cout<<std::endl;
28
}
29
30
~VetoedShower
(){}
31
38
bool
doVetoMPIStep
(
int
,
const
Event
&){
39
40
m_pTVeto
= infoPtr->QFac();
41
m_doneISR
=
false
;
42
43
// std::cout<<" ******** veto scale = "<<m_pTVeto<<" *********"<<std::endl;
44
45
return
false
;
46
}
47
59
bool
doVetoISREmission
(
int
,
const
Event
&e,
int
){
60
// Note ignoring new iSys param for now (addition required to fix compilation against >= 8.157
61
62
if
(
m_doneISR
)
return
false
;
63
64
int
i = e.size() - 1;
65
66
while
(i != -1){
67
68
if
(e[i].isFinal() && e[i].status() == 43)
break
;
69
70
--i;
71
72
if
(i == 0){
73
e.list();
74
throw
std::runtime_error(
"Pythia8::VetoedShower::doVetoISREmission: Could not find ISR emission"
);
75
}
76
}
77
78
//check the leg is connected to the hard system
79
//coverity[NEGATIVE_RETURNS:FALSE]
80
int
iMother = e[i].mother1();
81
if
(e[iMother].status() != -41)
82
throw
std::runtime_error(
"Pythia8::VetoedShower::doVetoISREmission: Unexpected status code in ISR"
);
83
84
iMother = e[iMother].daughter2();
85
if
(iMother != partonSystemsPtr->getInA(0) &&
86
iMother != partonSystemsPtr->getInB(0))
return
false
;
87
88
// Veto emission above the veto scale
89
if
(e[i].pT() >
m_pTVeto
)
return
true
;
90
91
m_doneISR
=
true
;
92
return
false
;
93
}
94
100
bool
doVetoFSREmission
(
int
,
const
Event
&e,
int
,
bool
){
101
// Note ignoring new iSys and isResonance params for now (addition required to fix compilation against >= 8.157
102
103
int
i = e.size() - 1;
104
105
while
(i != -1){
106
if
(e[i].isFinal() && e[i].status() == 51)
break
;
107
108
--i;
109
110
if
(i == 0){
111
e.list();
112
throw
std::runtime_error(
"Pythia8::VetoedShower::doVetoFSREmission: Could not find FSR emission"
);
113
}
114
}
115
116
// Make sure radiation from the hard system
117
//i cannot be negative here
118
//coverity[NEGATIVE_RETURNS:FALSE]
119
int
iMother = e[i].mother1();
120
int
sysSize = partonSystemsPtr->sizeOut(0);
121
bool
hardSys =
false
;
122
123
for
(
int
j = 0; j < sysSize; ++j){
124
int
iOut = partonSystemsPtr->getOut(0, j);
125
if
(iOut == iMother) {
126
hardSys =
true
;
127
break
;
128
}
129
}
130
131
if
(!hardSys)
return
false
;
132
133
// Veto if above the POWHEG scale
134
if
(e[i].pT() >
m_pTVeto
)
return
true
;
135
136
return
false
;
137
}
138
140
bool
canVetoMPIStep
(){
return
true
;}
142
int
numberVetoMPIStep
(){
return
1;}
144
bool
canVetoISREmission
(){
return
true
;}
146
bool
canVetoFSREmission
(){
return
true
;}
147
148
private
:
149
150
double
m_pTVeto
;
151
bool
m_doneISR
;
152
};
153
}
154
UserHooksFactory.h
vetoedShowerCreator
Pythia8_UserHooks::UserHooksFactory::Creator< Pythia8::VetoedShower > vetoedShowerCreator("VetoedShower")
Pythia8::VetoedShower
Definition
VetoedShower.cxx:18
Pythia8::VetoedShower::doVetoMPIStep
bool doVetoMPIStep(int, const Event &)
doVetoMPIStep is called immediately after the MPI generation In this case it nver actually vetoes the...
Definition
VetoedShower.cxx:38
Pythia8::VetoedShower::canVetoFSREmission
bool canVetoFSREmission()
Switch off veto of FSR.
Definition
VetoedShower.cxx:146
Pythia8::VetoedShower::VetoedShower
VetoedShower()
Definition
VetoedShower.cxx:22
Pythia8::VetoedShower::m_pTVeto
double m_pTVeto
Definition
VetoedShower.cxx:150
Pythia8::VetoedShower::canVetoISREmission
bool canVetoISREmission()
Switch on veto of ISR.
Definition
VetoedShower.cxx:144
Pythia8::VetoedShower::numberVetoMPIStep
int numberVetoMPIStep()
Call doVetoMIStep once.
Definition
VetoedShower.cxx:142
Pythia8::VetoedShower::canVetoMPIStep
bool canVetoMPIStep()
Switch on calling of doVetoMPIStep.
Definition
VetoedShower.cxx:140
Pythia8::VetoedShower::doVetoFSREmission
bool doVetoFSREmission(int, const Event &e, int, bool)
This is similar to the ISR veto, with the exception that since the ordering is in a slightly differen...
Definition
VetoedShower.cxx:100
Pythia8::VetoedShower::doVetoISREmission
bool doVetoISREmission(int, const Event &e, int)
This is called after the generation of each new ISR emission Can use it to test if the last generated...
Definition
VetoedShower.cxx:59
Pythia8::VetoedShower::m_doneISR
bool m_doneISR
Definition
VetoedShower.cxx:151
Pythia8::VetoedShower::~VetoedShower
~VetoedShower()
Definition
VetoedShower.cxx:30
Pythia8_UserHooks::UserHooksFactory::Creator
Definition
UserHooksFactory.h:54
Pythia8
Author: James Monk (jmonk@cern.ch).
Definition
IPythia8Custom.h:10
Event
Definition
trigbs_orderedMerge.cxx:42
Generated on
for ATLAS Offline Software by
1.17.0