Skip to content
Snippets Groups Projects

Add ghost merging alg

Merged Jackson Carl Burzynski requested to merge jburzyns/athena:JetGhostMergingAlg into master
All threads resolved!
1 file
+ 8
6
Compare changes
  • Side-by-side
  • Inline
@@ -20,23 +20,25 @@
namespace CP
{
JetGhostMuonAssociationAlg ::
JetGhostMuonAssociationAlg (const std::string& name,
ISvcLocator* pSvcLocator)
JetGhostMergingAlg ::
JetGhostMergingAlg (const std::string& name,
ISvcLocator* pSvcLocator)
: AnaAlgorithm (name, pSvcLocator)
{
}
StatusCode JetGhostMuonAssociationAlg ::
StatusCode JetGhostMergingAlg ::
initialize ()
{
ANA_CHECK (m_jetLocation.initialize ());
return StatusCode::SUCCESS;
}
StatusCode JetGhostMuonAssociationAlg ::
StatusCode JetGhostMergingAlg ::
execute ()
{
const EventContext &ctx = Gaudi::Hive::currentContext();
SG::ReadHandle<xAOD::JetContainer> inputJets(m_jetLocation,ctx);
if (!inputJets.isValid()) {
ATH_MSG_FATAL("No jet collection with name " << m_jetLocation.key() << " found in StoreGate!");
@@ -47,7 +49,7 @@ namespace CP
for(const xAOD::Jet *jet: *inputJets) {
std::vector<ElementLink<xAOD::IParticleContainer>> mergedGhosts;
for (const auto& ghostName: m_ghostTrackNames) {
for (const auto& ghostName: m_inputGhostTrackNames) {
static const SG::AuxElement::ConstAccessor<std::vector<ElementLink<DataVector<xAOD::IParticle> > > > ghostTrackAcc(ghostName);
const std::vector< ElementLink<DataVector<xAOD::IParticle> > > &ghosts = ghostTrackAcc( *jet );
mergedGhosts.insert(mergedGhosts.end(), ghosts.begin(), ghosts.end());
Loading