ATLAS Offline Software
TrackJetCleaningSelector.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 "TopEvent/EventTools.h"
7 #include "xAODJet/JetContainer.h"
9 
10 namespace top {
12  m_config(config) {
13  }
14 
16  // Selection is applied only if Variable-R track jets are used
17  if (m_config->sgKeyTrackJets() == "AntiKtVR30Rmax4Rmin02PV0TrackJets") {
18  static SG::AuxElement::Accessor<char> acc_passDRcut("passDRcut");
19  for (const xAOD::Jet* jet : event.m_trackJets) {
20  top::check(acc_passDRcut.isAvailable(
21  *jet), "passDRcut info not found in variable-R track jet. Needed for cleaning algorithm.");
22  if (!acc_passDRcut(*jet)) return false;
23  }
24  }
25  return true;
26  }
27 
28  std::string TrackJetCleaningSelector::name() const {
29  return "TRACKJETCLEAN";
30  }
31 }
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:66
top::TrackJetCleaningSelector::TrackJetCleaningSelector
TrackJetCleaningSelector(std::shared_ptr< top::TopConfig > config)
Definition: TrackJetCleaningSelector.cxx:11
top::TrackJetCleaningSelector::m_config
std::shared_ptr< top::TopConfig > m_config
Definition: TrackJetCleaningSelector.h:26
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
EventTools.h
A few functions for doing operations on particles / events. Currently holds code for dR,...
top::TrackJetCleaningSelector::name
std::string name() const override
A human readable name.
Definition: TrackJetCleaningSelector.cxx:28
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
TrackJetCleaningSelector.h
top::check
void check(bool thingToCheck, const std::string &usefulFailureMessage)
Print an error message and terminate if thingToCheck is false.
Definition: EventTools.cxx:15
TopConfig.h
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
JetContainer.h
SG::ConstAccessor< T, AuxAllocator_t< T > >::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
top::Event
Very simple class to hold event data after reading from a file.
Definition: Event.h:49
top::TrackJetCleaningSelector::apply
bool apply(const top::Event &event) const override
This does stuff based on the information in an event.
Definition: TrackJetCleaningSelector.cxx:15