ATLAS Offline Software
TopObjectSelection.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 // $Id: TopObjectSelection.h 810745 2017-09-29 14:03:01Z iconnell $
6 #ifndef ANALYSISTOP_TOPOBJECTSELECTONTOOLS_TOPOBJECTSELECTION_H
7 #define ANALYSISTOP_TOPOBJECTSELECTONTOOLS_TOPOBJECTSELECTION_H
8 
20 // system include(s):
21 #include <memory>
22 #include <vector>
23 
24 // Framework include(s):
25 #include "AsgTools/AsgTool.h"
26 #include "AsgTools/ToolHandle.h"
28 #include "AsgTools/AnaToolHandle.h"
30 
31 // Top include(s):
43 
44 // boosted-tagging includes
45 
46 // b-tagging
48 #include "TopEvent/Event.h"
49 
50 #include "xAODMuon/MuonContainer.h"
51 #include "xAODJet/JetContainer.h"
52 
53 // forward declare
54 namespace xAOD {
55  class SystematicEvent;
56 }
57 
58 namespace top {
59  class TopConfig;
60 
67  public:
77  explicit TopObjectSelection(const std::string& name);
78  virtual ~TopObjectSelection() {}
79 
80  // Delete Standard constructors
81  TopObjectSelection(const TopObjectSelection& rhs) = delete;
84 
86 
93  StatusCode execute(bool);
94 
105 
106 
117 
127  void muonSelection(MuonSelectionBase* ptr);
128 
139 
149  void tauSelection(TauSelectionBase* ptr);
150 
160  void jetSelection(JetSelectionBase* ptr);
161 
172 
173 
184 
195 
206 
217 
218 
228 
235  virtual void print(MsgStream& os) const;
236 
240  virtual void print() const;
241  private:
254 
256  virtual StatusCode applyOverlapRemoval(const bool isLoose, const std::string& sgKey);
257  virtual StatusCode applyOverlapRemoval(xAOD::SystematicEvent* currentSystematic);
258 
260  std::vector<unsigned int>& indices);
262  const xAOD::IParticleContainer* xaod_mu,
263  const xAOD::IParticleContainer* xaod_tjet,
264  std::vector<unsigned int>& goodElectrons,
265  std::vector<unsigned int>& goodMuons,
266  std::vector<unsigned int>& goodTrackJets);
267 
269  std::vector<unsigned int>& goodMuons);
270 
275  std::shared_ptr<top::TopConfig> m_config;
276 
278  std::unique_ptr<top::ElectronSelectionBase> m_electronSelection;
279 
281  std::unique_ptr<top::FwdElectronSelectionBase> m_fwdElectronSelection;
282 
284  std::unique_ptr<top::MuonSelectionBase> m_muonSelection;
285 
287  std::unique_ptr<top::SoftMuonSelectionBase> m_softmuonSelection;
288 
290  std::unique_ptr<top::TauSelectionBase> m_tauSelection;
291 
293  std::unique_ptr<top::JetSelectionBase> m_jetSelection;
294 
296  std::unique_ptr<top::PhotonSelectionBase> m_photonSelection;
297 
298 
300  std::unique_ptr<top::JetSelectionBase> m_largeJetSelection;
301 
303  std::unique_ptr<top::JetSelectionBase> m_trackJetSelection;
304 
306  std::unique_ptr<top::JetGhostTrackSelectionBase> m_jetGhostTrackSelection;
307 
309  std::unique_ptr<top::TrackSelectionBase> m_trackSelection;
310 
312  std::unique_ptr<top::OverlapRemovalBase> m_overlapRemovalToolPostSelection;
313 
314  //Electron In Jet Subtraction
315  std::unique_ptr<top::ElectronInJetSubtractionCollectionMaker> m_electronInJetSubtractor;
316 
317  // Pass selection strings
318  const std::string m_passPreORSelection;
319  const std::string m_passPreORSelectionLoose;
320  // the following two are used to give failing JVT and failing fJVT jets a lower priority in the OR
321  const std::string m_ORToolDecoration;
322  const std::string m_ORToolDecorationLoose;
323 
324  // Do we need to request loose lepton selection
326 
327  // do decorate the jets with the b-tagging flags
328  std::unordered_map<std::string, ToolHandle<IBTaggingSelectionTool> > m_btagSelTools;
329  std::unordered_map<std::string, ToolHandle<IBTaggingSelectionTool> > m_trkjet_btagSelTools;
330 
331  // Boolean to handle only running selection on nominal/systematics
333 
334  //helper OR tool for soft muons
336 
337  // Function to decorate event info
338  void decorateEventInfoPostOverlapRemoval(int, bool);
339  float calculateMinDRMuonJet(const xAOD::Muon& mu, const xAOD::JetContainer* xaod_jet, std::vector<unsigned int>& goodJets, bool useRapidity=false);
340  };
341 }
342 #endif
top::TopObjectSelection::applySelectionPreOverlapRemovalElectrons
void applySelectionPreOverlapRemovalElectrons()
For each systematic load each of the electrons and test if they pass the object selection.
Definition: TopObjectSelection.cxx:254
top::FwdElectronSelectionBase
Base class for implementing an electron selection.
Definition: FwdElectronSelectionBase.h:22
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
asg::AnaToolHandle< ORUtils::IOverlapRemovalTool >
top::TopObjectSelection::applySelectionPreOverlapRemovalTaus
void applySelectionPreOverlapRemovalTaus()
Definition: TopObjectSelection.cxx:358
top::TopObjectSelection::photonSelection
void photonSelection(PhotonSelectionBase *ptr)
Set the code used to select photons.
Definition: TopObjectSelection.cxx:140
top
TopConfig A simple configuration that is NOT a singleton.
Definition: AnalysisTrackingHelper.cxx:58
top::TopObjectSelection::initialize
StatusCode initialize()
Dummy implementation of the initialisation function.
Definition: TopObjectSelection.cxx:58
top::TopObjectSelection::m_photonSelection
std::unique_ptr< top::PhotonSelectionBase > m_photonSelection
Photon selection code - can load user defined classes.
Definition: TopObjectSelection.h:296
top::TopObjectSelection::jetGhostTrackSelection
void jetGhostTrackSelection(JetGhostTrackSelectionBase *ptr)
Set the code used to select tracks ghost associated to small-R jets.
Definition: TopObjectSelection.cxx:152
top::TopObjectSelection::m_jetSelection
std::unique_ptr< top::JetSelectionBase > m_jetSelection
Jet selection code - can load user defined classes.
Definition: TopObjectSelection.h:293
TauSelectionBase.h
top::OverlapRemovalBase
Definition: OverlapRemovalBase.h:15
Trk::indices
std::pair< long int, long int > indices
Definition: AlSymMatBase.h:24
top::TopObjectSelection::execute
StatusCode execute(bool)
Code that runs for every event (note that it runs the selection on all the systematic variations too)...
Definition: TopObjectSelection.cxx:165
top::TopObjectSelection::applySelectionPreOverlapRemovalJetGhostTracks
void applySelectionPreOverlapRemovalJetGhostTracks()
Definition: TopObjectSelection.cxx:582
top::TopObjectSelection::overlapRemovalPostSelection
void overlapRemovalPostSelection(OverlapRemovalBase *ptr)
Set the code used to perform the overlap removal.
Definition: TopObjectSelection.cxx:161
top::TopObjectSelection::electronSelection
void electronSelection(ElectronSelectionBase *ptr)
Set the code used to select electrons.
Definition: TopObjectSelection.cxx:116
top::TopObjectSelection::m_jetGhostTrackSelection
std::unique_ptr< top::JetGhostTrackSelectionBase > m_jetGhostTrackSelection
Ghost Track associated to small-R jets selection code - can load user defined classes
Definition: TopObjectSelection.h:306
ElectronInJetSubtractionCollectionMaker.h
top::TopObjectSelection::m_passPreORSelectionLoose
const std::string m_passPreORSelectionLoose
Definition: TopObjectSelection.h:319
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
top::TopObjectSelection::TopObjectSelection
TopObjectSelection(TopObjectSelection &&rhs)=delete
top::TopObjectSelection::m_ORToolDecoration
const std::string m_ORToolDecoration
Definition: TopObjectSelection.h:321
top::TopObjectSelection::m_trackSelection
std::unique_ptr< top::TrackSelectionBase > m_trackSelection
Track selection code - can load user defined classes
Definition: TopObjectSelection.h:309
ElectronSelectionBase.h
top::TopObjectSelection::m_passPreORSelection
const std::string m_passPreORSelection
Definition: TopObjectSelection.h:318
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
top::TopObjectSelection::m_ORToolDecorationLoose
const std::string m_ORToolDecorationLoose
Definition: TopObjectSelection.h:322
top::TopObjectSelection::tauSelection
void tauSelection(TauSelectionBase *ptr)
Set the code used to select taus.
Definition: TopObjectSelection.cxx:132
top::TopObjectSelection::trackJetOverlapRemoval
void trackJetOverlapRemoval(const xAOD::IParticleContainer *xaod_el, const xAOD::IParticleContainer *xaod_mu, const xAOD::IParticleContainer *xaod_tjet, std::vector< unsigned int > &goodElectrons, std::vector< unsigned int > &goodMuons, std::vector< unsigned int > &goodTrackJets)
Definition: TopObjectSelection.cxx:1073
top::TopObjectSelection::m_overlapRemovalTool_softMuons_Alljets
asg::AnaToolHandle< ORUtils::IOverlapRemovalTool > m_overlapRemovalTool_softMuons_Alljets
Definition: TopObjectSelection.h:335
JetSelectionBase.h
top::TopObjectSelection::m_executeNominal
bool m_executeNominal
Definition: TopObjectSelection.h:332
ToolHandleArray.h
top::TopObjectSelection::applySelectionPreOverlapRemovalFwdElectrons
void applySelectionPreOverlapRemovalFwdElectrons()
For each systematic load each of the fwd electrons and test if they pass the object selection.
Definition: TopObjectSelection.cxx:283
top::JetSelectionBase
Definition: JetSelectionBase.h:11
IBTaggingSelectionTool.h
top::TopObjectSelection::m_softmuonSelection
std::unique_ptr< top::SoftMuonSelectionBase > m_softmuonSelection
Soft Muon selection code - can load user defined classes.
Definition: TopObjectSelection.h:287
top::TopObjectSelection::m_overlapRemovalToolPostSelection
std::unique_ptr< top::OverlapRemovalBase > m_overlapRemovalToolPostSelection
Overlap removal that runs after all object selection.
Definition: TopObjectSelection.h:312
SoftMuonSelectionBase.h
top::TopObjectSelection::m_electronInJetSubtractor
std::unique_ptr< top::ElectronInJetSubtractionCollectionMaker > m_electronInJetSubtractor
Definition: TopObjectSelection.h:315
top::TopObjectSelection::jetSelection
void jetSelection(JetSelectionBase *ptr)
Set the code used to select jets.
Definition: TopObjectSelection.cxx:136
top::TopObjectSelection::applySelectionPreOverlapRemovalSoftMuons
void applySelectionPreOverlapRemovalSoftMuons()
Definition: TopObjectSelection.cxx:341
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
top::TopObjectSelection
Configure the object selection used in the analysis.
Definition: TopObjectSelection.h:66
top::TopObjectSelection::TopObjectSelection
TopObjectSelection(const std::string &name)
Setup the object selection at the start of the run.
Definition: TopObjectSelection.cxx:31
top::TopObjectSelection::m_fwdElectronSelection
std::unique_ptr< top::FwdElectronSelectionBase > m_fwdElectronSelection
Fwd Electron selection code - can load user defined classes.
Definition: TopObjectSelection.h:281
top::MuonSelectionBase
Definition: MuonSelectionBase.h:11
OverlapRemovalBase.h
top::TopObjectSelection::applyTightSelectionPostOverlapRemoval
void applyTightSelectionPostOverlapRemoval(const xAOD::IParticleContainer *xaod, std::vector< unsigned int > &indices)
Definition: TopObjectSelection.cxx:1049
top::TopObjectSelection::m_trackJetSelection
std::unique_ptr< top::JetSelectionBase > m_trackJetSelection
Track jet selection code - can load user defined classes.
Definition: TopObjectSelection.h:303
top::TopObjectSelection::applyOverlapRemoval
virtual StatusCode applyOverlapRemoval()
Definition: TopObjectSelection.cxx:685
top::SoftMuonSelectionBase
Definition: SoftMuonSelectionBase.h:11
top::TopObjectSelection::~TopObjectSelection
virtual ~TopObjectSelection()
Definition: TopObjectSelection.h:78
top::PhotonSelectionBase
Base class for implementing an Photon selection.
Definition: PhotonSelectionBase.h:20
TrackSelectionBase.h
top::TopObjectSelection::applySelectionPreOverlapRemovalTracks
void applySelectionPreOverlapRemovalTracks()
Definition: TopObjectSelection.cxx:648
Event.h
JetGhostTrackSelectionBase.h
top::TopObjectSelection::m_electronSelection
std::unique_ptr< top::ElectronSelectionBase > m_electronSelection
Electron selection code - can load user defined classes.
Definition: TopObjectSelection.h:278
top::TopObjectSelection::trackSelection
void trackSelection(TrackSelectionBase *ptr)
Set the code used to select tracks.
Definition: TopObjectSelection.cxx:156
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
top::TopObjectSelection::print
virtual void print() const
or prehaps you'd like the AsgTool print function
Definition: TopObjectSelection.cxx:1158
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
PhotonSelectionBase.h
top::TopObjectSelection::applySelectionPreOverlapRemoval
void applySelectionPreOverlapRemoval()
Definition: TopObjectSelection.cxx:174
AnaToolHandle.h
top::JetGhostTrackSelectionBase
Definition: JetGhostTrackSelectionBase.h:11
top::TopObjectSelection::calculateMinDRMuonJet
float calculateMinDRMuonJet(const xAOD::Muon &mu, const xAOD::JetContainer *xaod_jet, std::vector< unsigned int > &goodJets, bool useRapidity=false)
Definition: TopObjectSelection.cxx:1120
top::TopObjectSelection::overlapRemovalPostSelectionTrackJets
void overlapRemovalPostSelectionTrackJets(OverlapRemovalBase *ptr)
top::TopObjectSelection::applySelectionPreOverlapRemovalJets
void applySelectionPreOverlapRemovalJets()
Definition: TopObjectSelection.cxx:379
IOverlapRemovalTool.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
top::TopObjectSelection::trackJetSelection
void trackJetSelection(JetSelectionBase *ptr)
Set the code used to select track jets.
Definition: TopObjectSelection.cxx:148
top::TopObjectSelection::m_doLooseCuts
bool m_doLooseCuts
Definition: TopObjectSelection.h:325
top::TopObjectSelection::m_trkjet_btagSelTools
std::unordered_map< std::string, ToolHandle< IBTaggingSelectionTool > > m_trkjet_btagSelTools
Definition: TopObjectSelection.h:329
top::TrackSelectionBase
Definition: TrackSelectionBase.h:11
top::TopObjectSelection::m_tauSelection
std::unique_ptr< top::TauSelectionBase > m_tauSelection
Tau selection code - can load user defined classes.
Definition: TopObjectSelection.h:290
top::TopObjectSelection::decorateSoftMuonsPostOverlapRemoval
void decorateSoftMuonsPostOverlapRemoval(const xAOD::MuonContainer *xaod_softmu, std::vector< unsigned int > &goodMuons)
Definition: TopObjectSelection.cxx:1038
MuonSelectionBase.h
MuonContainer.h
top::TopObjectSelection::softmuonSelection
void softmuonSelection(SoftMuonSelectionBase *ptr)
Set the code used to select soft muons.
Definition: TopObjectSelection.cxx:128
xAOD::SystematicEvent
SystematicEvent A simple xAOD class which we can persist into a mini-xAOD The xAOD EDM is way too com...
Definition: SystematicEvent.h:27
JetContainer.h
top::TopObjectSelection::decorateEventInfoPostOverlapRemoval
void decorateEventInfoPostOverlapRemoval(int, bool)
Definition: TopObjectSelection.cxx:1138
top::TopObjectSelection::m_btagSelTools
std::unordered_map< std::string, ToolHandle< IBTaggingSelectionTool > > m_btagSelTools
Definition: TopObjectSelection.h:328
top::TopObjectSelection::applySelectionPreOverlapRemovalPhotons
void applySelectionPreOverlapRemovalPhotons()
Definition: TopObjectSelection.cxx:226
top::TopObjectSelection::m_muonSelection
std::unique_ptr< top::MuonSelectionBase > m_muonSelection
Muon selection code - can load user defined classes.
Definition: TopObjectSelection.h:284
top::TopObjectSelection::m_config
std::shared_ptr< top::TopConfig > m_config
Pointer to the configuration object so we can check which objects were requested in the config file.
Definition: TopObjectSelection.h:275
ToolHandle.h
top::TopObjectSelection::applySelectionPreOverlapRemovalLargeRJets
void applySelectionPreOverlapRemovalLargeRJets()
Definition: TopObjectSelection.cxx:505
top::ElectronSelectionBase
Base class for implementing an electron selection.
Definition: ElectronSelectionBase.h:22
top::TopObjectSelection::m_largeJetSelection
std::unique_ptr< top::JetSelectionBase > m_largeJetSelection
Large-R jet selection code - can load user defined classes.
Definition: TopObjectSelection.h:300
AsgTool.h
top::TopObjectSelection::applySelectionPreOverlapRemovalMuons
void applySelectionPreOverlapRemovalMuons()
Definition: TopObjectSelection.cxx:320
top::TopObjectSelection::fwdElectronSelection
void fwdElectronSelection(FwdElectronSelectionBase *ptr)
Set the code used to select forward electrons.
Definition: TopObjectSelection.cxx:120
top::TopObjectSelection::TopObjectSelection
TopObjectSelection(const TopObjectSelection &rhs)=delete
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
top::TopObjectSelection::operator=
TopObjectSelection & operator=(const TopObjectSelection &rhs)=delete
top::TopObjectSelection::applySelectionPreOverlapRemovalTrackJets
void applySelectionPreOverlapRemovalTrackJets()
Definition: TopObjectSelection.cxx:528
top::TopObjectSelection::muonSelection
void muonSelection(MuonSelectionBase *ptr)
Set the code used to select muons.
Definition: TopObjectSelection.cxx:124
top::TauSelectionBase
Definition: TauSelectionBase.h:11
FwdElectronSelectionBase.h
top::TopObjectSelection::largeJetSelection
void largeJetSelection(JetSelectionBase *ptr)
Set the code used to select large jets.
Definition: TopObjectSelection.cxx:144