CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
EmissionVetoHook Class Reference

#include <EmissionVetoHook.h>

Inheritance diagram for EmissionVetoHook:

Public Member Functions

bool canVetoFSREmission ()
 
bool canVetoISREmission ()
 
bool canVetoMPIStep ()
 
bool doVetoFSREmission (int, const Pythia8::Event &e, int iSys, bool)
 
bool doVetoISREmission (int, const Pythia8::Event &e, int iSys)
 
bool doVetoMPIStep (int, const Pythia8::Event &e)
 
 EmissionVetoHook (int argVerbosity)
 
void fatalEmissionVeto (string message)
 
int getNFSRveto ()
 
int getNISRveto ()
 
bool getNoRad ()
 
double getPTpowheg ()
 
double getPTshower ()
 
int numberVetoMPIStep ()
 
 ~EmissionVetoHook ()
 

Private Attributes

bool firstNoRad
 
int last
 
int nFSRveto
 
int nISRveto
 
bool noRad
 
double pTpowheg
 
double pTshower
 
double pTveto
 
int Verbosity
 

Detailed Description

Definition at line 3 of file EmissionVetoHook.h.

Constructor & Destructor Documentation

EmissionVetoHook::EmissionVetoHook ( int  argVerbosity)
inline

Definition at line 8 of file EmissionVetoHook.h.

EmissionVetoHook::~EmissionVetoHook ( )
inline

Definition at line 10 of file EmissionVetoHook.h.

References gather_cfg::cout, nFSRveto, and nISRveto.

10  {
11  cout << "Number of ISR vetoed = " << nISRveto << endl;
12  cout << "Number of FSR vetoed = " << nFSRveto << endl;
13  }
tuple cout
Definition: gather_cfg.py:121

Member Function Documentation

bool EmissionVetoHook::canVetoFSREmission ( )
inline

Definition at line 26 of file EmissionVetoHook.h.

26 { return true; }
bool EmissionVetoHook::canVetoISREmission ( )
inline

Definition at line 23 of file EmissionVetoHook.h.

23 { return true; }
bool EmissionVetoHook::canVetoMPIStep ( )
inline

Definition at line 17 of file EmissionVetoHook.h.

17 { return true; }
bool EmissionVetoHook::doVetoFSREmission ( int  ,
const Pythia8::Event &  e,
int  iSys,
bool   
)

Definition at line 100 of file EmissionVetoHook.cc.

References gather_cfg::cout, fatalEmissionVeto(), i, last, nFSRveto, pTshower, pTveto, and Verbosity.

100  {
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
void fatalEmissionVeto(string message)
tuple cout
Definition: gather_cfg.py:121
bool EmissionVetoHook::doVetoISREmission ( int  ,
const Pythia8::Event &  e,
int  iSys 
)

Definition at line 72 of file EmissionVetoHook.cc.

References gather_cfg::cout, fatalEmissionVeto(), i, last, nISRveto, pTshower, pTveto, and Verbosity.

72  {
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 }
int i
Definition: DBlmapReader.cc:9
void fatalEmissionVeto(string message)
tuple cout
Definition: gather_cfg.py:121
bool EmissionVetoHook::doVetoMPIStep ( int  ,
const Pythia8::Event &  e 
)

Definition at line 11 of file EmissionVetoHook.cc.

References funct::abs(), gather_cfg::cout, fatalEmissionVeto(), first, firstNoRad, last, noRad, pTpowheg, pTshower, pTveto, and Verbosity.

11  {
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 }
void fatalEmissionVeto(string message)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool first
Definition: L1TdeRCT.cc:79
tuple cout
Definition: gather_cfg.py:121
void EmissionVetoHook::fatalEmissionVeto ( string  message)

Definition at line 4 of file EmissionVetoHook.cc.

References edm::errors::Configuration, and edm::hlt::Exception.

Referenced by doVetoFSREmission(), doVetoISREmission(), and doVetoMPIStep().

4  {
5  throw edm::Exception(edm::errors::Configuration,"Pythia8Interface")
6  << "EmissionVeto: " << message << endl;
7 }
int EmissionVetoHook::getNFSRveto ( )
inline

Definition at line 35 of file EmissionVetoHook.h.

References nFSRveto.

35 { return nFSRveto; }
int EmissionVetoHook::getNISRveto ( )
inline

Definition at line 34 of file EmissionVetoHook.h.

References nISRveto.

34 { return nISRveto; }
bool EmissionVetoHook::getNoRad ( )
inline

Definition at line 36 of file EmissionVetoHook.h.

References noRad.

36 { return noRad; }
double EmissionVetoHook::getPTpowheg ( )
inline

Definition at line 32 of file EmissionVetoHook.h.

References pTpowheg.

32 { return pTpowheg; }
double EmissionVetoHook::getPTshower ( )
inline

Definition at line 33 of file EmissionVetoHook.h.

References pTshower.

33 { return pTshower; }
int EmissionVetoHook::numberVetoMPIStep ( )
inline

Definition at line 18 of file EmissionVetoHook.h.

18 { return 1; }

Member Data Documentation

bool EmissionVetoHook::firstNoRad
private

Definition at line 42 of file EmissionVetoHook.h.

Referenced by doVetoMPIStep().

int EmissionVetoHook::last
private

Definition at line 41 of file EmissionVetoHook.h.

Referenced by doVetoFSREmission(), doVetoISREmission(), and doVetoMPIStep().

int EmissionVetoHook::nFSRveto
private

Definition at line 41 of file EmissionVetoHook.h.

Referenced by doVetoFSREmission(), getNFSRveto(), and ~EmissionVetoHook().

int EmissionVetoHook::nISRveto
private

Definition at line 41 of file EmissionVetoHook.h.

Referenced by doVetoISREmission(), getNISRveto(), and ~EmissionVetoHook().

bool EmissionVetoHook::noRad
private

Definition at line 42 of file EmissionVetoHook.h.

Referenced by doVetoMPIStep(), and getNoRad().

double EmissionVetoHook::pTpowheg
private

Definition at line 40 of file EmissionVetoHook.h.

Referenced by doVetoMPIStep(), and getPTpowheg().

double EmissionVetoHook::pTshower
private
double EmissionVetoHook::pTveto
private

Definition at line 40 of file EmissionVetoHook.h.

Referenced by doVetoFSREmission(), doVetoISREmission(), and doVetoMPIStep().

int EmissionVetoHook::Verbosity
private

Definition at line 41 of file EmissionVetoHook.h.

Referenced by doVetoFSREmission(), doVetoISREmission(), and doVetoMPIStep().