diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkJetEtMiss/python/JetCommon.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkJetEtMiss/python/JetCommon.py index 7e4c417217dc8de925a8ab9de1a5de31f5dd7dcc..f485b59e6c317c7602b3694cc74b508e18d3010c 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkJetEtMiss/python/JetCommon.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkJetEtMiss/python/JetCommon.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration #******************************************************************** # JetCommon.py @@ -56,7 +56,7 @@ else: ################################################################## def defineEDAlg(R=0.4, inputtype="LCTopo"): - from EventShapeTools.EventDensityConfig import configEventDensityTool, EventDensityAlg + from EventShapeTools.EventDensityConfig import configEventDensityTool, EventDensityAthAlg from AthenaCommon.AppMgr import ToolSvc from JetRec.JetRecStandard import jtm @@ -64,14 +64,17 @@ def defineEDAlg(R=0.4, inputtype="LCTopo"): # map a getter to the input argument inputgetter = { "LCTopo" : jtm.lcget, "EMTopo" : jtm.emget, + "LCTopoOrigin" : jtm.lcoriginget, + "EMTopoOrigin" : jtm.emoriginget, "EMPFlow": jtm.empflowget, - "EMCPFlow": jtm.emcpflowget, + "EMPFlowPUSB": jtm.empflowpusbget, + "EMPFlowNeut": jtm.empflowneutget, }[inputtype] t=configEventDensityTool("EDTool"+str(int(R*10))+inputtype, inputgetter, R) t.OutputLevel = 3 ToolSvc += t - return EventDensityAlg( "EventDensityAlg"+t.name(), EventDensityTool = t , OutputLevel=3) + return EventDensityAthAlg( "EventDensityAthAlg"+t.name(), EventDensityTool = t , OutputLevel=3) ################################################################## diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkJetEtMiss/share/JETM1.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkJetEtMiss/share/JETM1.py index b5f3ce144b57e4b00f4587d00fc1f7806ef1a7b5..6d343ea0863785fb023d551553b183d7d4188421 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkJetEtMiss/share/JETM1.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkJetEtMiss/share/JETM1.py @@ -133,6 +133,11 @@ from DerivationFrameworkJetEtMiss.ExtendedJetCommon import addQGTaggerTool addQGTaggerTool(jetalg="AntiKt4EMTopo",sequence=jetm1Seq,algname="QGTaggerToolAlg") addQGTaggerTool(jetalg="AntiKt4EMPFlow",sequence=jetm1Seq,algname="QGTaggerToolPFAlg") +# Add alternative rho definitions +from DerivationFrameworkJetEtMiss.JetCommon import defineEDAlg +jetm1Seq += defineEDAlg(R=0.4, inputtype="EMPFlowPUSB") +jetm1Seq += defineEDAlg(R=0.4, inputtype="EMPFlowNeut") + OutputJets["JETM1"] = [] #======================================= @@ -199,6 +204,10 @@ JETM1SlimmingHelper.AppendToDictionary = { "AntiKt10TruthSoftDropBeta50Zcut10JetsAux": "xAOD::JetAuxContainer" , "AntiKt10TruthSoftDropBeta100Zcut10Jets" : "xAOD::JetContainer" , "AntiKt10TruthSoftDropBeta100Zcut10JetsAux": "xAOD::JetAuxContainer" , + "Kt4EMPFlowPUSBEventShape": "xAOD::EventShape" , + "Kt4EMPFlowPUSBEventShapeAux": "xAOD::AuxInfoBase" , + "Kt4EMPFlowNeutEventShape": "xAOD::EventShape" , + "Kt4EMPFlowNeutEventShapeAux": "xAOD::AuxInfoBase" , } @@ -228,7 +237,7 @@ if DerivationFrameworkIsMonteCarlo: JETM1SlimmingHelper.AllVariables = [ "MuonTruthParticles", "egammaTruthParticles", "TruthParticles", "TruthEvents", "TruthVertices", "MuonSegments", - "Kt4EMTopoOriginEventShape","Kt4LCTopoOriginEventShape","Kt4EMPFlowEventShape", + "Kt4EMTopoOriginEventShape","Kt4LCTopoOriginEventShape","Kt4EMPFlowEventShape","Kt4EMPFlowPUSBEventShape","Kt4EMPFlowNeutEventShape", ] # Trigger content diff --git a/Reconstruction/Jet/JetRec/python/JetRecStandardTools.py b/Reconstruction/Jet/JetRec/python/JetRecStandardTools.py index 172126555298356c75819964a53ed649b88a7256..5df5a425d5b8b6aa882cf2bbac1450c2acc81b2c 100644 --- a/Reconstruction/Jet/JetRec/python/JetRecStandardTools.py +++ b/Reconstruction/Jet/JetRec/python/JetRecStandardTools.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration # JetRecStandardTools.py # @@ -384,7 +384,39 @@ jtm += PFlowPseudoJetGetter( InputContainer = "CHSParticleFlowObjects", OutputContainer = "PseudoJetEMPFlow", SkipNegativeEnergy = True, - GhostScale = 0.0 + GhostScale = 0.0, + UseCharged = True, + UseNeutral = True, + UseChargedPV = True, + UseChargedPUsideband = False, +) + +# EM-scale pflow - z0sinTheta sideband +jtm += PFlowPseudoJetGetter( + "empflowpusbget", + Label = "EMPFlowPUSB", + InputContainer = "CHSParticleFlowObjects", + OutputContainer = "PseudoJetEMPFlowPUSB", + SkipNegativeEnergy = True, + GhostScale = 0.0, + UseCharged = True, + UseNeutral = True, + UseChargedPV = False, + UseChargedPUsideband = True, +) + +# EM-scale pflow - neutral objects only +jtm += PFlowPseudoJetGetter( + "empflowneutget", + Label = "EMPFlowNeut", + InputContainer = "CHSParticleFlowObjects", + OutputContainer = "PseudoJetEMPFlowNeut", + SkipNegativeEnergy = True, + GhostScale = 0.0, + UseCharged = False, + UseNeutral = True, + UseChargedPV = False, + UseChargedPUsideband = False, ) # AntiKt2 track jets. diff --git a/Reconstruction/Jet/JetRecTools/JetRecTools/ChargedHadronSubtractionTool.h b/Reconstruction/Jet/JetRecTools/JetRecTools/ChargedHadronSubtractionTool.h index 7e04a4262b9a17dc4409e7d8773f6ada53d79a99..6fe183ace2eca8e9cc590d70e8e82dc1b1900ca5 100644 --- a/Reconstruction/Jet/JetRecTools/JetRecTools/ChargedHadronSubtractionTool.h +++ b/Reconstruction/Jet/JetRecTools/JetRecTools/ChargedHadronSubtractionTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef JETRECTOOLS_CHARGEDHADRONSUBTRACTIONTOOL_H @@ -41,6 +41,7 @@ class ChargedHadronSubtractionTool : public JetConstituentModifierBase{ const xAOD::Vertex* getPrimaryVertex() const; bool m_useTrackToVertexTool; + float m_z0sinThetaCutValue; std::string m_vertexContainer_key; std::string m_trkVtxAssoc_key; diff --git a/Reconstruction/Jet/JetRecTools/JetRecTools/PFlowPseudoJetGetter.h b/Reconstruction/Jet/JetRecTools/JetRecTools/PFlowPseudoJetGetter.h index 7578a7684d522c18a38625f4888e29082a7c1d5a..cbc38dd5482bb5830ad95df24769417d97d7eb6f 100644 --- a/Reconstruction/Jet/JetRecTools/JetRecTools/PFlowPseudoJetGetter.h +++ b/Reconstruction/Jet/JetRecTools/JetRecTools/PFlowPseudoJetGetter.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // PFlowPseudoJetGetter.h @@ -13,11 +13,10 @@ /// PseudoJetGetter for pflow /// /// Properties: -/// RetrievePFOTool - Tool to fetch the pflow -/// InputIsEM - If true, EM-scale is used for the neutral pflow -/// CalibratePFO - If true the EM-scale pflow is calibrated /// UseNeutral - If true, the neutral component of pflow is used /// UseCharged - If true, the charged component of pflow is used +/// UseChargedPV - If true, require charged particles are associated with PV +/// UseChargedPUsideband - If true, require charged particles are in PV sideband /// \author P-A Delsart, D. Adams ////////////////////////////////////////////////// @@ -33,6 +32,12 @@ public: protected: + + bool m_useCharged; /// Flag indicating to use charged particles at all + bool m_useNeutral; /// Flag indicating to use neutral particles at all + bool m_useChargedPV; /// Flag indicating to use charged particles only from PU z0 sideband + bool m_useChargedPUsideband; /// Flag indicating to use charged particles only from PU z0 sideband + virtual jet::IConstituentUserInfo* buildCUI(const xAOD::IParticle* ppar, jet::IConstituentUserInfo::Index idx, const LabelIndex* pli) const {return PseudoJetGetter::buildCUI(ppar,idx,pli);} diff --git a/Reconstruction/Jet/JetRecTools/Root/ChargedHadronSubtractionTool.cxx b/Reconstruction/Jet/JetRecTools/Root/ChargedHadronSubtractionTool.cxx index 4db91ab33ef199e208aff2d9192381d8ec8271d8..40688ed45392dd183d398d2f08038cbba0b6bef2 100644 --- a/Reconstruction/Jet/JetRecTools/Root/ChargedHadronSubtractionTool.cxx +++ b/Reconstruction/Jet/JetRecTools/Root/ChargedHadronSubtractionTool.cxx @@ -14,6 +14,8 @@ ChargedHadronSubtractionTool::ChargedHadronSubtractionTool(const std::string& na m_vertexContainer_key="PrimaryVertices", "StoreGate key for the primary vertex container"); + declareProperty("Z0sinThetaCutValue", m_z0sinThetaCutValue=2.0, "True if we will use the track to vertex tool"); + } StatusCode ChargedHadronSubtractionTool::initialize() { @@ -64,6 +66,7 @@ const xAOD::Vertex* ChargedHadronSubtractionTool::getPrimaryVertex() const { StatusCode ChargedHadronSubtractionTool::matchToPrimaryVertex(xAOD::PFOContainer& cont) const { const static SG::AuxElement::Accessor PVMatchedAcc("matchedToPV"); + const static SG::AuxElement::Accessor PUsidebandMatchedAcc("matchedToPUsideband"); // Use only one of TVA or PV const jet::TrackVertexAssociation* trkVtxAssoc = nullptr; @@ -88,6 +91,7 @@ StatusCode ChargedHadronSubtractionTool::matchToPrimaryVertex(xAOD::PFOContainer if(fabs(ppfo->charge()) < FLT_MIN) continue; bool matchedToPrimaryVertex = false; + bool matchedToPileupSideband = false; const xAOD::TrackParticle* ptrk = ppfo->track(0); if(ptrk==nullptr) { ATH_MSG_WARNING("Charged PFO with index " << ppfo->index() << " has no ID track!"); @@ -104,10 +108,12 @@ StatusCode ChargedHadronSubtractionTool::matchToPrimaryVertex(xAOD::PFOContainer // Thus we correct the track z0 to be w.r.t z = 0 float z0 = ptrk->z0() + ptrk->vz() - vtx->z(); float theta = ptrk->theta(); - matchedToPrimaryVertex = ( fabs(z0*sin(theta)) < 2.0 ); + matchedToPrimaryVertex = ( fabs(z0*sin(theta)) < m_z0sinThetaCutValue ); + if (fabs(z0*sin(theta)) < 2.0*m_z0sinThetaCutValue && fabs(z0*sin(theta)) >= m_z0sinThetaCutValue ) matchedToPileupSideband = true; } } // TVA vs PV decision PVMatchedAcc(*ppfo) = matchedToPrimaryVertex; + PUsidebandMatchedAcc(*ppfo) = matchedToPileupSideband; } return StatusCode::SUCCESS; diff --git a/Reconstruction/Jet/JetRecTools/Root/PFlowPseudoJetGetter.cxx b/Reconstruction/Jet/JetRecTools/Root/PFlowPseudoJetGetter.cxx index 4ca8a2362d49f38ba52e0284c08bd59d885e0d85..6567d85c9ff8ae003f66b5f74b4147cb450d4ffb 100644 --- a/Reconstruction/Jet/JetRecTools/Root/PFlowPseudoJetGetter.cxx +++ b/Reconstruction/Jet/JetRecTools/Root/PFlowPseudoJetGetter.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // PFlowPseudoJetGetter.cxx @@ -10,6 +10,10 @@ PFlowPseudoJetGetter::PFlowPseudoJetGetter(const std::string &name) : PseudoJetGetter(name) { + declareProperty("UseCharged", m_useCharged =true); + declareProperty("UseNeutral", m_useNeutral =true); + declareProperty("UseChargedPV", m_useChargedPV =true); + declareProperty("UseChargedPUsideband", m_useChargedPUsideband =false); } int PFlowPseudoJetGetter::appendTo(PseudoJetVector& psjs, const LabelIndex* pli) const { @@ -32,8 +36,14 @@ int PFlowPseudoJetGetter::appendTo(PseudoJetVector& psjs, const LabelIndex* pli) // a weight of 0 due to being in dense showers, but need to be present for // overlap removal, because they don't retain these weights when added to the TST if( fabs(pfo->charge())>FLT_MIN) { + if (m_useCharged) reject = false; // put back in 0 energy tracks for MET const static SG::AuxElement::ConstAccessor PVMatchedAcc("matchedToPV"); - reject = !PVMatchedAcc(*pfo); + if (m_useChargedPV && !PVMatchedAcc(*pfo)) reject = true; + const static SG::AuxElement::ConstAccessor PUsidebandMatchedAcc("matchedToPUsideband"); + if (m_useChargedPUsideband && !PUsidebandMatchedAcc(*pfo)) reject = true; + if (!m_useCharged) reject = true; + }else{ + if (!m_useNeutral) reject = true; } if(!reject) filteredpfos.push_back(pfo); }