ATLAS Offline Software
Algorithms/MuonAnalysisAlgorithms/Root/MuonSelectionAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 //
8 // includes
9 //
10 
13 
14 //
15 // method implementations
16 //
17 
18 namespace CP
19 {
20 
22  initialize ()
23  {
24  ANA_CHECK (m_selectionTool.retrieve());
25 
31 
32  auto *selectionTool = dynamic_cast<IAsgSelectionTool *>(&*m_selectionTool);
33  asg::AcceptData blankAccept {&selectionTool->getAcceptInfo()};
34  m_setOnFail = selectionFromAccept(blankAccept);
35 
36  if (!m_nameSvc.empty())
37  {
38  ANA_CHECK (m_nameSvc.retrieve());
40  m_selectionTool->getAcceptInfo()));
41  }
42 
43  return StatusCode::SUCCESS;
44  }
45 
46 
47 
49  execute ()
50  {
51  for (const auto& sys : m_systematicsList.systematicsVector())
52  {
53  const xAOD::MuonContainer *muons = nullptr;
55  for (const xAOD::Muon *muon : *muons)
56  {
58  {
61 
63  {
65  }
66  } else {
68 
70  {
72  }
73  }
74  }
75  }
76  return StatusCode::SUCCESS;
77  }
78 }
MuonSelectionAlg.h
CP::MuonSelectionAlgV2::initialize
StatusCode initialize() override
Definition: Algorithms/MuonAnalysisAlgorithms/Root/MuonSelectionAlg.cxx:22
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
CP::SysWriteSelectionHandle::setBits
void setBits(const SG::AuxElement &element, SelectionType selection, const CP::SystematicSet &sys) const
set the selection decoration
CP::selectionFromAccept
SelectionType selectionFromAccept(const asg::AcceptData &accept)
the selection decoration made from the given AcceptData object
Definition: SelectionHelpers.cxx:32
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
CP::SysReadHandle::retrieve
::StatusCode retrieve(const T *&object, const CP::SystematicSet &sys) const
retrieve the object for the given name
CP::SysListHandle::systematicsVector
const std::vector< CP::SystematicSet > & systematicsVector() const
the list of systematics to loop over
Definition: SysListHandle.cxx:96
IAsgSelectionTool
Definition: IAsgSelectionTool.h:28
IAsgSelectionTool.h
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
CP::SysWriteSelectionHandle::setBool
void setBool(const SG::AuxElement &element, bool selection, const CP::SystematicSet &sys) const
set the selection decoration
CP::SysWriteSelectionHandle::getLabel
std::string getLabel() const
get the name/label of the decoration
Definition: SysWriteSelectionHandle.cxx:76
CP::SysReadHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle)
initialize this handle
CP::SysListHandle::initialize
::StatusCode initialize()
intialize this property
Definition: SysListHandle.cxx:69
CP::SysReadSelectionHandle::getBool
bool getBool(const SG::AuxElement &element, const CP::SystematicSet &sys) const
get the selection as a bool
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CP::MuonSelectionAlgV2::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition: Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonSelectionAlg.h:39
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
CP::MuonSelectionAlgV2::execute
StatusCode execute() override
Definition: Algorithms/MuonAnalysisAlgorithms/Root/MuonSelectionAlg.cxx:49
CP::MuonSelectionAlgV2::m_muonsHandle
SysReadHandle< xAOD::MuonContainer > m_muonsHandle
the particle continer we run on
Definition: Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonSelectionAlg.h:48
CP::MuonSelectionAlgV2::m_nameSvc
ServiceHandle< ISelectionNameSvc > m_nameSvc
the ISelectionNameSvc
Definition: Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonSelectionAlg.h:63
CP::MuonSelectionAlgV2::m_selectionTool
ToolHandle< IMuonSelectionTool > m_selectionTool
the selection tool
Definition: Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonSelectionAlg.h:35
CP::SysReadSelectionHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle, const ISysHandleBase &objectHandle)
initialize the accessor
Definition: SysReadSelectionHandle.cxx:34
CP::SysReadHandle::getNamePattern
virtual std::string getNamePattern() const override
get the name pattern before substitution
CP::MuonSelectionAlgV2::m_selectionHandle
SysWriteSelectionHandle m_selectionHandle
the decoration for the quality selection
Definition: Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonSelectionAlg.h:53
asg::AcceptData
Definition: AcceptData.h:30
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
CP::MuonSelectionAlgV2::m_setOnFail
SelectionType m_setOnFail
the bits to set for an object failing the preselection
Definition: Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonSelectionAlg.h:67
CP::SysWriteSelectionHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle, const ISysHandleBase &objectHandle)
initialize the accessor
Definition: SysWriteSelectionHandle.cxx:34
CP::MuonSelectionAlgV2::m_badMuonVetoHandle
SysWriteSelectionHandle m_badMuonVetoHandle
the decoration for the bad muon veto
Definition: Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonSelectionAlg.h:58
CP::MuonSelectionAlgV2::m_preselection
SysReadSelectionHandle m_preselection
the preselection we apply to our input
Definition: Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonSelectionAlg.h:43