Skip to content
Snippets Groups Projects
Commit 2d113550 authored by Edward Moyse's avatar Edward Moyse
Browse files

Merge branch 'R22_testScott' into 'master'

tauRec: thinning of CaloCalTopoClusters_links for tau clusters

See merge request atlas/athena!37811
parents aebd47c8 fc99c7cc
No related branches found
No related tags found
No related merge requests found
...@@ -195,13 +195,17 @@ for theKey in CaloClusterKeys: #Fixme .. Apply this only to TopoClusters? ...@@ -195,13 +195,17 @@ for theKey in CaloClusterKeys: #Fixme .. Apply this only to TopoClusters?
AuxListItem="xAOD::CaloClusterAuxContainer#"+theKey+"Aux" AuxListItem="xAOD::CaloClusterAuxContainer#"+theKey+"Aux"
for moment in AODMoments: for moment in AODMoments:
AuxListItem+="."+moment AuxListItem+="."+moment
pass # for tau clusters
if theKey == "CaloCalTopoClusters":
AuxListItem += ".CellLink"
if len(AODMoments)==0: AuxListItem+="." if len(AODMoments)==0: AuxListItem+="."
CaloClusterItemList+=[AuxListItem] CaloClusterItemList+=[AuxListItem]
# write the link only for egClusterColl # write the link only for egClusterColl
#CaloClusterItemList+=["CaloClusterCellLinkContainer#egClusterCollection_links"] #CaloClusterItemList+=["CaloClusterCellLinkContainer#egClusterCollection_links"]
# for tau clusters (CaloCalTopoClusters within 0.2 of the tau axis)
CaloClusterItemList += ["CaloClusterCellLinkContainer#CaloCalTopoClusters_links"]
CaloAODList+=CaloClusterItemList CaloAODList+=CaloClusterItemList
...@@ -216,4 +220,3 @@ CaloAODList+=["TileMuContainer#TileMuObj"] ...@@ -216,4 +220,3 @@ CaloAODList+=["TileMuContainer#TileMuObj"]
# LAr noisy Feb/PA summary # LAr noisy Feb/PA summary
CaloAODList += ["LArNoisyROSummary#LArNoisyROSummary"] CaloAODList += ["LArNoisyROSummary#LArNoisyROSummary"]
...@@ -1293,6 +1293,7 @@ if ( rec.doAOD() or rec.doWriteAOD()) and not rec.readAOD() : ...@@ -1293,6 +1293,7 @@ if ( rec.doAOD() or rec.doWriteAOD()) and not rec.readAOD() :
alg = TauCellThinningAlg('TauCellThinningAlg', alg = TauCellThinningAlg('TauCellThinningAlg',
StreamName = 'StreamAOD', StreamName = 'StreamAOD',
Cells = 'AllCalo', Cells = 'AllCalo',
CellLinks = 'CaloCalTopoClusters_links',
Taus = "TauJets", Taus = "TauJets",
UseSubtractedCluster = tauFlags.useSubtractedCluster()) UseSubtractedCluster = tauFlags.useSubtractedCluster())
topSequence += alg topSequence += alg
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
StatusCode TauCellThinningAlg::initialize() StatusCode TauCellThinningAlg::initialize()
{ {
ATH_CHECK( m_cells.initialize(m_streamName) ); ATH_CHECK( m_cells.initialize(m_streamName) );
ATH_CHECK( m_cellLinks.initialize(m_streamName) );
ATH_CHECK( m_taus.initialize() ); ATH_CHECK( m_taus.initialize() );
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
...@@ -28,6 +29,9 @@ StatusCode TauCellThinningAlg::execute (const EventContext& ctx) const ...@@ -28,6 +29,9 @@ StatusCode TauCellThinningAlg::execute (const EventContext& ctx) const
{ {
SG::ThinningHandle<CaloCellContainer> cells (m_cells, ctx); SG::ThinningHandle<CaloCellContainer> cells (m_cells, ctx);
cells.thinAll(); cells.thinAll();
SG::ThinningHandle<CaloClusterCellLinkContainer> cellLinkHandle (m_cellLinks, ctx);
cellLinkHandle.thinAll();
SG::ReadHandle<xAOD::TauJetContainer> taus (m_taus, ctx); SG::ReadHandle<xAOD::TauJetContainer> taus (m_taus, ctx);
if (!taus.isValid()) { if (!taus.isValid()) {
...@@ -45,7 +49,7 @@ StatusCode TauCellThinningAlg::execute (const EventContext& ctx) const ...@@ -45,7 +49,7 @@ StatusCode TauCellThinningAlg::execute (const EventContext& ctx) const
const CaloClusterCellLink* cellLinks = cluster->getCellLinks(); const CaloClusterCellLink* cellLinks = cluster->getCellLinks();
if (!cellLinks) { 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; continue;
} }
...@@ -56,7 +60,18 @@ StatusCode TauCellThinningAlg::execute (const EventContext& ctx) const ...@@ -56,7 +60,18 @@ StatusCode TauCellThinningAlg::execute (const EventContext& ctx) const
<< m_cells.key() << "; cluster skipped."); << m_cells.key() << "; cluster skipped.");
continue; 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 it = cellLinks->begin();
CaloClusterCellLink::const_iterator end = cellLinks->end(); CaloClusterCellLink::const_iterator end = cellLinks->end();
for (; it != end; ++it) { for (; it != end; ++it) {
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "AthenaBaseComps/AthReentrantAlgorithm.h" #include "AthenaBaseComps/AthReentrantAlgorithm.h"
#include "CaloEvent/CaloCellContainer.h" #include "CaloEvent/CaloCellContainer.h"
#include "CaloEvent/CaloClusterCellLinkContainer.h"
#include "xAODTau/TauJetContainer.h" #include "xAODTau/TauJetContainer.h"
#include "StoreGate/ReadHandleKey.h" #include "StoreGate/ReadHandleKey.h"
#include "StoreGate/ThinningHandleKey.h" #include "StoreGate/ThinningHandleKey.h"
...@@ -45,6 +46,10 @@ class TauCellThinningAlg : public AthReentrantAlgorithm ...@@ -45,6 +46,10 @@ class TauCellThinningAlg : public AthReentrantAlgorithm
SG::ThinningHandleKey<CaloCellContainer> m_cells SG::ThinningHandleKey<CaloCellContainer> m_cells
{ this, "Cells", "AllCalo", "Cell container to thin" }; { 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 // Tau container
SG::ReadHandleKey<xAOD::TauJetContainer> m_taus SG::ReadHandleKey<xAOD::TauJetContainer> m_taus
{ this, "Taus", "TauJets", "Container of taus for which cells should be saved" }; { this, "Taus", "TauJets", "Container of taus for which cells should be saved" };
......
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