CMS 3D CMS Logo

PowhegResHook.cc
Go to the documentation of this file.
1 // Hook for setting shower scale in top and W resonances
2 // for Powheg ttb_NLO_dec and b_bbar_4l processes
3 // C++ port of algorithm by Jezo et. al. (arXiv:1607.04538, Appendix B.2)
4 
5 #include "Pythia8/Pythia.h"
6 
7 using namespace Pythia8;
8 
10 
11 double PowhegResHook::scaleResonance( const int iRes, const Event& event) {
12  calcScales_ = settingsPtr->flag("POWHEGres:calcScales");
13 
14  double scale = 0.;
15 
16  int nDau = event[iRes].daughterList().size();
17 
18  if (!calcScales_ or nDau == 0) {
19  // No resonance found, set scale to high value
20  // Pythia will shower any MC generated resonance unrestricted
21  scale = 1e30;
22  }
23 
24  else if (nDau < 3) {
25  // No radiating resonance found
26  scale = 0.8;
27  }
28 
29  else if (abs(event[iRes].id()) == 6) {
30  // Find top daughters
31  int idw = -1, idb = -1, idg = -1;
32 
33  for (int i = 0; i < nDau; i++) {
34  int iDau = event[iRes].daughterList()[i];
35  if (abs(event[iDau].id()) == 24) idw = iDau;
36  if (abs(event[iDau].id()) == 5) idb = iDau;
37  if (abs(event[iDau].id()) == 21) idg = iDau;
38  }
39 
40  // Get daughter 4-vectors in resonance frame
41  Vec4 pw(event[idw].p());
42  pw.bstback(event[iRes].p());
43 
44  Vec4 pb(event[idb].p());
45  pb.bstback(event[iRes].p());
46 
47  Vec4 pg(event[idg].p());
48  pg.bstback(event[iRes].p());
49 
50  // Calculate scale
51  scale = sqrt(2*pg*pb*pg.e()/pb.e());
52  }
53 
54  else if (abs(event[iRes].id()) == 24) {
55  // Find W daughters
56  int idq = -1, ida = -1, idg = -1;
57 
58  for (int i = 0; i < nDau; i++) {
59  int iDau = event[iRes].daughterList()[i];
60  if (event[iDau].id() == 21) idg = iDau;
61  else if (event[iDau].id() > 0) idq = iDau;
62  else if (event[iDau].id() < 0) ida = iDau;
63  }
64 
65  // Get daughter 4-vectors in resonance frame
66  Vec4 pq(event[idq].p());
67  pq.bstback(event[iRes].p());
68 
69  Vec4 pa(event[ida].p());
70  pa.bstback(event[iRes].p());
71 
72  Vec4 pg(event[idg].p());
73  pg.bstback(event[iRes].p());
74 
75  // Calculate scale
76  Vec4 pw = pq + pa + pg;
77  double q2 = pw*pw;
78  double csi = 2*pg.e()/sqrt(q2);
79  double yq = 1 - pg*pq/(pg.e()*pq.e());
80  double ya = 1 - pg*pa/(pg.e()*pa.e());
81 
82  scale = sqrt(min(1-yq,1-ya)*pow2(csi)*q2/2);
83  }
84 
85  return scale;
86 }
87 
ExtVec< T, 4 > Vec4
Definition: ExtVec.h:62
susybsm::HSCParticle pa
Definition: classes.h:8
double q2[4]
Definition: TauolaWrapper.h:88
double scaleResonance(const int iRes, const Pythia8::Event &event) override
T sqrt(T t)
Definition: SSEVec.h:18
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T min(T a, T b)
Definition: MathUtil.h:58
Definition: event.py:1