ATLAS Offline Software
NFwdElectronTightSelector.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3  */
4 
6 #include <algorithm>
7 
9 using namespace TopEventSelectionTools;
10 
11 namespace top {
12  NFwdElectronTightSelector::NFwdElectronTightSelector(const std::string& params) :
13  SignValueSelector("FWDEL_N_TIGHT", params, true) {
15  }
16 
18  auto func = [&](const xAOD::Electron* elPtr) {
19  return elPtr->pt() > value() && elPtr->auxdataConst<char>("passPreORSelection");
20  };
21  auto count = std::count_if(event.m_fwdElectrons.begin(), event.m_fwdElectrons.end(), func);
22 
23  return checkInt(count, multiplicity());
24  }
25 
27  ATH_MSG_INFO("NFwdElectronTightSelector::applyParticleLevel: "
28  << "no separate fwdElectrons container currently defined at particleLevel"
29  << "FWDEL_N_TIGHT always returning true at particle level.");
30  return true;
31  }
32 }
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
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
top::SignValueSelector::multiplicity
double multiplicity() const
Get the cut multiplicity assigned in the constructor.
Definition: SignValueSelector.cxx:106
MsgCategory.h
top::NFwdElectronTightSelector::apply
bool apply(const top::Event &event) const override
This does stuff based on the information in an event.
Definition: NFwdElectronTightSelector.cxx:17
top::SignValueSelector
Many of the tools need a sign (>=) and a value (2).
Definition: SignValueSelector.h:16
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
NFwdElectronTightSelector.h
top::ParticleLevelEvent
Definition: ParticleLevelEvent.h:24
top::SignValueSelector::checkMultiplicityIsInteger
void checkMultiplicityIsInteger()
Integers are annoying in C++.
Definition: SignValueSelector.cxx:82
top::NFwdElectronTightSelector::applyParticleLevel
bool applyParticleLevel(const top::ParticleLevelEvent &event) const override
This does stuff based on the information in a particle level event.
Definition: NFwdElectronTightSelector.cxx:26
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::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