CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EmissionVetoHook.cc
Go to the documentation of this file.
2 
5  throw edm::Exception(edm::errors::Configuration,"Pythia8Interface")
6  << "EmissionVeto: " << message << endl;
7 }
8 
9 // Use VetoMIStep to analyse the incoming LHEF event and
10 // extract the veto scale
11 bool EmissionVetoHook::doVetoMPIStep(int, const Pythia8::Event &e) {
12  int first=-1, myid;
13  last = -1;
14  for(int ip = 2; ip < e.size(); ip++) {
15  myid = e[ip].id();
16  if(abs(myid) < 6 || abs(myid) == 21) continue;
17  first = ip;
18  break;
19  }
20  if(first < 0) fatalEmissionVeto(string("signal particles not found"));
21  for(int ip = first; ip < e.size(); ip++) {
22  myid = e[ip].id();
23  if(abs(myid) < 6 || abs(myid) == 21) continue;
24  last = ip;
25  }
26  if(Verbosity)
27  cout << "last before powheg emission = " << last << " , id = "
28  << e[last].id() << " emission size = " << e.size() - 1 - last << endl;
29 
30  // Some events may not have radiation from POWHEG
31  switch (e.size() - 1 - last) {
32  case 0:
33  // No radiation - veto scale is given by the factorisation scale
34  pTpowheg = -1.;
35  pTveto = infoPtr->QFac();
36  noRad = true;
37 
38  // If this is the first no radiation event, then print scale
39  if (firstNoRad) {
40  if(Verbosity)
41  cout << "Info: no POWHEG radiation, Q = " << pTveto
42  << " GeV" << endl;
43  firstNoRad = false;
44  }
45  break;
46 
47  case 1:
48  // Radiation is parton last+1 - first check that it is as expected
49  if (e[last+1].id() != 21 && e[last+1].idAbs() > 5) {
50  cout << endl << "Emergency dump of the intermediate event: " << endl;
51  e.list();
52  fatalEmissionVeto(string("Error: jet is not quark/gluon"));
53  }
54  // Veto scale is given by jet pT
55  pTpowheg = e[last+1].pT();
56  pTveto = e[last+1].pT();
57  noRad = false;
58  break;
59  }
60 
61  if(Verbosity) cout << "veto pT = " << pTveto << " QFac = " << infoPtr->QFac() << endl;
62 
63  // Initialise other variables
64  pTshower = -1.;
65 
66  // Do not veto the event
67  return false;
68 }
69 
70 // For subsequent ISR/FSR emissions, find the pT of the shower
71 // emission and veto as necessary
72 bool EmissionVetoHook::doVetoISREmission(int, const Pythia8::Event &e, int iSys) {
73  // Must be radiation from the hard system
74  if (iSys != 0) return false;
75 
76  if(last < 0) fatalEmissionVeto(string("Variable last is not filled"));
77 
78  // ISR - next shower emission is given status 43
79  int i;
80  for (i = e.size() - 1; i > last; i--)
81  if (e[i].isFinal() && e[i].status() == 43) break;
82  if (i == last) {
83  cout << endl << "Emergency dump of the intermediate event: " << endl;
84  e.list();
85  fatalEmissionVeto(string("Error: couldn't find ISR emission"));
86  }
87 
88  // Veto if above the POWHEG scale
89  if (e[i].pT() > pTveto) {
90  nISRveto++;
91  if(Verbosity) cout << "ISR vetoed" << endl;
92  return true;
93  }
94  // Store the first shower emission pT
95  if (pTshower < 0.) pTshower = e[i].pT();
96 
97  return false;
98 }
99 
100 bool EmissionVetoHook::doVetoFSREmission(int, const Pythia8::Event &e, int iSys, bool) {
101  // Must be radiation from the hard system
102  if (iSys != 0) return false;
103 
104  // FSR - shower emission will have status 51 and not be t/tbar
105  int i;
106  for (i = e.size() - 1; i > last; i--)
107  if (e[i].isFinal() && e[i].status() == 51 &&
108  e[i].idAbs() != 6) break;
109  if (i == last) {
110  cout << endl << "Emergency dump of the intermediate event: " << endl;
111  e.list();
112  fatalEmissionVeto(string("Error: couldn't find FSR emission"));
113  }
114 
115  // Veto if above the POWHEG scale
116  if (e[i].pT() > pTveto) {
117  nFSRveto++;
118  if(Verbosity) cout << "FSR vetoed" << endl;
119  return true;
120  }
121  // Store the first shower emission pT
122  if (pTshower < 0.) pTshower = e[i].pT();
123 
124  return false;
125 }
int i
Definition: DBlmapReader.cc:9
bool doVetoISREmission(int, const Pythia8::Event &e, int iSys)
void fatalEmissionVeto(string message)
bool doVetoFSREmission(int, const Pythia8::Event &e, int iSys, bool)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool first
Definition: L1TdeRCT.cc:75
bool doVetoMPIStep(int, const Pythia8::Event &e)
tuple cout
Definition: gather_cfg.py:121