CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
Pythia8::PowhegHooksBB4L Class Reference

#include <PowhegHooksBB4L.h>

Inheritance diagram for Pythia8::PowhegHooksBB4L:

Public Member Functions

bool canSetResonanceScale () override
 
bool canVetoFSREmission () override
 
bool canVetoPartonLevel () override
 
bool canVetoProcessLevel () override
 
bool doVetoFSR (bool condition, double scale, int iTopCharge)
 
bool doVetoFSREmission (int sizeOld, const Event &e, int iSys, bool inResonance) override
 
void doVetoFSRInit ()
 
bool doVetoPartonLevel (const Event &e) override
 
bool doVetoProcessLevel (Event &e) override
 
double findresscale (const int iRes, const Event &event)
 
double getdechardness (int topcharge, const Event &e)
 
double gSplittingScale (Vec4 pt, Vec4 p1, Vec4 p2)
 
bool initAfterBeams () override
 
bool match_decay (int iparticle, const Event &e, const vector< int > &ids, vector< int > &positions, vector< Vec4 > &momenta, bool exitOnExtraLegs=true)
 
 PowhegHooksBB4L ()
 
double pTpythia (const Event &e, int RadAfterBranch, int EmtAfterBranch, int RecAfterBranch)
 
double qSplittingScale (Vec4 pt, Vec4 p1, Vec4 p2)
 
bool retryPartonLevel () override
 
double scaleResonance (int iRes, const Event &e) override
 
 ~PowhegHooksBB4L () override
 

Private Attributes

double atopresscale
 
bool debug
 
bool dryRunFSR
 
bool excludeFSRConflicting
 
unsigned long int nFSRvetoBB4l
 
bool onlyDistance1
 
double pTmin
 
bool pTpythiaVeto
 
double scaleResonanceVeto
 
double topresscale
 
bool vetoAtPL
 
double vetoDecScale
 
bool vetoDipoleFrame
 
bool vetoFSREmission
 
bool vetoPartonLevel
 
bool vetoQED
 
int vetoTopCharge
 
bool wouldVetoFsr
 

Detailed Description

Definition at line 18 of file PowhegHooksBB4L.h.

Constructor & Destructor Documentation

◆ PowhegHooksBB4L()

Pythia8::PowhegHooksBB4L::PowhegHooksBB4L ( )
inline

Definition at line 21 of file PowhegHooksBB4L.h.

21 : nFSRvetoBB4l(0) {}
unsigned long int nFSRvetoBB4l

◆ ~PowhegHooksBB4L()

Pythia8::PowhegHooksBB4L::~PowhegHooksBB4L ( )
inlineoverride

Definition at line 22 of file PowhegHooksBB4L.h.

References gather_cfg::cout, and nFSRvetoBB4l.

22 { std::cout << "Number of FSR vetoed in BB4l = " << nFSRvetoBB4l << std::endl; }
unsigned long int nFSRvetoBB4l

Member Function Documentation

◆ canSetResonanceScale()

bool Pythia8::PowhegHooksBB4L::canSetResonanceScale ( )
inlineoverride

Definition at line 240 of file PowhegHooksBB4L.h.

References scaleResonanceVeto.

240 { return scaleResonanceVeto; }

◆ canVetoFSREmission()

bool Pythia8::PowhegHooksBB4L::canVetoFSREmission ( )
inlineoverride

Definition at line 121 of file PowhegHooksBB4L.h.

References vetoFSREmission.

121 { return vetoFSREmission; } // || vetoProduction; }

◆ canVetoPartonLevel()

bool Pythia8::PowhegHooksBB4L::canVetoPartonLevel ( )
inlineoverride

Definition at line 83 of file PowhegHooksBB4L.h.

References vetoAtPL, and vetoPartonLevel.

◆ canVetoProcessLevel()

bool Pythia8::PowhegHooksBB4L::canVetoProcessLevel ( )
inlineoverride

Definition at line 46 of file PowhegHooksBB4L.h.

46 { return true; }

◆ doVetoFSR()

bool Pythia8::PowhegHooksBB4L::doVetoFSR ( bool  condition,
double  scale,
int  iTopCharge 
)
inline

Definition at line 213 of file PowhegHooksBB4L.h.

References dryRunFSR, nFSRvetoBB4l, radtype_, pfClustersFromCombinedCaloHF_cfi::scale, vetoDecScale, vetoTopCharge, and wouldVetoFsr.

