6 #ifndef Pythia8_PowhegHooksBB4L_H 7 #define Pythia8_PowhegHooksBB4L_H 10 #include "Pythia8/Pythia.h" 28 onlyDistance1 = settingsPtr->flag(
"POWHEG:bb4l:FSREmission:onlyDistance1");
29 dryRunFSR = settingsPtr->flag(
"POWHEG:bb4l:FSREmission:dryRun");
30 vetoAtPL = settingsPtr->flag(
"POWHEG:bb4l:FSREmission:vetoAtPL");
31 vetoQED = settingsPtr->flag(
"POWHEG:bb4l:FSREmission:vetoQED");
34 debug = settingsPtr->flag(
"POWHEG:bb4l:DEBUG");
36 vetoDipoleFrame = settingsPtr->flag(
"POWHEG:bb4l:FSREmission:vetoDipoleFrame");
37 pTpythiaVeto = settingsPtr->flag(
"POWHEG:bb4l:FSREmission:pTpythiaVeto");
39 pTmin = settingsPtr->parm(
"POWHEG:bb4l:pTminVeto");
52 ss << infoPtr->getEventAttribute(
"#rwgt");
58 int i_top = -1, i_atop = -1;
59 for (
int i = 0;
i <
e.size();
i++) {
127 int iRecAft =
e.size() - 1;
128 int iEmt =
e.size() - 2;
129 int iRadAft =
e.size() - 3;
130 int iRadBef =
e[iEmt].mother1();
133 int iTop =
e[iRadBef].mother1();
135 while (
abs(
e[iTop].
id()) != 6 && iTop > 0) {
136 iTop =
e[iTop].mother1();
141 "Warning in PowhegHooksBB4L::doVetoFSREmission: emission in resonance not from top quark, not vetoing");
145 int iTopCharge = (
e[iTop].id() > 0) ? 1 : -1;
154 Vec4 pr(
e[iRadAft].
p()), pe(
e[iEmt].
p()),
pt(
e[iTop].
p()), prec(
e[iRecAft].
p()), psystem;
159 psystem =
pr + pe + prec;
164 if (
e[iRadBef].
id() == 21)
167 else if (
abs(
e[iRadBef].
id()) == 5 && ((
e[iEmt].
id() == 21) && !
vetoQED))
174 if (iTopCharge > 0) {
177 cout <<
e[iTop].id() <<
": " <<
e[iRadBef].id() <<
" > " <<
e[iRadAft].id() <<
" + " <<
e[iEmt].id()
178 <<
"; " <<
scale << endl;
182 cout <<
e[iTop].id() <<
": " <<
e[iRadBef].id() <<
" > " <<
e[iRadAft].id() <<
" + " <<
e[iEmt].id()
183 <<
"; " <<
scale << endl;
186 }
else if (iTopCharge < 0) {
189 cout <<
e[iTop].id() <<
": " <<
e[iRadBef].id() <<
" > " <<
e[iRadAft].id() <<
" + " <<
e[iEmt].id()
190 <<
"; " <<
scale << endl;
194 cout <<
e[iTop].id() <<
": " <<
e[iRadBef].id() <<
" > " <<
e[iRadAft].id() <<
" + " <<
e[iEmt].id()
195 <<
"; " <<
scale << endl;
199 cout <<
"Bug in PohwgeHooksBB4l" << endl;
246 if (
e[iRes].
id() == 6) {
248 return sqrt(
e[iRes].m2Calc());
251 }
else if (
e[iRes].
id() == -6) {
253 return sqrt(
e[iRes].m2Calc());
257 return pow(10.0, 30.);
267 int nDau =
event[iRes].daughterList().size();
273 }
else if (nDau < 3) {
276 }
else if (
abs(
event[iRes].
id()) == 6) {
278 int idw = -1, idb = -1, idg = -1;
280 for (
int i = 0;
i < nDau;
i++) {
281 int iDau =
event[iRes].daughterList()[
i];
292 pw.bstback(
event[iRes].
p());
295 pb.bstback(
event[iRes].
p());
298 pg.bstback(
event[iRes].
p());
301 scale =
sqrt(2 * pg * pb * pg.e() / pb.e());
315 const vector<int> &ids,
316 vector<int> &positions,
317 vector<Vec4> &momenta,
318 bool exitOnExtraLegs =
true) {
320 if (
e[iparticle].daughterList().
size() != ids.size()) {
321 if (exitOnExtraLegs &&
e[iparticle].daughterList().size() > ids.size()) {
322 cout <<
"extra leg" << endl;
328 for (
unsigned i = 0;
i <
e[iparticle].daughterList().size();
i++) {
329 int di =
e[iparticle].daughterList()[
i];
330 if (ids[
i] != 0 &&
e[di].
id() != ids[
i])
337 for (
unsigned i = 0;
i <
e[iparticle].daughterList().size();
i++) {
338 int di =
e[iparticle].daughterList()[
i];
339 positions.push_back(di);
340 momenta.push_back(
e[di].
p());
361 inline double pTpythia(
const Event &
e,
int RadAfterBranch,
int EmtAfterBranch,
int RecAfterBranch) {
363 Vec4 radVec =
e[RadAfterBranch].p();
364 Vec4 emtVec =
e[EmtAfterBranch].p();
365 Vec4 recVec =
e[RecAfterBranch].p();
366 int radID =
e[RadAfterBranch].id();
369 Vec4 Q(radVec + emtVec);
370 double Qsq = Q.m2Calc();
373 double m2Rad = (
abs(radID) >= 4 &&
abs(radID) < 7) ? pow2(particleDataPtr->m0(radID)) : 0.;
378 Vec4 sum = radVec + recVec + emtVec;
379 double m2Dip = sum.m2Calc();
381 double x1 = 2. * (sum * radVec) / m2Dip;
382 double x3 = 2. * (sum * emtVec) / m2Dip;
384 pTnow = z * (1. - z);
387 pTnow *= (Qsq - m2Rad);
390 cout <<
"Warning: pTpythia was negative" << endl;
393 return (
sqrt(pTnow));
397 int tid = 6 * topcharge, wid = 24 * topcharge, bid = 5 * topcharge, gid = 21, wildcard = 0;
400 Vec4 p_top, p_b, p_g, p_g1, p_g2;
401 for (
int i = 0;
i <
e.size();
i++)
402 if (
e[
i].
id() == tid) {
425 vector<Vec4> momenta;
426 vector<int> positions;
429 if (
match_decay(i_top,
e, vector<int>{wid, bid}, positions, momenta,
false)) {
431 int i_b = positions[1];
433 if (
match_decay(i_b,
e, vector<int>{bid, gid}, positions, momenta))
441 else if (
match_decay(i_top,
e, vector<int>{wid, bid, gid}, positions, momenta,
false)) {
443 int i_b = positions[1], i_g = positions[2];
445 if (
match_decay(i_b,
e, vector<int>{bid, gid}, positions, momenta))
451 if (
match_decay(i_g,
e, vector<int>{wildcard, wildcard}, positions, momenta))
460 cout <<
"getdechardness" << endl;
461 cout <<
"top at position " << i_top << endl;
462 cout <<
"with " <<
e[i_top].daughterList().size() <<
" daughters " << endl;
463 for (
unsigned i = 0;
i <
e[i_top].daughterList().size();
i++) {
464 int di =
e[i_top].daughterList()[
i];
465 cout <<
"with daughter " << di <<
": " <<
e[di].id() << endl;
505 #endif // end Pythia8_PowhegHooksBB4L_H
bool excludeFSRConflicting
double scaleResonance(int iRes, const Event &e) override
double pTpythia(const Event &e, int RadAfterBranch, int EmtAfterBranch, int RecAfterBranch)
double qSplittingScale(Vec4 pt, Vec4 p1, Vec4 p2)
~PowhegHooksBB4L() override
bool initAfterBeams() override
double getdechardness(int topcharge, const Event &e)
bool canVetoProcessLevel() override
bool doVetoFSR(bool condition, double scale, int iTopCharge)
bool canVetoFSREmission() override
Abs< T >::type abs(const T &t)
double scaleResonanceVeto
double findresscale(const int iRes, const Event &event)
double gSplittingScale(Vec4 pt, Vec4 p1, Vec4 p2)
bool doVetoFSREmission(int sizeOld, const Event &e, int iSys, bool inResonance) override
bool canVetoPartonLevel() override
bool doVetoProcessLevel(Event &e) override
bool retryPartonLevel() override
bool canSetResonanceScale() override
bool doVetoPartonLevel(const Event &e) override
bool match_decay(int iparticle, const Event &e, const vector< int > &ids, vector< int > &positions, vector< Vec4 > &momenta, bool exitOnExtraLegs=true)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
unsigned long int nFSRvetoBB4l
Power< A, B >::type pow(const A &a, const B &b)