diff --git a/Calorimeter/CaloExample/CaloRecEx/share/CaloRecOutputItemList_jobOptions.py b/Calorimeter/CaloExample/CaloRecEx/share/CaloRecOutputItemList_jobOptions.py index fbb3ed952c6773eaf770ef2d71c6ad7f50caebc7..bece6e4a22a2d669bb8cdba34190239c94e7ffd1 100644 --- a/Calorimeter/CaloExample/CaloRecEx/share/CaloRecOutputItemList_jobOptions.py +++ b/Calorimeter/CaloExample/CaloRecEx/share/CaloRecOutputItemList_jobOptions.py @@ -195,13 +195,17 @@ for theKey in CaloClusterKeys: #Fixme .. Apply this only to TopoClusters? AuxListItem="xAOD::CaloClusterAuxContainer#"+theKey+"Aux" for moment in AODMoments: AuxListItem+="."+moment - pass + # for tau clusters + if theKey == "CaloCalTopoClusters": + AuxListItem += ".CellLink" if len(AODMoments)==0: AuxListItem+="." CaloClusterItemList+=[AuxListItem] # write the link only for egClusterColl #CaloClusterItemList+=["CaloClusterCellLinkContainer#egClusterCollection_links"] +# for tau clusters (CaloCalTopoClusters within 0.2 of the tau axis) +CaloClusterItemList += ["CaloClusterCellLinkContainer#CaloCalTopoClusters_links"] CaloAODList+=CaloClusterItemList @@ -216,4 +220,3 @@ CaloAODList+=["TileMuContainer#TileMuObj"] # LAr noisy Feb/PA summary CaloAODList += ["LArNoisyROSummary#LArNoisyROSummary"] - diff --git a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py index fb3a520a2af04978a42a22617ce2395427da5801..fb953b93aecd9944913a2f68433ddf62b4d7202f 100644 --- a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py +++ b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py @@ -1293,6 +1293,7 @@ if ( rec.doAOD() or rec.doWriteAOD()) and not rec.readAOD() : alg = TauCellThinningAlg('TauCellThinningAlg', StreamName = 'StreamAOD', Cells = 'AllCalo', + CellLinks = 'CaloCalTopoClusters_links', Taus = "TauJets", UseSubtractedCluster = tauFlags.useSubtractedCluster()) topSequence += alg diff --git a/Reconstruction/tauRec/src/TauCellThinningAlg.cxx b/Reconstruction/tauRec/src/TauCellThinningAlg.cxx index 1faf4ef756ced6c604e06631377687b85a6e45f0..15dcd85b8e4bb5d4f09d9f668adc29653b14ddec 100644 --- a/Reconstruction/tauRec/src/TauCellThinningAlg.cxx +++ b/Reconstruction/tauRec/src/TauCellThinningAlg.cxx @@ -15,6 +15,7 @@ StatusCode TauCellThinningAlg::initialize() { ATH_CHECK( m_cells.initialize(m_streamName) ); + ATH_CHECK( m_cellLinks.initialize(m_streamName) ); ATH_CHECK( m_taus.initialize() ); return StatusCode::SUCCESS; @@ -28,6 +29,9 @@ StatusCode TauCellThinningAlg::execute (const EventContext& ctx) const { SG::ThinningHandle<CaloCellContainer> cells (m_cells, ctx); cells.thinAll(); + + SG::ThinningHandle<CaloClusterCellLinkContainer> cellLinkHandle (m_cellLinks, ctx); + cellLinkHandle.thinAll(); SG::ReadHandle<xAOD::TauJetContainer> taus (m_taus, ctx); if (!taus.isValid()) { @@ -45,7 +49,7 @@ StatusCode TauCellThinningAlg::execute (const EventContext& ctx) const const CaloClusterCellLink* cellLinks = cluster->getCellLinks(); if (!cellLinks) { - ATH_MSG_WARNING( "Cluster without cell links found! Cells cannot be written in AOD." ); + ATH_MSG_WARNING( "Cluster without cell links found! Cells cannot be written in xAOD." ); continue; } @@ -56,7 +60,18 @@ StatusCode TauCellThinningAlg::execute (const EventContext& ctx) const << m_cells.key() << "; cluster skipped."); continue; } - + + // cluster cell link thinning + CaloClusterCellLinkContainer::const_iterator cellLinks_it = std::find(cellLinkHandle->begin(), cellLinkHandle->end(), cellLinks); + if(cellLinks_it != cellLinkHandle->end()) { + size_t link_index = std::distance(cellLinkHandle->begin(), cellLinks_it); + cellLinkHandle.keep(link_index); + } + else { + ATH_MSG_WARNING( "Could not find cluster cell link in " << m_cellLinks.key() << ", won't be saved in xAOD." ); + } + + // cell thinning CaloClusterCellLink::const_iterator it = cellLinks->begin(); CaloClusterCellLink::const_iterator end = cellLinks->end(); for (; it != end; ++it) { diff --git a/Reconstruction/tauRec/tauRec/TauCellThinningAlg.h b/Reconstruction/tauRec/tauRec/TauCellThinningAlg.h index 6af5a040330bc137f673170e9d1f90eee8563954..a202feee001d8b16f6a2e384728c81ed9cd34379 100644 --- a/Reconstruction/tauRec/tauRec/TauCellThinningAlg.h +++ b/Reconstruction/tauRec/tauRec/TauCellThinningAlg.h @@ -7,6 +7,7 @@ #include "AthenaBaseComps/AthReentrantAlgorithm.h" #include "CaloEvent/CaloCellContainer.h" +#include "CaloEvent/CaloClusterCellLinkContainer.h" #include "xAODTau/TauJetContainer.h" #include "StoreGate/ReadHandleKey.h" #include "StoreGate/ThinningHandleKey.h" @@ -45,6 +46,10 @@ class TauCellThinningAlg : public AthReentrantAlgorithm SG::ThinningHandleKey<CaloCellContainer> m_cells { this, "Cells", "AllCalo", "Cell container to thin" }; + // Cluster cell link container to thin + SG::ThinningHandleKey<CaloClusterCellLinkContainer> m_cellLinks + { this, "CellLinks", "CaloCalTopoClusters_links", "Cell container to thin" }; + // Tau container SG::ReadHandleKey<xAOD::TauJetContainer> m_taus { this, "Taus", "TauJets", "Container of taus for which cells should be saved" };