Commit 609acd5f authored by Teng Jian Khoo's avatar Teng Jian Khoo Committed by Graeme Stewart
Browse files

'more PF MET fixes' (METReconstruction-00-03-16)

	* Further PFlow MET fixes and diagnostics
	* Tagged as METReconstruction-00-03-16

2016-08-24 Teng Jian Khoo <khoo@cern.ch>
	* Bugfix weighted cPFO summation
	* Add a MET association map diagnostic alg
	* Tagged as METReconstruction-00-03-15

2016-08-04 Teng Jian Khoo <khoo@cern.ch>
	* Implement weighted cPFO summation
	* Tagged as METReconstruction-00-03-14
parent f15e15cd
......@@ -35,6 +35,7 @@
#include "xAODPFlow/PFOContainer.h"
#include "xAODPFlow/PFO.h"
#include "PFlowUtils/IRetrievePFOTool.h"
#include "PFlowUtils/IWeightPFOTool.h"
#include "FourMomUtils/xAODP4Helpers.h"
#include "RecoToolInterfaces/ITrackIsolationTool.h"
......@@ -76,8 +77,10 @@ namespace met {
bool m_useRapidity;
bool m_useIsolationTools;
bool m_useModifiedClus;
bool m_weight_charged_pfo;
ToolHandle<CP::IRetrievePFOTool> m_pfotool;
ToolHandle<CP::IWeightPFOTool> m_pfoweighttool;
ToolHandle<InDet::IInDetTrackSelectionTool> m_trkseltool;
ToolHandle<xAOD::ITrackIsolationTool> m_trkIsolationTool;
ToolHandle<xAOD::ICaloTopoClusterIsolationTool> m_caloIsolationTool;
......
......@@ -53,8 +53,10 @@ namespace met {
declareProperty( "UseModifiedClus", m_useModifiedClus = false );
declareProperty( "UseTracks", m_useTracks = true );
declareProperty( "PFlow", m_pflow = false );
declareProperty( "WeightCPFO", m_weight_charged_pfo = true );
declareProperty( "UseRapidity", m_useRapidity = false );
declareProperty( "PFOTool", m_pfotool );
declareProperty( "PFOWeightTool", m_pfoweighttool );
declareProperty( "UseIsolationTools", m_useIsolationTools=true );
declareProperty( "TrackSelectorTool", m_trkseltool );
declareProperty( "TrackIsolationTool", m_trkIsolationTool );
......@@ -81,6 +83,10 @@ namespace met {
ATH_CHECK( m_trkseltool.retrieve() );
ATH_CHECK(m_trkIsolationTool.retrieve());
ATH_CHECK(m_caloIsolationTool.retrieve());
if(m_pflow) {
ATH_CHECK( m_pfotool.retrieve() );
ATH_CHECK( m_pfoweighttool.retrieve() );
}
if(m_clcoll == "CaloCalTopoClusters") {
if(m_useModifiedClus) {
......
......@@ -123,7 +123,7 @@ namespace met {
nearbyPFO.reserve(10);
for(const auto& pfo : *pfoCont) {
std::vector<const IParticle*> cls;
if (pfo->charge()==0) {
if (fabs(pfo->charge())<1e-9) {
if (swclus->p4().DeltaR(pfo->p4EM())<m_tcMatch_dR && pfo->eEM()>0) {
nearbyPFO.push_back(pfo);
}
......@@ -134,6 +134,11 @@ namespace met {
if(pfotrk == eltrk) {
if(acceptChargedPFO(eltrk,pv)) {
pfolist.push_back(pfo);
if(m_weight_charged_pfo) {
float weight = 0.0;
ATH_CHECK( m_pfoweighttool->fillWeight( *pfo, weight ) );
momenta[pfo] = weight*MissingETBase::Types::constvec_t(*pfo);
}
}
}
}
......@@ -143,6 +148,7 @@ namespace met {
bool doSum = true;
double sumE_pfo = 0.;
TLorentzVector momentum;
std::sort(nearbyPFO.begin(),nearbyPFO.end(),greaterPtPFO);
for(const auto& pfo : nearbyPFO) {
// Handle neutral PFOs like topoclusters
......@@ -157,7 +163,7 @@ namespace met {
pfolist.push_back(pfo);
sumE_pfo += pfo_e;
TLorentzVector momentum = pv ? pfo->GetVertexCorrectedEMFourVec(*pv) : pfo->p4EM();
momentum = pv ? pfo->GetVertexCorrectedEMFourVec(*pv) : pfo->p4EM();
momenta[pfo] = MissingETBase::Types::constvec_t(momentum.Px(),momentum.Py(),momentum.Pz(),
momentum.E(),momentum.Pt());
} // if we will retain the topocluster
......
......@@ -113,9 +113,11 @@ namespace met {
if (m_pflow && !mismatchedPFlow) {
for (size_t consti = 0; consti < jet->numConstituents(); consti++) {
const xAOD::PFO *pfo = static_cast<const xAOD::PFO*>(jet->rawConstituent(consti));
if (pfo->charge()!=0) {
ATH_MSG_VERBOSE("Jet constituent PFO, pt " << pfo->pt());
if (fabs(pfo->charge())>1e-9) {
ATH_MSG_VERBOSE(" Accepted charged PFO, pt " << pfo->pt());
trkvec += *pfo;
selectedTracks.push_back(pfo->track(0));
selectedTracks.push_back(pfo);
}
}
} else {
......@@ -160,8 +162,9 @@ namespace met {
for(const auto& pfo : *pfoCont) {
const TrackParticle* pfotrk = pfo->track(0);
if (pfo->charge()!=0) for(const auto& trk : jettracks) if (trk==pfotrk) consts.push_back(pfo);
if (pfo->charge()==0) {
if (fabs(pfo->charge())>1e-9) {
for(const auto& trk : jettracks) if (trk==pfotrk) consts.push_back(pfo);
} else {
bool marked = false;
for (size_t consti = 0; consti < jet->numConstituents(); consti++) if (pfo->p4EM().DeltaR(jet->rawConstituent(consti)->p4())<0.05) marked = true;
if (marked) {
......
......@@ -143,15 +143,23 @@ namespace met {
StatusCode METMuonAssociator::extractPFO(const xAOD::IParticle* obj,
std::vector<const xAOD::IParticle*>& pfolist,
const xAOD::PFOContainer* pfoCont,
std::map<const IParticle*,MissingETBase::Types::constvec_t>&,
std::map<const IParticle*,MissingETBase::Types::constvec_t>& momenta,
const xAOD::Vertex* pv) const
{
const xAOD::Muon *mu = static_cast<const xAOD::Muon*>(obj);
const TrackParticle* idtrack = mu->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
if(idtrack && acceptChargedPFO(idtrack,pv)) {
for(const auto& pfo : *pfoCont) {
if (pfo->charge()!=0 && pfo->track(0) == idtrack) {
if (fabs(pfo->charge())>1e-9 && pfo->track(0) == idtrack) {
ATH_MSG_VERBOSE("Accept muon PFO " << pfo << " px, py = " << pfo->p4().Px() << ", " << pfo->p4().Py());
ATH_MSG_VERBOSE("Muon PFO index: " << pfo->index() << ", pt: " << pfo->pt() << ", eta: " << pfo->eta() << ", phi: " << pfo->phi() );
ATH_MSG_VERBOSE("Muon ID Track index: " << idtrack->index() << ", pt: " << idtrack->pt() << ", eta: " << idtrack->eta() << ", phi: " << idtrack->phi() );
pfolist.push_back(pfo);
if(m_weight_charged_pfo) {
float weight = 0.0;
ATH_CHECK( m_pfoweighttool->fillWeight( *pfo, weight ) );
momenta[pfo] = weight*MissingETBase::Types::constvec_t(*pfo);
}
break;
}
}
......
......@@ -140,7 +140,7 @@ namespace met {
nearbyPFO.reserve(10);
for(const auto& pfo : *pfoCont) {
std::vector<const IParticle*> cls;
if (pfo->charge()==0) {
if (fabs(pfo->charge())<1e-9) {
if (swclus->p4().DeltaR(pfo->p4EM())<0.1 && pfo->eEM()>0) {
nearbyPFO.push_back(pfo);
}
......@@ -152,6 +152,11 @@ namespace met {
if(pfo->track(0) == phtrk) {
if(acceptChargedPFO(phtrk,pv)) {
pfolist.push_back(pfo);
if(m_weight_charged_pfo) {
float weight = 0.0;
ATH_CHECK( m_pfoweighttool->fillWeight( *pfo, weight ) );
momenta[pfo] = weight*MissingETBase::Types::constvec_t(*pfo);
}
}
}
}
......@@ -163,6 +168,7 @@ namespace met {
bool doSum = true;
double sumE_pfo = 0.;
std::sort(nearbyPFO.begin(),nearbyPFO.end(),greaterPtPFO);
TLorentzVector momentum;
for(const auto& pfo : nearbyPFO) {
// Handle neutral PFOs like topoclusters
double pfo_e = pfo->eEM();
......@@ -176,7 +182,7 @@ namespace met {
pfolist.push_back(pfo);
sumE_pfo += pfo_e;
TLorentzVector momentum = pv ? pfo->GetVertexCorrectedEMFourVec(*pv) : pfo->p4EM();
momentum = pv ? pfo->GetVertexCorrectedEMFourVec(*pv) : pfo->p4EM();
momenta[pfo] = MissingETBase::Types::constvec_t(momentum.Px(),momentum.Py(),momentum.Pz(),
momentum.E(),momentum.Pt());
} // if we will retain the topocluster
......
......@@ -98,7 +98,7 @@ namespace met {
}
for(const auto& sig : *uniquePFOs) {
const PFO *pfo = static_cast<const PFO*>(sig);
if (pfo->charge()!=0) {
if (fabs(pfo->charge())>1e-9) {
if (acceptChargedPFO(pfo->track(0),pv)) {
*metCoreTrk += sig;
*metCoreCl += sig;
......
......@@ -189,7 +189,7 @@ namespace met {
bool METSoftTermsTool::accept(const xAOD::PFO* pfo) const
{
if(pfo->charge()==0) return true;
if(fabs(pfo->charge())<1e-9) return true;
if(fabs(pfo->track(0)->z0() - (*m_pv_cont)[0]->z())>2) return false;
return true;
}
......@@ -373,11 +373,13 @@ namespace met {
iPart!=signalList.end(); ++iPart) {
const PFO* pfo = dynamic_cast<const PFO*>(*iPart);
if(pfo) {
if(pfo->charge()==0) {
metTerm->add(pfo->ptEM()*cos(pfo->phiEM()),
pfo->ptEM()*sin(pfo->phiEM()),
pfo->ptEM());
} else {
// In principle for the charged PFOs we should perhaps add the weights
// but this shouldn't happen if we don't have a jet.
if(fabs(pfo->charge()<1e-9)) {
metTerm->add(pfo->pt()*cos(pfo->phi()),
pfo->pt()*sin(pfo->phi()),
pfo->pt());
......
......@@ -184,9 +184,10 @@ namespace met {
{
const TauJet* tau = static_cast<const TauJet*>(obj);
const Jet* seedjet = *tau->jetLink();
TLorentzVector momentum;
for(const auto& pfo : *pfoCont) {
bool match = false;
if (pfo->charge()==0) {
if (fabs(pfo->charge())<1e-9) {
if(seedjet->p4().DeltaR(pfo->p4EM())<0.2 && pfo->eEM()>0) {match = true;}
}
else {
......@@ -216,10 +217,14 @@ namespace met {
}
if(match) {
pfolist.push_back(pfo);
if(pfo->charge()==0) {
TLorentzVector momentum = pv ? pfo->GetVertexCorrectedEMFourVec(*pv) : pfo->p4EM();
if(fabs(pfo->charge())<1e-9) {
momentum = pv ? pfo->GetVertexCorrectedEMFourVec(*pv) : pfo->p4EM();
momenta[pfo] = MissingETBase::Types::constvec_t(momentum.Px(),momentum.Py(),momentum.Pz(),
momentum.E(),momentum.Pt());
} else if(m_weight_charged_pfo) {
float weight = 0.0;
ATH_CHECK( m_pfoweighttool->fillWeight( *pfo, weight ) );
momenta[pfo] = weight*MissingETBase::Types::constvec_t(*pfo);
}
}
}
......
......@@ -80,10 +80,12 @@ def getAssociator(config,suffix,doPFlow=False,
pfotool = CfgMgr.CP__RetrievePFOTool('MET_PFOTool_'+suffix)
ToolSvc += pfotool
tool.PFOTool = pfotool
pfoweighttool = CfgMgr.CP__WeightPFOTool('MET_PFOWeightTool_'+suffix)
ToolSvc += pfoweighttool
tool.PFOWeightTool = pfoweighttool
tool.PFlow = True
else:
tool.UseModifiedClus = doOriginCorrClus
# set input/output key names
if config.inputKey == '':
tool.InputCollection = defaultInputKey[config.objType]
......
import AthenaPoolCnvSvc.ReadAthenaPool
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
from AthenaCommon.AppMgr import ServiceMgr
from AthenaCommon import CfgMgr
from RecExConfig.RecFlags import rec
filelist = [
#"/atlas/data1/userdata/khoo/Data15/xAOD_20.7/mc15_13TeV.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.merge.AOD.e3698_s2608_s2183_r7725_r7676/AOD.07915894._000339.pool.root.1",
#"user.valentem.mc15_13TeV.361107.merge.DAOD_JETM3.e3601_s2576_s2132_r7725_r7676.2016-08-31_EXT0/user.valentem.9333594.EXT0._000547.DAOD_JETM3.test.pool.root"
#"DAOD_JETM3.MC15.pool.root"
"/atlas/data1/userdata/valentem/PFlow/AODs/user.valentem.mc15_13TeV.361107.merge.DAOD_JETM3.e3601_s2576_s2132_r7725_r7676.2016-09-04_EXT0/user.valentem.9354614.EXT0._002886.DAOD_JETM3.test.pool.root"
]
athenaCommonFlags.FilesInput = filelist
ServiceMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput()
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
topSequence += CfgMgr.met__METAssocTestAlg("TestMETAssocEMTopo",
#OutputLevel=VERBOSE,
FailOnInconsistency=True)
topSequence += CfgMgr.met__METAssocTestAlg("TestMETAssocEMPFlow",
#OutputLevel=VERBOSE,
FailOnInconsistency=True,
METMapSuffix="AntiKt4EMPFlow")
theApp.EvtMax = -1
ServiceMgr.EventSelector.SkipEvents = 0
ServiceMgr.MessageSvc.defaultLimit = 9999
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#include "METAssocTestAlg.h"
#include "xAODMissingET/MissingETAssociationMap.h"
using namespace xAOD;
// allow for differences due to float compression
static const float f_tolerance = 1;
namespace met {
METAssocTestAlg::METAssocTestAlg(const std::string& name, ISvcLocator* pSvcLocator) :
::AthAlgorithm( name, pSvcLocator ) {
declareProperty( "METMapSuffix", m_mapsuffix="AntiKt4EMTopo" );
declareProperty( "JetCollection", m_jetname="" );
declareProperty( "FailOnInconsistency", m_failOnInconsistency=false );
}
StatusCode METAssocTestAlg::initialize()
{
if(m_mapsuffix.empty()) {
ATH_MSG_FATAL( "METMapSuffix (e.g. AntiKt4EMTopo) must be set!" );
return StatusCode::FAILURE;
}
m_mapname = "METAssoc_"+m_mapsuffix;
if(m_jetname.empty()) { m_jetname = m_mapsuffix+"Jets"; }
ATH_MSG_INFO( "Initialising " << name() );
ATH_MSG_INFO( "MET map name: " << m_mapname );
return StatusCode::SUCCESS;
}
StatusCode METAssocTestAlg::finalize() { return StatusCode::SUCCESS; }
StatusCode METAssocTestAlg::execute()
{
const MissingETAssociationMap* map(NULL);
ATH_MSG_DEBUG( "Running METAssocTestAlg on " << "map " << m_mapname << "." );
ATH_CHECK( evtStore()->retrieve(map, m_mapname) );
for(const auto& assoc : *map) {
if(assoc->isMisc()) { // misc association gets special treatment
ATH_MSG_VERBOSE( " Now on MET misc association" );
ATH_CHECK( checkMiscAssoc(*assoc) );
} else {
ATH_MSG_VERBOSE( " Now on MET association for jet " << assoc->refJet()->index() );
// Test jets for consistency with the map
ATH_CHECK( checkJet(*assoc) );
// Test associated objects for consistency with the map
ATH_CHECK( checkObjects(*assoc) );
// Test association for self-consistency based on stored keys
ATH_CHECK( checkAssoc(*assoc) );
}
}
return StatusCode::SUCCESS;
}
StatusCode METAssocTestAlg::checkJet(const xAOD::MissingETAssociation& assoc)
{
const auto& jet = *assoc.refJet();
JetFourMom_t jetconstp4 = jet.jetP4(JetConstitScaleMomentum);
MissingETBase::Types::constvec_t jettrkvec = assoc.jetTrkVec();
// switch on all overlapping objects
assoc.resetObjSelectionFlags();
for(size_t iobj=0; iobj<assoc.objects().size(); ++iobj) {
assoc.setObjSelectionFlag(iobj,true);
}
// get cluster/inclusive pflow and track/charged pflow constituent sums
MissingETBase::Types::constvec_t overlapcalvec = assoc.overlapCalVec();
MissingETBase::Types::constvec_t overlaptrkvec = assoc.overlapTrkVec();
ATH_MSG_VERBOSE(" Jet constituent-scale pt: " << jetconstp4.pt() << ", E: " << jetconstp4.e() );
ATH_MSG_VERBOSE(" Max constituent overlap pt: " << overlapcalvec.cpt() << ", E: " << overlapcalvec.ce() );
ATH_MSG_VERBOSE(" Jet track pt: " << jettrkvec.cpt() << ", E: " << jettrkvec.ce() );
ATH_MSG_VERBOSE(" Max track overlap pt: " << overlaptrkvec.cpt() << ", E: " << overlaptrkvec.ce() );
// optionally quit and fail if overlap-removal exceeds original jet constituent-scale energy
if(overlapcalvec.ce()-jetconstp4.e()>f_tolerance) {
ATH_MSG_ERROR("Too-large overlapcalvec!");
if(m_failOnInconsistency) return StatusCode::FAILURE;
}
if(overlaptrkvec.ce()-jettrkvec.ce()>f_tolerance) {
ATH_MSG_ERROR("Too-large overlaptrkvec!");
if(m_failOnInconsistency) return StatusCode::FAILURE;
}
return StatusCode::SUCCESS;
}
StatusCode METAssocTestAlg::checkObjects(const xAOD::MissingETAssociation& assoc)
{
const auto& jet = *assoc.refJet();
JetFourMom_t jetconstp4 = jet.jetP4(JetConstitScaleMomentum);
MissingETBase::Types::constvec_t jettrkvec = assoc.jetTrkVec();
// loop over individual objects and check that none of them has a larger
// associated constituent sum than the jet
for(size_t iobj=0; iobj<assoc.objects().size(); ++iobj) {
ATH_MSG_VERBOSE(" Now on constituent " << iobj );
const IParticle* obj = assoc.objects()[iobj];
if(!obj) continue; // invalid ElementLink -- thinned?
assoc.resetObjSelectionFlags();
assoc.setObjSelectionFlag(iobj,true);
MissingETBase::Types::constvec_t overlapcalvec = assoc.overlapCalVec();
MissingETBase::Types::constvec_t overlaptrkvec = assoc.overlapTrkVec();
ATH_MSG_VERBOSE(" Object pt: " << obj->pt() << ", E: " << obj->e() << ", type: " << obj->type());
ATH_MSG_VERBOSE(" Constituent pt: " << overlapcalvec.cpt() << ", E: " << overlapcalvec.ce() );
ATH_MSG_VERBOSE(" Track pt: " << overlaptrkvec.cpt() << ", E: " << overlaptrkvec.ce() );
// optionally quit and fail if overlap-removal exceeds original jet constituent-scale energy
if(overlapcalvec.ce()-jetconstp4.e()>f_tolerance) {
ATH_MSG_ERROR("Too-large overlapcalvec!");
ATH_MSG_ERROR(" Object pt: " << obj->pt() << ", E: " << obj->e() << ", type: " << obj->type());
if(m_failOnInconsistency) return StatusCode::FAILURE;
}
if(overlaptrkvec.ce()-jettrkvec.ce()>f_tolerance) {
ATH_MSG_ERROR("Too-large overlaptrkvec!");
ATH_MSG_ERROR(" Object pt: " << obj->pt() << ", E: " << obj->e() << ", type: " << obj->type());
if(m_failOnInconsistency) return StatusCode::FAILURE;
}
}
return StatusCode::SUCCESS;
}
StatusCode METAssocTestAlg::checkAssoc(const xAOD::MissingETAssociation& assoc)
{
const auto& jet = *assoc.refJet();
JetFourMom_t jetconstp4 = jet.jetP4(JetConstitScaleMomentum);
MissingETBase::Types::constvec_t jettrkvec = assoc.jetTrkVec();
// loop over the encoded cluster/inclusive pflow constituent sums and check that these are
// all smaller than the jet constituent-scale pt
for(size_t ikey=0; ikey<assoc.calkey().size(); ++ikey) {
ATH_MSG_VERBOSE(" Now on calkey " << ikey << ": " << assoc.calkey()[ikey] );
MissingETBase::Types::constvec_t calvec = assoc.calVec(ikey);
ATH_MSG_VERBOSE(" Constituent pt: " << calvec.cpt() << ", E: " << calvec.ce() );
if(calvec.ce()-jetconstp4.e()>f_tolerance) {
ATH_MSG_ERROR("Too-large calvec!");
for(size_t iobj=0; iobj<assoc.objects().size(); ++iobj) {
if( ((1<<iobj)&assoc.calkey()[ikey]) == 0 ) {
const IParticle* obj = assoc.objects()[iobj];
if(!obj) continue; // invalid ElementLink -- thinned?
ATH_MSG_ERROR(" Object pt: " << obj->pt() << ", E: " << obj->e() << ", type: " << obj->type());
}
}
if(m_failOnInconsistency) return StatusCode::FAILURE;
}
}
// loop over the encoded track/charged pflow constituent sums and check that these are
// all smaller than the jet track sum
for(size_t ikey=0; ikey<assoc.trkkey().size(); ++ikey) {
ATH_MSG_VERBOSE(" Now on trkkey " << ikey << ": " << assoc.trkkey()[ikey] );
MissingETBase::Types::constvec_t trkvec = assoc.trkVec(ikey);
ATH_MSG_VERBOSE(" Track pt: " << trkvec.cpt() << ", E: " << trkvec.ce() );
if(trkvec.ce()-jettrkvec.ce()>f_tolerance) {
ATH_MSG_ERROR("Too-large trkvec!");
for(size_t iobj=0; iobj<assoc.objects().size(); ++iobj) {
if( ((1<<iobj)&assoc.trkkey()[ikey]) == 0 ) {
const IParticle* obj = assoc.objects()[iobj];
if(!obj) continue; // invalid ElementLink -- thinned?
ATH_MSG_ERROR(" Object pt: " << obj->pt() << ", E: " << obj->e() << ", type: " << obj->type());
}
}
if(m_failOnInconsistency) return StatusCode::FAILURE;
}
}
return StatusCode::SUCCESS;
}
StatusCode METAssocTestAlg::checkMiscAssoc(const xAOD::MissingETAssociation& assoc)
{
// loop over the encoded cluster/inclusive pflow constituent sums
for(size_t ikey=0; ikey<assoc.calkey().size(); ++ikey) {
ATH_MSG_VERBOSE(" Now on calkey " << ikey << ": " << assoc.calkey()[ikey] );
MissingETBase::Types::constvec_t calvec = assoc.calVec(ikey);
ATH_MSG_VERBOSE(" Constituent pt: " << calvec.cpt() << ", E: " << calvec.ce() );
}
// loop over the encoded track/charged pflow constituent sums
for(size_t ikey=0; ikey<assoc.trkkey().size(); ++ikey) {
ATH_MSG_VERBOSE(" Now on trkkey " << ikey << ": " << assoc.trkkey()[ikey] );
MissingETBase::Types::constvec_t trkvec = assoc.trkVec(ikey);
ATH_MSG_VERBOSE(" Track pt: " << trkvec.cpt() << ", E: " << trkvec.ce() );
}
return StatusCode::SUCCESS;
}
}
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef METASSOCTESTALG_H
#define METASSOCTESTALG_H
#include "AthenaBaseComps/AthAlgorithm.h"
#include "xAODMissingET/MissingETAssociation.h"
namespace met {
class METAssocTestAlg : public AthAlgorithm
{
public:
METAssocTestAlg(const std::string& name, ISvcLocator* pSvcLocator);
~METAssocTestAlg() {}
StatusCode initialize();
StatusCode finalize();
StatusCode execute();
private:
StatusCode checkJet(const xAOD::MissingETAssociation&);
StatusCode checkObjects(const xAOD::MissingETAssociation&);
StatusCode checkAssoc(const xAOD::MissingETAssociation&);
StatusCode checkMiscAssoc(const xAOD::MissingETAssociation&);
std::string m_mapname = ""; // internal var for retrieving MET map
std::string m_jetname = ""; // internal var for retrieving jet collection
// configure m_jetname if the container name is not m_mapsuffix+"Jets"
std::string m_mapsuffix = ""; // configurable var setting m_mapname and m_jetname
bool m_failOnInconsistency = false;
};
}
#endif
......@@ -29,6 +29,7 @@
// Algs
#include "METRecoAlg.h"
#include "METReaderAlg.h"
#include "METAssocTestAlg.h"
using namespace met;
......@@ -58,6 +59,7 @@ DECLARE_TOOL_FACTORY(METRegionsTool)
//
DECLARE_ALGORITHM_FACTORY(METRecoAlg)
DECLARE_ALGORITHM_FACTORY(METReaderAlg)
DECLARE_ALGORITHM_FACTORY(METAssocTestAlg)
DECLARE_FACTORY_ENTRIES(METReconstruction) {
DECLARE_TOOL(METRecoTool)
......@@ -86,4 +88,5 @@ DECLARE_FACTORY_ENTRIES(METReconstruction) {
//
DECLARE_ALGORITHM(METRecoAlg)
DECLARE_ALGORITHM(METReaderAlg)
DECLARE_ALGORITHM(METAssocTestAlg)
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment