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

Migrate DVMeffFilterTool to use DataHandles

parent 4f901c2a
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
......@@ -16,6 +16,8 @@
// DerivationFramework includes
#include "DerivationFrameworkInterfaces/ISkimmingTool.h"
#include "xAODJet/JetContainer.h"
#include "xAODMissingET/MissingETContainer.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_metSGKey;
std::string m_jetSGKey;
mutable std::atomic<unsigned int> m_ntot;
mutable std::atomic<unsigned int> m_npass;
SG::ReadHandleKey<xAOD::MissingETContainer> m_metSGKey { this, "MetContainerKey", "MET_Calo", ""};
SG::ReadHandleKey<xAOD::JetContainer> m_jetSGKey { this, "JetContainerKey", "AntiKt4LCTopoJets", ""};
double m_MeffCut;
double m_METoverMeffCutMin;
double m_METoverMeffCutMax;
......
......@@ -9,8 +9,6 @@
#include "LongLivedParticleDPDMaker/DVMeffFilterTool.h"
#include <vector>
#include <string>
#include "xAODMissingET/MissingETContainer.h"
#include "xAODJet/JetContainer.h"
// Constructor
DerivationFramework::DVMeffFilterTool::DVMeffFilterTool( const std::string& t,
......@@ -19,8 +17,6 @@ DerivationFramework::DVMeffFilterTool::DVMeffFilterTool( const std::string& t,
AthAlgTool(t,n,p),
m_ntot(0),
m_npass(0),
m_metSGKey("MET_Calo"),
m_jetSGKey("AntiKt4LCTopoJets"),
m_MeffCut(1000000.),
m_METoverMeffCutMin(0.3),
m_METoverMeffCutMax(0.7),
......@@ -29,14 +25,12 @@ DerivationFramework::DVMeffFilterTool::DVMeffFilterTool( const std::string& t,
m_METCut(80000.)
{
declareInterface<DerivationFramework::ISkimmingTool>(this);
declareProperty("METContainerKey", m_metSGKey);
declareProperty("MeffCut", m_MeffCut);
declareProperty("jetPtCut", m_jetPtCut);
declareProperty("jetEtaCut", m_jetEtaCut);
declareProperty("METoverMeffCutMin", m_METoverMeffCutMin);
declareProperty("METoverMeffCutMax", m_METoverMeffCutMax);
declareProperty("METCut",m_METCut);
declareProperty("JetContainerKey", m_jetSGKey);
}
// Destructor
......@@ -47,6 +41,8 @@ DerivationFramework::DVMeffFilterTool::~DVMeffFilterTool() {
StatusCode DerivationFramework::DVMeffFilterTool::initialize()
{
ATH_MSG_VERBOSE("initialize() ...");
ATH_CHECK(m_metSGKey.initialize());
ATH_CHECK(m_jetSGKey.initialize());
return StatusCode::SUCCESS;
}
StatusCode DerivationFramework::DVMeffFilterTool::finalize()
......@@ -66,9 +62,8 @@ bool DerivationFramework::DVMeffFilterTool::eventPassesFilter() const
double totalJetPT = 0.;
bool passesEvent=false;
const xAOD::MissingETContainer* metContainer(0);
StatusCode sc=evtStore()->retrieve(metContainer,m_metSGKey);
if( sc.isFailure() || !metContainer ) {
SG::ReadHandle<xAOD::MissingETContainer> metContainer(m_metSGKey);
if( !metContainer.isValid() ) {
msg(MSG::WARNING) << "No MET container found, will skip this event" << endmsg;
return false;
}
......@@ -78,9 +73,8 @@ bool DerivationFramework::DVMeffFilterTool::eventPassesFilter() const
MET = metContainer->at(0)->met();
}
const xAOD::JetContainer* jetContainer(0);
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;
}
......
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