Referenced by doVetoFSREmission().

213  {
214  if (radtype_.radtype == 2)
215  return false;
216  if (condition) {
217  if (!wouldVetoFsr) {
218  wouldVetoFsr = true;
220  vetoTopCharge = iTopCharge;
221  }
222  if (dryRunFSR)
223  return false;
224  else {
225  nFSRvetoBB4l++;
226  return true;
227  }
228  } else
229  return false;
230  }
struct @754 radtype_
unsigned long int nFSRvetoBB4l

◆ doVetoFSREmission()

bool Pythia8::PowhegHooksBB4L::doVetoFSREmission ( int  sizeOld,
const Event e,
int  iSys,
bool  inResonance 
)
inlineoverride

Definition at line 122 of file PowhegHooksBB4L.h.

References funct::abs(), atopresscale, gather_cfg::cout, debug, HLT_2024v12_cff::distance, doVetoFSR(), MillePedeFileConverter_cfg::e, gSplittingScale(), onlyDistance1, AlCaHLTBitMon_ParallelJobs::p, DiDispStaMuonMonitor_cfi::pt, pTpythia(), pTpythiaVeto, qSplittingScale(), pfClustersFromCombinedCaloHF_cfi::scale, topresscale, vetoDipoleFrame, vetoFSREmission, vetoQED, and wouldVetoFsr.

122  {
124  //VETO INSIDE THE RESONANCE //
126  if (inResonance && vetoFSREmission) {
127  int iRecAft = e.size() - 1;
128  int iEmt = e.size() - 2;
129  int iRadAft = e.size() - 3;
130  int iRadBef = e[iEmt].mother1();
131 
132  // find the top resonance the radiator originates from
133  int iTop = e[iRadBef].mother1();
134  int distance = 1;
135  while (abs(e[iTop].id()) != 6 && iTop > 0) {
136  iTop = e[iTop].mother1();
137  distance++;
138  }
139  if (iTop == 0) {
140  infoPtr->errorMsg(
141  "Warning in PowhegHooksBB4L::doVetoFSREmission: emission in resonance not from top quark, not vetoing");
142  return doVetoFSR(false, 0, 0);
143  //return false;
144  }
145  int iTopCharge = (e[iTop].id() > 0) ? 1 : -1;
146 
147  // calculate the scale of the emission
148  double scale;
149  //using pythia pT definition ...
150  if (pTpythiaVeto)
151  scale = pTpythia(e, iRadAft, iEmt, iRecAft);
152  //.. or using POWHEG pT definition
153  else {
154  Vec4 pr(e[iRadAft].p()), pe(e[iEmt].p()), pt(e[iTop].p()), prec(e[iRecAft].p()), psystem;
155  // The computation of the POWHEG pT can be done in the top rest frame or in the diple one.
156  // pdipole = pemt +prec +prad (after the emission)
157  // For the first emission off the top resonance pdipole = pw +pb (before the emission) = ptop
158  if (vetoDipoleFrame)
159  psystem = pr + pe + prec;
160  else
161  psystem = pt;
162 
163  // gluon splitting into two partons
164  if (e[iRadBef].id() == 21)
165  scale = gSplittingScale(psystem, pr, pe);
166  // quark emitting a gluon (or a photon)
167  else if (abs(e[iRadBef].id()) == 5 && ((e[iEmt].id() == 21) && !vetoQED))
168  scale = qSplittingScale(psystem, pr, pe);
169  // other stuff (which we should not veto)
170  else
171  scale = 0;
172  }
173 
174  if (iTopCharge > 0) {
175  if (onlyDistance1) {
176  if (debug && (distance == 1) && scale > topresscale && !wouldVetoFsr)
177  cout << e[iTop].id() << ": " << e[iRadBef].id() << " > " << e[iRadAft].id() << " + " << e[iEmt].id()
178  << "; " << scale << endl;
179  return doVetoFSR((distance == 1) && scale > topresscale, scale, iTopCharge);
180  } else {
181  if (debug && scale > topresscale && !wouldVetoFsr)
182  cout << e[iTop].id() << ": " << e[iRadBef].id() << " > " << e[iRadAft].id() << " + " << e[iEmt].id()
183  << "; " << scale << endl;
184  return doVetoFSR(scale > topresscale, scale, iTopCharge);
185  }
186  } else if (iTopCharge < 0) {
187  if (onlyDistance1) {
188  if (debug && (distance == 1) && scale > atopresscale && !wouldVetoFsr)
189  cout << e[iTop].id() << ": " << e[iRadBef].id() << " > " << e[iRadAft].id() << " + " << e[iEmt].id()
190  << "; " << scale << endl;
191  return doVetoFSR((distance == 1) && scale > atopresscale, scale, iTopCharge);
192  } else {
193  if (debug && scale > topresscale && !wouldVetoFsr)
194  cout << e[iTop].id() << ": " << e[iRadBef].id() << " > " << e[iRadAft].id() << " + " << e[iEmt].id()
195  << "; " << scale << endl;
196  return doVetoFSR(scale > atopresscale, scale, iTopCharge);
197  }
198  } else {
199  cout << "Bug in PohwgeHooksBB4l" << endl;
200  }
201  }
203  // VETO THE PRODUCTION PROCESS //
205  // covered by multiuserhook, i.e. need to turn on EV1
206  // else if(!inResonance && vetoProduction){
207  // return EmissionVetoHook1::doVetoFSREmission(sizeOld, e, iSys, inResonance);
208  // }
209 
210  return false;
211  }
double pTpythia(const Event &e, int RadAfterBranch, int EmtAfterBranch, int RecAfterBranch)
double qSplittingScale(Vec4 pt, Vec4 p1, Vec4 p2)
bool doVetoFSR(bool condition, double scale, int iTopCharge)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ExtVec< T, 4 > Vec4
Definition: ExtVec.h:60
double gSplittingScale(Vec4 pt, Vec4 p1, Vec4 p2)

◆ doVetoFSRInit()

void Pythia8::PowhegHooksBB4L::doVetoFSRInit ( )
inline

Definition at line 232 of file PowhegHooksBB4L.h.

References vetoDecScale, vetoTopCharge, and wouldVetoFsr.

Referenced by doVetoProcessLevel().

232  {
233  wouldVetoFsr = false;
234  vetoDecScale = -1;
235  vetoTopCharge = 0;
236  }

◆ doVetoPartonLevel()

bool Pythia8::PowhegHooksBB4L::doVetoPartonLevel ( const Event e)
inlineoverride

Definition at line 84 of file PowhegHooksBB4L.h.

References atopresscale, gather_cfg::cout, debug, dryRunFSR, MillePedeFileConverter_cfg::e, getdechardness(), radtype_, pfClustersFromCombinedCaloHF_cfi::scale, topresscale, vetoAtPL, vetoDecScale, vetoPartonLevel, vetoTopCharge, and wouldVetoFsr.

84  {
85  if (radtype_.radtype == 2)
86  return false;
87  if (debug) {
88  if (dryRunFSR && wouldVetoFsr) {
90  cout << "FSRdecScale = " << vetoDecScale << ", PLdecScale = " << scale << ", ratio = " << vetoDecScale / scale
91  << endl;
92  }
93  }
94  if (vetoPartonLevel) {
95  double topdecscale = getdechardness(1, e);
96  double atopdecscale = getdechardness(-1, e);
97  if ((topdecscale > topresscale) || (atopdecscale > atopresscale)) {
98  //if(dryRunFSR && ! wouldVetoFsr) mydatacontainer_.excludeEvent = excludeFSRConflicting?1:0;
99  return true;
100  } else
101  //if(dryRunFSR && wouldVetoFsr) mydatacontainer_.excludeEvent = excludeFSRConflicting?1:0;
102  return false;
103  }
104  if (vetoAtPL) {
105  if (dryRunFSR && wouldVetoFsr)
106  return true;
107  else
108  return false;
109  }
110  return false;
111  }
double getdechardness(int topcharge, const Event &e)
struct @754 radtype_

◆ doVetoProcessLevel()

bool Pythia8::PowhegHooksBB4L::doVetoProcessLevel ( Event e)
inlineoverride

Definition at line 47 of file PowhegHooksBB4L.h.

References cms::cuda::assert(), atopresscale, doVetoFSRInit(), MillePedeFileConverter_cfg::e, findresscale(), mps_fire::i, radtype_, contentValuesCheck::ss, groupFilesInBlocks::temp, and topresscale.

