CMS 3D CMS Logo

Public Member Functions | Private Attributes

EmissionVetoHook Class Reference

#include <EmissionVetoHook.h>

List of all members.

Public Member Functions

bool canVetoFSREmission ()
bool canVetoISREmission ()
bool canVetoMIStep ()
bool doVetoFSREmission (int, const Pythia8::Event &e)
bool doVetoISREmission (int, const Pythia8::Event &e)
bool doVetoMIStep (int, const Pythia8::Event &e)
 EmissionVetoHook (int Verbosity)
void fatalEmissionVeto (string message)
int getNFSRveto ()
int getNISRveto ()
bool getNoRad ()
double getPTpowheg ()
double getPTshower ()
int numberVetoMIStep ()
 ~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  Verbosity) [inline]

Definition at line 8 of file EmissionVetoHook.h.

                                  : nISRveto(0), nFSRveto(0), 
    firstNoRad(true) { }
EmissionVetoHook::~EmissionVetoHook ( ) [inline]

Definition at line 10 of file EmissionVetoHook.h.

References gather_cfg::cout, nFSRveto, and nISRveto.

                     {
    cout << "Number of ISR vetoed = " << nISRveto << endl;
    cout << "Number of FSR vetoed = " << nFSRveto << endl;
  }

Member Function Documentation

bool EmissionVetoHook::canVetoFSREmission ( ) [inline]

Definition at line 26 of file EmissionVetoHook.h.

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

Definition at line 23 of file EmissionVetoHook.h.

{ return true; }
bool EmissionVetoHook::canVetoMIStep ( ) [inline]

Definition at line 17 of file EmissionVetoHook.h.

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

Definition at line 95 of file EmissionVetoHook.cc.

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

                                                                   {
  // FSR - shower emission will have status 51 and not be t/tbar
  int i;
  for (i = e.size() - 1; i > last; i--)
    if (e[i].isFinal() && e[i].status() == 51 &&
        e[i].idAbs() != 6) break;
  if (i == last) {
    cout << endl << "Emergency dump of the intermediate event: " << endl;
    e.list();
    fatalEmissionVeto(string("Error: couldn't find FSR emission"));
  }

  // Veto if above the POWHEG scale
  if (e[i].pT() > pTveto) {
    nFSRveto++;  
    if(Verbosity) cout << "FSR vetoed" << endl;
    return true;
  }
  // Store the first shower emission pT   
  if (pTshower < 0.) pTshower = e[i].pT();

  return false;
}
bool EmissionVetoHook::doVetoISREmission ( int  ,
const Pythia8::Event &  e 
)

Definition at line 72 of file EmissionVetoHook.cc.

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

                                                                   {
  // ISR - next shower emission is given status 43
  int i;
  for (i = e.size() - 1; i > last; i--)
    if (e[i].isFinal() && e[i].status() == 43) break;
  if (i == last) {
    cout << endl << "Emergency dump of the intermediate event: " << endl;
    e.list();
    fatalEmissionVeto(string("Error: couldn't find ISR emission"));
  }
     
  // Veto if above the POWHEG scale
  if (e[i].pT() > pTveto) {
    nISRveto++;
    if(Verbosity) cout << "ISR vetoed" << endl;
    return true; 
  }
  // Store the first shower emission pT
  if (pTshower < 0.) pTshower = e[i].pT();
   
  return false;
}
bool EmissionVetoHook::doVetoMIStep ( int  ,
const Pythia8::Event &  e 
)

Definition at line 11 of file EmissionVetoHook.cc.

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

                                                              {
  int first=-1, myid;
  last = -1;
  for(int ip = 2; ip < e.size(); ip++) {
    myid = e[ip].id();
    if(abs(myid) < 6 || abs(myid) == 21) continue;
    first = ip;
    break;
  }
  if(first < 0) fatalEmissionVeto(string("signal particles not found"));
  for(int ip = first; ip < e.size(); ip++) {
    myid = e[ip].id();
    if(abs(myid) < 6 || abs(myid) == 21) continue;
    last = ip;
  }
  if(Verbosity)
    cout << "last before powheg emission = " << last << " , id = "
         << e[last].id() << endl;

  // Some events may not have radiation from POWHEG
  switch (e.size() - 1 - last) {
  case 0:
    // No radiation - veto scale is given by the factorisation scale
    pTpowheg = -1.;
    pTveto   = infoPtr->QFac();
    noRad    = true;

    // If this is the first no radiation event, then print scale
    if (firstNoRad) {
      if(Verbosity)
        cout << "Info: no POWHEG radiation, Q = " << pTveto
             << " GeV" << endl;
      firstNoRad = false;
    }
    break;

  case 1:
    // Radiation is parton last+1 - first check that it is as expected
    if (e[last+1].id() != 21 && e[last+1].idAbs() > 5) {
      cout << endl << "Emergency dump of the intermediate event: " << endl;
      e.list();
      fatalEmissionVeto(string("Error: jet is not quark/gluon"));
    }
    // Veto scale is given by jet pT
    pTveto = pTpowheg = e[last+1].pT();
    noRad  = false;
    noRad  = false;
    break;
  }

  if(Verbosity) cout << "veto pT = " << pTveto << endl;

  // Initialise other variables
  pTshower = -1.;

  // Do not veto the event
  return false;
}
void EmissionVetoHook::fatalEmissionVeto ( string  message)

Definition at line 4 of file EmissionVetoHook.cc.

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

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

                                                       {
  throw edm::Exception(edm::errors::Configuration,"Pythia8Interface")
    << "EmissionVeto: " << message << endl;
}
int EmissionVetoHook::getNFSRveto ( ) [inline]

Definition at line 35 of file EmissionVetoHook.h.

References nFSRveto.

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

Definition at line 34 of file EmissionVetoHook.h.

References nISRveto.

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

Definition at line 36 of file EmissionVetoHook.h.

References noRad.

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

Definition at line 32 of file EmissionVetoHook.h.

References pTpowheg.

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

Definition at line 33 of file EmissionVetoHook.h.

References pTshower.

{ return pTshower; }
int EmissionVetoHook::numberVetoMIStep ( ) [inline]

Definition at line 18 of file EmissionVetoHook.h.

{ return 1; }

Member Data Documentation

Definition at line 42 of file EmissionVetoHook.h.

Referenced by doVetoMIStep().

int EmissionVetoHook::last [private]

Definition at line 41 of file EmissionVetoHook.h.

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

Definition at line 41 of file EmissionVetoHook.h.

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

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 doVetoMIStep(), and getNoRad().

double EmissionVetoHook::pTpowheg [private]

Definition at line 40 of file EmissionVetoHook.h.

Referenced by doVetoMIStep(), and getPTpowheg().

double EmissionVetoHook::pTshower [private]

Definition at line 40 of file EmissionVetoHook.h.

Referenced by doVetoFSREmission(), doVetoISREmission(), doVetoMIStep(), and getPTshower().

double EmissionVetoHook::pTveto [private]

Definition at line 40 of file EmissionVetoHook.h.

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

Definition at line 41 of file EmissionVetoHook.h.

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