ATLAS Offline Software
NFwdElectronSelector.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3  */
4 
6 #include <algorithm>
7 
8 namespace top {
10  SignValueSelector("FWDEL_N", params, true) {
12  }
13 
15  auto func = [&](const xAOD::Electron* elPtr) {
16  return elPtr->pt() > value();
17  };
18  auto count = std::count_if(event.m_fwdElectrons.begin(), event.m_fwdElectrons.end(), func);
19 
20  return checkInt(count, multiplicity());
21  }
22 
24  return true;
25  }
26 }
top::SignValueSelector::checkInt
bool checkInt(int value, int cut) const
Compare a cut supplied by the user with the value calculated in the event.
Definition: SignValueSelector.cxx:159
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
top::SignValueSelector::multiplicity
double multiplicity() const
Get the cut multiplicity assigned in the constructor.
Definition: SignValueSelector.cxx:106
top::SignValueSelector
Many of the tools need a sign (>=) and a value (2).
Definition: SignValueSelector.h:16
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
NFwdElectronSelector.h
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
top::NFwdElectronSelector::applyParticleLevel
bool applyParticleLevel(const top::ParticleLevelEvent &event) const override
This does stuff based on the information in a particle level event.
Definition: NFwdElectronSelector.cxx:23
top::ParticleLevelEvent
Definition: ParticleLevelEvent.h:24
top::SignValueSelector::checkMultiplicityIsInteger
void checkMultiplicityIsInteger()
Integers are annoying in C++.
Definition: SignValueSelector.cxx:82
top::SignValueSelector::value
double value() const
Get the cut value assigned in the constructor.
Definition: SignValueSelector.cxx:94
xAOD::Electron_v1
Definition: Electron_v1.h:34
top::NFwdElectronSelector::NFwdElectronSelector
NFwdElectronSelector(const std::string &params)
Definition: NFwdElectronSelector.cxx:9
top::Event
Very simple class to hold event data after reading from a file.
Definition: Event.h:49
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
top::NFwdElectronSelector::apply
bool apply(const top::Event &event) const override
This does stuff based on the information in an event.
Definition: NFwdElectronSelector.cxx:14