ATLAS Offline Software
SSLeptonSelector.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3  */
4 
6 #include "TopEvent/EventTools.h"
7 
8 // Note: initial version committed on Dec/18/2014
9 // Can't yet fully reproduce the selection used by Run 1 Top/Exotics SS+bjets analysis
10 // One thing needed to reproduce that is loose leptons
11 // Need to support selection of leptons with different quality/isolation at once
12 // Need to support applying SF to leptons with different quality/isolation at once
13 
14 namespace top {
16  unsigned int negative_counter = 0;
17  unsigned int positive_counter = 0;
18 
19  for (const auto* const elPtr : event.m_electrons)
20  if (elPtr->charge() > 0) ++positive_counter;
21  else ++negative_counter;
22 
23  for (const auto* const muPtr : event.m_muons)
24  if (muPtr->charge() > 0) ++positive_counter;
25  else ++negative_counter;
26 
27  return positive_counter > 1 || negative_counter > 1;
28  }
29 
31  // If any of the required collections is a nullptr (i.e. has not been
32  // loaded) return false.
33  if (not event.m_electrons
34  or not event.m_muons) {
35  return false;
36  }
37 
38  unsigned int negative_counter = 0;
39  unsigned int positive_counter = 0;
40 
41  for (const auto elPtr : *event.m_electrons)
42  if (elPtr->charge() > 0) ++positive_counter;
43  else ++negative_counter;
44 
45  for (const auto muPtr : *event.m_muons)
46  if (muPtr->charge() > 0) ++positive_counter;
47  else ++negative_counter;
48 
49  return positive_counter > 1 || negative_counter > 1;
50  }
51 
52  std::string SSLeptonSelector::name() const {
53  return "SS";
54  }
55 }
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
top::SSLeptonSelector::name
std::string name() const override
A human readable name.
Definition: SSLeptonSelector.cxx:52
EventTools.h
A few functions for doing operations on particles / events. Currently holds code for dR,...
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
top::ParticleLevelEvent
Definition: ParticleLevelEvent.h:24
top::SSLeptonSelector::apply
bool apply(const top::Event &event) const override
This does stuff based on the information in an event.
Definition: SSLeptonSelector.cxx:15
top::SSLeptonSelector::applyParticleLevel
bool applyParticleLevel(const top::ParticleLevelEvent &event) const override
This does stuff based on the information in a particle level event.
Definition: SSLeptonSelector.cxx:30
SSLeptonSelector.h
top::Event
Very simple class to hold event data after reading from a file.
Definition: Event.h:49