Skip to content
Snippets Groups Projects
Commit e8551785 authored by Zach Marshall's avatar Zach Marshall Committed by Frank Winklmeier
Browse files

Adding electrons, taus, and photons to DumpEventDataToJSON

Adding electrons, taus, and photons to DumpEventDataToJSON

For event displays, adding a couple of simple lines to include photons,
electrons, and tau jets in the JSON dumps that we hand off to Phoenix.
It's not completely clear to me if there are naming conventions within
Phoenix that need to be respected, so this mostly tries to follow what's
already done inside the code.
parent 3fe8c9bf
No related branches found
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@ find_package( Acts COMPONENTS Core )
atlas_add_component( DumpEventDataToJSON
src/*.cxx
src/components/*.cxx
LINK_LIBRARIES ActsEventLib AthenaBaseComps CaloEvent GaudiKernel StoreGateLib TrkExInterfaces MuonPrepRawData InDetPrepRawData TrkTrack nlohmann_json::nlohmann_json xAODCaloEvent xAODEventInfo xAODJet xAODMuon xAODTracking )
LINK_LIBRARIES ActsEventLib AthenaBaseComps CaloEvent GaudiKernel StoreGateLib TrkExInterfaces MuonPrepRawData InDetPrepRawData TrkTrack nlohmann_json::nlohmann_json xAODCaloEvent xAODEgamma xAODEventInfo xAODJet xAODMuon xAODTau xAODTracking )
# Install files from the package:
atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
......@@ -35,6 +35,12 @@ def DumpEventDataToJSONAlgCfg(flags, doExtrap=False, doACTSEDM = True, **kwargs)
kwargs.setdefault('JetContainerKeys', ['AnalysisJets','AnalysisLargeRJets'])
# AnalysisMuons are the standard calibrated muon container
kwargs.setdefault('MuonContainerKeys', ['AnalysisMuons'])
# AnalysisTauJets are the calibrated tau jet container
kwargs.setdefault('TauJetContainerKeys', ['AnalysisTauJets'])
# AnalysisElectrons are the standard calibrated electron container
kwargs.setdefault('ElectronContainerKeys', ['AnalysisElectrons'])
# AnalysisPhotons are the standard calibrated photon container
kwargs.setdefault('PhotonContainerKeys', ['AnalysisPhotons'])
# No clusters or cells in DAOD_PHYSLITE
kwargs.setdefault('CaloClusterContainerKeys', [])
kwargs.setdefault('CaloCellContainerKey', [])
......
......@@ -37,6 +37,9 @@ StatusCode DumpEventDataToJsonAlg::initialize() {
ATH_CHECK(m_caloClustersKeys.initialize(!m_caloClustersKeys.empty()));
ATH_CHECK(m_caloCellKey.initialize(!m_caloCellKey.empty()));
ATH_CHECK(m_muonKeys.initialize(!m_muonKeys.empty()));
ATH_CHECK(m_tauJetKeys.initialize(!m_tauJetKeys.empty()));
ATH_CHECK(m_electronKeys.initialize(!m_electronKeys.empty()));
ATH_CHECK(m_photonKeys.initialize(!m_photonKeys.empty()));
ATH_CHECK(m_trackCollectionKeys.initialize(!m_trackCollectionKeys.empty()));
// ACTS
......@@ -152,6 +155,9 @@ StatusCode DumpEventDataToJsonAlg::execute() {
ATH_CHECK(getAndFillArrayOfContainers(j, m_jetKeys, "Jets"));
ATH_CHECK(getAndFillArrayOfContainers(j, m_trackParticleKeys, "Tracks"));
ATH_CHECK(getAndFillArrayOfContainers(j, m_muonKeys, "Muons"));
ATH_CHECK(getAndFillArrayOfContainers(j, m_tauJetKeys, "Taus"));
ATH_CHECK(getAndFillArrayOfContainers(j, m_electronKeys, "Electrons"));
ATH_CHECK(getAndFillArrayOfContainers(j, m_photonKeys, "Photons"));
ATH_CHECK(getAndFillArrayOfContainers(j, m_caloClustersKeys, "CaloClusters"));
ATH_CHECK(getAndFillArrayOfContainers(j, m_caloCellKey, "CaloCells"));
ATH_CHECK(getAndFillArrayOfContainers(j, m_trackCollectionKeys, "Tracks"));
......@@ -429,6 +435,38 @@ nlohmann::json DumpEventDataToJsonAlg::getData(const xAOD::Muon &muon) {
return data;
}
// Specialisation for Tau Jets
template <>
nlohmann::json DumpEventDataToJsonAlg::getData(const xAOD::TauJet &tauJet) {
nlohmann::json data;
data["phi"] = tauJet.phi();
data["eta"] = tauJet.eta();
data["energy"] = tauJet.e();
return data;
}
// Specialisation for Electrons
template <>
nlohmann::json DumpEventDataToJsonAlg::getData(const xAOD::Electron &electron) {
nlohmann::json data;
data["phi"] = electron.phi();
data["eta"] = electron.eta();
data["energy"] = electron.e();
return data;
}
// Specialisation for Photons
template <>
nlohmann::json DumpEventDataToJsonAlg::getData(const xAOD::Photon &photon) {
nlohmann::json data;
data["phi"] = photon.phi();
data["eta"] = photon.eta();
data["energy"] = photon.e();
return data;
}
template <class TYPE>
void DumpEventDataToJsonAlg::addLink(const TYPE &link, nlohmann::json &data) {
if (link.isValid()) {
......
......@@ -14,6 +14,9 @@
#include "xAODTracking/TrackParticleContainer.h"
#include "xAODJet/JetContainer.h"
#include "xAODMuon/MuonContainer.h"
#include "xAODTau/TauJetContainer.h"
#include "xAODEgamma/ElectronContainer.h"
#include "xAODEgamma/PhotonContainer.h"
#include "xAODCaloEvent/CaloClusterContainer.h"
#include "CaloEvent/CaloCellContainer.h"
#include "TrkTrack/TrackCollection.h"
......@@ -79,6 +82,12 @@ protected:
SG::ReadHandleKeyArray<xAOD::MuonContainer> m_muonKeys{this, "MuonContainerKeys", {"Muons"}, "Keys for Muon Containers"};
SG::ReadHandleKeyArray<xAOD::TauJetContainer> m_tauJetKeys{this, "TauJetContainerKeys", {"TauJets"}, "Keys for Tau Containers"};
SG::ReadHandleKeyArray<xAOD::ElectronContainer> m_electronKeys{this, "ElectronContainerKeys", {"Electrons"}, "Keys for Electron Containers"};
SG::ReadHandleKeyArray<xAOD::PhotonContainer> m_photonKeys{this, "PhotonContainerKeys", {"Photons"}, "Keys for Photon Containers"};
SG::ReadHandleKeyArray<xAOD::CaloClusterContainer> m_caloClustersKeys{this, "CaloClusterContainerKeys", {"CaloCalTopoClusters"}, "Keys for CaloClusters Containers"};
SG::ReadHandleKeyArray<CaloCellContainer> m_caloCellKey{this, "CaloCellContainerKey", {"AllCalo"}, "Key for CaloCell Container"};
......
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