Skip to content
Snippets Groups Projects
Commit 218ae794 authored by William Keaton Balunas's avatar William Keaton Balunas
Browse files

Handle FlowElements correctly in MET overlaps

parent b68eee3d
No related branches found
No related tags found
5 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,!42104Handle FlowElements correctly in MET overlaps
...@@ -13,7 +13,7 @@ atlas_add_library( xAODMissingET ...@@ -13,7 +13,7 @@ atlas_add_library( xAODMissingET
Root/*.cxx Root/*.cxx
PUBLIC_HEADERS xAODMissingET PUBLIC_HEADERS xAODMissingET
INCLUDE_DIRS ${Boost_INCLUDE_DIRS} INCLUDE_DIRS ${Boost_INCLUDE_DIRS}
LINK_LIBRARIES AthContainers AthLinks xAODBase xAODCore xAODJet LINK_LIBRARIES AthContainers AthLinks xAODBase xAODCore xAODJet PFlowUtilsLib
PRIVATE_LINK_LIBRARIES xAODCaloEvent xAODTracking xAODTruth ) PRIVATE_LINK_LIBRARIES xAODCaloEvent xAODTracking xAODTruth )
atlas_add_xaod_smart_pointer_dicts( atlas_add_xaod_smart_pointer_dicts(
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#include "xAODBase/IParticleContainer.h" #include "xAODBase/IParticleContainer.h"
#include "xAODBase/ObjectType.h" #include "xAODBase/ObjectType.h"
#include "PFlowUtils/FEHelpers.h"
#include <cstdio> #include <cstdio>
#include <iterator> #include <iterator>
#include <utility> #include <utility>
...@@ -212,26 +214,27 @@ const xAOD::IParticleContainer* MissingETAssociationMap_v1::getUniqueSignals(con ...@@ -212,26 +214,27 @@ const xAOD::IParticleContainer* MissingETAssociationMap_v1::getUniqueSignals(con
MissingETBase::Types::const_signal_vector_t* uniques = new MissingETBase::Types::const_signal_vector_t(SG::VIEW_ELEMENTS); MissingETBase::Types::const_signal_vector_t* uniques = new MissingETBase::Types::const_signal_vector_t(SG::VIEW_ELEMENTS);
for(IParticleContainer::const_iterator iSig=signals->begin(); for(IParticleContainer::const_iterator iSig=signals->begin();
iSig!=signals->end(); ++iSig) { iSig!=signals->end(); ++iSig) {
xAOD::Type::ObjectType objType = (*iSig)->type();
if(objType == xAOD::Type::FlowElement) objType = FEHelpers::signalToXAODType(static_cast<const xAOD::FlowElement&>(**iSig));
switch(p) { switch(p) {
case MissingETBase::UsageHandler::TrackCluster: case MissingETBase::UsageHandler::TrackCluster:
if((*iSig)->type()==xAOD::Type::CaloCluster if(objType==xAOD::Type::CaloCluster
|| (*iSig)->type()==xAOD::Type::TrackParticle) {break;} || objType==xAOD::Type::TrackParticle) {break;}
else {continue;} else {continue;}
case MissingETBase::UsageHandler::OnlyCluster: case MissingETBase::UsageHandler::OnlyCluster:
if((*iSig)->type()==xAOD::Type::CaloCluster) {break;} if(objType==xAOD::Type::CaloCluster) {break;}
else {continue;} else {continue;}
case MissingETBase::UsageHandler::OnlyTrack: case MissingETBase::UsageHandler::OnlyTrack:
if((*iSig)->type()==xAOD::Type::TrackParticle) {break;} if(objType==xAOD::Type::TrackParticle) {break;}
else {continue;} else {continue;}
case MissingETBase::UsageHandler::ParticleFlow: case MissingETBase::UsageHandler::ParticleFlow:
if((*iSig)->type()==xAOD::Type::ParticleFlow) {break;} if(objType==xAOD::Type::ParticleFlow) {break;}
else if((*iSig)->type()==xAOD::Type::FlowElement && ((static_cast<const xAOD::FlowElement*>(*iSig))->signalType() & xAOD::FlowElement::PFlow)) {break;}
else {continue;} else {continue;}
case MissingETBase::UsageHandler::TruthParticle: case MissingETBase::UsageHandler::TruthParticle:
if((*iSig)->type()==xAOD::Type::TruthParticle) {break;} if(objType==xAOD::Type::TruthParticle) {break;}
else {continue;} else {continue;}
case MissingETBase::UsageHandler::AllCalo: case MissingETBase::UsageHandler::AllCalo:
if((*iSig)->type()!=xAOD::Type::TrackParticle) {break;} if(objType!=xAOD::Type::TrackParticle) {break;}
else {continue;} else {continue;}
default: {continue;} default: {continue;}
} }
...@@ -261,7 +264,7 @@ const xAOD::IParticleContainer* MissingETAssociationMap_v1::getOverlapRemovedSig ...@@ -261,7 +264,7 @@ const xAOD::IParticleContainer* MissingETAssociationMap_v1::getOverlapRemovedSig
{ {
MissingETBase::Types::const_signal_vector_t* uniques = new MissingETBase::Types::const_signal_vector_t(SG::VIEW_ELEMENTS); MissingETBase::Types::const_signal_vector_t* uniques = new MissingETBase::Types::const_signal_vector_t(SG::VIEW_ELEMENTS);
for(const auto *const sig : *signals) { for(const auto *const sig : *signals) {
if(!MissingETAssociation_v1::testPolicy(sig->type(),p)) continue; if(!MissingETAssociation_v1::testPolicy(*sig,p)) continue;
size_t assocIndex = findIndexByJetConst(sig); size_t assocIndex = findIndexByJetConst(sig);
if(assocIndex==MissingETBase::Numerical::invalidIndex()) { if(assocIndex==MissingETBase::Numerical::invalidIndex()) {
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "xAODTruth/TruthParticle.h" #include "xAODTruth/TruthParticle.h"
#include "xAODPFlow/PFO.h" #include "xAODPFlow/PFO.h"
#include "xAODPFlow/FlowElement.h" #include "xAODPFlow/FlowElement.h"
#include "PFlowUtils/FEHelpers.h"
#include <iterator> #include <iterator>
#include <cstdio> #include <cstdio>
...@@ -698,6 +699,7 @@ namespace xAOD { ...@@ -698,6 +699,7 @@ namespace xAOD {
if(mine == target) { if(mine == target) {
if((*mine)->type()==xAOD::Type::TruthParticle) overlapTypes |= 1; if((*mine)->type()==xAOD::Type::TruthParticle) overlapTypes |= 1;
else if((*mine)->type()==xAOD::Type::Other) overlapTypes |= 1 << xAOD::Type::NeutralParticle; else if((*mine)->type()==xAOD::Type::Other) overlapTypes |= 1 << xAOD::Type::NeutralParticle;
else if((*mine)->type()==xAOD::Type::FlowElement) overlapTypes |= 1 << FEHelpers::signalToXAODType(static_cast<const xAOD::FlowElement&>(**mine));
else overlapTypes |= 1 << (*mine)->type(); else overlapTypes |= 1 << (*mine)->type();
} }
} }
...@@ -731,8 +733,6 @@ namespace xAOD { ...@@ -731,8 +733,6 @@ namespace xAOD {
else {continue;} else {continue;}
case MissingETBase::UsageHandler::ParticleFlow: case MissingETBase::UsageHandler::ParticleFlow:
if(types[iOL] & 1<<xAOD::Type::ParticleFlow) {break;} if(types[iOL] & 1<<xAOD::Type::ParticleFlow) {break;}
//TODO: Check with TJ that this is OK
if(types[iOL] & 1<<xAOD::Type::FlowElement) {break;}
else {continue;} else {continue;}
case MissingETBase::UsageHandler::TruthParticle: case MissingETBase::UsageHandler::TruthParticle:
if(types[iOL] & 1) {break;} if(types[iOL] & 1) {break;}
...@@ -814,7 +814,7 @@ namespace xAOD { ...@@ -814,7 +814,7 @@ namespace xAOD {
bool MissingETAssociation_v1::checkUsage(const MissingETAssociationHelper& helper, const IParticle* pSig, MissingETBase::UsageHandler::Policy p) const bool MissingETAssociation_v1::checkUsage(const MissingETAssociationHelper& helper, const IParticle* pSig, MissingETBase::UsageHandler::Policy p) const
{ {
if(MissingETAssociation_v1::testPolicy(pSig->type(),p)) { if(MissingETAssociation_v1::testPolicy(*pSig,p)) {
const IParticleContainer* pCont = static_cast<const IParticleContainer*>(pSig->container()); const IParticleContainer* pCont = static_cast<const IParticleContainer*>(pSig->container());
MissingETBase::Types::objlink_t el(*pCont,pSig->index()); MissingETBase::Types::objlink_t el(*pCont,pSig->index());
for(size_t iObj=0; iObj<this->objectLinks().size(); ++iObj) { for(size_t iObj=0; iObj<this->objectLinks().size(); ++iObj) {
...@@ -869,19 +869,23 @@ namespace xAOD { ...@@ -869,19 +869,23 @@ namespace xAOD {
m_objConstLinks.reserve(50); m_objConstLinks.reserve(50);
} }
bool MissingETAssociation_v1::testPolicy(unsigned int type,MissingETBase::UsageHandler::Policy p) { bool MissingETAssociation_v1::testPolicy(const xAOD::IParticle& part, MissingETBase::UsageHandler::Policy p) {
xAOD::Type::ObjectType objType = part.type();
if(objType == xAOD::Type::FlowElement) objType = FEHelpers::signalToXAODType(static_cast<const xAOD::FlowElement&>(part));
return testPolicy(objType, p);
}
bool MissingETAssociation_v1::testPolicy(xAOD::Type::ObjectType type, MissingETBase::UsageHandler::Policy p) {
switch(p) { switch(p) {
case MissingETBase::UsageHandler::TrackCluster: case MissingETBase::UsageHandler::TrackCluster:
return type==xAOD::Type::CaloCluster return type==xAOD::Type::CaloCluster
|| type==xAOD::Type::TrackParticle;
|| type==xAOD::Type::TrackParticle;
case MissingETBase::UsageHandler::OnlyCluster: case MissingETBase::UsageHandler::OnlyCluster:
return type==xAOD::Type::CaloCluster; return type==xAOD::Type::CaloCluster;
case MissingETBase::UsageHandler::OnlyTrack: case MissingETBase::UsageHandler::OnlyTrack:
return type==xAOD::Type::TrackParticle; return type==xAOD::Type::TrackParticle;
case MissingETBase::UsageHandler::ParticleFlow: case MissingETBase::UsageHandler::ParticleFlow:
if(type==xAOD::Type::ParticleFlow) {return true;} return type==xAOD::Type::ParticleFlow;
return type==xAOD::Type::FlowElement;
case MissingETBase::UsageHandler::AllCalo: case MissingETBase::UsageHandler::AllCalo:
return type!=xAOD::Type::TrackParticle; return type!=xAOD::Type::TrackParticle;
default: break; default: break;
......
...@@ -29,7 +29,7 @@ namespace xAOD ...@@ -29,7 +29,7 @@ namespace xAOD
{ {
public: public:
static bool testPolicy(unsigned int type, MissingETBase::UsageHandler::Policy p); static bool testPolicy(const xAOD::IParticle& part, MissingETBase::UsageHandler::Policy p);
/*! @brief Vector sum of constituents for subtractive overlap removal */ /*! @brief Vector sum of constituents for subtractive overlap removal */
class ConstVec class ConstVec
...@@ -354,6 +354,9 @@ namespace xAOD ...@@ -354,6 +354,9 @@ namespace xAOD
/*!@}*/ /*!@}*/
protected: protected:
static bool testPolicy(xAOD::Type::ObjectType type, MissingETBase::UsageHandler::Policy p);
/// Function initialising the object to work in standalone mode /// Function initialising the object to work in standalone mode
void createPrivateStore(); void createPrivateStore();
......
...@@ -22,6 +22,8 @@ namespace FEHelpers { ...@@ -22,6 +22,8 @@ namespace FEHelpers {
std::string getClusterMomentName(xAOD::CaloCluster::MomentType momentType); std::string getClusterMomentName(xAOD::CaloCluster::MomentType momentType);
xAOD::Type::ObjectType signalToXAODType(const xAOD::FlowElement& fe);
} }
#endif #endif
\ No newline at end of file
...@@ -171,4 +171,14 @@ namespace FEHelpers { ...@@ -171,4 +171,14 @@ namespace FEHelpers {
} }
} }
xAOD::Type::ObjectType signalToXAODType(const xAOD::FlowElement& fe){
xAOD::FlowElement::signal_t st = fe.signalType();
if(st & xAOD::FlowElement::PFlow) return xAOD::Type::ParticleFlow;
if(st & xAOD::FlowElement::CaloCluster) return xAOD::Type::CaloCluster;
if(st & xAOD::FlowElement::Track) return xAOD::Type::TrackParticle;
if(st & xAOD::FlowElement::Muon) return xAOD::Type::Muon;
if(st & xAOD::FlowElement::TCC) return xAOD::Type::TrackCaloCluster;
if(st & xAOD::FlowElement::UFO) return xAOD::Type::TrackCaloCluster; // UFO doesn't have its own xAOD type
return xAOD::Type::Other;
}
} }
\ No newline at end of file
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