Skip to content
Snippets Groups Projects
Commit 4398fed3 authored by Baptiste Ravina's avatar Baptiste Ravina Committed by Frank Winklmeier
Browse files

CPAlgorithms: additional variables for photons

CPAlgorithms: additional variables for photons
parent 806a50f8
No related branches found
No related tags found
28 merge requests!78241Draft: FPGATrackSim: GenScan code refactor,!78236Draft: Switching Streams https://its.cern.ch/jira/browse/ATR-27417,!78056AFP monitoring: new synchronization and cleaning,!78041AFP monitoring: new synchronization and cleaning,!77990Updating TRT chip masks for L1TRT trigger simulation - ATR-28372,!77733Draft: add new HLT NN JVT, augmented with additional tracking information,!77731Draft: Updates to ZDC reconstruction,!77728Draft: updates to ZDC reconstruction,!77522Draft: sTGC Pad Trigger Emulator,!76725ZdcNtuple: Fix cppcheck warning.,!76611L1CaloFEXByteStream: Fix out-of-bounds array accesses.,!76475Punchthrough AF3 implementation in FastG4,!76474Punchthrough AF3 implementation in FastG4,!75729New implementation of ZDC nonlinear FADC correction.,!75703Draft: Update to HI han config for HLT jets,!75184Draft: Update file heavyions_run.config,!74430Draft: Fixing upper bound for Delayed Jet Triggers,!73963Changing the path of the histograms to "Expert" area,!73875updating ID ART reference plots,!73874AtlasCLHEP_RandomGenerators: Fix cppcheck warnings.,!73449Add muon detectors to DarkJetPEBTLA partial event building,!73343Draft: [TrigEgamma] Add photon ringer chains on bootstrap mechanism,!72336Fixed TRT calibration crash,!72176Draft: Improving L1TopoOnline chain that now gets no-empty plots. Activating it by default,!72012Draft: Separate JiveXMLConfig.py into Config files,!71876Fix MET trigger name in MissingETMonitoring,!71820Draft: Adding new TLA End-Of-Fill (EOF) chains and removing obsolete DIPZ chains,!71727CPAlgorithms: additional variables for photons
Showing with 107 additions and 1 deletion
......@@ -257,6 +257,9 @@ class ConfigFactory():
from EgammaAnalysisAlgorithms.PhotonAnalysisConfig import PhotonWorkingPointConfig
self.addAlgConfigBlock(algName="WorkingPoint", alg=PhotonWorkingPointConfig,
superBlocks="Photons")
from EgammaAnalysisAlgorithms.PhotonExtraVariablesConfig import PhotonExtraVariablesBlock
self.addAlgConfigBlock(algName="ExtraVariables", alg=PhotonExtraVariablesBlock,
superBlocks="Photons")
# muons
from MuonAnalysisAlgorithms.MuonAnalysisConfig import MuonCalibrationConfig
......
......@@ -43,6 +43,7 @@
#include <EgammaAnalysisAlgorithms/EgammaIsolationCorrectionAlg.h>
#include <EgammaAnalysisAlgorithms/EgammaIsolationSelectionAlg.h>
#include <EgammaAnalysisAlgorithms/PhotonOriginCorrectionAlg.h>
#include <EgammaAnalysisAlgorithms/PhotonExtraVariablesAlg.h>
#include <ElectronPhotonFourMomentumCorrection/EgammaCalibrationAndSmearingTool.h>
#include <ElectronPhotonSelectorTools/AsgDeadHVCellRemovalTool.h>
#include <EventSelectionAlgorithms/MissingETPlusTransverseMassSelectorAlg.h>
......@@ -123,6 +124,7 @@ namespace CP
ANA_CHECK (asg::registerAlgorithmFactory<CP::EgammaCalibrationAndSmearingAlg>("CP::EgammaCalibrationAndSmearingAlg"));
ANA_CHECK (asg::registerAlgorithmFactory<CP::EgammaIsolationCorrectionAlg>("CP::EgammaIsolationCorrectionAlg"));
ANA_CHECK (asg::registerAlgorithmFactory<CP::EgammaIsolationSelectionAlg>("CP::EgammaIsolationSelectionAlg"));
ANA_CHECK (asg::registerAlgorithmFactory<CP::PhotonExtraVariablesAlg>("CP::PhotonExtraVariablesAlg"));
ANA_CHECK (asg::registerAlgorithmFactory<CP::EventFlagSelectionAlg>("CP::EventFlagSelectionAlg"));
ANA_CHECK (asg::registerAlgorithmFactory<CP::EventStatusSelectionAlg>("CP::EventStatusSelectionAlg"));
ANA_CHECK (asg::registerAlgorithmFactory<CP::JetCalibrationAlg>("CP::JetCalibrationAlg"));
......
......@@ -19,5 +19,6 @@
#include <EgammaAnalysisAlgorithms/PhotonOriginCorrectionAlg.h>
#include <EgammaAnalysisAlgorithms/EgammaFSRForMuonsCollectorAlg.h>
#include <EgammaAnalysisAlgorithms/ElectronSiHitDecAlg.h>
#include <EgammaAnalysisAlgorithms/PhotonExtraVariablesAlg.h>
#endif
/*
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
/// @author Nils Abicht
#ifndef PHOTON_EXTRAVARIABLES_ALG__H
#define PHOTON_EXTRAVARIABLES_ALG__H
#include <AnaAlgorithm/AnaAlgorithm.h>
#include <SystematicsHandles/SysListHandle.h>
#include <SystematicsHandles/SysReadHandle.h>
#include <SystematicsHandles/SysWriteDecorHandle.h>
#include <xAODEgamma/PhotonContainer.h>
namespace CP {
class PhotonExtraVariablesAlg final : public EL::AnaAlgorithm {
public:
using EL::AnaAlgorithm::AnaAlgorithm;
virtual StatusCode initialize() override;
virtual StatusCode execute() override;
private:
CP::SysListHandle m_systematicsList {this};
CP::SysReadHandle<xAOD::PhotonContainer> m_photonsHandle { this, "photons", "", "the input photon container" };
CP::SysWriteDecorHandle<int> m_conversionTypeHandle { this, "conversionType", "conversionType_%SYS%", "decoration name for photon conversionType" };
CP::SysWriteDecorHandle<float> m_caloEta2Handle { this, "caloEta2", "caloEta2_%SYS%", "decoration name for photon caloEtaBE(2)" };
};
} // namespace
#endif
......@@ -11,5 +11,6 @@
<class name="CP::PhotonOriginCorrectionAlg" />
<class name="CP::EgammaFSRForMuonsCollectorAlg" />
<class name="CP::ElectronSiHitDecAlg" />
<class name="CP::PhotonExtraVariablesAlg" />
</lcgdict>
/*
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
/// @author Nils Abicht
#include <EgammaAnalysisAlgorithms/PhotonExtraVariablesAlg.h>
namespace CP {
StatusCode PhotonExtraVariablesAlg::initialize() {
ANA_CHECK(m_photonsHandle.initialize(m_systematicsList));
ANA_CHECK(m_conversionTypeHandle.initialize(m_systematicsList, m_photonsHandle));
ANA_CHECK(m_caloEta2Handle.initialize(m_systematicsList, m_photonsHandle));
ANA_CHECK(m_systematicsList.initialize());
return StatusCode::SUCCESS;
}
StatusCode PhotonExtraVariablesAlg::execute() {
for (const auto &sys : m_systematicsList.systematicsVector()) {
const xAOD::PhotonContainer *photons = nullptr;
ANA_CHECK(m_photonsHandle.retrieve(photons, sys));
for (const xAOD::Photon *photon : *photons) {
int conversionType = photon->conversionType();
m_conversionTypeHandle.set(*photon, conversionType, sys);
float caloEta2 = photon->caloCluster()->etaBE(2);
m_caloEta2Handle.set(*photon, caloEta2, sys);
}
}
return StatusCode::SUCCESS;
}
} // namespace
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
from AnalysisAlgorithmsConfig.ConfigBlock import ConfigBlock
class PhotonExtraVariablesBlock(ConfigBlock):
"""a ConfigBlock for additional photon output variables"""
"""Decorates the output photons with the conversion type and calorimeter eta"""
"""and writes them to the output. Useful e.g. for photon-fake studies."""
def __init__(self):
super(PhotonExtraVariablesBlock, self).__init__()
self.addOption('containerName', None, type=str, info='the input photon container')
def makeAlgs(self, config):
alg = config.createAlgorithm('CP::PhotonExtraVariablesAlg', 'PhotonExtraVariables' + self.containerName)
alg.photons = config.readName(self.containerName)
alg.affectingSystematicsFilter = '.*'
config.addOutputVar(self.containerName, 'conversionType_%SYS%', 'conversionType', noSys=True)
config.addOutputVar(self.containerName, 'caloEta2_%SYS%', 'caloEta2', noSys=True)
......@@ -11,6 +11,7 @@
#include <EgammaAnalysisAlgorithms/PhotonOriginCorrectionAlg.h>
#include <EgammaAnalysisAlgorithms/EgammaFSRForMuonsCollectorAlg.h>
#include <EgammaAnalysisAlgorithms/ElectronSiHitDecAlg.h>
#include <EgammaAnalysisAlgorithms/PhotonExtraVariablesAlg.h>
DECLARE_COMPONENT (CP::EgammaCalibrationAndSmearingAlg)
DECLARE_COMPONENT (CP::EgammaIsGoodOQSelectionTool)
......@@ -23,4 +24,4 @@ DECLARE_COMPONENT (CP::ElectronLRTMergingAlg)
DECLARE_COMPONENT (CP::PhotonOriginCorrectionAlg)
DECLARE_COMPONENT (CP::EgammaFSRForMuonsCollectorAlg)
DECLARE_COMPONENT (CP::ElectronSiHitDecAlg)
DECLARE_COMPONENT (CP::PhotonExtraVariablesAlg)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment