ATLAS Offline Software
TauSmearingAlg.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 
9 //
10 // includes
11 //
12 
14 
15 //
16 // method implementations
17 //
18 
19 namespace CP
20 {
21 
23  initialize ()
24  {
25  ANA_CHECK (m_smearingTool.retrieve());
31  return StatusCode::SUCCESS;
32  }
33 
34 
35 
37  execute ()
38  {
39  for (const auto& sys : m_systematicsList.systematicsVector())
40  {
41  ANA_CHECK (m_smearingTool->applySystematicVariation (sys));
42  xAOD::TauJetContainer *taus = nullptr;
43  ANA_CHECK (m_tauHandle.getCopy (taus, sys));
44  for (xAOD::TauJet *tau : *taus)
45  {
46  if (m_preselection.getBool (*tau, sys))
47  {
48  ANA_CHECK_CORRECTION (m_outOfValidity, *tau, m_smearingTool->applyCorrection (*tau));
49  }
50  }
51  }
52  return StatusCode::SUCCESS;
53  }
54 }
CP::TauSmearingAlg::initialize
StatusCode initialize() override
Definition: TauSmearingAlg.cxx:23
CP::TauSmearingAlg::m_preselection
SysReadSelectionHandle m_preselection
the preselection we apply to our input
Definition: TauSmearingAlg.h:49
TauSmearingAlg.h
CP::SysListHandle::addSystematics
StatusCode addSystematics(const CP::SystematicSet &recommended, const CP::SystematicSet &affecting)
register a set of affecting variables for the current algorithm (usually obtained from an CP::ISystem...
Definition: SysListHandle.cxx:48
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
CP::SysListHandle::systematicsVector
const std::vector< CP::SystematicSet > & systematicsVector() const
the list of systematics to loop over
Definition: SysListHandle.cxx:96
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
CP::TauSmearingAlg::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition: TauSmearingAlg.h:40
CP::TauSmearingAlg::m_outOfValidity
OutOfValidityHelper m_outOfValidity
the helper for OutOfValidity results
Definition: TauSmearingAlg.h:54
CP::TauSmearingAlg::m_smearingTool
ToolHandle< TauAnalysisTools::ITauSmearingTool > m_smearingTool
the smearing tool
Definition: TauSmearingAlg.h:36
CP::TauSmearingAlg::m_tauHandle
SysCopyHandle< xAOD::TauJetContainer > m_tauHandle
the tau collection we run on
Definition: TauSmearingAlg.h:44
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
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
ANA_CHECK_CORRECTION
#define ANA_CHECK_CORRECTION(helper, object, expr)
a helper check macro to work with OutOfValidityHelper
Definition: OutOfValidityHelper.h:132
CP::TauSmearingAlg::execute
StatusCode execute() override
Definition: TauSmearingAlg.cxx:37
CP::OutOfValidityHelper::initialize
::StatusCode initialize()
standard initialize
Definition: OutOfValidityHelper.cxx:25
CP::SysReadSelectionHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle, const ISysHandleBase &objectHandle)
initialize the accessor
Definition: SysReadSelectionHandle.cxx:34
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30