47  {
48  // extract the radtype from the event comment
49  stringstream ss;
50  // use eventattribute as comments not filled when using edm input
51  //ss << infoPtr->getEventComments();
52  ss << infoPtr->getEventAttribute("#rwgt");
53  string temp;
54  ss >> temp >> radtype_.radtype;
55  assert(temp == "#rwgt");
56 
57  // find last top and the last anti-top in the record
58  int i_top = -1, i_atop = -1;
59  for (int i = 0; i < e.size(); i++) {
60  if (e[i].id() == 6)
61  i_top = i;
62  if (e[i].id() == -6)
63  i_atop = i;
64  }
65  if (i_top != -1)
66  topresscale = findresscale(i_top, e);
67  else
68  topresscale = 1e30;
69  if (i_top != -1)
70  atopresscale = findresscale(i_atop, e);
71  else
72  atopresscale = 1e30;
73  // initialize stuff
74  doVetoFSRInit();
75  // do not veto, ever
76  return false;
77  }
assert(be >=bs)
double findresscale(const int iRes, const Event &event)
struct @754 radtype_

◆ findresscale()

double Pythia8::PowhegHooksBB4L::findresscale ( const int  iRes,
const Event event 
)
inline

Definition at line 264 of file PowhegHooksBB4L.h.

References funct::abs(), mps_fire::i, AlCaHLTBitMon_ParallelJobs::p, pTmin, pfClustersFromCombinedCaloHF_cfi::scale, and mathSSE::sqrt().

Referenced by doVetoProcessLevel().

264  {
265  double scale = 0.;
266 
267  int nDau = event[iRes].daughterList().size();
268 
269  if (nDau == 0) {
270  // No resonance found, set scale to high value
271  // Pythia will shower any MC generated resonance unrestricted
272  scale = 1e30;
273  } else if (nDau < 3) {
274  // No radiating resonance found
275  scale = pTmin;
276  } else if (abs(event[iRes].id()) == 6) {
277  // Find top daughters
278  int idw = -1, idb = -1, idg = -1;
279 
280  for (int i = 0; i < nDau; i++) {
281  int iDau = event[iRes].daughterList()[i];
282  if (abs(event[iDau].id()) == 24)
283  idw = iDau;
284  if (abs(event[iDau].id()) == 5)
285  idb = iDau;
286  if (abs(event[iDau].id()) == 21)
287  idg = iDau;
288  }
289 
290  // Get daughter 4-vectors in resonance frame
291  Vec4 pw(event[idw].p());
292  pw.bstback(event[iRes].p());
293 
294  Vec4 pb(event[idb].p());
295  pb.bstback(event[iRes].p());
296 
297  Vec4 pg(event[idg].p());
298  pg.bstback(event[iRes].p());
299 
300  // Calculate scale
301  scale = sqrt(2 * pg * pb * pg.e() / pb.e());
302  } else {
303  scale = 1e30;
304  }
305 
306  return scale;
307  }
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ExtVec< T, 4 > Vec4
Definition: ExtVec.h:60
Definition: event.py:1

◆ getdechardness()

double Pythia8::PowhegHooksBB4L::getdechardness ( int  topcharge,
const Event e 
)
inline

Definition at line 396 of file PowhegHooksBB4L.h.

References gather_cfg::cout, MillePedeFileConverter_cfg::e, beamvalidation::exit(), gSplittingScale(), h, mps_fire::i, match_decay(), SiStripPI::max, AlCaHLTBitMon_ParallelJobs::p, and qSplittingScale().

Referenced by doVetoPartonLevel().

