6 #ifndef Pythia8_PowhegHooksBB4L_H 7 #define Pythia8_PowhegHooksBB4L_H 10 #include "Pythia8/Pythia.h" 34 onlyDistance1 = settingsPtr->flag(
"POWHEG:bb4l:onlyDistance1");
49 int nDau =
event[iRes].daughterList().size();
60 else if (
std::abs(event[iRes].
id()) == 6) {
62 int idw = -1, idb = -1, idg = -1;
64 for (
int i = 0;
i < nDau;
i++) {
65 int iDau =
event[iRes].daughterList()[
i];
66 if (
std::abs(event[iDau].
id()) == 24) idw = iDau;
67 if (
std::abs(event[iDau].
id()) == 5) idb = iDau;
68 if (
std::abs(event[iDau].
id()) == 21) idg = iDau;
72 Vec4 pw(event[idw].
p());
73 pw.bstback(event[iRes].
p());
75 Vec4 pb(event[idb].
p());
76 pb.bstback(event[iRes].
p());
78 Vec4 pg(event[idg].
p());
79 pg.bstback(event[iRes].
p());
82 scale =
sqrt(2*pg*pb*pg.e()/pb.e());
97 inline bool match_decay(
int iparticle,
const Event &
e,
const vector<int> &
ids, vector<int> &positions, vector<Vec4> &momenta,
bool exitOnExtraLegs =
true){
99 if (e[iparticle].daughterList().
size() != ids.size()) {
100 if (exitOnExtraLegs && e[iparticle].daughterList().size() > ids.size())
exit(-1);
104 for (
unsigned int i = 0;
i < e[iparticle].daughterList().size();
i++) {
105 int di = e[iparticle].daughterList()[
i];
106 if (ids[
i] != 0 && e[di].
id() != ids[
i])
113 for (
unsigned int i = 0;
i < e[iparticle].daughterList().size();
i++) {
114 int di = e[iparticle].daughterList()[
i];
115 positions.push_back(di);
116 momenta.push_back(e[di].
p());
124 return sqrt( 2*p1*p2*p2.e()/p1.e() );
130 return sqrt( 2*p1*p2*p1.e()*p2.e()/(
pow(p1.e(),2)+
pow(p2.e(),2)) );
136 int tid = 6*topcharge, wid = 24*topcharge, bid = 5*topcharge, gid = 21, wildcard = 0;
139 Vec4 p_top, p_b, p_g, p_g1, p_g2;
140 for (
int i = 0;
i < e.size();
i++)
141 if (e[
i].
id() == tid) {
145 if (i_top == -1)
return -1.0;
163 vector<Vec4> momenta;
164 vector<int> positions;
167 if (
match_decay(i_top, e, vector<int> {wid, bid}, positions, momenta,
false) ) {
169 int i_b = positions[1];
171 if (
match_decay(i_b, e, vector<int> {bid, gid}, positions, momenta) )
179 else if (
match_decay(i_top, e, vector<int> {wid, bid, gid}, positions, momenta,
false) ) {
181 int i_b = positions[1], i_g = positions[2];
183 if (
match_decay(i_b, e, vector<int> {bid, gid}, positions, momenta) )
189 if (
match_decay(i_g, e, vector<int> {wildcard, wildcard}, positions, momenta) )
210 infoPtr->errorMsg(
"Warning in PowhegHooksBB4L::doVetoPartonLevel: passed doVetoFSREmission veto, but wouldn't have passed veto based on the full event listing");
223 if (e[iRes].
id() == 6)
225 else if (e[iRes].
id() == -6)
250 int iEmt = e.size() - 2;
251 int iRadAft = e.size() - 3;
252 int iRadBef = e[iEmt].mother1();
255 int iTop = e[iRadBef].mother1();
257 while (
std::abs(e[iTop].
id()) != 6 && iTop > 0) {
258 iTop = e[iTop].mother1();
262 infoPtr->errorMsg(
"Warning in PowhegHooksBB4L::doVetoFSREmission: emission in resonance not from top quark, not vetoing");
265 int iTopCharge = (e[iTop].id()>0)?1:-1;
269 Vec4 pr(e[iRadAft].
p()), pe(e[iEmt].
p()),
pt(e[iTop].
p());
272 if (e[iRadBef].
id() == 21)
275 else if (
std::abs(e[iRadBef].
id()) <= 5)
282 if (iTopCharge > 0) {
330 #endif // end Pythia8_PowhegHooksBB4L_H
bool doVetoFSREmission(int sizeOld, const Event &e, int iSys, bool inResonance)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
bool canVetoFSREmission()
double qSplittingScale(Vec4 pt, Vec4 p1, Vec4 p2)
double scaleResonance(int iRes, const Event &e)
double getdechardness(int topcharge, const Event &e)
bool canSetResonanceScale()
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
Abs< T >::type abs(const T &t)
double findresscale(const int iRes, const Event &event)
double gSplittingScale(Vec4 pt, Vec4 p1, Vec4 p2)
bool doVetoPartonLevel(const Event &e)
bool useScaleResonanceInstead
bool match_decay(int iparticle, const Event &e, const vector< int > &ids, vector< int > &positions, vector< Vec4 > &momenta, bool exitOnExtraLegs=true)
Power< A, B >::type pow(const A &a, const B &b)
bool canVetoPartonLevel()