ATLAS Offline Software
PhysicsAnalysis
TopPhys
xAOD
TopEventSelectionTools
Root
NPhotonSelector.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TopEventSelectionTools/NPhotonSelector.h
"
6
7
#include <algorithm>
8
9
namespace
top
{
10
NPhotonSelector::NPhotonSelector
(
const
std::string&
params
) :
11
SignValueSelector
(
"PH_N"
,
params
, true) {
12
checkMultiplicityIsInteger
();
13
}
14
15
bool
NPhotonSelector::apply
(
const
top::Event
&
event
)
const
{
16
auto
func = [&](
const
xAOD::Photon
* phPtr) {
17
return
phPtr->pt() >
value
();
18
};
19
auto
count
= std::count_if(
event
.m_photons.begin(),
event
.m_photons.end(), func);
20
21
return
checkInt
(
count
,
multiplicity
());
22
}
23
24
bool
NPhotonSelector::applyParticleLevel
(
const
top::ParticleLevelEvent
&
event
)
const
{
25
auto
func = [&](
const
xAOD::TruthParticle
* truPhPtr) {
26
return
truPhPtr->pt() >
value
();
27
};
28
auto
count
= std::count_if(
event
.m_photons->begin(),
event
.m_photons->end(), func);
29
30
return
checkInt
(
count
,
multiplicity
());
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
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
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition:
TruthParticle_v1.h:41
top::NPhotonSelector::apply
bool apply(const top::Event &event) const override
This does stuff based on the information in an event.
Definition:
NPhotonSelector.cxx:15
top::ParticleLevelEvent
Definition:
ParticleLevelEvent.h:24
top::SignValueSelector::checkMultiplicityIsInteger
void checkMultiplicityIsInteger()
Integers are annoying in C++.
Definition:
SignValueSelector.cxx:82
top::NPhotonSelector::NPhotonSelector
NPhotonSelector(const std::string ¶ms)
Definition:
NPhotonSelector.cxx:10
top::SignValueSelector::value
double value() const
Get the cut value assigned in the constructor.
Definition:
SignValueSelector.cxx:94
top::NPhotonSelector::applyParticleLevel
bool applyParticleLevel(const top::ParticleLevelEvent &event) const override
This does stuff based on the information in a particle level event.
Definition:
NPhotonSelector.cxx:24
xAOD::Photon_v1
Definition:
Photon_v1.h:37
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
NPhotonSelector.h
Generated on Fri Jul 5 2024 21:23:45 for ATLAS Offline Software by
1.8.18