396  {
397  int tid = 6 * topcharge, wid = 24 * topcharge, bid = 5 * topcharge, gid = 21, wildcard = 0;
398  // find last top in the record
399  int i_top = -1;
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) {
403  i_top = i;
404  p_top = e[i].p();
405  }
406  if (i_top == -1)
407  return -1.0;
408 
409  // summary of cases
410  // 1.) t > W b
411  // a.) b > 3 ... error
412  // b.) b > b g ... h = sqrt(2*p_g*p_b*p_g.e()/p_b.e())
413  // c.) b > other ... h = -1
414  // return h
415  // 2.) t > W b g
416  // a.) b > 3 ... error
417  // b.) b > b g ... h1 = sqrt(2*p_g*p_b*p_g.e()/p_b.e())
418  // c.) b > other ... h1 = -1
419  // i.) g > 3 ... error
420  // ii.) g > 2 ... h2 = sqrt(2*p_g1*p_g2*p_g1.e()*p_g2.e()/(pow(p_g1.e(),2)+pow(p_g2.e(),2))) );
421  // iii.) g > other ... h2 = -1
422  // return max(h1,h2)
423  // 3.) else ... error
424 
425  vector<Vec4> momenta;
426  vector<int> positions;
427 
428  // 1.) t > b W
429  if (match_decay(i_top, e, vector<int>{wid, bid}, positions, momenta, false)) {
430  double h;
431  int i_b = positions[1];
432  // a.+b.) b > 3 or b > b g
433  if (match_decay(i_b, e, vector<int>{bid, gid}, positions, momenta))
434  h = qSplittingScale(e[i_top].p(), momenta[0], momenta[1]);
435  // c.) b > other
436  else
437  h = -1;
438  return h;
439  }
440  // 2.) t > b W g
441  else if (match_decay(i_top, e, vector<int>{wid, bid, gid}, positions, momenta, false)) {
442  double h1, h2;
443  int i_b = positions[1], i_g = positions[2];
444  // a.+b.) b > 3 or b > b g
445  if (match_decay(i_b, e, vector<int>{bid, gid}, positions, momenta))
446  h1 = qSplittingScale(e[i_top].p(), momenta[0], momenta[1]);
447  // c.) b > other
448  else
449  h1 = -1;
450  // i.+ii.) g > 3 or g > 2
451  if (match_decay(i_g, e, vector<int>{wildcard, wildcard}, positions, momenta))
452  h2 = gSplittingScale(e[i_top].p(), momenta[0], momenta[1]);
453  // c.) b > other
454  else
455  h2 = -1;
456  return max(h1, h2);
457  }
458  // 3.) else
459  else {
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;
466  }
467  exit(-1);
468  }
469  }
double qSplittingScale(Vec4 pt, Vec4 p1, Vec4 p2)
ExtVec< T, 4 > Vec4
Definition: ExtVec.h:60
double gSplittingScale(Vec4 pt, Vec4 p1, Vec4 p2)
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.
Definition: Activities.doc:4
def exit(msg="")

◆ gSplittingScale()

double Pythia8::PowhegHooksBB4L::gSplittingScale ( Vec4  pt,
Vec4  p1,
Vec4  p2 
)
inline

Definition at line 351 of file PowhegHooksBB4L.h.

References LaserDQM_cfg::p1, SiStripOfflineCRack_cfg::p2, funct::pow(), DiDispStaMuonMonitor_cfi::pt, and mathSSE::sqrt().

Referenced by doVetoFSREmission(), and getdechardness().

351  {
352  p1.bstback(pt);
353  p2.bstback(pt);
354  return sqrt(2 * p1 * p2 * p1.e() * p2.e() / (pow(p1.e() + p2.e(), 2)));
355  }
T sqrt(T t)
Definition: SSEVec.h:19
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29

◆ initAfterBeams()

bool Pythia8::PowhegHooksBB4L::initAfterBeams ( )
inlineoverride

Definition at line 25 of file PowhegHooksBB4L.h.

References debug, dryRunFSR, excludeFSRConflicting, onlyDistance1, pTmin, pTpythiaVeto, scaleResonanceVeto, vetoAtPL, vetoDipoleFrame, vetoFSREmission, vetoPartonLevel, and vetoQED.

25  {
26  // settings of this class
27  vetoFSREmission = settingsPtr->flag("POWHEG:bb4l:FSREmission:veto");
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");
32  vetoPartonLevel = settingsPtr->flag("POWHEG:bb4l:PartonLevel:veto");
33  excludeFSRConflicting = settingsPtr->flag("POWHEG:bb4l:PartonLevel:excludeFSRConflicting");
34  debug = settingsPtr->flag("POWHEG:bb4l:DEBUG");
35  scaleResonanceVeto = settingsPtr->flag("POWHEG:bb4l:ScaleResonance:veto");
36  vetoDipoleFrame = settingsPtr->flag("POWHEG:bb4l:FSREmission:vetoDipoleFrame");
37  pTpythiaVeto = settingsPtr->flag("POWHEG:bb4l:FSREmission:pTpythiaVeto");
38  //vetoProduction = (settingsPtr->mode("POWHEG:veto")==1);
39  pTmin = settingsPtr->parm("POWHEG:bb4l:pTminVeto");
40  return true;
41  }

◆ match_decay()

bool Pythia8::PowhegHooksBB4L::match_decay ( int  iparticle,
const Event e,
const vector< int > &  ids,
vector< int > &  positions,
vector< Vec4 > &  momenta,
bool  exitOnExtraLegs = true 
)
inline

Definition at line 313 of file PowhegHooksBB4L.h.

References gather_cfg::cout, MillePedeFileConverter_cfg::e, beamvalidation::exit(), mps_fire::i, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by getdechardness().

318  {
319  // compare sizes
320  if (e[iparticle].daughterList().size() != ids.size()) {
321  if (exitOnExtraLegs && e[iparticle].daughterList().size() > ids.size()) {
322  cout << "extra leg" << endl;
323  exit(-1);
324  }
325  return false;
326  }
327  // compare content
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])
331  return false;
332  }
333  // reset the positions and momenta vectors (because they may be reused)
334  positions.clear();
335  momenta.clear();
336  // construct the array of momenta
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());
341  }
342  return true;
343  }
size
Write out results.
def exit(msg="")

◆ pTpythia()

double Pythia8::PowhegHooksBB4L::pTpythia ( const Event e,
int  RadAfterBranch,
int  EmtAfterBranch,
int  RecAfterBranch 
)
inline

Definition at line 361 of file PowhegHooksBB4L.h.

References funct::abs(), gather_cfg::cout, MillePedeFileConverter_cfg::e, L1TauEmu::pow2(), and mathSSE::sqrt().

Referenced by doVetoFSREmission().

361  {
362  // Convenient shorthands for later
363  Vec4 radVec = e[RadAfterBranch].p();
364  Vec4 emtVec = e[EmtAfterBranch].p();
365  Vec4 recVec = e[RecAfterBranch].p();
366  int radID = e[RadAfterBranch].id();
367 
368  // Calculate virtuality of splitting
369  Vec4 Q(radVec + emtVec);
370  double Qsq = Q.m2Calc();
371 
372  // Mass term of radiator
373  double m2Rad = (abs(radID) >= 4 && abs(radID) < 7) ? pow2(particleDataPtr->m0(radID)) : 0.;
374 
375  // z values for FSR
376  double z, pTnow;
377  // Construct 2 -> 3 variables
378  Vec4 sum = radVec + recVec + emtVec;
379  double m2Dip = sum.m2Calc();
380 
381  double x1 = 2. * (sum * radVec) / m2Dip;
382  double x3 = 2. * (sum * emtVec) / m2Dip;
383  z = x1 / (x1 + x3);
384  pTnow = z * (1. - z);
385 
386  // Virtuality
387  pTnow *= (Qsq - m2Rad);
388 
389  if (pTnow < 0.) {
390  cout << "Warning: pTpythia was negative" << endl;
391  return -1.;
392  } else
393  return (sqrt(pTnow));
394  }
constexpr int pow2(int x)
Definition: TauNNIdHW.h:51
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ExtVec< T, 4 > Vec4
Definition: ExtVec.h:60

◆ qSplittingScale()

double Pythia8::PowhegHooksBB4L::qSplittingScale ( Vec4  pt,
Vec4  p1,
Vec4  p2 
)
inline

Definition at line 345 of file PowhegHooksBB4L.h.

References LaserDQM_cfg::p1, SiStripOfflineCRack_cfg::p2, DiDispStaMuonMonitor_cfi::pt, and mathSSE::sqrt().

Referenced by doVetoFSREmission(), and getdechardness().

345  {
346  p1.bstback(pt);
347  p2.bstback(pt);
348  return sqrt(2 * p1 * p2 * p2.e() / p1.e());
349  }
T sqrt(T t)
Definition: SSEVec.h:19

◆ retryPartonLevel()

bool Pythia8::PowhegHooksBB4L::retryPartonLevel ( )
inlineoverride

Definition at line 82 of file PowhegHooksBB4L.h.

References vetoAtPL, and vetoPartonLevel.

◆ scaleResonance()

double Pythia8::PowhegHooksBB4L::scaleResonance ( int  iRes,
const Event e 
)
inlineoverride

Definition at line 245 of file PowhegHooksBB4L.h.

