Commit fb7cd197 authored by Johannes Elmsheuser's avatar Johannes Elmsheuser
Browse files

Merge branch 'sys_selection_handle' into 'master'

first version of a SysReadSelectionHandle

See merge request atlas/athena!53339
parents cdf02da4 813a8df8
......@@ -10,7 +10,7 @@
#include <AnaAlgorithm/AnaAlgorithm.h>
#include <SelectionHelpers/ISelectionAccessor.h>
#include <SelectionHelpers/SelectionReadHandle.h>
#include <SelectionHelpers/SysReadSelectionHandle.h>
#include <SystematicsHandles/SysReadHandle.h>
#include <SystematicsHandles/SysReadDecorHandle.h>
#include <SystematicsHandles/SysWriteDecorHandle.h>
......@@ -53,7 +53,7 @@ namespace CP
/// \brief the preselection we apply to our input
private:
SelectionReadHandle m_preselection {
SysReadSelectionHandle m_preselection {
this, "preselection", "", "the preselection to apply"};
/// \brief the decoration for reading systematically aware preselection
......
......@@ -12,7 +12,7 @@
#include <AnaAlgorithm/AnaAlgorithm.h>
#include <PATCore/IAsgSelectionTool.h>
#include <SelectionHelpers/ISelectionAccessor.h>
#include <SelectionHelpers/SelectionReadHandle.h>
#include <SelectionHelpers/SysReadSelectionHandle.h>
#include <SystematicsHandles/SysListHandle.h>
#include <SystematicsHandles/SysReadHandle.h>
#include <xAODBase/IParticleContainer.h>
......@@ -75,7 +75,7 @@ namespace CP
/// \brief the preselection we apply to our input
private:
SelectionReadHandle m_preselection {
SysReadSelectionHandle m_preselection {
this, "preselection", "", "the preselection to apply"};
/// \brief the accessor for \ref m_selectionDecoration
......
......@@ -12,7 +12,7 @@
#include <AnaAlgorithm/AnaAlgorithm.h>
#include <PATCore/IAsgSelectionTool.h>
#include <SelectionHelpers/ISelectionAccessor.h>
#include <SelectionHelpers/SelectionReadHandle.h>
#include <SelectionHelpers/SysReadSelectionHandle.h>
#include <SystematicsHandles/SysCopyHandle.h>
#include <SystematicsHandles/SysListHandle.h>
......@@ -78,7 +78,7 @@ namespace CP
/// \brief the preselection we apply to our input
private:
SelectionReadHandle m_preselection {
SysReadSelectionHandle m_preselection {
this, "preselection", "", "the preselection to apply"};
/// \brief the decoration for the asg selection
......
......@@ -8,7 +8,7 @@
#define ASG_ANALYSIS_ALGORITHMS__EVENT_SELECTION_BY_OBJECT_FLAG_ALG_H
#include <AnaAlgorithm/AnaAlgorithm.h>
#include <SelectionHelpers/SelectionReadHandle.h>
#include <SelectionHelpers/SysReadSelectionHandle.h>
#include <SystematicsHandles/SysCopyHandle.h>
#include <SystematicsHandles/SysFilterReporterParams.h>
#include <SystematicsHandles/SysListHandle.h>
......@@ -48,11 +48,11 @@ class EventSelectionByObjectFlagAlg final : public EL::AnaAlgorithm {
/// \brief the preselection we apply to our input
private:
SelectionReadHandle m_preselection{this, "preselection", "", "the preselection to apply"};
SysReadSelectionHandle m_preselection{this, "preselection", "", "the preselection to apply"};
/// \brief the preselection we apply to our input
private:
SelectionReadHandle m_veto{this, "veto", "", "selection upon which events are vetoed"};
SysReadSelectionHandle m_veto{this, "veto", "", "selection upon which events are vetoed"};
};
} // namespace CP
......
......@@ -9,7 +9,7 @@
#define ASG_ANALYSIS_ALGORITHMS__KINEMATIC_HIST_ALG_H
#include <AnaAlgorithm/AnaAlgorithm.h>
#include <SelectionHelpers/SelectionReadHandle.h>
#include <SelectionHelpers/SysReadSelectionHandle.h>
#include <SystematicsHandles/SysReadHandle.h>
#include <SystematicsHandles/SysListHandle.h>
#include <xAODBase/IParticleContainer.h>
......@@ -48,7 +48,7 @@ namespace CP
/// \brief the preselection we apply to our input
private:
SelectionReadHandle m_preselection {
SysReadSelectionHandle m_preselection {
this, "preselection", "", "the preselection to apply"};
/// \brief the pattern for histogram names
......
......@@ -10,7 +10,7 @@
#include <AnaAlgorithm/AnaAlgorithm.h>
#include <SelectionHelpers/ISelectionAccessor.h>
#include <SelectionHelpers/SelectionReadHandle.h>
#include <SelectionHelpers/SysReadSelectionHandle.h>
#include <SystematicsHandles/SysReadHandle.h>
#include <SystematicsHandles/SysListHandle.h>
#include <xAODBase/IParticleContainer.h>
......@@ -49,7 +49,7 @@ namespace CP
/// \brief the preselection we apply to our input
private:
SelectionReadHandle m_preselection {
SysReadSelectionHandle m_preselection {
this, "preselection", "", "the preselection to apply"};
/// \brief the pattern for histogram names
......
......@@ -36,11 +36,11 @@ namespace CP
ANA_CHECK (m_eventInfoHandle.initialize (m_systematicsList));
ANA_CHECK (m_particleHandle.initialize (m_systematicsList));
ANA_CHECK (m_preselection.initialize (m_systematicsList, m_particleHandle, SG::AllowEmpty));
ANA_CHECK (m_inputSelectionDecoration.initialize (m_systematicsList, m_particleHandle, SG::AllowEmpty));
ANA_CHECK (m_scaleFactorInputDecoration.initialize (m_systematicsList, m_particleHandle));
ANA_CHECK (m_scaleFactorOutputDecoration.initialize (m_systematicsList, m_eventInfoHandle));
ANA_CHECK (m_systematicsList.initialize());
ANA_CHECK (m_preselection.initialize());
return StatusCode::SUCCESS;
}
......@@ -61,7 +61,7 @@ namespace CP
float scaleFactor = 1;
for (const xAOD::IParticle *particle : *particles)
{
if (m_preselection.getBool (*particle))
if (m_preselection.getBool (*particle, sys))
{
if (m_inputSelectionDecoration && m_inputSelectionDecoration.get (*particle, sys) == 0)
continue;
......
......@@ -74,8 +74,8 @@ namespace CP
m_accept.addCut ("numSCTHits", "Minimum and/or maxiumum SCT hits");
ANA_CHECK (m_particlesHandle.initialize (m_systematicsList));
ANA_CHECK (m_preselection.initialize (m_systematicsList, m_particlesHandle, SG::AllowEmpty));
ANA_CHECK (m_systematicsList.initialize());
ANA_CHECK (m_preselection.initialize());
return StatusCode::SUCCESS;
}
......@@ -122,7 +122,7 @@ namespace CP
{
asg::AcceptData acceptData (&m_accept);
if (m_preselection.getBool (*particle))
if (m_preselection.getBool (*particle, sys))
{
std::size_t cutIndex {0};
......
......@@ -48,8 +48,8 @@ namespace CP
ANA_CHECK (m_systematicsList.addSystematics (*m_systematicsTool));
ANA_CHECK (m_particlesHandle.initialize (m_systematicsList));
ANA_CHECK (m_preselection.initialize (m_systematicsList, m_particlesHandle, SG::AllowEmpty));
ANA_CHECK (m_systematicsList.initialize());
ANA_CHECK (m_preselection.initialize());
asg::AcceptData blankAccept (&m_selectionTool->getAcceptInfo());
// Just in case this isn't initially set up as a failure clear it this one
......@@ -74,7 +74,7 @@ namespace CP
ANA_CHECK (m_particlesHandle.getCopy (particles, sys));
for (xAOD::IParticle *particle : *particles)
{
if (m_preselection.getBool (*particle))
if (m_preselection.getBool (*particle, sys))
{
m_selectionAccessor->setBits
(*particle, selectionFromAccept (m_selectionTool->accept (particle)));
......
......@@ -25,9 +25,9 @@ EventSelectionByObjectFlagAlg ::EventSelectionByObjectFlagAlg(
StatusCode EventSelectionByObjectFlagAlg ::initialize() {
ANA_CHECK(m_particleHandle.initialize (m_systematicsList));
ANA_CHECK(m_preselection.initialize (m_systematicsList, m_particleHandle, SG::AllowEmpty));
ANA_CHECK(m_veto.initialize (m_systematicsList, m_particleHandle));
ANA_CHECK(m_systematicsList.initialize());
ANA_CHECK(m_preselection.initialize());
ANA_CHECK(m_veto.initialize());
ANA_CHECK(m_filterParams.initialize());
return StatusCode::SUCCESS;
......@@ -48,8 +48,8 @@ StatusCode EventSelectionByObjectFlagAlg ::execute() {
// reject events with any particle passing the input selection
for (const xAOD::IParticle *particle : *particles) {
if (m_preselection.getBool(*particle)) {
if (m_veto.getBool(*particle)) {
if (m_preselection.getBool(*particle, sys)) {
if (m_veto.getBool (*particle, sys)) {
ATH_MSG_VERBOSE("Event failed.");
filter.setPassed (false);
break;
......
......@@ -34,8 +34,8 @@ namespace CP
initialize ()
{
ANA_CHECK (m_inputHandle.initialize (m_systematicsList));
ANA_CHECK (m_preselection.initialize (m_systematicsList, m_inputHandle, SG::AllowEmpty));
ANA_CHECK (m_systematicsList.initialize());
ANA_CHECK (m_preselection.initialize());
return StatusCode::SUCCESS;
}
......@@ -69,7 +69,7 @@ namespace CP
for (std::size_t iter = 0; iter != input->size(); ++ iter)
{
const xAOD::IParticle *particle = (*input)[iter];
if (m_preselection.getBool (*particle))
if (m_preselection.getBool (*particle, sys))
{
while (histIter->second.perObject.size() <= count)
{
......
......@@ -37,8 +37,8 @@ namespace CP
initialize ()
{
ANA_CHECK (m_inputHandle.initialize (m_systematicsList));
ANA_CHECK (m_preselection.initialize (m_systematicsList, m_inputHandle, SG::AllowEmpty));
ANA_CHECK (m_systematicsList.initialize());
ANA_CHECK (m_preselection.initialize());
if (m_selectionNCuts.size() != m_selection.size())
{
......@@ -105,7 +105,7 @@ namespace CP
for (const xAOD::IParticle *particle : *input)
{
if (m_preselection.getBool (*particle))
if (m_preselection.getBool (*particle, sys))
{
bool keep = true;
unsigned cutIndex = 1;
......
......@@ -12,7 +12,7 @@
#include <AnaAlgorithm/AnaAlgorithm.h>
#include <EgammaAnalysisInterfaces/IEgammaCalibrationAndSmearingTool.h>
#include <EgammaAnalysisAlgorithms/CopyHelpers.h>
#include <SelectionHelpers/SelectionReadHandle.h>
#include <SelectionHelpers/SysReadSelectionHandle.h>
#include <SelectionHelpers/OutOfValidityHelper.h>
#include <SystematicsHandles/SysCopyHandle.h>
#include <SystematicsHandles/SysListHandle.h>
......@@ -53,7 +53,7 @@ namespace CP
/// \brief the preselection we apply to our input
private:
SelectionReadHandle m_preselection {
SysReadSelectionHandle m_preselection {
this, "preselection", "", "the preselection to apply"};
/// \brief the helper for OutOfValidity results
......
......@@ -13,7 +13,7 @@
#include <EgammaAnalysisAlgorithms/CopyHelpers.h>
#include <IsolationCorrections/IIsolationCorrectionTool.h>
#include <SelectionHelpers/OutOfValidityHelper.h>
#include <SelectionHelpers/SelectionReadHandle.h>
#include <SelectionHelpers/SysReadSelectionHandle.h>
#include <SystematicsHandles/SysCopyHandle.h>
#include <SystematicsHandles/SysListHandle.h>
......@@ -53,7 +53,7 @@ namespace CP
/// \brief the preselection we apply to our input
private:
SelectionReadHandle m_preselection {
SysReadSelectionHandle m_preselection {
this, "preselection", "", "the preselection to apply"};
/// \brief the helper for OutOfValidity results
......
......@@ -14,7 +14,7 @@
#include <EgammaAnalysisAlgorithms/CopyHelpers.h>
#include <SelectionHelpers/ISelectionAccessor.h>
#include <SelectionHelpers/OutOfValidityHelper.h>
#include <SelectionHelpers/SelectionReadHandle.h>
#include <SelectionHelpers/SysReadSelectionHandle.h>
#include <SystematicsHandles/SysListHandle.h>
#include <SystematicsHandles/SysReadHandle.h>
......@@ -48,7 +48,7 @@ namespace CP
/// \brief the preselection we apply to our input
private:
SelectionReadHandle m_preselection {
SysReadSelectionHandle m_preselection {
this, "preselection", "", "the preselection to apply"};
/// \brief the particle continer we run on
......
......@@ -12,7 +12,7 @@
#include <AnaAlgorithm/AnaAlgorithm.h>
#include <EgammaAnalysisInterfaces/IAsgElectronEfficiencyCorrectionTool.h>
#include <SelectionHelpers/OutOfValidityHelper.h>
#include <SelectionHelpers/SelectionReadHandle.h>
#include <SelectionHelpers/SysReadSelectionHandle.h>
#include <SystematicsHandles/SysReadHandle.h>
#include <SystematicsHandles/SysWriteDecorHandle.h>
#include <SystematicsHandles/SysListHandle.h>
......@@ -53,7 +53,7 @@ namespace CP
/// \brief the preselection we apply to our input
private:
SelectionReadHandle m_preselection {
SysReadSelectionHandle m_preselection {
this, "preselection", "", "the preselection to apply"};
/// \brief the helper for OutOfValidity results
......
......@@ -12,7 +12,7 @@
#include <AnaAlgorithm/AnaAlgorithm.h>
#include <EgammaAnalysisInterfaces/IAsgPhotonEfficiencyCorrectionTool.h>
#include <SelectionHelpers/OutOfValidityHelper.h>
#include <SelectionHelpers/SelectionReadHandle.h>
#include <SelectionHelpers/SysReadSelectionHandle.h>
#include <SystematicsHandles/SysListHandle.h>
#include <SystematicsHandles/SysReadHandle.h>
#include <SystematicsHandles/SysWriteDecorHandle.h>
......@@ -52,7 +52,7 @@ namespace CP
/// \brief the preselection we apply to our input
private:
SelectionReadHandle m_preselection {
SysReadSelectionHandle m_preselection {
this, "preselection", "", "the preselection to apply"};
/// \brief the helper for OutOfValidity results
......
......@@ -13,7 +13,7 @@
#include <EgammaAnalysisInterfaces/IElectronPhotonShowerShapeFudgeTool.h>
#include <EgammaAnalysisAlgorithms/CopyHelpers.h>
#include <SelectionHelpers/OutOfValidityHelper.h>
#include <SelectionHelpers/SelectionReadHandle.h>
#include <SelectionHelpers/SysReadSelectionHandle.h>
#include <SystematicsHandles/SysCopyHandle.h>
#include <SystematicsHandles/SysListHandle.h>
#include <xAODEgamma/PhotonContainer.h>
......@@ -54,7 +54,7 @@ namespace CP
/// \brief the preselection we apply to our input
private:
SelectionReadHandle m_preselection {
SysReadSelectionHandle m_preselection {
this, "preselection", "", "the preselection to apply"};
/// \brief the helper for OutOfValidity results
......
......@@ -34,9 +34,9 @@ namespace CP
{
ANA_CHECK (m_calibrationAndSmearingTool.retrieve());
ANA_CHECK (m_egammaHandle.initialize (m_systematicsList));
ANA_CHECK (m_preselection.initialize (m_systematicsList, m_egammaHandle, SG::AllowEmpty));
ANA_CHECK (m_systematicsList.addSystematics (*m_calibrationAndSmearingTool));
ANA_CHECK (m_systematicsList.initialize());
ANA_CHECK (m_preselection.initialize());
ANA_CHECK (m_outOfValidity.initialize());
return StatusCode::SUCCESS;
}
......@@ -53,7 +53,7 @@ namespace CP
ANA_CHECK (m_egammaHandle.getCopy (egammas, sys));
for (xAOD::Egamma *egamma : *egammas)
{
if (m_preselection.getBool (*egamma))
if (m_preselection.getBool (*egamma, sys))
{
ANA_CHECK_CORRECTION (m_outOfValidity, *egamma, m_calibrationAndSmearingTool->applyCorrection (*egamma));
}
......
......@@ -34,9 +34,9 @@ namespace CP
{
ANA_CHECK (m_isolationCorrectionTool.retrieve());
ANA_CHECK (m_egammaHandle.initialize (m_systematicsList));
ANA_CHECK (m_preselection.initialize (m_systematicsList, m_egammaHandle, SG::AllowEmpty));
ANA_CHECK (m_systematicsList.addSystematics (*m_isolationCorrectionTool));
ANA_CHECK (m_systematicsList.initialize());
ANA_CHECK (m_preselection.initialize());
ANA_CHECK (m_outOfValidity.initialize());
return StatusCode::SUCCESS;
}
......@@ -53,7 +53,7 @@ namespace CP
ANA_CHECK (m_egammaHandle.getCopy (egammas, sys));
for (xAOD::Egamma *egamma : *egammas)
{
if (m_preselection.getBool (*egamma))
if (m_preselection.getBool (*egamma, sys))
{
ANA_CHECK_CORRECTION (m_outOfValidity, *egamma, m_isolationCorrectionTool->applyCorrection (*egamma));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment