6 #ifndef Pythia8_PowhegHooksBB4L_H
7 #define Pythia8_PowhegHooksBB4L_H
10 #include "Pythia8/Pythia.h"
32 onlyDistance1 = settingsPtr->flag(
"POWHEG:bb4l:FSREmission:onlyDistance1");
33 dryRunFSR = settingsPtr->flag(
"POWHEG:bb4l:FSREmission:dryRun");
34 vetoAtPL = settingsPtr->flag(
"POWHEG:bb4l:FSREmission:vetoAtPL");
35 vetoQED = settingsPtr->flag(
"POWHEG:bb4l:FSREmission:vetoQED");
38 debug = settingsPtr->flag(
"POWHEG:bb4l:DEBUG");
40 vetoDipoleFrame = settingsPtr->flag(
"POWHEG:bb4l:FSREmission:vetoDipoleFrame");
41 pTpythiaVeto = settingsPtr->flag(
"POWHEG:bb4l:FSREmission:pTpythiaVeto");
43 pTmin = settingsPtr->parm(
"POWHEG:bb4l:pTminVeto");
58 ss << infoPtr->getEventAttribute(
"#rwgt");
61 assert (temp ==
"#rwgt");
64 int i_top = -1, i_atop = -1;
65 for (
int i = 0;
i < e.size();
i++) {
66 if (e[
i].
id() == 6) i_top =
i;
67 if (e[
i].
id() == -6) i_atop =
i;
129 int iRecAft = e.size() - 1;
130 int iEmt = e.size() - 2;
131 int iRadAft = e.size() - 3;
132 int iRadBef = e[iEmt].mother1();
135 int iTop = e[iRadBef].mother1();
137 while (
abs(e[iTop].
id()) != 6 && iTop > 0) {
138 iTop = e[iTop].mother1();
142 infoPtr->errorMsg(
"Warning in PowhegHooksBB4L::doVetoFSREmission: emission in resonance not from top quark, not vetoing");
146 int iTopCharge = (e[iTop].id()>0)?1:-1;
152 scale =
pTpythia(e, iRadAft, iEmt, iRecAft);
155 Vec4 pr(e[iRadAft].
p()), pe(e[iEmt].
p()),
pt(e[iTop].
p()), prec(e[iRecAft].
p()), psystem;
160 psystem = pr+pe+prec;
165 if (e[iRadBef].
id() == 21)
168 else if (
abs(e[iRadBef].
id()) == 5 && ((e[iEmt].
id() == 21) && !
vetoQED) )
175 if (iTopCharge > 0) {
178 cout << e[iTop].id() <<
": " << e[iRadBef].id() <<
" > " << e[iRadAft].id() <<
" + " << e[iEmt].id() <<
"; " << scale << endl;
183 cout << e[iTop].id() <<
": " << e[iRadBef].id() <<
" > " << e[iRadAft].id() <<
" + " << e[iEmt].id() <<
"; " << scale << endl;
187 else if (iTopCharge < 0){
190 cout << e[iTop].id() <<
": " << e[iRadBef].id() <<
" > " << e[iRadAft].id() <<
" + " << e[iEmt].id() <<
"; " << scale << endl;
195 cout << e[iTop].id() <<
": " << e[iRadBef].id() <<
" > " << e[iRadAft].id() <<
" + " << e[iEmt].id() <<
"; " << scale << endl;
200 cout <<
"Bug in PohwgeHooksBB4l" << endl;
246 if (e[iRes].
id() == 6){
248 return sqrt(e[iRes].m2Calc());
252 else if (e[iRes].
id() == -6){
254 return sqrt(e[iRes].m2Calc());
259 return pow(10.0,30.);
270 int nDau =
event[iRes].daughterList().size();
281 else if (
abs(event[iRes].
id()) == 6) {
283 int idw = -1, idb = -1, idg = -1;
285 for (
int i = 0;
i < nDau;
i++) {
286 int iDau =
event[iRes].daughterList()[
i];
287 if (
abs(event[iDau].
id()) == 24) idw = iDau;
288 if (
abs(event[iDau].
id()) == 5) idb = iDau;
289 if (
abs(event[iDau].
id()) == 21) idg = iDau;
293 Vec4 pw(event[idw].
p());
294 pw.bstback(event[iRes].
p());
296 Vec4 pb(event[idb].
p());
297 pb.bstback(event[iRes].
p());
299 Vec4 pg(event[idg].
p());
300 pg.bstback(event[iRes].
p());
303 scale =
sqrt(2*pg*pb*pg.e()/pb.e());
316 inline bool match_decay(
int iparticle,
const Event &
e,
const vector<int> &ids, vector<int> &positions, vector<Vec4> &momenta,
bool exitOnExtraLegs =
true){
318 if (e[iparticle].daughterList().
size() != ids.size()) {
319 if (exitOnExtraLegs && e[iparticle].daughterList().size() > ids.size()) {
320 cout <<
"extra leg" << endl;
326 for (
unsigned i = 0;
i < e[iparticle].daughterList().size();
i++) {
327 int di = e[iparticle].daughterList()[
i];
328 if (ids[
i] != 0 && e[di].
id() != ids[
i])
335 for (
unsigned i = 0;
i < e[iparticle].daughterList().size();
i++) {
336 int di = e[iparticle].daughterList()[
i];
337 positions.push_back(di);
338 momenta.push_back(e[di].
p());
346 return sqrt( 2*p1*p2*p2.e()/p1.e() );
352 return sqrt( 2*p1*p2*p1.e()*p2.e()/(
pow(p1.e()+p2.e(),2)) );
364 Vec4 radVec = e[RadAfterBranch].p();
365 Vec4 emtVec = e[EmtAfterBranch].p();
366 Vec4 recVec = e[RecAfterBranch].p();
367 int radID = e[RadAfterBranch].id();
370 Vec4 Q(radVec + emtVec);
371 double Qsq = Q.m2Calc();
375 double m2Rad = (
abs(radID) >= 4 &&
abs(radID) < 7) ?
376 pow2(particleDataPtr->m0(radID)) : 0.;
381 Vec4 sum = radVec + recVec + emtVec;
382 double m2Dip = sum.m2Calc();
384 double x1 = 2. * (sum * radVec) / m2Dip;
385 double x3 = 2. * (sum * emtVec) / m2Dip;
387 pTnow = z * (1. -
z);
391 pTnow *= (Qsq - m2Rad);
394 cout <<
"Warning: pTpythia was negative" << endl;
402 int tid = 6*topcharge, wid = 24*topcharge, bid = 5*topcharge, gid = 21, wildcard = 0;
405 Vec4 p_top, p_b, p_g, p_g1, p_g2;
406 for (
int i = 0;
i < e.size();
i++)
407 if (e[
i].
id() == tid) {
411 if (i_top == -1)
return -1.0;
429 vector<Vec4> momenta;
430 vector<int> positions;
433 if (
match_decay(i_top, e, vector<int> {wid, bid}, positions, momenta,
false) ) {
435 int i_b = positions[1];
437 if (
match_decay(i_b, e, vector<int> {bid, gid}, positions, momenta) )
445 else if (
match_decay(i_top, e, vector<int> {wid, bid, gid}, positions, momenta,
false) ) {
447 int i_b = positions[1], i_g = positions[2];
449 if (
match_decay(i_b, e, vector<int> {bid, gid}, positions, momenta) )
455 if (
match_decay(i_g, e, vector<int> {wildcard, wildcard}, positions, momenta) )
464 cout <<
"getdechardness" << endl;
465 cout <<
"top at position " << i_top << endl;
466 cout <<
"with " << e[i_top].daughterList().size() <<
" daughters " << endl;
467 for (
unsigned i = 0;
i < e[i_top].daughterList().size();
i++) {
468 int di = e[i_top].daughterList()[
i];
469 cout <<
"with daughter " << di <<
": " << e[di].id() << endl;
512 #endif // end Pythia8_PowhegHooksBB4L_H
bool canVetoProcessLevel()
bool doVetoFSREmission(int sizeOld, const Event &e, int iSys, bool inResonance)
bool excludeFSRConflicting
bool canVetoFSREmission()
double pTpythia(const Event &e, int RadAfterBranch, int EmtAfterBranch, int RecAfterBranch)
double qSplittingScale(Vec4 pt, Vec4 p1, Vec4 p2)
double scaleResonance(int iRes, const Event &e)
double getdechardness(int topcharge, const Event &e)
bool doVetoProcessLevel(Event &e)
bool canSetResonanceScale()
bool doVetoFSR(bool condition, double scale, int iTopCharge)
Abs< T >::type abs(const T &t)
double scaleResonanceVeto
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
double findresscale(const int iRes, const Event &event)
double gSplittingScale(Vec4 pt, Vec4 p1, Vec4 p2)
bool doVetoPartonLevel(const Event &e)
bool match_decay(int iparticle, const Event &e, const vector< int > &ids, vector< int > &positions, vector< Vec4 > &momenta, bool exitOnExtraLegs=true)
unsigned long int nFSRvetoBB4l
tuple size
Write out results.
Power< A, B >::type pow(const A &a, const B &b)
bool canVetoPartonLevel()