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

Migrate DVTracklessJetFilterTool to use DataHandles

parent 1f59b0bc
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
......@@ -16,6 +16,8 @@
// DerivationFramework includes
#include "DerivationFrameworkInterfaces/ISkimmingTool.h"
#include "xAODJet/JetContainer.h"
#include "StoreGate/ReadHandleKey.h"
namespace DerivationFramework {
......@@ -43,10 +45,10 @@ namespace DerivationFramework {
virtual bool eventPassesFilter() const;
private:
mutable unsigned int m_ntot;
mutable unsigned int m_npass;
std::string m_jetSGKey;
mutable std::atomic<unsigned int> m_ntot;
mutable std::atomic<unsigned int> m_npass;
SG::ReadHandleKey<xAOD::JetContainer> m_jetSGKey
{ this, "JetContainerKey", "AntiKt4EMTopoJets", ""};
double m_ptCut;
double m_etaCut;
......
......@@ -9,7 +9,6 @@
#include "LongLivedParticleDPDMaker/DVTracklessJetFilterTool.h"
#include <vector>
#include <string>
#include "xAODJet/JetContainer.h"
// Constructor
......@@ -19,11 +18,9 @@ DerivationFramework::DVTracklessJetFilterTool::DVTracklessJetFilterTool( const s
AthAlgTool(t,n,p),
m_ntot(0),
m_npass(0),
m_jetSGKey("AntiKt4EMTopoJets"),
m_ptCut(50000.0)
{
declareInterface<DerivationFramework::ISkimmingTool>(this);
declareProperty("JetContainerKey", m_jetSGKey);
declareProperty("JetPtCut", m_ptCut);
declareProperty("JetEtaCut", m_etaCut);
declareProperty("sumPtTrkCut", m_sumPtTrkCut);
......@@ -38,6 +35,7 @@ DerivationFramework::DVTracklessJetFilterTool::~DVTracklessJetFilterTool() {
StatusCode DerivationFramework::DVTracklessJetFilterTool::initialize()
{
ATH_MSG_VERBOSE("initialize() ...");
ATH_CHECK(m_jetSGKey.initialize());
return StatusCode::SUCCESS;
......@@ -57,12 +55,11 @@ bool DerivationFramework::DVTracklessJetFilterTool::eventPassesFilter() const
int nJetsPassed=0;
const xAOD::JetContainer* jetContainer(0);
StatusCode sc=evtStore()->retrieve(jetContainer,m_jetSGKey);
if( sc.isFailure() || !jetContainer ) {
SG::ReadHandle<xAOD::JetContainer> jetContainer(m_jetSGKey);
if( !jetContainer.isValid() ) {
msg(MSG::WARNING) << "No Jet container found, will skip this event" << endmsg;
return false;
}
}
msg(MSG::DEBUG)<<"size of Jet container is "<<jetContainer->size()<<endmsg;
for (unsigned int i=0; i< jetContainer->size(); ++i) {
......
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