ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
top::MLLWindow Class Reference

Reject events in the invariant mass (of two charged leptons) window. More...

#include <MLLWindowSelector.h>

Inheritance diagram for top::MLLWindow:
Collaboration diagram for top::MLLWindow:

Public Member Functions

 MLLWindow (std::string params)
 
bool apply (const top::Event &event) const override
 This does stuff based on the information in an event. More...
 
bool applyParticleLevel (const top::ParticleLevelEvent &event) const override
 This does stuff based on the information in a particle level event. More...
 
std::string name () const override
 A human readable name. More...
 

Private Attributes

double m_cutvalue0
 
double m_cutvalue1
 

Detailed Description

Reject events in the invariant mass (of two charged leptons) window.

Definition at line 14 of file MLLWindowSelector.h.

Constructor & Destructor Documentation

◆ MLLWindow()

top::MLLWindow::MLLWindow ( std::string  params)
explicit

Definition at line 9 of file MLLWindowSelector.cxx.

9  :
10  m_cutvalue0(0.),
11  m_cutvalue1(0.) {
12  std::istringstream(params) >> m_cutvalue0 >> m_cutvalue1;
13  }

Member Function Documentation

◆ apply()

bool top::MLLWindow::apply ( const top::Event ) const
overridevirtual

This does stuff based on the information in an event.

The idea is that you implement this to return either true or false based on the information held within top::Event. If this returns true then the event is kept. If it returns false then the event is removed.

Parameters
top::EventThe current event.
Returns
true if the event should be kept, false otherwise.

Implements top::EventSelectorBase.

Definition at line 15 of file MLLWindowSelector.cxx.

15  {
16  const xAOD::IParticle* lepton0 = 0;
17  const xAOD::IParticle* lepton1 = 0;
18 
19  if (event.m_electrons.size() == 2) {
20  lepton0 = event.m_electrons[0];
21  lepton1 = event.m_electrons[1];
22  } else if (event.m_muons.size() == 2) {
23  lepton0 = event.m_muons[0];
24  lepton1 = event.m_muons[1];
25  } else {
26  throw std::runtime_error("MLLWindowSelector::apply: Need two same-flavour electrons or muons");
27  }
28 
29  const double mll = top::invariantMass(*lepton0, *lepton1);
30  return mll < m_cutvalue0 || mll > m_cutvalue1;
31  }

◆ applyParticleLevel()

bool top::MLLWindow::applyParticleLevel ( const top::ParticleLevelEvent ) const
overridevirtual

This does stuff based on the information in a particle level event.

The idea is that you implement this to return either true or false, based on the information held within the top::ParticleLevelEvent. If this function returns true, then the event is kept, otherwise it is removed. The function has a default implementation (which returns true) because it is expected that many EventSelector objects do not operate on ParticleLevelEvent objects.

Parameters
top::ParticleLevelEventthe current particle level event.
trueif the event should be kept (i.e. it passed the selector criteria), false otherwise.

Reimplemented from top::EventSelectorBase.

Definition at line 33 of file MLLWindowSelector.cxx.

33  {
34  // If any of the required collections is a nullptr (i.e. has not been
35  // loaded) return false.
36  if (not event.m_electrons
37  or not event.m_muons) {
38  return false;
39  }
40 
41  const xAOD::IParticle* lepton0 = 0;
42  const xAOD::IParticle* lepton1 = 0;
43 
44  if (event.m_electrons->size() == 2) {
45  lepton0 = (*event.m_electrons)[0];
46  lepton1 = (*event.m_electrons)[1];
47  } else if (event.m_muons->size() == 2) {
48  lepton0 = (*event.m_muons)[0];
49  lepton1 = (*event.m_muons)[1];
50  } else {
51  throw std::runtime_error("MLLWindowSelector::applyParticleLevel: Need two same-flavour electrons or muons");
52  }
53 
54  const double mll = top::invariantMass(*lepton0, *lepton1);
55  return mll < m_cutvalue0 || mll > m_cutvalue1;
56  }

◆ name()

std::string top::MLLWindow::name ( ) const
overridevirtual

A human readable name.

Mostly used for printing the cut and value to the screen. Must be implemented for each tool.

Implements top::EventSelectorBase.

Definition at line 58 of file MLLWindowSelector.cxx.

58  {
59  std::stringstream ss;
60  ss << "MLLWIN " << m_cutvalue0 << " " << m_cutvalue1;
61  return ss.str();
62  }

Member Data Documentation

◆ m_cutvalue0

double top::MLLWindow::m_cutvalue0
private

Definition at line 24 of file MLLWindowSelector.h.

◆ m_cutvalue1

double top::MLLWindow::m_cutvalue1
private

Definition at line 25 of file MLLWindowSelector.h.


The documentation for this class was generated from the following files:
top::MLLWindow::m_cutvalue0
double m_cutvalue0
Definition: MLLWindowSelector.h:24
top::invariantMass
double invariantMass(const xAOD::IParticle &p1, const xAOD::IParticle &p2)
Calculate the invariant mass of two particles.
Definition: EventTools.cxx:48
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:40
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
top::MLLWindow::m_cutvalue1
double m_cutvalue1
Definition: MLLWindowSelector.h:25
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226