References atopresscale, MillePedeFileConverter_cfg::e, funct::pow(), radtype_, mathSSE::sqrt(), and topresscale.

245  {
246  if (e[iRes].id() == 6) {
247  if (radtype_.radtype == 2)
248  return sqrt(e[iRes].m2Calc());
249  else
250  return topresscale;
251  } else if (e[iRes].id() == -6) {
252  if (radtype_.radtype == 2)
253  return sqrt(e[iRes].m2Calc());
254  else
255  return atopresscale;
256  } else
257  return pow(10.0, 30.);
258  }
T sqrt(T t)
Definition: SSEVec.h:19
struct @754 radtype_
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29

Member Data Documentation

◆ atopresscale

double Pythia8::PowhegHooksBB4L::atopresscale
private

◆ debug

bool Pythia8::PowhegHooksBB4L::debug
private

◆ dryRunFSR

bool Pythia8::PowhegHooksBB4L::dryRunFSR
private

Definition at line 481 of file PowhegHooksBB4L.h.

Referenced by doVetoFSR(), doVetoPartonLevel(), and initAfterBeams().

◆ excludeFSRConflicting

bool Pythia8::PowhegHooksBB4L::excludeFSRConflicting
private

Definition at line 483 of file PowhegHooksBB4L.h.

Referenced by initAfterBeams().

◆ nFSRvetoBB4l

unsigned long int Pythia8::PowhegHooksBB4L::nFSRvetoBB4l
private

Definition at line 498 of file PowhegHooksBB4L.h.

Referenced by doVetoFSR(), and ~PowhegHooksBB4L().

◆ onlyDistance1

bool Pythia8::PowhegHooksBB4L::onlyDistance1
private

Definition at line 481 of file PowhegHooksBB4L.h.

Referenced by doVetoFSREmission(), and initAfterBeams().

◆ pTmin

double Pythia8::PowhegHooksBB4L::pTmin
private

Definition at line 496 of file PowhegHooksBB4L.h.

Referenced by findresscale(), and initAfterBeams().

◆ pTpythiaVeto

bool Pythia8::PowhegHooksBB4L::pTpythiaVeto
private

Definition at line 494 of file PowhegHooksBB4L.h.

Referenced by doVetoFSREmission(), and initAfterBeams().

◆ scaleResonanceVeto

double Pythia8::PowhegHooksBB4L::scaleResonanceVeto
private

Definition at line 485 of file PowhegHooksBB4L.h.

Referenced by canSetResonanceScale(), and initAfterBeams().

◆ topresscale

double Pythia8::PowhegHooksBB4L::topresscale
private

◆ vetoAtPL

bool Pythia8::PowhegHooksBB4L::vetoAtPL
private

◆ vetoDecScale

double Pythia8::PowhegHooksBB4L::vetoDecScale
private

Definition at line 491 of file PowhegHooksBB4L.h.

Referenced by doVetoFSR(), doVetoFSRInit(), and doVetoPartonLevel().

◆ vetoDipoleFrame

bool Pythia8::PowhegHooksBB4L::vetoDipoleFrame
private

Definition at line 493 of file PowhegHooksBB4L.h.

Referenced by doVetoFSREmission(), and initAfterBeams().

◆ vetoFSREmission

bool Pythia8::PowhegHooksBB4L::vetoFSREmission
private

Definition at line 481 of file PowhegHooksBB4L.h.

Referenced by canVetoFSREmission(), doVetoFSREmission(), and initAfterBeams().

◆ vetoPartonLevel

bool Pythia8::PowhegHooksBB4L::vetoPartonLevel
private

◆ vetoQED

bool Pythia8::PowhegHooksBB4L::vetoQED
private

Definition at line 481 of file PowhegHooksBB4L.h.

Referenced by doVetoFSREmission(), and initAfterBeams().

◆ vetoTopCharge

int Pythia8::PowhegHooksBB4L::vetoTopCharge
private

Definition at line 492 of file PowhegHooksBB4L.h.

Referenced by doVetoFSR(), doVetoFSRInit(), and doVetoPartonLevel().

◆ wouldVetoFsr

bool Pythia8::PowhegHooksBB4L::wouldVetoFsr
private

Definition at line 481 of file PowhegHooksBB4L.h.

Referenced by doVetoFSR(), doVetoFSREmission(), doVetoFSRInit(), and doVetoPartonLevel().