Skip to content
Snippets Groups Projects
Commit 51b58fca authored by Emily Anne Thompson's avatar Emily Anne Thompson
Browse files

Migrate EmergingJetsFilterTool to use DataHandles

parent 8f6fbe90
No related branches found
No related tags found
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!39666Migrate LongLivedParticleDPDMaker to R22
......@@ -17,6 +17,8 @@
// DerivationFramework includes
#include "DerivationFrameworkInterfaces/ISkimmingTool.h"
#include "xAODJet/JetContainer.h"
#include "StoreGate/ReadHandleKey.h"
namespace DerivationFramework {
......@@ -47,10 +49,10 @@ namespace DerivationFramework {
private:
ToolHandle< Trig::TrigDecisionTool > m_tdt;
std::vector< std::string > m_triggers;
mutable unsigned int m_ntot;
mutable unsigned int m_npass;
mutable unsigned int m_nptpass;
std::string m_jetSGKey;
mutable std::atomic<unsigned int> m_ntot;
mutable std::atomic<unsigned int> m_npass;
mutable std::atomic<unsigned int> m_nptpass;
SG::ReadHandleKey<xAOD::JetContainer> m_jetSGKey { this, "JetContainerKey", "AntiKt4EMTopoJets", ""};
double m_ptCut;
double m_etaCut;
......
......@@ -9,7 +9,6 @@
#include "LongLivedParticleDPDMaker/EmergingJetsFilterTool.h"
#include <vector>
#include <string>
#include "xAODJet/JetContainer.h"
#include "xAODTracking/TrackParticleContainer.h"
#include "TrigDecisionTool/ChainGroup.h"
......@@ -25,7 +24,6 @@ DerivationFramework::EmergingJetsFilterTool::EmergingJetsFilterTool( const std::
m_ntot(0),
m_npass(0),
m_nptpass(0),
m_jetSGKey("AntiKt4EMTopoJets"),
m_ptCut(100000.0),
m_etaCut(2.5),
m_nJetsRequired(4)
......@@ -33,7 +31,6 @@ DerivationFramework::EmergingJetsFilterTool::EmergingJetsFilterTool( const std::
declareInterface<DerivationFramework::ISkimmingTool>(this);
declareProperty("TrigDecisionTool", m_tdt, "Tool to access the trigger decision");
declareProperty("Triggers", m_triggers = std::vector< std::string >());
declareProperty("JetContainerKey", m_jetSGKey);
declareProperty("JetPtCut", m_ptCut);
declareProperty("JetEtaCut", m_etaCut);
declareProperty("nJetsRequired", m_nJetsRequired);
......@@ -53,6 +50,7 @@ StatusCode DerivationFramework::EmergingJetsFilterTool::initialize()
return StatusCode::FAILURE;
}
ATH_MSG_INFO("Retrieved tool: " << m_tdt);
ATH_CHECK(m_jetSGKey.initialize());
return StatusCode::SUCCESS;
......@@ -91,9 +89,8 @@ bool DerivationFramework::EmergingJetsFilterTool::eventPassesFilter() const
// access jet container
const xAOD::JetContainer* jets(0);
StatusCode sc = evtStore()->retrieve(jets,m_jetSGKey);
if( sc.isFailure() || !jets ){
SG::ReadHandle<xAOD::JetContainer> jets(m_jetSGKey);
if( !jets.isValid() ) {
msg(MSG::WARNING) << "No Jet container found, will skip this event" << endmsg;
return false;
}
......
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